/** * Shared generation prologue. * * Both entry points — `generateBufferFromJson` (core) and * `createDocumentGenerator` (plugin) — must resolve the same theme, apply the * same in-document overrides, and apply the same export mode before the * structure → layout → render engine runs. Keeping two copies of that meant * `props.themeOverrides` reached only one of them (#133); this module is the * single definition so the next root-level prop cannot diverge (#132). * * The prologue deliberately stops before font resolution: the core path * resolves fonts straight after this, while the plugin path must first expand * custom components (which can introduce new families). */ import type { ReportComponentDefinition } from '../types'; import type { ThemeConfig } from '../styles'; import type { FontRuntimeOpts, GenerationWarning } from '@json-to-office/shared'; export interface ThemeContextOptions { customThemes?: { [key: string]: ThemeConfig; }; fonts?: FontRuntimeOpts; warnings?: GenerationWarning[]; /** * Theme lookup for the base `props.theme` name. The plugin builder passes * its own (customThemes → doc-named built-in → constructor-supplied theme → * built-in); omit it to use customThemes → built-in. `authored` is true when * the name came from the document's own `props.theme` (not the * 'consulting' default), so the lookup can honor an explicitly doc-named built-in * without the constructor theme being shadowed for unnamed docs (#141). */ resolveNamedTheme?: (name: string, warnings: GenerationWarning[] | undefined, authored: boolean) => ThemeConfig; } export interface GenerationThemeContext { /** Provenance supplied by the shared plugin/block expansion stage. */ blockPaths?: readonly string[]; sourceMap?: Readonly>; /** The document after the export-mode pre-pass rewrote font references. */ document: ReportComponentDefinition; theme: ThemeConfig; /** Base theme name, retained for built-in fallback lookups. */ themeName: string; } export declare function resolveThemeContext(documentIn: ReportComponentDefinition, options?: ThemeContextOptions): GenerationThemeContext; //# sourceMappingURL=generationContext.d.ts.map