import type { Drawing } from '../drawing/drawing'; import type { Relationships } from '../packaging/relationships'; import { type XmlNode } from '../xml/tree'; import type { LegacyComment } from './comments'; import type { HeaderFooter, PageMargins, PageSetup } from './page-setup'; import type { WebPublishItem } from './web-publish'; import type { TableDefinition } from './table'; import { type Worksheet } from './worksheet'; /** Inputs the worksheet reader needs from the surrounding workbook context. */ export interface WorksheetReadContext { /** Resolved shared-strings table. Pass `[]` when no sst is present. */ sharedStrings: ReadonlyArray; /** This worksheet's `_rels/sheetN.xml.rels`. Used to resolve external hyperlink targets and table parts. */ rels?: Relationships; /** Resolves a worksheet-rels rId pointing at xl/tables/tableN.xml into a parsed TableDefinition. */ loadTable?: (relId: string) => TableDefinition | undefined; /** * Loader for comments parts (rels Type=…/comments). Called once per matching * rel; the reader appends every returned LegacyComment onto * `ws.legacyComments`. */ loadComments?: (relId: string) => ReadonlyArray | undefined; /** * Loader for the worksheet's drawing part. Called once when the worksheet * inline carries ``. */ loadDrawing?: (relId: string) => Drawing | undefined; } /** * Parse a `xl/worksheets/sheetN.xml` payload into a fully-populated Worksheet. * The returned worksheet's `title` matches the `title` argument; the XML * doesn't carry the sheet name (it lives in `workbook.xml`). */ export declare function parseWorksheetXml(bytes: Uint8Array | string, title: string, ctx: WorksheetReadContext): Worksheet; export declare const parseWebPublishItem: (node: XmlNode) => WebPublishItem | undefined; export declare const parsePageMargins: (node: XmlNode) => PageMargins | undefined; export declare const parsePageSetup: (node: XmlNode) => PageSetup | undefined; export declare const parseHeaderFooter: (node: XmlNode) => HeaderFooter | undefined;