Types
Type Aliases
BaseProperties
type BaseProperties = object;
Properties
$description?
optional $description: string;
$extensions?
optional $extensions: Record<string, any>;
BorderToken
type BorderToken = BaseProperties & object;
Type declaration
ColorToken
type ColorToken = BaseProperties & object;
Type declaration
Config
type Config = object;
Properties
data
data: string | string[] | object | object[];
options?
optional options: ConfigOptions;
ConfigOptions
type ConfigOptions = object;
Properties
customValidator?
optional customValidator: ValidatorConfig;
loader
loader: Loader | string;
platforms: Platform[];
validator()?
optional validator: (value, config?) => ValidatorReturn;
Parameters
Returns
ValidatorReturn
CubicBezierToken
type CubicBezierToken = BaseProperties & object;
Type declaration
DimensionToken
type DimensionToken = BaseProperties & object;
Type declaration
Name | Type |
---|
$type? | "dimension" |
$value | | { unit : "px" | "rem" ; value : number ; } | ReferenceValue |
DurationToken
type DurationToken = BaseProperties & object;
Type declaration
Name | Type |
---|
$type? | "duration" |
$value | | { unit : "ms" | "s" ; value : number ; } | ReferenceValue |
FontFamilyToken
type FontFamilyToken = BaseProperties & object;
Type declaration
FontWeightToken
type FontWeightToken = BaseProperties & object;
Type declaration
GradientToken
type GradientToken = BaseProperties & object;
Type declaration
LooseToken
type LooseToken = ModifyProperties<Token, {
$type: string;
$value: any;
}>;
NumberToken
type NumberToken = BaseProperties & object;
Type declaration
type Platform = object;
Properties
config?
optional config: any;
format: Format | string;
name
name: string;
outputs
outputs: object[];
optional fileHeader: FileHeader;
filter()?
optional filter: ({ token, path }) => boolean;
Parameters
Parameter | Type |
---|
{ token, path } | { path : string ; token : Token ; } |
{ token, path }.path | string |
{ token, path }.token | Token |
Returns
boolean
name
name: string;
optional transforms: (string | Transform | TransformGroup)[];
type PlatformWithoutString = ModifyProperties<Platform, {
format: Format;
transforms: (Transform | TransformGroup)[];
}>;
ReferenceValue
type ReferenceValue = `{${string}}`;
ShadowToken
type ShadowToken = BaseProperties & object;
Type declaration
Name | Type |
---|
$type? | "shadow" |
$value | ShadowValue | ShadowValue [] | ReferenceValue |
StrictToken
type StrictToken = WithRequired<Token, "$type">;
StrokeStyleToken
type StrokeStyleToken = BaseProperties & object;
Type declaration
Token
type Token =
| ColorToken
| DimensionToken
| FontFamilyToken
| FontWeightToken
| DurationToken
| CubicBezierToken
| NumberToken
| TransitionToken
| ShadowToken
| GradientToken
| TypographyToken
| StrokeStyleToken
| BorderToken;
TokenCompositeValue
type TokenCompositeValue = Exclude<
| TypographyToken["$value"]
| ShadowToken["$value"]
| GradientToken["$value"]
| TransitionToken["$value"]
| StrokeStyleToken["$value"]
| BorderToken["$value"], ReferenceValue>;
TokenGroup
type TokenGroup = TokenGroupProperties & object;
TokenGroupProperties
type TokenGroupProperties = object;
Properties
$description?
optional $description: string;
$extensions?
optional $extensions: object;
$type?
optional $type: TokenType;
TokenType
type TokenType = Exclude<Token["$type"], undefined>;
TokenValue
type TokenValue = Token["$value"];
TransitionToken
type TransitionToken = BaseProperties & object;
Type declaration
TypographyToken
type TypographyToken = BaseProperties & object;
Type declaration
Functions
defineConfig()
function defineConfig(config): Config;
Define a configuration object for the design token builder.
It should be used with CLI.
Parameters
Returns
Config