import { TokenSet } from "./types.js"; import { Tokens } from "style-dictionary"; import { DesignToken, TransformedToken as TransformedToken$1 } from "style-dictionary/types"; /** * Returns value based on design token format used. Read more:https://v4.styledictionary.com/info/dtcg/ * * Use generic (``) to define return value type * @param token Transformed or Design token * @returns value */ export declare const getValue: (token: TransformedToken$1 | DesignToken) => T; /** * Check if token type matches provided type * This function is curried * @param types Type or array of types to check against * @param token Transformed token * @returns boolean */ export declare const typeEquals: (types: string[] | string, token: TransformedToken$1) => boolean; export declare const pathStartsWithOneOf: ((paths: (string | string[])[], token: TransformedToken$1) => boolean) & ((paths: (string | string[])[]) => (token: TransformedToken$1) => boolean); export declare function isSemanticToken(token: TransformedToken$1): boolean; export declare function isSemanticColorToken(token: TransformedToken$1, color: string): boolean; export declare const isDigit: (s: string) => boolean; /** Copied from Style Dictionary and added types @see https://github.com/amzn/style-dictionary/blob/31c29df0382a61b085f6392dc3225c5009fbffc5/lib/utils/combineJSON.js#L33 */ export declare function traverseObj(obj: Tokens | TokenSet, fn: (obj: TokenSet | Tokens | DesignToken, key: keyof Tokens | string, slice: Tokens | DesignToken | string) => void): import("style-dictionary/types").DesignTokens | TokenSet; /** * In the given tokens array, inline and remove tokens that match the predicate * * Example: In pseudo-code, given the predicate `(token) => token.path === ['size', '1']` and the following tokens * ```js * [ * { path: ['size', 'base'], original: { $value: '8px' } }, * { path: ['size', '1'], original: { $value: '{size.base} * 2' } }, * { path: ['size', 'sm']: original: { $value: 'min({size.1}, 12px)' } } * ] * ``` * would return * ```js * [ * { path: ['size', 'base'], original: { $value: '8px' } }, * { path: ['size', 'sm']: original: { $value: 'min({size.base} * 2, 12px)' } } * ] * ``` * * @param shouldInline - predicate to determine if token should be inlined * @param tokens - array of tokens to transform * @returns copy of `tokens` without those that matched the predicate, * where references to the matching tokens have been inlined */ export declare function inlineTokens(shouldInline: (t: TransformedToken$1) => boolean, tokens: TransformedToken$1[]): TransformedToken$1[]; export declare function shortSizeName(size: string): string; export declare const sizeComparator: (size: string) => number; export declare function orderBySize(sizes: string[]): string[]; /** * Derives a primitive token key from a value with a unit, e.g. '3px' -> '3', '30%' -> '30'. * A decimal point becomes a dash ('1.5px' -> '1-5') so the key never reads as a nested token path. */ export declare function numericKey(value: string): string; /** * Derives primitive token entries keyed by {@link numericKey} from a record of config values. * Throws when two different values resolve to the same key (e.g. '1px' and '1rem'), * since they would silently overwrite one another's primitive token. */ export declare function numericKeyedValues(values: Record, tokenGroup: string): [string, string][]; /** * Maps a record of config values to a group of design tokens with the given $type, * keeping the record's keys as token names. An optional `toValue` maps each entry * to its token value, e.g. to produce a reference like `{opacity.30}`. */ export declare function tokensFromRecord(values: Record, $type: string, toValue?: (value: string, name: string) => string): TokenSet;