/** * Theme engine. * * The server resolves brand/campaign/context colours and sends tokens plus, * for each token, WHERE IT CAME FROM. The client's job is only to put them * somewhere CSS can see them, and to do it as custom properties rather than * inline styles so a copied component can be restyled without forking the * package. * * `sources` is carried alongside deliberately: it is what the Ledger renders, * and a theme that arrives without provenance is a theme nobody can explain * to a brand manager asking why their blue changed. */ export interface ResolvedTheme { colors: Record; sources: Record; } /** CSS custom-property prefix. `--st-` is short enough to type in overrides. */ export declare const TOKEN_PREFIX = "--st-"; /** `primaryColor` → `--st-primary-color`. */ export declare function tokenName(key: string): string; /** * Theme tokens as a style object, ready for React's `style` prop or * `Object.assign(el.style, …)`. * * Values are passed through as authored. Sanitising here would mean parsing * CSS colour syntax in the client, which is both a losing game and the wrong * layer — the server owns what a valid resolved colour is. */ export declare function themeStyle(theme: ResolvedTheme | null): Record; /** * Write tokens onto an element. * * Returns a function restoring the previous values, so a component that * unmounts mid-stream does not leave a half-applied theme behind on a * long-lived host element. */ export declare function applyTheme(element: HTMLElement, theme: ResolvedTheme | null): () => void; /** * Where a token came from — for the Ledger, and for anyone debugging why a * brand colour did not win. */ export declare function tokenSource(theme: ResolvedTheme | null, key: string): string | null; /** * The ink that reads on a given hex color — the SDK twin of the shell's * ReadableTextColor (mosaic-edge-serve/internal/theme/theme.go) and the TS * resolver's readableTextColor (mosaic/services/themeService.ts). Same * perceived-luminance rule in all three places; change them together. * Non-hex input returns light ink, matching both twins. */ export declare function readableTextColor(color: string): string; //# sourceMappingURL=theme.d.ts.map