Theemo / @theemo/style-dictionary / StyleDictionaryWriterConfig
Interface: StyleDictionaryWriterConfig
The config for Style Dicitionary being used as WriterTool
.
Remarks
The result from Lexer
is pushed into the writer. Such, the configuration requires you to provide the file for the respective token and the "path" (the canonical name of the token, so to say) within that file.
Properties
dataForToken()?
ts
optional dataForToken: (token) => Record<string, unknown>;
Customize the data for a token
Parameters
Parameter | Type | Description |
---|---|---|
token | Token <"unknown" > | the Token |
Returns
Record
<string
, unknown
>
additional properties for a token
Defined in
directory?
ts
optional directory: string;
The directory to which the tokens are written to
Default Value
ts
tokens
Defined in
fileForToken()
ts
fileForToken: (token) => string;
The file for the given token.
Parameters
Parameter | Type | Description |
---|---|---|
token | Token <"unknown" > | the Token |
Returns
string
the file path
Defined in
pathForToken()
ts
pathForToken: (token) => string[];
The path (the canonical name) of the token
Parameters
Parameter | Type | Description |
---|---|---|
token | Token <"unknown" > | the Token |
Returns
string
[]
the segments of the name
Defined in
valueForToken()?
ts
optional valueForToken: (token, tokens) => undefined | string;
The value for the given token
Parameters
Parameter | Type | Description |
---|---|---|
token | Token <"unknown" > | the Token |
tokens | TokenCollection <Token <"unknown" >> | all tokens |
Returns
undefined
| string
the value for the given token