import { PoNode } from '../po-helpers.js'; /** * §20.1.4.1.16 `a:fontScheme` — the two typefaces a theme names, each in three * scripts. A document does not repeat them: it refers to them by TOKEN * (`+mj-lt`, `+mn-ea`, …), which every reader is expected to resolve. */ export interface ThemeFonts { /** `a:majorFont` — headings. */ readonly major: ThemeFontSlots; /** `a:minorFont` — body text. */ readonly minor: ThemeFontSlots; } /** One font of a scheme, in the three scripts a run may pick from. */ export interface ThemeFontSlots { readonly latin?: string; readonly ea?: string; readonly cs?: string; } /** * Parse a theme's font scheme (§20.1.4.1.16). * * @param themeXml The raw theme part bytes, UTF-8. * @returns The two fonts; slots the theme leaves empty are absent. */ export declare function parseThemeFonts(themeXml: Uint8Array): ThemeFonts; /** * Resolve a typeface written as a theme TOKEN to the name it stands for. * * A slide states its fonts as `+mn-lt` far more often than by name, and left * unresolved that string travels into the model as if it WERE a typeface: no * substitution table knows it, so a deck whose theme is Times came out in a * grotesque (45541_Header). * * @param typeface The `@typeface` as the file writes it. * @param fonts The theme's font scheme, when the part was read. * @returns The resolved name; the input unchanged when it is not a token, and * `undefined` when it is a token the theme leaves empty. */ export declare function resolveThemeFont(typeface: string | undefined, fonts: ThemeFonts | undefined): string | undefined; /** * Parse a DrawingML theme part (ECMA-376 §20.1.6.2, `a:clrScheme`) into a * `name → hex` colour map. Reads the twelve scheme slots — `dk1`/`lt1`/`dk2`/ * `lt2`, `accent1`–`accent6`, `hlink`/`folHlink` — taking each slot's * `a:srgbClr@val` or, for a system colour, its resolved `a:sysClr@lastClr`. * Unknown slots and slots with no resolvable colour are skipped. * * @param themeXml The raw `word/theme/theme1.xml` (or sibling) bytes, UTF-8. * @returns A map keyed by slot name (`'accent1'`, …) to uppercase RRGGBB hex; * empty when no `a:clrScheme` is present. */ export declare function parseTheme(themeXml: Uint8Array): Map; /** * Parse a theme's line-style widths (ECMA-376 §20.1.4.1.21 `a:lnStyleLst`). * * A shape drawn from the gallery keeps its outline as ``, * which is a 1-based index into this list — the reference names the colour and * the list holds the width. The standard Office theme is 0.75pt / 2pt / 3pt. * * @param themeXml The raw theme part bytes, UTF-8. * @returns The widths in points, in list order; empty when the theme declares * no `a:fmtScheme`. */ export declare function parseThemeLineWidths(themeXml: Uint8Array): Array; /** * Parse a theme's fill styles (§20.1.4.1.13 `a:fillStyleLst`), as the raw nodes. * * A shape drawn from the gallery carries no fill of its own — only * ``, a 1-based index into this list, and a colour to put * where the styles say `phClr`. The standard Office theme's slots are a solid, * a subtle gradient and a stronger one, so reading the reference's colour alone * paints slot 3 flat: 47504.xlsx's rectangle is a gradient in both references * and a single blue in ours. * * The nodes are handed back unparsed because what they hold is a whole fill — * solid, gradient, pattern — which the shape readers already know how to read. * * @param themeXml The raw theme part bytes, UTF-8. * @returns The `a:fillStyleLst` children in list order; empty when the theme * declares no `a:fmtScheme`. */ export declare function parseThemeFillStyles(themeXml: Uint8Array): Array; /** * Parse a theme's BACKGROUND fill styles (§20.1.4.1.7 `a:bgFillStyleLst`), as * the raw nodes. An `` reaches them with an index past 1000 — slot * 1001 is the first — and that is where the page-sized backdrops Word's cover * pages are built from live (fdo78957.docx). * * @param themeXml The raw theme part bytes, UTF-8. * @returns The fill children in list order; empty when the theme declares none. */ export declare function parseThemeBgFillStyles(themeXml: Uint8Array): Array; /** * Parse a theme's effect styles (§20.1.4.1.15 `a:effectStyleLst`), as the raw * nodes. `` is a 1-based index into this list, exactly as * the fill and line references index theirs. * * @param themeXml The raw theme part bytes, UTF-8. * @returns The `a:effectStyle` children in list order; empty when the theme * declares no `a:fmtScheme`. */ export declare function parseThemeEffectStyles(themeXml: Uint8Array): Array;