import type { Alignment } from './alignment'; import type { Border } from './borders'; import type { Fill } from './fills'; import type { Font } from './fonts'; import { type Stylesheet } from './stylesheet'; export interface NamedStyle { readonly name: string; /** OOXML built-in id (0..N); absent for user-defined styles. */ readonly builtinId?: number; readonly customBuiltin?: boolean; readonly hidden?: boolean; readonly iLevel?: number; readonly font?: Font; readonly fill?: Fill; readonly border?: Border; readonly alignment?: Alignment; readonly protection?: Protection; readonly numberFormat?: string; } import type { Protection } from './protection'; /** * NamedStyle as it sits inside the Stylesheet (an `` entry). * Captures the resolved cellStyleXfs index so the writer can emit the * `` element directly. */ export interface StylesheetNamedStyle { readonly name: string; readonly xfId: number; readonly builtinId?: number; readonly customBuiltin?: boolean; readonly hidden?: boolean; readonly iLevel?: number; } /** * Register a NamedStyle on the Stylesheet: * 1. add Font / Fill / Border / NumberFormat to their pools * 2. push a CellXf with apply* flags into cellStyleXfs * 3. append a {name, xfId, builtinId} entry into the workbook's * namedStyles list (caller-managed; this function returns the * xfId so callers can connect the dots) * Idempotent on (name): re-registering by the same name returns the * cached xfId. */ export declare function addNamedStyle(ss: Stylesheet, style: NamedStyle): number; /** Curated subset of openpyxl's `styles` dict. Keys match the user-visible names. */ export declare const BUILTIN_NAMED_STYLES: Readonly>; /** * Register a built-in style with the supplied Stylesheet (idempotent). * Returns the cellStyleXfs index. Throws OpenXmlSchemaError when the * name is unknown. */ export declare function ensureBuiltinStyle(ss: Stylesheet, name: keyof typeof BUILTIN_NAMED_STYLES | string): number;