import type { ChartExModel } from "./chart-ex-types.js"; /** * Chart cache populator. * * Walks a ChartModel, finds every `numRef`/`strRef` formula, resolves it against * the actual worksheet cell values in the workbook, and populates the cache * points so that headless consumers (PDF export, image preview, other readers * that don't recalculate formulas) see non-empty charts. * * Excel itself recomputes caches on open, so this is a best-effort enrichment: * - empty/missing cells produce null values at the correct index * - formula-bearing cells use their cached result when available * - non-existent sheets or malformed formulas are skipped silently */ import type { ChartModel, NumberReference, StringReference, MultiLevelStringReference } from "./types.js"; import type { Workbook } from "../workbook.js"; import type { Worksheet } from "../worksheet.js"; /** * Populate all number/string caches in a ChartModel from the given workbook. * Mutates the model in place. Safe to call multiple times (idempotent). * * @param model - The chart model to enrich * @param workbook - The workbook used to resolve sheet/cell references * @param contextWorksheet - Optional worksheet providing the default scope for * defined-name resolution. When a defined name has a sheet-scoped entry * matching this worksheet's workbook index (`localSheetId`), that entry * wins over the workbook-scoped entry. Supplying this argument is required * to correctly resolve sheet-scoped names; omitting it falls back to * workbook-scoped names only. */ export declare function fillChartCaches(model: ChartModel, workbook: Workbook, contextWorksheet?: Worksheet): void; export declare function fillChartExCaches(model: ChartExModel, workbook: Workbook, contextWorksheet?: Worksheet): void; /** * Populate a NumberReference cache from the workbook. * Only fills if `cache.points` is currently empty. * * @param contextWorksheet - Optional worksheet whose sheet-scoped defined * names take precedence over workbook-scoped ones. */ export declare function fillNumRef(ref: NumberReference, workbook: Workbook, date1904?: boolean, contextWorksheet?: Worksheet): void; /** * Populate a StringReference cache from the workbook. * Only fills if `cache.points` is currently empty. * * @param contextWorksheet - Optional worksheet whose sheet-scoped defined * names take precedence over workbook-scoped ones. */ export declare function fillStrRef(ref: StringReference, workbook: Workbook, contextWorksheet?: Worksheet): void; export declare function fillMultiLvlStrRef(ref: MultiLevelStringReference, workbook: Workbook, contextWorksheet?: Worksheet): void;