Skip to content

cupertino-files / StylesheetModel

Class: StylesheetModel ​

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

Constructors ​

Constructor ​

new StylesheetModel(store, object): StylesheetModel

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

Parameters ​

store ​

ObjectStore

object ​

IwaObject

Returns ​

StylesheetModel

Properties ​

object ​

readonly object: IwaObject

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


store ​

readonly store: ObjectStore

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

Accessors ​

component ​

Get Signature ​

get component(): Component

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

Returns ​

Component


id ​

Get Signature ​

get id(): bigint

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

Returns ​

bigint


parentId ​

Get Signature ​

get parentId(): bigint | undefined

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

Parent stylesheet (theme stylesheet), if chained.

Returns ​

bigint | undefined

Methods ​

characterStyles() ​

characterStyles(): StyleInfo[]

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

Returns ​

StyleInfo[]


createCharacterStyle() ​

createCharacterStyle(options): bigint

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

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:254

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:227

Parameters ​

identifier ​

string

Returns ​

StyleInfo | undefined


findByName() ​

findByName(name, type?): StyleInfo | undefined

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

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:205

identifier → style id entries of identifier_to_style_map.

Returns ​

Map<string, bigint>


paragraphStyles() ​

paragraphStyles(): StyleInfo[]

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

Returns ​

StyleInfo[]


parentSheet() ​

parentSheet(): StylesheetModel | undefined

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

Returns ​

StylesheetModel | undefined


style() ​

style(style, type?): StyleHandle | undefined

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

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:193

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.