Worksheet
80 methods
Sub-APIs
getName
→ Promise<string>getName(): Promise<string>;Get the sheet name. Async — reads from Rust via IPC (cached after first call).
setName
→ Promise<void>setName(name: string): Promise<void>;| Parameter | Type | Required |
|---|---|---|
| name | string | required |
Set the sheet name.
getIndex
→ numbergetIndex(): number;Get the 0-based sheet index.
getSheetId
→ SheetIdgetSheetId(): SheetId;Get the internal sheet ID. @deprecated Use the `sheetId` property instead.
setCell
→ Promise<void>setCell(address: string, value: CellValuePrimitive | Date, options?: CellWriteOptions): Promise<void>;| Parameter | Type | Required |
|---|---|---|
| address | string | required |
| value | CellValuePrimitive | Date | required |
| options | CellWriteOptions | optional |
Set a cell value by A1 address. String values starting with "=" are treated as formulas (e.g. "=SUM(B1:B10)"). Use `options.asFormula` to force formula interpretation without the "=" prefix. Use `options.literal` to store strings starting with "=" as literal text. Date values are automatically converted via setDateValue().
setDateValue
→ Promise<void>setDateValue(row: number, col: number, year: number, month: number, day: number): Promise<void>;| Parameter | Type | Required |
|---|---|---|
| row | number | required |
| col | number | required |
| year | number | required |
| month | number | required |
| day | number | required |
Set a calendar date in a cell, automatically applying a date format. Four input forms (in order of preference for unambiguous semantics): 1. **Calendar parts** — `setDateValue(row, col, year, month, day)` / `setDateValue(addr, year, month, day)`. No `Date`, no timezone — the calendar value is the input. 2. **ISO calendar string** — `setDateValue(row, col, '2026-03-01')` / `setDateValue(addr, '2026-03-01')`. No `Date`, no timezone. 3. **`Date` instant** — `setDateValue(row, col, date)` / `setDateValue(addr, date)`. Resolved against the session's `userTimezone` (set when the workbook was created). 4. **`Date` instant with explicit override** — `setDateValue(row, col, date, { tz })` / `setDateValue(addr, date, { tz })`. Use when a `Date` should be interpreted in a frame other than the session default. @see plans/active/ux/datetime/round-1/session-user-timezone.md
setTimeValue
→ Promise<void>setTimeValue(row: number, col: number, hours: number, minutes: number, seconds: number): Promise<void>;| Parameter | Type | Required |
|---|---|---|
| row | number | required |
| col | number | required |
| hours | number | required |
| minutes | number | required |
| seconds | number | required |
Set a time-of-day in a cell, automatically applying a time format. Three input forms: 1. **Time parts** — `setTimeValue(row, col, hours, minutes, seconds)` / `setTimeValue(addr, hours, minutes, seconds)`. 2. **`Date` instant** — `setTimeValue(row, col, date)` / `setTimeValue(addr, date)`. Resolved against the session's `userTimezone`. 3. **`Date` instant with explicit override** — `setTimeValue(row, col, date, { tz })`.
getCell
→ Promise<CellData>getCell(address: string): Promise<CellData>;| Parameter | Type | Required |
|---|---|---|
| address | string | required |
Get cell data by A1 address.
getRange
→ Promise<CellData[][]>getRange(range: string): Promise<CellData[][]>;| Parameter | Type | Required |
|---|---|---|
| range | string | required |
Get a 2D array of cell data for a range (A1 notation).
getRanges
→ Promise<CellData[][][]>getRanges(addresses: string): Promise<CellData[][][]>;| Parameter | Type | Required |
|---|---|---|
| addresses | string | required |
Get cell data for multiple ranges at once (spreadsheet special-cell typeWorksheet.getRanges equivalent). @param addresses - Comma-separated A1-style range addresses (e.g. "A1:B5,D1:E5,G1") @returns Array of 2D cell data arrays, one per address
setRange
→ Promise<void>setRange(range: string, values: (CellValuePrimitive | Date)[][]): Promise<void>;| Parameter | Type | Required |
|---|---|---|
| range | string | required |
| values | (CellValuePrimitive | Date)[][] | required |
Set a 2D array of values into a range (A1 notation). String values starting with "=" are treated as formulas.
setArrayFormula
→ Promise<void>setArrayFormula(range: CellRange, formula: string): Promise<void>;| Parameter | Type | Required |
|---|---|---|
| range | CellRange | required |
| formula | string | required |
Enter a CSE (`Ctrl+Shift+Enter`) array formula on the given range. The formula is stored only on the top-left anchor; covered cells are projections of the array result and read-only. Editing any covered cell via `setCell` is rejected by Rust compute-core with `ComputeError::PartialArrayWrite`. Tearing down the array formula is `clear` / `setCell(anchor, null)` on the anchor. Distinct from a regular `setCell` of an array-returning formula: dynamic-array spills allow blocker-literal writes into spill members (raise `#SPILL!`), CSE rejects all partial writes.
clearData
→ Promise<ClearResult>clearData(range: string): Promise<ClearResult>;| Parameter | Type | Required |
|---|---|---|
| range | string | required |
Clear all cell data (values and formulas) in a range (A1 notation, e.g. "A1:C3").
clear
→ Promise<ClearResult>clear(range: string, applyTo?: ClearApplyTo): Promise<ClearResult>;| Parameter | Type | Required |
|---|---|---|
| range | string | required |
| applyTo | ClearApplyTo | optional |
Unified clear with mode selection (spreadsheet special-cell typeRange.clear equivalent). @param range - A1 range string (e.g. "A1:C3") @param applyTo - What to clear: 'all' (default), 'contents', 'formats', 'hyperlinks'
clearOrResetContents
→ Promise<void>clearOrResetContents(range: string): Promise<void>;| Parameter | Type | Required |
|---|---|---|
| range | string | required |
Clear cell contents with form control awareness (spreadsheet special-cell typeclearOrResetContents equivalent). For cells linked to form controls: resets the control to its default value (checkbox -> unchecked/false, comboBox -> first item/empty). For all other cells: clears contents normally (same as clear(range, 'contents')). @param range - A1 range string (e.g. "A1:C3")
getControl
→ Promise<CellControl | undefined>getControl(address: string): Promise<CellControl | undefined>;| Parameter | Type | Required |
|---|---|---|
| address | string | required |
Get the cell control (e.g., checkbox) for a cell by A1 address. Returns undefined if the cell does not contain a control.
setControl
→ Promise<void>setControl(address: string, control: CellControl | undefined): Promise<void>;| Parameter | Type | Required |
|---|---|---|
| address | string | required |
| control | CellControl | undefined | required |
Set or clear a cell control by A1 address. Pass undefined to remove the control and revert to a plain cell.
getValue
→ Promise<CellValuePrimitive>getValue(address: string): Promise<CellValuePrimitive>;| Parameter | Type | Required |
|---|---|---|
| address | string | required |
Get the computed value of a cell by A1 address. Returns null for empty cells. Error cells are returned as display strings (e.g. "#DIV/0!").
getData
→ Promise<CellValue[][]>getData(): Promise<CellValue[][]>;Get all cell values in the used range as a 2D array. Returns [] if sheet is empty.
getValues
→ Promise<CellValue[][]>getValues(range: string): Promise<CellValue[][]>;| Parameter | Type | Required |
|---|---|---|
| range | string | required |
Get cell values for a range as a 2D array. Returns primitive values only (no formatting, formulas, or metadata). Empty cells are null. This is the most common read pattern for SDK/LLM consumers. @param range - A1-style range string (e.g. "A1:C10") @returns 2D array of cell values
evaluate
→ Promise<CellValue>evaluate(expression: string): Promise<CellValue>;| Parameter | Type | Required |
|---|---|---|
| expression | string | required |
Evaluate a formula expression in the context of this sheet without writing it to any cell. The expression should not include the leading `=`. @example const total = await ws.evaluate("SUM(A1:A10)"); @param expression - Formula expression string (e.g. "SUM(A1:A10)") @returns The computed result value
validateFormulaSyntax
→ Promise<FormulaSyntaxValidationError | null>validateFormulaSyntax(formula: string): Promise<FormulaSyntaxValidationError | null>;| Parameter | Type | Required |
|---|---|---|
| formula | string | required |
Validate a formula expression in the context of this sheet without writing it to any cell. Returns `null` when the formula is syntactically valid. Unlike {@link evaluate}, this is a raw commit-time syntax check: it does not normalize or auto-correct incomplete input before parsing.
getFormula
→ Promise<string | null>getFormula(address: string): Promise<string | null>;| Parameter | Type | Required |
|---|---|---|
| address | string | required |
Get the formula of a cell by A1 address (null if not a formula cell).
getFormulas
→ Promise<(string | null)[][]>getFormulas(range: string): Promise<(string | null)[][]>;| Parameter | Type | Required |
|---|---|---|
| range | string | required |
Get formulas for a range. Returns 2D array: formula string or null per cell.
getFormulasR1C1
→ Promise<(string | null)[][]>getFormulasR1C1(range: string): Promise<(string | null)[][]>;| Parameter | Type | Required |
|---|---|---|
| range | string | required |
Get formulas for a range in R1C1 notation. Returns 2D array: R1C1 formula string or null per cell. References are converted relative to each cell's position: - `$A$1` (absolute) becomes `R1C1` - `A1` relative to cell B2 becomes `R[-1]C[-1]` - `$A1` relative to cell B2 becomes `R[-1]C1` (mixed) @param range - A1-style range string (e.g. "A1:C10")
getFormulaArray
→ Promise<string | null>getFormulaArray(address: string): Promise<string | null>;| Parameter | Type | Required |
|---|---|---|
| address | string | required |
Get the array formula for a cell that is part of a dynamic array spill. If the cell is the source of a dynamic array (e.g., =SEQUENCE(5)), returns the formula. If the cell is a spill member (projected from a source), returns the source cell's formula. Returns null if the cell is not part of an array. @param address - A1-style cell address @returns The array formula string, or null if not an array cell
getRawCellData
→ Promise<RawCellData>getRawCellData(address: string, includeFormula?: boolean): Promise<RawCellData>;| Parameter | Type | Required |
|---|---|---|
| address | string | required |
| includeFormula | boolean | optional |
Get raw cell data (value, formula, format, borders, etc.) by A1 address.
getRawRangeData
→ Promise<RawCellData[][]>getRawRangeData(range: string | CellRange, options?: {
includeFormula?: boolean;
}): Promise<RawCellData[][]>;| Parameter | Type | Required |
|---|---|---|
| range | string | CellRange | required |
| options | { includeFormula?: boolean; } | optional |
Get raw data for a range as a 2D array (A1 notation or CellRange).
getRangeWithIdentity
→ Promise<IdentifiedCellData[]>getRangeWithIdentity(range: string | CellRange): Promise<IdentifiedCellData[]>;| Parameter | Type | Required |
|---|---|---|
| range | string | CellRange | required |
Get all non-empty cells in a range with stable CellId identity. Returns a flat array of cells (not a 2D grid) — only cells with data are included. Each cell includes its CellId, position, computed value, formula text (if formula cell), and pre-formatted display string. Used by operations that need identity-aware cell data (find-replace, clipboard, cell relocation).
describe
→ Promise<string>describe(address?: string): Promise<string>;| Parameter | Type | Required |
|---|---|---|
| address | string | optional |
Get a human-readable description of a cell or the entire used range. With address: returns compact cell string — "Revenue | =SUM(B2:B10) | [bold]" Without address: returns describeRange() over the used range (or empty string if sheet is empty)
describeRange
→ Promise<string>describeRange(range: string | CellRange, includeStyle?: boolean): Promise<string>;| Parameter | Type | Required |
|---|---|---|
| range | string | CellRange | required |
| includeStyle | boolean | optional |
Get a tabular description of a range with formula abbreviation.
summarize
→ Promise<string>summarize(options?: SummaryOptions): Promise<string>;| Parameter | Type | Required |
|---|---|---|
| options | SummaryOptions | optional |
Get a sheet overview summary for agent context.
getUsedRange
→ Promise<CellRange | null>getUsedRange(): Promise<CellRange | null>;Get the used range, or null if the sheet is empty.
getCurrentRegion
→ Promise<CellRange>getCurrentRegion(row: number, col: number): Promise<CellRange>;| Parameter | Type | Required |
|---|---|---|
| row | number | required |
| col | number | required |
Get the contiguous data region around a cell (Excel's Ctrl+Shift+* / CurrentRegion).
findDataEdge
→ Promise<{ row: number; col: number; }>findDataEdge(row: number, col: number, direction: 'up' | 'down' | 'left' | 'right'): Promise<{
row: number;
col: number;
}>;| Parameter | Type | Required |
|---|---|---|
| row | number | required |
| col | number | required |
| direction | 'up' | 'down' | 'left' | 'right' | required |
Find the data edge in a direction (Excel's Ctrl+Arrow). Single bridge call to Rust.
findLastRow
→ Promise<{ lastDataRow: number | null; lastFormatRow: number | null; }>findLastRow(col: number): Promise<{
lastDataRow: number | null;
lastFormatRow: number | null;
}>;| Parameter | Type | Required |
|---|---|---|
| col | number | required |
Find the last populated row in a column. Returns data and formatting edges.
findLastColumn
→ Promise<{ lastDataCol: number | null; lastFormatCol: number | null; }>findLastColumn(row: number): Promise<{
lastDataCol: number | null;
lastFormatCol: number | null;
}>;| Parameter | Type | Required |
|---|---|---|
| row | number | required |
Find the last populated column in a row. Returns data and formatting edges.
findCells
→ Promise<string[]>findCells(predicate: (cell: CellData) => boolean, range?: string): Promise<string[]>;| Parameter | Type | Required |
|---|---|---|
| predicate | (cell: CellData) => boolean, range?: string | required |
Find all cells matching a predicate. Returns A1 addresses. Searches entire sheet or optionally within a range.
findByValue
→ Promise<string[]>findByValue(value: CellValue, range?: string): Promise<string[]>;| Parameter | Type | Required |
|---|---|---|
| value | CellValue | required |
| range | string | optional |
Find all cells with a specific value. Returns A1 addresses. Searches entire sheet or optionally within a range.
findByFormula
→ Promise<string[]>findByFormula(pattern: RegExp, range?: string): Promise<string[]>;| Parameter | Type | Required |
|---|---|---|
| pattern | RegExp | required |
| range | string | optional |
Find all cells whose formula matches a regex pattern. Returns A1 addresses. Searches entire sheet or optionally within a range.
regexSearch
→ Promise<SearchResult[]>regexSearch(patterns: string[], options?: SearchOptions): Promise<SearchResult[]>;| Parameter | Type | Required |
|---|---|---|
| patterns | string[] | required |
| options | SearchOptions | optional |
Search cells using regex patterns.
signCheck
→ Promise<SignCheckResult>signCheck(range?: string, options?: SignCheckOptions): Promise<SignCheckResult>;| Parameter | Type | Required |
|---|---|---|
| range | string | optional |
| options | SignCheckOptions | optional |
Detect cells whose numeric sign disagrees with their neighbors. Returns anomalies sorted by severity — the agent decides which are real errors.
findInRange
→ Promise<SearchResult | null>findInRange(range: string, text: string, options?: FindInRangeOptions): Promise<SearchResult | null>;| Parameter | Type | Required |
|---|---|---|
| range | string | required |
| text | string | required |
| options | FindInRangeOptions | optional |
Find the first cell matching text within a range (spreadsheet special-cell typeRange.find equivalent). @param range - A1 range string to search within @param text - Text or regex pattern to search for @param options - Search options (matchCase, entireCell) @returns The first matching SearchResult, or null if no match found
replaceAll
→ Promise<number>replaceAll(range: string, text: string, replacement: string, options?: FindInRangeOptions): Promise<number>;| Parameter | Type | Required |
|---|---|---|
| range | string | required |
| text | string | required |
| replacement | string | required |
| options | FindInRangeOptions | optional |
Find and replace all occurrences within a range (spreadsheet special-cell typeRange.replaceAll equivalent). @param range - A1 range string to search within @param text - Text to find @param replacement - Replacement text @param options - Search options (matchCase, entireCell) @returns Number of replacements made
getExtendedRange
→ Promise<CellRange>getExtendedRange(range: string, direction: 'up' | 'down' | 'left' | 'right', activeCell?: {
row: number;
col: number;
}): Promise<CellRange>;| Parameter | Type | Required |
|---|---|---|
| range | string | required |
| direction | 'up' | 'down' | 'left' | 'right' | required |
| activeCell | { row: number; col: number; } | optional |
Get the extended range in a direction (spreadsheet special-cell typeRange.getExtendedRange / Ctrl+Shift+Arrow). From the active cell (default: top-left of range), finds the data edge in the given direction and returns a range extending from the original range to that edge. @param range - A1 range string (current selection) @param direction - Direction to extend @param activeCell - Optional active cell override (default: top-left of range) @returns Extended range as CellRange
isEntireColumn
→ booleanisEntireColumn(range: string | CellRange): boolean;| Parameter | Type | Required |
|---|---|---|
| range | string | CellRange | required |
Check if a range represents entire column(s) (e.g., "A:C"). @param range - A1 range string or CellRange object @returns True if the range represents entire column(s)
isEntireRow
→ booleanisEntireRow(range: string | CellRange): boolean;| Parameter | Type | Required |
|---|---|---|
| range | string | CellRange | required |
Check if a range represents entire row(s) (e.g., "1:5"). @param range - A1 range string or CellRange object @returns True if the range represents entire row(s)
getVisibleView
→ Promise<VisibleRangeView>getVisibleView(range: string): Promise<VisibleRangeView>;| Parameter | Type | Required |
|---|---|---|
| range | string | required |
Get only the visible (non-hidden) rows from a range (visible range-view equivalent). Filters out rows hidden by AutoFilter or manual hide operations. Returns cell values for visible rows only, along with the absolute row indices. @param range - A1 range string (e.g., "A1:Z100") @returns Visible rows' values and their indices
getSpecialCells
→ Promise<string[]>getSpecialCells(cellType: CellType, valueType?: CellValueType): Promise<string[]>;| Parameter | Type | Required |
|---|---|---|
| cellType | CellType | required |
| valueType | CellValueType | optional |
Find cells matching a special cell type (spreadsheet special-cell typeRange.getSpecialCells equivalent). Returns addresses of cells matching the specified type within the used range. Optionally filter by value type when cellType is `Constants` or `Formulas`. @param cellType - The type of cells to find @param valueType - Optional value type filter (only for Constants/Formulas) @returns Array of matching cell addresses
getValueForEditing
→ Promise<string>getValueForEditing(row: number, col: number, editText?: string): Promise<string>;| Parameter | Type | Required |
|---|---|---|
| row | number | required |
| col | number | required |
| editText | string | optional |
Get the edit-mode string representation of a cell value. Used by formula bar and in-cell editing. For formula cells, returns the formula string (e.g. "=SUM(A1:A10)"). For date/time cells, returns pre-computed edit text if available. For value cells, returns the raw value as a string. @param row - Row index (0-based) @param col - Column index (0-based) @param editText - Optional pre-computed edit text (for date/time cells) @returns The string to display in edit mode
getDisplayValue
→ Promise<string>getDisplayValue(address: string): Promise<string>;| Parameter | Type | Required |
|---|---|---|
| address | string | required |
Get the display value (formatted string) for a cell by A1 address.
getDisplayValues
→ Promise<string[][]>getDisplayValues(range: string): Promise<string[][]>;| Parameter | Type | Required |
|---|---|---|
| range | string | required |
Get the formatted display values for a range as a 2D array. Returns the same formatted strings shown in each cell (number formats applied, dates formatted, etc.). This is the range counterpart to `getDisplayValue()`. @param range - A1-style range string (e.g. "A1:C10") @returns 2D array of formatted display strings
getValueTypes
→ Promise<RangeValueType[][]>getValueTypes(range: string | CellRange): Promise<RangeValueType[][]>;| Parameter | Type | Required |
|---|---|---|
| range | string | CellRange | required |
Get per-cell value type classification for a range (spreadsheet special-cell typeRange.valueTypes equivalent). @param range - A1 range string or CellRange object @returns 2D array of RangeValueType enums
getNumberFormatCategories
→ Promise<NumberFormatCategory[][]>getNumberFormatCategories(range: string | CellRange): Promise<NumberFormatCategory[][]>;| Parameter | Type | Required |
|---|---|---|
| range | string | CellRange | required |
Get per-cell number format category for a range (spreadsheet special-cell typeRange.numberFormatCategories equivalent). @param range - A1 range string or CellRange object @returns 2D array of NumberFormatCategory enums
sortRange
→ Promise<void>sortRange(range: string, options: SortOptions): Promise<void>;| Parameter | Type | Required |
|---|---|---|
| range | string | required |
| options | SortOptions | required |
Sort a range by the specified options (A1 notation).
sortByColor
→ Promise<void>sortByColor(range: string | CellRange, opts: SortByColorOptions): Promise<void>;| Parameter | Type | Required |
|---|---|---|
| range | string | CellRange | required |
| opts | SortByColorOptions | required |
Sort a range by cell or font color, putting matched-color rows on top or bottom. Convenience wrapper over {@link sortRange} with a single color-keyed criterion. Excel/ECMA-376 vocabulary: `'fill'` is the cell background fill, `'font'` is the cell font color. Compares the resolved per-cell effective format. @param range - A1-style range string or CellRange object @param opts - Color sort options (column, color type, target color, top/bottom position)
autoFill
→ Promise<AutoFillResult>autoFill(sourceRange: string, targetRange: string, fillMode?: AutoFillMode): Promise<AutoFillResult>;| Parameter | Type | Required |
|---|---|---|
| sourceRange | string | required |
| targetRange | string | required |
| fillMode | AutoFillMode | optional |
Autofill from source range into target range. @param sourceRange - Source range in A1 notation (e.g., "A1:A3") @param targetRange - Target range to fill into (e.g., "A4:A10") @param fillMode - Fill behavior. Default: 'auto' (detect pattern).
fillSeries
→ Promise<void>fillSeries(range: string, options: FillSeriesOptions): Promise<void>;| Parameter | Type | Required |
|---|---|---|
| range | string | required |
| options | FillSeriesOptions | required |
Fill a range with a series (Edit > Fill > Series dialog equivalent). More explicit than autoFill — caller specifies exact series parameters. The range contains BOTH source cells (first row/col) and target cells (rest). The kernel splits them based on direction. @param range - Range in A1 notation containing source + target cells @param options - Series parameters (type, step, stop, direction, etc.)
moveTo
→ Promise<void>moveTo(sourceRange: string, targetRow: number, targetCol: number): Promise<void>;| Parameter | Type | Required |
|---|---|---|
| sourceRange | string | required |
| targetRow | number | required |
| targetCol | number | required |
Move (relocate) cells from a source range to a target position. Moves cell values, formulas, and formatting. Formula references within the moved range are adjusted to the new position. The source range is cleared after the move. @param sourceRange - Source range in A1 notation (e.g., "A1:B10") @param targetRow - Destination top-left row (0-based) @param targetCol - Destination top-left column (0-based)
copyFrom
→ Promise<void>copyFrom(sourceRange: string, targetRange: string, options?: CopyFromOptions): Promise<void>;| Parameter | Type | Required |
|---|---|---|
| sourceRange | string | required |
| targetRange | string | required |
| options | CopyFromOptions | optional |
Copy cells from a source range to a target range with optional paste-special behavior. Supports selective copy (values only, formulas only, formats only, or all), skip-blanks, and transpose. Maps to spreadsheet special-cell typeRange.copyFrom(). @param sourceRange - Source range in A1 notation (e.g., "A1:B10") @param targetRange - Target range in A1 notation (e.g., "D1:E10") @param options - Optional paste-special behavior (copyType, skipBlanks, transpose)
setCells
→ Promise<SetCellsResult>setCells(cells: Array<{
addr: string;
value: CellValuePrimitive | Date;
}>): Promise<SetCellsResult>;| Parameter | Type | Required |
|---|---|---|
| cells | Array<{ addr: string; value: CellValuePrimitive | Date; }> | required |
Bulk-write scattered cell values and/or formulas in a single IPC call. Values starting with "=" are treated as formulas. Supports both A1 addressing and numeric (row, col) addressing.
toCSV
→ Promise<string>toCSV(options?: {
separator?: string;
range?: string;
}): Promise<string>;| Parameter | Type | Required |
|---|---|---|
| options | { separator?: string; range?: string; } | optional |
Export the used range as a CSV string (RFC 4180 compliant). Fields containing commas, quotes, or newlines are quoted. Double-quotes inside fields are escaped as "". Formula injection is prevented by prefixing `=`, `+`, `-`, `@` with a tab character. @param options - Optional separator (default ",")
toJSON
→ Promise<Record<string, CellValue>[]>toJSON(options?: {
headerRow?: number | 'none';
range?: string;
}): Promise<Record<string, CellValue>[]>;| Parameter | Type | Required |
|---|---|---|
| options | { headerRow?: number | 'none'; range?: string; } | optional |
Export the used range as an array of row objects. By default, the first row is used as header keys. Pass `headerRow: 'none'` to use column letters (A, B, C, ...) as keys. Pass `headerRow: N` to use a specific 0-based row as headers. @param options - Optional header row configuration and range
getDependents
→ Promise<string[]>getDependents(address: string): Promise<string[]>;| Parameter | Type | Required |
|---|---|---|
| address | string | required |
Get cells that depend on this cell by A1 address.
getPrecedents
→ Promise<string[]>getPrecedents(address: string): Promise<string[]>;| Parameter | Type | Required |
|---|---|---|
| address | string | required |
Get cells that this cell depends on by A1 address.
enableCalculation
enableCalculation: boolean;Per-sheet toggle that controls whether formulas on this sheet are recalculated. When `false`, formulas retain their last computed value but do not recalculate when dependencies change. Defaults to `true`.
calculate
→ Promise<void>calculate(markAllDirty?: boolean): Promise<void>;| Parameter | Type | Required |
|---|---|---|
| markAllDirty | boolean | optional |
Force recalculation of this sheet. @param markAllDirty - If `true`, marks all formula cells on this sheet as dirty before recalculating (equivalent to a full sheet recalc). Defaults to `false`, which recalculates only cells already marked dirty.
getSelectionAggregates
→ Promise<AggregateResult>getSelectionAggregates(ranges: CellRange[]): Promise<AggregateResult>;| Parameter | Type | Required |
|---|---|---|
| ranges | CellRange[] | required |
Get aggregates (SUM, COUNT, AVG, MIN, MAX) for selected ranges.
formatValues
→ Promise<string[]>formatValues(entries: FormatEntry[]): Promise<string[]>;| Parameter | Type | Required |
|---|---|---|
| entries | FormatEntry[] | required |
Batch-format values using number format codes. Returns formatted strings.
getVisibility
→ Promise<'visible' | 'hidden' | 'veryHidden'>getVisibility(): Promise<'visible' | 'hidden' | 'veryHidden'>;Get the visibility state of the sheet ('visible', 'hidden', or 'veryHidden').
setVisibility
→ Promise<void>setVisibility(state: 'visible' | 'hidden' | 'veryHidden'): Promise<void>;| Parameter | Type | Required |
|---|---|---|
| state | 'visible' | 'hidden' | 'veryHidden' | required |
Set the visibility state of the sheet.
getNext
→ Promise<Worksheet>getNext(visibleOnly?: boolean): Promise<Worksheet>;| Parameter | Type | Required |
|---|---|---|
| visibleOnly | boolean | optional |
Returns the next worksheet. If `visibleOnly` is true, skips hidden sheets. Throws if no next sheet exists.
getNextOrNull
→ Promise<Worksheet | null>getNextOrNull(visibleOnly?: boolean): Promise<Worksheet | null>;| Parameter | Type | Required |
|---|---|---|
| visibleOnly | boolean | optional |
Returns the next worksheet, or null if none exists. If `visibleOnly` is true, skips hidden sheets.
getPrevious
→ Promise<Worksheet>getPrevious(visibleOnly?: boolean): Promise<Worksheet>;| Parameter | Type | Required |
|---|---|---|
| visibleOnly | boolean | optional |
Returns the previous worksheet. If `visibleOnly` is true, skips hidden sheets. Throws if no previous sheet exists.
getPreviousOrNull
→ Promise<Worksheet | null>getPreviousOrNull(visibleOnly?: boolean): Promise<Worksheet | null>;| Parameter | Type | Required |
|---|---|---|
| visibleOnly | boolean | optional |
Returns the previous worksheet, or null if none exists. If `visibleOnly` is true, skips hidden sheets.
on
→ CallableDisposableon(event: string, handler: (event: unknown) => void): CallableDisposable;| Parameter | Type | Required |
|---|---|---|
| event | string | required |
| handler | (event: unknown) => void | required |
refreshActiveCellData
→ Promise<void>refreshActiveCellData(row: number, col: number): Promise<void>;| Parameter | Type | Required |
|---|---|---|
| row | number | required |
| col | number | required |
Refresh the active-cell metadata cache (Stream C fix). Call this when the active cell changes (selection move) so the viewport reader's `getActiveCellData()` returns up-to-date metadata — including `isCseAnchor` — and the formula bar can immediately display `{=…}` braces for CSE array formula cells. Looks up the cellId at the given position and calls the compute bridge's `refreshActiveCell`. Safe to call speculatively; no-ops if the cell has no id (empty cell).
refreshActiveCellEditSource
→ Promise<void>refreshActiveCellEditSource(row: number, col: number): Promise<void>;| Parameter | Type | Required |
|---|---|---|
| row | number | required |
| col | number | required |
Refresh the active-cell edit-source read model for the given cell. This is infrastructure for edit-entry hot paths. It is intentionally scoped to the active cell rather than exposing arbitrary synchronous cell reads.
getActiveCellEditSource
→ ActiveCellEditSource | nullgetActiveCellEditSource(row: number, col: number): ActiveCellEditSource | null;| Parameter | Type | Required |
|---|---|---|
| row | number | required |
| col | number | required |
Synchronously read the active-cell edit-source cache when it matches the requested cell and is fresh. Returns null for stale/missing/different-cell data so callers can fall back to one Rust-owned edit-source query.
setBoundsReader
→ voidsetBoundsReader(reader: IObjectBoundsReader): void;| Parameter | Type | Required |
|---|---|---|
| reader | IObjectBoundsReader | required |
Inject the bounds reader (from the renderer's SceneGraphBoundsReader) so that floating-object handles can resolve pixel bounds via `handle.getBounds()`. Calling this invalidates cached typed collections so they pick up the new reader on their next access.