import { OpcPackage } from '../core/opc/index.js'; import { ParsedWorksheet } from '../core/spreadsheet-model/index.js'; /** §20.5 — a chart frame anchored over the grid, sized from its cell-range anchor. */ export interface SheetChartRef { /** * The resolved chart part path (`'xl/charts/chart1.xml'`) — globally unique, used * as the FlowDoc charts key and the `ChartBlock.chartRelId`. */ readonly chartPartPath: string; readonly widthPt: number; readonly heightPt: number; /** * Where the anchor puts the frame, in points from the grid's top-left. A * chart is anchored over the sheet like any other drawing; placed in the flow * instead it lands at the left margin, below everything, and on whatever page * that turns out to be. */ readonly xPt: number; readonly yPt: number; /** Anchor top row (0-based) — used only to order charts on the sheet. */ readonly anchorRow: number; } /** * §20.5.2.1 `xdr:pic` — a picture anchored over the grid. The reader reads the * resolved media part's bytes into the SheetDoc resource store. */ export interface SheetPicture { /** The resolved media part path; the reader loads its bytes into the resource store. */ readonly imagePartPath: string; readonly widthPt: number; readonly heightPt: number; /** Where the anchor puts it, in points from the grid's top-left. */ readonly xPt: number; readonly yPt: number; /** Anchor top row (0-based) — used only to order pictures on the sheet. */ readonly anchorRow: number; } /** Both kinds of anchored frame the drawing yields, anchor-ordered. */ export interface SheetDrawing { readonly charts: Array; readonly pictures: Array; } /** * Parse a `xl/drawings/drawingN.xml` part (§20.5.2.35/.33/.1 — `xdr:twoCellAnchor` * / `oneCellAnchor` / `absoluteAnchor`) into the {@link SheetDrawing} it yields. * Each anchor frames either a chart (`graphicFrame`) or a picture (`xdr:pic`); both * are sized from the anchor and returned anchor-ordered. * * @param drawingXml The drawing part bytes. * @param drawingPartPath The drawing part path, for resolving its relationships. * @param pkg The OPC package, used to resolve relId → part path. * @param worksheet The host worksheet, for the column/row track geometry. */ export declare function parseSheetDrawing(drawingXml: Uint8Array, drawingPartPath: string, pkg: OpcPackage, worksheet: ParsedWorksheet): SheetDrawing; /** * Build a `col → width-in-points` accessor: a `` override (Excel "chars") * where present, else the default — the same conversions the print model uses. * Exported so the sheet-shape parser (E-SHEET W2) sizes shape anchors with the same * track geometry. */ export declare function makeColWidthPt(ws: ParsedWorksheet): (col: number) => number; /** * Build a `row → height-in-points` accessor: the explicit row height where present, * else the default. Pairs with {@link makeColWidthPt} for the anchor track geometry. */ export declare function makeRowHeightPt(ws: ParsedWorksheet): (row: number) => number;