import { CalcPropertiesAccessor, WorkbookCharts, WorkbookDefinedNames, WorkbookImages, WorkbookNamedStyles, WorkbookPivots, WorkbookPropertiesAccessor, WorkbookProtectionAccessor, WorkbookSparklineGroups, WorkbookTables } from "./api-collections.js"; import { Worksheet } from "./api-worksheet.js"; import type { ApiWarning, DependencyReference, LayoutOptions as WorkbookLayoutOptions, RecalcWorkbook, SearchMatch, SearchOptions } from "./api-schema/index.js"; import type { WorkbookLayout } from "./types.js"; export { Cell, Range } from "./api-range.js"; export { Worksheet } from "./api-worksheet.js"; export { AutoFilterAccessor, CalcPropertiesAccessor, ChartCollection, ChartExCollection, CommentCollection, ConditionalFormatCollection, DataValidationCollection, HyperlinkCollection, ImageCollection, MergeCollection, PivotCollection, SparklineGroupCollection, TableCollection, ThreadedNotesCollection, WorkbookCharts, WorkbookDefinedNames, WorkbookImages, WorkbookNamedStyles, WorkbookPivots, WorkbookPropertiesAccessor, WorkbookProtectionAccessor, WorkbookSparklineGroups, WorkbookTables, } from "./api-collections.js"; export { SheetFreezeAccessor, SheetPageSetupAccessor, SheetPropertiesAccessor, SheetProtectionAccessor, } from "./api-worksheet.js"; export { NumberFormat } from "./number-formats.js"; export type { NumberFormatCode, NumberFormatKey } from "./number-formats.js"; export { absoluteAnchor, anchorA1, cellA1, colLetter, rangeA1 } from "./api-refs.js"; export { distinctValuesFor } from "./pivotSource.js"; export type { AbsoluteAnchorOptions, AnchorA1, CellAddress, RangeAddress } from "./api-refs.js"; export type { AlignmentPatch, ApiCellValue, ApiError, ApiError as ApiErrorPayload, ApiErrorCode, ApiWarning, AutoFilterColumnInfo, AutoFilterColumnPatch, AutoFilterCriteria, AutoFilterCustomCriterion, AutoFilterInfo, AutoFilterOperator, BorderLinePatch, BorderLineStyle, BorderPatch, CalcMode, CalcProperties, CalcPropertiesPatch, CellInfo, CfOperator, CfRuleKind, ChartAnchor, ChartInfo, ChartKind, ChartLegendPosition, ChartPatch, ChartSeriesInfo, ChartSeriesPatch, ClearMode, CommentInfo, CommentPatch, ConditionalFormatRuleInfo, ConditionalFormatRulePatch, ThreadedNoteInfo, ThreadedNotePatch, DataValidationErrorStyle, DataValidationInfo, DataValidationOperator, DataValidationPatch, DataValidationType, DefinedNameInfo, DefinedNamePatch, DependencyInfo, DependencyReference, EngineCellValue, FillPatch, FontPatch, FormulaFallback, FreezeInfo, HorizontalAlign, HyperlinkInfo, HyperlinkPatch, ImageFormat, ImageInfo, ImagePatch, LayoutOptions as WorkbookLayoutOptions, MergeInfo, RangeInfo, RecalcCell, RecalcSheet, RecalcWorkbook, SearchHit, SearchMatch, SearchMode, SearchOptions, SearchTarget, HeaderFooterInfo, HeaderFooterPatch, PageMarginsInfo, PageMarginsPatch, PageOrder, PageOrientation, PageSetupSettings, PageSetupSettingsPatch, PatternType, PivotAggregation, PivotCellRole, PivotDataField, PivotFieldFilter, PivotGrid, PivotGridCell, PivotInfo, PivotPatch, PrintCellComments, PrintErrors, PrintOptionsInfo, PrintOptionsPatch, SheetInfo, SheetPageSetup, SheetPageSetupPatch, SheetProperties, SheetPropertiesPatch, SheetProtectionInfo, SheetProtectionPatch, SheetVisibility, SparklineAxisType, SparklineDisplayBlanks, SparklineEntry, SparklineGroupInfo, SparklineGroupPatch, SparklineKind, StylePatch, TableColumnInfo, TableColumnPatch, TableInfo, TablePatch, TableStylePatch, TableStyleSettings, TableTotalsFunction, UnderlinePatch, VerticalAlign, WorkbookProperties, WorkbookPropertiesPatch, WorkbookProtectionInfo, WorkbookProtectionPatch, } from "./api-schema/index.js"; export type DefaultWasmInput = string | URL | RequestInfo | BufferSource | WebAssembly.Module; export type DefaultWasmInputResolver = () => DefaultWasmInput | Promise; /** * Override how {@link Workbook.create}/{@link Workbook.open} locate the default * wasm binary when no explicit `wasmBinaryUrl` is given. The browser entry * resolves to a same-origin URL; importing `@hewliyang/xlsx-preview/node` * registers a Node resolver that reads the bundled binary off disk so the * browser entry stays free of `node:fs`. */ export declare function registerDefaultWasmInputResolver(resolver: DefaultWasmInputResolver): void; export interface WorkbookApiOptions { wasmBinaryUrl?: string | URL | RequestInfo | BufferSource | WebAssembly.Module; } export interface RecalcOptions { errorsOnly?: boolean; } export type { CellInput } from "./api-range.js"; export declare class Workbook { private handle; static create(options?: WorkbookApiOptions): Promise; static open(bytes: ArrayBuffer | Uint8Array, options?: WorkbookApiOptions): Promise; readonly definedNames: WorkbookDefinedNames; readonly namedStyles: WorkbookNamedStyles; readonly allTables: WorkbookTables; readonly allCharts: WorkbookCharts; readonly allImages: WorkbookImages; readonly allSparklineGroups: WorkbookSparklineGroups; readonly allPivots: WorkbookPivots; readonly properties: WorkbookPropertiesAccessor; readonly calcProperties: CalcPropertiesAccessor; readonly protection: WorkbookProtectionAccessor; private readonly worksheetCache; private constructor(); /** * Resolve a stable {@link Worksheet} object for a sheet info. Worksheets are * cached by their stable `SheetInfo.id`, so `wb.sheet('X')` twice returns the * same object and a `rename()` on one handle is visible through every other. */ private worksheetFor; sheet(name: string): Worksheet; worksheets(): Worksheet[]; activeSheet(): Worksheet; addSheet(name: string): Worksheet; removeSheet(name: string): void; warnings(): ApiWarning[]; takeWarnings(): ApiWarning[]; /** * Search cells across the workbook. * * Defaults: `target: "values"`, `mode: "substring"`, `caseSensitive: false`, * `includeHidden: true` (hidden and very-hidden sheets are searched by * default; set `includeHidden: false` to skip them, unless an explicit * `sheet` is named — a named sheet is always searched regardless of * visibility). */ search(query: string, options?: Partial): SearchMatch[]; /** * Recalculate all formulas. By default the returned report lists only cells * that produced an engine error (those with a `fallback`), dropping sheets * with no errors — recalc always evaluates every cell, so read computed * values via `Cell.info()` / `Range.values()`. Pass `{ errorsOnly: false }` * to get the full cell-by-cell report. */ recalculate(options?: RecalcOptions): RecalcWorkbook; layout(options?: WorkbookLayoutOptions): WorkbookLayout; parseFormulaReferences(sheet: string, anchor: string, formula: string): DependencyReference[]; functionNames(): string[]; save(): Uint8Array; /** * Escape hatch: list every part path in the package (the modeled object * graph serialized to OPC), e.g. `xl/workbook.xml`. Use with * {@link getPart}/{@link setPart} to read or author schema we don't model. */ partNames(): string[]; /** * Escape hatch: read a part's raw XML by path, or `undefined` if absent. * Leading `/` is optional. Throws on non-UTF-8 (binary) parts. */ getPart(name: string): string | undefined; /** * Escape hatch: write a part's raw XML, overwriting or creating it. For a * brand-new part path you must also declare its content type by editing * `[Content_Types].xml` via this same method. Round-trips verbatim. */ setPart(name: string, xml: string): void; /** Escape hatch: delete a part by path. Returns whether it existed. */ removePart(name: string): boolean; dispose(): void; }