import type { WorkbookHandle as WasmWorkbookHandle } from "./xlcore_wasm.js"; import type { ApiCellValue, CellInfo, ClearMode, CommentInfo, CommentPatch, DependencyInfo, DependencyReference, HyperlinkInfo, HyperlinkPatch, RangeInfo, RichText, RichTextRun, StylePatch } from "./api-schema/index.js"; import { type CellAddress, type RangeAddress, type SheetRef } from "./api-refs.js"; export type CellInput = string | number | boolean | null | ApiCellValue; export declare class Range { protected readonly handle: WasmWorkbookHandle; private readonly sheetRef; readonly reference: string; constructor(handle: WasmWorkbookHandle, sheetRef: SheetRef, reference: string); get sheet(): string; info(): RangeInfo; values(): ApiCellValue[][]; formulas(): Array>; setValues(values: CellInput[][]): this; setFormulas(formulas: Array>): this; /** * Apply a {@link StylePatch} to every cell in the range. * * Merged-cell caveat: in OOXML only the **top-left anchor** of a merged region * carries a style; the other cells in the merge are written as empty. To restyle * a merged range, target its top-left anchor (e.g. `sheet.range("A1")` for a * merge anchored at `A1:C3`) rather than the full `A1:C3` reference. Calling * `setStyle` on the wider range will still touch the anchor but is otherwise * a no-op on the merged remainder. */ setStyle(patch: StylePatch): this; clear(mode?: ClearMode): this; copyTo(dest: Range | string): Range; fillTo(dest: Range | string): Range; moveTo(dest: Range | string): Range; merge(): this; unmerge(): this; } export declare class Cell { private readonly handle; private readonly sheetRef; readonly reference: string; constructor(handle: WasmWorkbookHandle, sheetRef: SheetRef, reference: string); get sheet(): string; asRange(): Range; info(): CellInfo; value(): ApiCellValue; formula(): string | undefined; setValue(value: CellInput): this; setFormula(formula: string): this; /** The cell's rich-text runs, if it holds a multi-run inline string. */ richText(): RichText | undefined; /** Write the cell as a rich-text inline string of formatted runs. */ setRichText(runs: RichTextRun[]): this; /** * Apply a {@link StylePatch} to this cell. * * If this cell is part of a merged region, the style is only persisted when the * reference points at the merge's **top-left anchor** — OOXML stores style on * the anchor only and writes the merged remainder as empty. Targeting any other * cell of the merge is silently a no-op at render time. */ setStyle(patch: StylePatch): this; clear(mode?: ClearMode): this; precedents(): DependencyReference[]; dependents(): DependencyReference[]; dependencies(): DependencyInfo; setHyperlink(patch: HyperlinkPatch): HyperlinkInfo; removeHyperlink(): HyperlinkInfo[]; setComment(patch: CommentPatch): CommentInfo; removeComment(): CommentInfo[]; } export declare function makeRange(handle: WasmWorkbookHandle, sheetRef: SheetRef, addr: RangeAddress): Range; export declare function makeCell(handle: WasmWorkbookHandle, sheetRef: SheetRef, addr: CellAddress): Cell;