/** * Token JS Compiler -- `TokenDef[]` to JavaScript const + `.d.ts` type declaration. * * Emits a fully typed `tokens` object grouped by category with const * assertion, plus a companion `.d.ts` declaration using `typeof`. * * @module */ import type { Token } from '@czap/core'; /** * Output of {@link TokenJSCompiler.compile}. * * Two parallel artifacts for the same token set: a runtime ES module and * a companion ambient declaration. The type declaration uses `typeof` so * values round-trip exactly through the compiler without hand-maintained * duplication. */ export interface TokenJSResult { /** Runtime `.ts` source declaring `export const tokens` with const assertion. */ readonly code: string; /** Ambient `.d.ts` declaration exposing the same shape via `typeof`. */ readonly typeDeclaration: string; } /** * Compile a list of {@link Token.Shape} into a JS object + companion type * declaration, grouped by category. */ declare function compile(tokens: readonly Token.Shape[]): TokenJSResult; /** * Token JS compiler namespace. * * Serializes a token set to a runtime ES module and an ambient `.d.ts` * declaration in parallel so consumers import a single typed object while * the build artifact stays 100% generated. */ export declare const TokenJSCompiler: { /** Compile a token array into parallel `.ts` source and `.d.ts` declaration. */ readonly compile: typeof compile; }; export {}; //# sourceMappingURL=token-js.d.ts.map