/** * Build-time token and theme manifest derivation. * * Scans a project for token definition modules (`tokens.ts` / * `*.tokens.ts`) and theme definition modules (`themes.ts` / * `*.themes.ts`), then derives the exports behind `virtual:czap/tokens`, * `virtual:czap/tokens.css`, and `virtual:czap/themes`. * * @module */ import type { Theme, Token } from '@czap/core'; /** Serializable token entry exported from `virtual:czap/tokens`. */ export type TokenManifestEntry = Pick & { readonly _tag: 'TokenDef'; readonly _version: 1; }; /** Token export name → definition for `virtual:czap/tokens`. */ export type TokenManifest = Readonly>; /** Serializable theme entry exported from `virtual:czap/themes`. */ export type ThemeManifestEntry = Pick & { readonly _tag: 'ThemeDef'; readonly _version: 1; }; /** Theme export name → definition for `virtual:czap/themes`. */ export type ThemeManifest = Readonly>; /** Options for {@link collectTokenManifest}. */ export interface CollectTokenManifestOptions { /** * Extra directory holding token definitions -- mirror of the plugin's * `dirs.token` override; scanned in addition to the project walk. */ readonly tokenDir?: string; } /** Options for {@link collectThemeManifest}. */ export interface CollectThemeManifestOptions { /** * Extra directory holding theme definitions -- mirror of the plugin's * `dirs.theme` override; scanned in addition to the project walk. */ readonly themeDir?: string; } /** * Derive the token map for `virtual:czap/tokens` and `virtual:czap/tokens.css`. * * @param projectRoot - Absolute path of the project to scan. * @param options - Optional `tokenDir` override (mirror of `dirs.token`). */ export declare function collectTokenManifest(projectRoot: string, options?: CollectTokenManifestOptions): Promise; /** * Derive the theme map for `virtual:czap/themes`. * * @param projectRoot - Absolute path of the project to scan. * @param options - Optional `themeDir` override (mirror of `dirs.theme`). */ export declare function collectThemeManifest(projectRoot: string, options?: CollectThemeManifestOptions): Promise; /** * Compile all collected tokens into one CSS sheet: `@property` registrations * (when applicable) plus a single merged `:root { … }` block. */ export declare function compileCollectedTokensCss(tokens: TokenManifest): string; //# sourceMappingURL=token-manifest.d.ts.map