import { type TokenData, type TokenSrcGroup, type Except } from '@knapsack/types'; export type TokenRefChunk = { type: 'ref'; id: string; string: string; } | { type: 'string'; string: string; }; /** * Given a subvalue (an item within a composite token, ie "offsetX" within a * shadow composite token) THAT IS A STRING, discover references, if any at all. */ export declare function parseValueChunks(subVal: string): TokenRefChunk[]; export declare function getIds(tokenGroup: TokenSrcGroup): { tokenIds: Set; groupIds: Set; }; /** * Turn a nested object into a single-level object with dot notation keys and * values equal to the deepest **object** in the nested object. */ export declare function flatten(obj: Record): Record>; /** * This type and `TokenData` may look exactly the same but there's an important * distinction: `TokenData` has its `type` & `value` coupled, where this does not * Simplified example with only 2 types: * ```ts * type TokenData = * | { type: 'color', value: string } * | { type: 'number', value: number } * type TokenDataUncoupled = { * type: 'color' | 'number'; * value: string | number; * } * ``` * The job of `validateTokenData` is to take a `TokenDataUncoupled` and return a * `TokenData` by checking the `type` and `value` are correct AND BELONG TOGETHER. */ type TokenDataUncoupled = Except & { type: TokenData['type']; value: TokenData['value']; originalValue: TokenData['originalValue']; }; /** * Validate the `type` and `value` of a `TokenData` object, allows TypeScript to * infer the correct `type` and `value` for the `TokenData` object. */ export declare function validateTokenData(token: TokenDataUncoupled): TokenData; export {}; //# sourceMappingURL=utils.d.ts.map