/** * @file * * This file provides mechanisms to convert a token source object (KsDesignTokenSrcGroup) * to an intermediate format (Getables) which allows easy recursive generating of * an array of objects with very specific keys (KsDesignTokenData). The process * is basically: * * Step 1: the json stored within a client project. * * const exampleSrc: KsDesignTokensSrcGroup = { * a: { * b: { * c: { * value: '#ccc', * }, * }, * }, * d: { * e: { * f: { * value: '{a.b.c.value} hi #ccc', * }, * }, * }, * }; * * Step 2: the lookup table generated by https://npmjs.com/package/flatten that * the functions below traverse. * * const exampleGetables: Getables = { * 'a.b.c.value': '#ccc', * 'd.e.f.value': '{a.b.c.value}', * }; * * Step 3: the final output format used within the Knapsack UI. * * const exampleTokenData: KsDesignTokenData = [ * { * name: 'a-b-c', * value: '#ccc', * original: { * value: '#ccc', * }, * path: ['a', 'b', 'c'], * attributes: { * type: 'color', * }, * }, * { * name: 'd-e-f', * value: '#ccc', * original: { * value: '{a.b.c.value}', * }, * path: ['d', 'e', 'f'], * attributes: { * type: 'color', * }, * }, * ] * */ import { type KsDesignTokenSrcGroup, type KsDesignTokenData } from '../../types.js'; /** * Dive through tokens source to generate a map of lookup strings */ export declare const srcTokenGroupToDatas: ({ tokensGroupSrc, tokenPrefix, }: { tokensGroupSrc: KsDesignTokenSrcGroup; tokenPrefix?: string; }) => { tokens: KsDesignTokenData[]; }; //# sourceMappingURL=sd-src-to-ks-data.d.ts.map