import type { WorkbookHandle as WasmWorkbookHandle } from "./xlcore_wasm.js"; import type { FreezeInfo, RangeInfo, SheetInfo, SheetPageSetup, SheetPageSetupPatch, SheetProperties, SheetPropertiesPatch, SheetProtectionInfo, SheetProtectionPatch, SheetVisibility, StylePatch } from "./api-schema/index.js"; import { AutoFilterAccessor, ChartCollection, ChartExCollection, CommentCollection, ConditionalFormatCollection, DataValidationCollection, HyperlinkCollection, ImageCollection, PivotCollection, MergeCollection, ShapeCollection, SparklineGroupCollection, TableCollection, ThreadedNotesCollection } from "./api-collections.js"; import { type CellAddress, type RangeAddress, type SheetRef } from "./api-refs.js"; import { Cell, type CellInput, Range } from "./api-range.js"; declare abstract class SheetScopedApi { protected readonly handle: WasmWorkbookHandle; protected readonly sheetRef: SheetRef; constructor(handle: WasmWorkbookHandle, sheetRef: SheetRef); protected get sheet(): string; } export declare class SheetFreezeAccessor extends SheetScopedApi { get(): FreezeInfo; set(frozenRows: number, frozenColumns: number): FreezeInfo; } export declare class SheetPageSetupAccessor extends SheetScopedApi { get(): SheetPageSetup; set(patch: SheetPageSetupPatch): SheetPageSetup; clear(): SheetPageSetup; } export declare class SheetPropertiesAccessor extends SheetScopedApi { get(): SheetProperties; set(patch: SheetPropertiesPatch): SheetProperties; } export declare class SheetProtectionAccessor extends SheetScopedApi { get(): SheetProtectionInfo | null; set(patch: SheetProtectionPatch): SheetProtectionInfo; remove(): SheetProtectionInfo | null; } export declare class Worksheet { private readonly handle; private readonly sheetRef; readonly merges: MergeCollection; readonly hyperlinks: HyperlinkCollection; readonly comments: CommentCollection; readonly threadedNotes: ThreadedNotesCollection; readonly dataValidations: DataValidationCollection; readonly conditionalFormats: ConditionalFormatCollection; readonly autoFilter: AutoFilterAccessor; readonly tables: TableCollection; readonly charts: ChartCollection; readonly chartsEx: ChartExCollection; readonly images: ImageCollection; readonly shapes: ShapeCollection; readonly sparklineGroups: SparklineGroupCollection; readonly pivots: PivotCollection; readonly freeze: SheetFreezeAccessor; readonly pageSetup: SheetPageSetupAccessor; readonly properties: SheetPropertiesAccessor; readonly protection: SheetProtectionAccessor; constructor(handle: WasmWorkbookHandle, initialName: string); get name(): string; /** @internal Re-point this cached worksheet at its current name (keyed by stable sheet id). */ syncName(name: string): void; info(): SheetInfo; get index(): number; get rowCount(): number; get columnCount(): number; get visibility(): SheetVisibility | undefined; get active(): boolean; range(addr: RangeAddress): Range; cell(addr: CellAddress): Cell; /** Append a single row of values after the last row that contains data. */ appendRow(values: CellInput[]): RangeInfo; /** Append multiple rows after the last row that contains data. */ appendRows(rows: CellInput[][]): RangeInfo; /** * Bulk-apply a map (or `[ref, patch]` iterable) of styles to this sheet. * * Each entry is forwarded to the underlying `setStyle`, so the same merged-cell * caveat applies: target the merge's **top-left anchor** rather than the full * merged range — OOXML only stores style on the anchor. */ setStyles(patches: Record | Iterable<[string, StylePatch]>): this; setShowGridLines(visible: boolean): this; getShowGridLines(): boolean; /** @param row 1-based row index (row 1 = A1's row). */ setRowHeight(row: number, height: number): this; /** @param row 1-based row index (row 1 = A1's row). */ setRowVisible(row: number, visible: boolean): this; /** @param column 1-based column index (column 1 = A). */ setColumnWidth(column: number, width: number): this; /** @param column 1-based column index (column 1 = A). */ setColumnVisible(column: number, visible: boolean): this; /** * Resize a column to fit its contents. Returns the resulting width in * character units. * @param column 1-based column index (column 1 = A). */ autoFitColumn(column: number, minWidth?: number, maxWidth?: number): number; /** * Resize a range of columns to fit their contents. Returns the resulting * widths in character units. * @param start 1-based first column; @param end 1-based last column. */ autoFitColumns(start: number, end: number, minWidth?: number, maxWidth?: number): number[]; /** @param start 1-based first row of the group; level 1-7 (0 ungroups). */ groupRows(start: number, end: number, level?: number, collapsed?: boolean): this; /** @param start 1-based first row of the group to ungroup. */ ungroupRows(start: number, end: number): this; /** @param start 1-based first column of the group; level 1-7 (0 ungroups). */ groupColumns(start: number, end: number, level?: number, collapsed?: boolean): this; /** @param start 1-based first column of the group to ungroup. */ ungroupColumns(start: number, end: number): this; /** @param before 1-based row index to insert before (row 1 = A1's row). */ insertRows(before: number, count: number): this; /** @param start 1-based row index of the first row to delete (row 1 = A1's row). */ deleteRows(start: number, count: number): this; /** @param before 1-based column index to insert before (column 1 = A). */ insertColumns(before: number, count: number): this; /** @param start 1-based column index of the first column to delete (column 1 = A). */ deleteColumns(start: number, count: number): this; setVisibility(visibility: SheetVisibility): SheetInfo; activate(): SheetInfo; rename(newName: string): this; moveTo(toIndex: number): SheetInfo; remove(): void; } export {};