import { ShapeBlock } from '../core/document-model/index.js'; import { ColorResolver } from '../core/drawingml/colors.js'; import { ParsedWorksheet } from '../core/spreadsheet-model/index.js'; import { PoNode } from '../core/po-helpers.js'; /** * Parse a drawing's `xdr:sp` shape anchors (§20.5.2.30) into anchor-ordered * {@link ShapeBlock}s (E-SHEET W2), reusing the shared DrawingML geometry / fill / * line / text readers. A shape's box comes from its sheet anchor (from/to tracks), * not its `a:xfrm`. Returns `[]` when the drawing has no shapes (chart/picture-only), * so the reader's gate keeps non-shape sheets off this second parse. * * @param drawingXml The drawing part bytes (re-parsed via `parseXml` for the * preserveOrder tree the shape readers expect). * @param worksheet The host worksheet, for the column/row track geometry. * @param colors The theme colour resolver threaded into fill/line parsing. * @param themeLineWidths The theme's `a:lnStyleLst` widths in points, which an * `` indexes for a gallery-styled outline. * @param themeFillStyles The theme's `a:fillStyleLst` nodes, which an * `` indexes for a gallery-styled fill. * @param themeEffectStyles The theme's `a:effectStyleLst` nodes, which an * `` indexes for a gallery-styled shadow. */ export declare function parseSheetShapes(drawingXml: Uint8Array, worksheet: ParsedWorksheet, colors: ColorResolver, themeLineWidths?: ReadonlyArray, themeFillStyles?: ReadonlyArray, themeEffectStyles?: ReadonlyArray): Array; /** * The boxes the diagram frames of a drawing occupy, in document order. * * §20.5.2.16 `xdr:graphicFrame` is how a sheet hosts a diagram: the frame is * anchored like any other drawing and the diagram itself lives in its own * parts. The frame gives the corner its fallback shapes are laid out from — * see {@link parseDiagramShapes}. * * @param drawingXml The drawing part bytes. * @param worksheet The host worksheet, for the column/row track geometry. * @returns One box per diagram frame, in the order the drawing writes them. */ export declare function parseDiagramFrames(drawingXml: Uint8Array, worksheet: ParsedWorksheet): Array; /** * Parse the fallback drawing of a SmartArt diagram (§ MS-ODRAWXML 2.1 * `dsp:drawing`) into the shapes it lays out. * * A diagram is FOUR parts of description — data, layout, quick style, colours — * that a renderer is meant to lay out itself, and nobody outside Office does. * The producer therefore also writes what it drew: a plain DrawingML picture of * the result, under `dsp:`, reachable from the drawing part by a * `diagramDrawing` relationship. Reading it is the difference between a diagram * and a blank space — tdf83671_SmartArt_import.xlsx draws three nested circles * where we drew nothing between its "start" and its "end". * * The shapes' `a:xfrm` offsets are relative to the frame the diagram sits in, * so the frame's own corner is all that has to be added. * * @param diagramXml The `dsp:drawing` part bytes. * @param frame The box the graphic frame occupies on the page. * @param colors The theme colour resolver. * @param themeLineWidths `a:lnStyleLst` widths, indexed by ``. * @param themeFillStyles `a:fillStyleLst` nodes, indexed by ``. * @param themeEffectStyles `a:effectStyleLst` nodes, indexed by ``. * @returns The shapes, in the order the diagram stacks them. */ export declare function parseDiagramShapes(diagramXml: Uint8Array, frame: AnchorBox, colors: ColorResolver, themeLineWidths?: ReadonlyArray, themeFillStyles?: ReadonlyArray, themeEffectStyles?: ReadonlyArray): Array; export interface AnchorBox { readonly widthPt: number; readonly heightPt: number; readonly anchorRow: number; /** Distance from the sheet's top-left corner to the shape's, in points. */ readonly xPt: number; readonly yPt: number; }