Skip to content

cupertino-files / StylesheetModel

Class: StylesheetModel

Defined in: src/tss/stylesheet.ts:147

Constructors

Constructor

new StylesheetModel(store, object): StylesheetModel

Defined in: src/tss/stylesheet.ts:151

Parameters

store

ObjectStore

object

IwaObject

Returns

StylesheetModel

Properties

object

readonly object: IwaObject

Defined in: src/tss/stylesheet.ts:149


store

readonly store: ObjectStore

Defined in: src/tss/stylesheet.ts:148

Accessors

component

Get Signature

get component(): Component

Defined in: src/tss/stylesheet.ts:164

Returns

Component


id

Get Signature

get id(): bigint

Defined in: src/tss/stylesheet.ts:156

Returns

bigint


parentId

Get Signature

get parentId(): bigint | undefined

Defined in: src/tss/stylesheet.ts:171

Parent stylesheet (theme stylesheet), if chained.

Returns

bigint | undefined

Methods

characterStyles()

characterStyles(): StyleInfo[]

Defined in: src/tss/stylesheet.ts:229

Returns

StyleInfo[]


createCharacterStyle()

createCharacterStyle(options): bigint

Defined in: src/tss/stylesheet.ts:326

Create a character style (anonymous unless a name/identifier is given).

Parameters

options
basedOn?

string | bigint

character

CharacterFormatting

identifier?

string

name?

string

Returns

bigint


createParagraphStyle()

createParagraphStyle(options): bigint

Defined in: src/tss/stylesheet.ts:237

Create a paragraph style. Returns the new style's object id. basedOn may be a style id or a UI name resolved in this sheet chain.

Parameters

options
basedOn?

string | bigint

character?

CharacterFormatting

copyOf?

string | bigint

identifier?

string

name?

string

paragraph?

ParagraphFormatting

Returns

bigint


findByIdentifier()

findByIdentifier(identifier): StyleInfo | undefined

Defined in: src/tss/stylesheet.ts:210

Parameters

identifier

string

Returns

StyleInfo | undefined


findByName()

findByName(name, type?): StyleInfo | undefined

Defined in: src/tss/stylesheet.ts:202

Find a style by UI name (exact match), optionally filtered by archive type. Searches this stylesheet, then its parent chain.

Parameters

name

string

type?

number

Returns

StyleInfo | undefined


identifierMap()

identifierMap(): Map<string, bigint>

Defined in: src/tss/stylesheet.ts:188

identifier → style id entries of identifier_to_style_map.

Returns

Map<string, bigint>


paragraphStyles()

paragraphStyles(): StyleInfo[]

Defined in: src/tss/stylesheet.ts:225

Returns

StyleInfo[]


parentSheet()

parentSheet(): StylesheetModel | undefined

Defined in: src/tss/stylesheet.ts:219

Returns

StylesheetModel | undefined


style()

style(style, type?): StyleHandle | undefined

Defined in: src/tss/stylesheet.ts:353

Handle for reading and editing an existing style, by id or UI name.

Editing a style reaches every run that uses it — which is the point of a stylesheet, and the difference between "make this heading blue" and "make all headings blue".

Parameters

style

string | bigint

type?

number

Returns

StyleHandle | undefined


styles()

styles(): StyleInfo[]

Defined in: src/tss/stylesheet.ts:176

All styles registered in the styles list, resolved to StyleInfo.

Returns

StyleInfo[]

MIT licensed. Independently made — not by Apple in California. Not affiliated with or endorsed by Apple Inc.