Skip to content

cupertino-files / TableModel

Class: TableModel

Defined in: src/tst/tables.ts:536

Constructors

Constructor

new TableModel(store, object, infoObject?): TableModel

Defined in: src/tst/tables.ts:542

Parameters

store

ObjectStore

object

IwaObject

infoObject?

IwaObject

Returns

TableModel

Properties

infoObject

readonly infoObject: IwaObject | undefined

Defined in: src/tst/tables.ts:540

The TST.TableInfoArchive drawable owning this model, when known.


object

readonly object: IwaObject

Defined in: src/tst/tables.ts:538


store

readonly store: ObjectStore

Defined in: src/tst/tables.ts:537

Accessors

columnCount

Get Signature

get columnCount(): number

Defined in: src/tst/tables.ts:560

Returns

number


footerRowCount

Get Signature

get footerRowCount(): number

Defined in: src/tst/tables.ts:1712

Returns

number


hasReadableCells

Get Signature

get hasReadableCells(): boolean

Defined in: src/tst/tables.ts:954

True when cells decodes every cell in this table.

Always true for v5 storage. For pre-BNC it means every record matched a measured shape — the interesting case is false, which says the list cells() returns is short and undecodedPreBncCells says by how much.

Returns

boolean


headerColumnCount

Get Signature

get headerColumnCount(): number

Defined in: src/tst/tables.ts:568

Returns

number


headerColumnsFrozen

Get Signature

get headerColumnsFrozen(): boolean

Defined in: src/tst/tables.ts:1721

Returns

boolean


headerRowCount

Get Signature

get headerRowCount(): number

Defined in: src/tst/tables.ts:564

Returns

number


headerRowsFrozen

Get Signature

get headerRowsFrozen(): boolean

Defined in: src/tst/tables.ts:1717

Header rows stay visible while the table scrolls (Numbers).

Returns

boolean


name

Get Signature

get name(): string | undefined

Defined in: src/tst/tables.ts:548

Returns

string | undefined

Set Signature

set name(value): void

Defined in: src/tst/tables.ts:552

Parameters
value

string

Returns

void


repeatingHeaderColumns

Get Signature

get repeatingHeaderColumns(): boolean

Defined in: src/tst/tables.ts:1730

Returns

boolean


repeatingHeaderRows

Get Signature

get repeatingHeaderRows(): boolean

Defined in: src/tst/tables.ts:1726

Header rows repeat at the top of each page/slide the table spans.

Returns

boolean


rowCount

Get Signature

get rowCount(): number

Defined in: src/tst/tables.ts:556

Returns

number


storageGeneration

Get Signature

get storageGeneration(): "empty" | "v5" | "preBNC"

Defined in: src/tst/tables.ts:922

Cell-storage generation used by this table:

  • "v5" "BNC" storage — readable. Observed in files as early as the 2018-era apps (format 3.2.13), not only Numbers 10+.
  • "preBNC" storage versions 3/4 written by iWork '13/'15-era apps — NOT readable (undocumented layout; the reference Python implementation refuses these too)
  • "empty" no tile rows at all
Returns

"empty" | "v5" | "preBNC"

Methods

activeCategories()

activeCategories(): TableCategories | undefined

Defined in: src/tst/tables.ts:2868

The category definition the app is currently applying, if any.

Returns

TableCategories | undefined


bandStyle()

bandStyle(band): TableStyleHandle | undefined

Defined in: src/tst/tables.ts:2224

Cell formatting of a named band — fill, borders, padding, alignment.

A band has two styles, not one: this covers the cell (background and borders); bandTextStyle covers the text inside it. Making a header row bold means editing the text style, not this one.

Parameters

band

TableBand

Returns

TableStyleHandle | undefined


bandTextStyle()

bandTextStyle(band): StyleHandle | undefined

Defined in: src/tst/tables.ts:2235

Character formatting of a named band's text.

A TSWP.CharacterStyleArchive, so it takes the same CharacterFormatting as any other text in the suite.

Parameters

band

TableBand

Returns

StyleHandle | undefined


categories()

categories(): TableCategories[]

Defined in: src/tst/tables.ts:2863

The table's category (row grouping) definitions.

More than one can exist — Numbers keeps a definition around when grouping is switched off — so enabled says which is live.

Returns

TableCategories[]


cellControl()

cellControl(row, column): CellControl | undefined

Defined in: src/tst/tables.ts:2568

The control on one cell, if it has one.

Parameters

row

number

column

number

Returns

CellControl | undefined


cellFormat()

cellFormat(row, column): CellFormat | undefined

Defined in: src/tst/tables.ts:690

How a cell's value is displayed, or undefined when it has no explicit format and the app falls back to its automatic rendering.

Parameters

row

number

column

number

Returns

CellFormat | undefined


cellFormatting()

cellFormatting(row, column): CellFormatting

Defined in: src/tst/tables.ts:2249

Read the formatting in effect for a cell, or {} when it has none.

Parameters

row

number

column

number

Returns

CellFormatting


cellFormula()

cellFormula(row, column): string | undefined

Defined in: src/tst/tables.ts:811

The formula in a cell, as text, or undefined when it holds a literal.

Rendered from the cell's position because references are stored as offsets from the cell using them — one formula entry is shared by every cell in a filled-down column, and each renders differently.

Function names come from a registry the format does not contain (see formulas.ts); an unrecognised one renders as FUNCTION_<id> rather than a guess. Use cellFormulaDetail to see what was unnamed.

Parameters

row

number

column

number

Returns

string | undefined


cellFormulaDetail()

cellFormulaDetail(row, column): RenderedFormula | undefined

Defined in: src/tst/tables.ts:816

cellFormula plus the ids and node types it could not name.

Parameters

row

number

column

number

Returns

RenderedFormula | undefined


cells()

cells(): CellInfo[]

Defined in: src/tst/tables.ts:967

All non-empty cells in reading order.

Reads pre-BNC (storage version 4) tables too, for the record shapes that have been measured — see ./prebnc.ts. A cell whose shape is unmeasured is omitted, and undecodedPreBncCells counts them, so "this table read clean" and "this table half-read" stay distinguishable.

Returns

CellInfo[]


cellStyle()

cellStyle(row, column): TableStyleHandle | undefined

Defined in: src/tst/tables.ts:2241

The cell style applied to one cell, if it has an explicit one.

Parameters

row

number

column

number

Returns

TableStyleHandle | undefined


cellStyleId()

cellStyleId(row, column): number | undefined

Defined in: src/tst/tables.ts:2913

cell_style_id of a cell, if its record carries one.

Parameters

row

number

column

number

Returns

number | undefined


cellText()

cellText(row, column): string

Defined in: src/tst/tables.ts:1106

Convenience: cell text/number as a display string ("" for empty).

Parameters

row

number

column

number

Returns

string


cellValue()

cellValue(row, column): CellValue | undefined

Defined in: src/tst/tables.ts:1098

One cell's typed value, or undefined when the cell is empty.

undefined also covers a pre-BNC cell whose record shape has not been measured — see undecodedPreBncCells, which is how the two are told apart.

Parameters

row

number

column

number

Returns

CellValue | undefined


clearAllCells()

clearAllCells(): void

Defined in: src/tst/tables.ts:1664

Clear every cell, keeping the table's shape, styling and bands.

A blank table laid out like the one it was copied from, which is what "add a table" usually means — as opposed to a duplicate of the data. Covered cells are cleared too: leaving them would strand values inside a merge whose anchor is now empty.

Returns

void


clearCell()

clearCell(row, column): void

Defined in: src/tst/tables.ts:1171

Clear a cell's value, keeping its styling.

Parameters

row

number

column

number

Returns

void


clearFormula()

clearFormula(row, column): boolean

Defined in: src/tst/tables.ts:1277

Remove a cell's formula, keeping the value it last cached.

Returns false when the cell had none. This is what "convert to value" does in the app: the number stays, the recipe goes.

Parameters

row

number

column

number

Returns

boolean


columnWidth()

columnWidth(column): number

Defined in: src/tst/tables.ts:1782

Parameters

column

number

Returns

number


conditionalRuleId()

conditionalRuleId(row, column): number | undefined

Defined in: src/tst/tables.ts:2460

The second conditional id a cell record carries, meaning unconfirmed.

Sits in the COND_RULE_STYLE_ID slot, which by position corresponds to CellArchive.conditional_style_applied_rule — the rule that last matched. The corpus does not bear that out: in the one fixture with real rules, every cell sharing a one-rule set carries the same value (15) regardless of content, and cells on other sets carry 0, which is not a valid key in any of the table's lists. So it is exposed raw and preserved byte-for-byte rather than interpreted. See docs/VERIFICATION.md.

Parameters

row

number

column

number

Returns

number | undefined


conditionalRules()

conditionalRules(row, column): ConditionalRule[]

Defined in: src/tst/tables.ts:2478

The conditional-formatting rules on a cell, in evaluation order.

Conditions render against the cell asked about, so a rule on B4 reads B4<0. Nothing here evaluates them: deciding which rule matches means running the calc engine over the document, and a wrong answer would be indistinguishable from a right one.

Parameters

row

number

column

number

Returns

ConditionalRule[]


conditionalStyleKey()

conditionalStyleKey(row, column): number | undefined

Defined in: src/tst/tables.ts:2444

Key into conditionalStyleSets carried by a cell's record.

Parameters

row

number

column

number

Returns

number | undefined


conditionalStyleSet()

conditionalStyleSet(row, column): ConditionalStyleSet | undefined

Defined in: src/tst/tables.ts:2465

The rule set governing one cell, if it has one.

Parameters

row

number

column

number

Returns

ConditionalStyleSet | undefined


conditionalStyleSets()

conditionalStyleSets(): Map<number, ConditionalStyleSet>

Defined in: src/tst/tables.ts:2308

Every conditional-formatting rule set the table interns, by key.

Rule sets are shared: one entry covers every cell it was applied to, and its refcount is that cell count. So this returns a handful of sets even for a table where hundreds of cells are conditionally formatted.

Returns

Map<number, ConditionalStyleSet>


controlKey()

controlKey(row, column): number | undefined

Defined in: src/tst/tables.ts:2563

Key into controls carried by a cell's record, if it has one.

Parameters

row

number

column

number

Returns

number | undefined


controls()

controls(): Map<number, CellControl>

Defined in: src/tst/tables.ts:2558

Data-entry controls (checkbox, slider, stepper, pop-up menu) the table interns, by key. A cell's record points at one through CONTROL_ID.

Empty for every corpus document — see src/tst/controls.ts.

Returns

Map<number, CellControl>


deleteColumns()

deleteColumns(at, count?): void

Defined in: src/tst/tables.ts:1940

Delete columns starting at at.

Parameters

at

number

count?

number = 1

Returns

void

Agent Tool

modify_table


deleteRows()

deleteRows(at, count?): void

Defined in: src/tst/tables.ts:1893

Delete rows starting at at.

Parameters

at

number

count?

number = 1

Returns

void

Agent Tool

modify_table


filterRules()

filterRules(set): FilterRule[]

Defined in: src/tst/tables.ts:2548

A filter set's rules with this table's owner registry supplied, so a rule reaching into another table names it instead of rendering OTHER_TABLE::.

FilterSet.rules takes the registry as an argument rather than finding it itself: a FilterSet is constructible from any object and has no table to ask.

Parameters

set

FilterSet | undefined

Returns

FilterRule[]


filterSets()

filterSets(): object

Defined in: src/tst/tables.ts:2523

The table's row and column filter sets.

Reached through hidden_states_owner, because a filter set belongs to a hidden-state extent rather than to the table directly — the extent records which rows ended up hidden, the filter set records why. Tables written before that structure existed have neither.

Returns

object

columns

columns: FilterSet | undefined

rows

rows: FilterSet | undefined


formulaArchiveAt()

formulaArchiveAt(row, column): RawMessage | undefined

Defined in: src/tst/tables.ts:848

The raw TSCE.FormulaArchive behind a cell, if it has one.

The unrendered truth — what cellFormulaDetail renders, and the yardstick formula writing is measured against: a rebuilt formula is proven by comparing bytes with what Apple stored here.

Parameters

row

number

column

number

Returns

RawMessage | undefined


formulaId()

formulaId(row, column): number | undefined

Defined in: src/tst/tables.ts:854

formula_id of a cell, if its record carries one.

Parameters

row

number

column

number

Returns

number | undefined


formulas()

formulas(): object[]

Defined in: src/tst/tables.ts:866

Every formula cell in the table, with its rendered text.

Returns

object[]

Agent Tool

list_formulas


grid()

grid(): (CellValue | null)[][]

Defined in: src/tst/tables.ts:1078

Dense 2-D array of the table (null = empty cell).

Returns

(CellValue | null)[][]


insertColumns()

insertColumns(at, count?): void

Defined in: src/tst/tables.ts:1915

Insert blank columns before at.

Parameters

at

number

count?

number = 1

Returns

void

Agent Tool

modify_table


insertRows()

insertRows(at, count?): void

Defined in: src/tst/tables.ts:1868

Insert blank rows before at.

The whole table's storage is rebuilt rather than patched: tiles, row headers and per-column cell counts all have to agree afterwards, and shifting them independently is how those three drift apart.

Formula references are not adjusted. Relative references survive by construction — they are offsets from the cell using them, so a formula that moves keeps pointing at the same relative neighbour — but an absolute range spanning the insertion point still names its old bounds. Adjusting those correctly is calc-engine work; see docs/FORMAT.md §14.7.

Parameters

at

number

count?

number = 1

Returns

void

Agent Tool

modify_table


isColumnHidden()

isColumnHidden(column): boolean

Defined in: src/tst/tables.ts:1817

Parameters

column

number

Returns

boolean


isCovered()

isCovered(row, column): boolean

Defined in: src/tst/tables.ts:908

True when a cell is swallowed by a merge anchored elsewhere.

Such a cell is not displayed at all: the anchor's content spans it. Writing to it produces a value nobody will ever see.

Parameters

row

number

column

number

Returns

boolean


isRowHidden()

isRowHidden(row): boolean

Defined in: src/tst/tables.ts:1813

True when the row or column is hidden.

Parameters

row

number

Returns

boolean


mergeAt()

mergeAt(row, column): MergeRange | undefined

Defined in: src/tst/tables.ts:892

The merge covering a cell, if any — including the one it anchors.

Parameters

row

number

column

number

Returns

MergeRange | undefined


mergeCells()

mergeCells(row, column, rowCount, columnCount): void

Defined in: src/tst/tables.ts:1371

Merge a rectangle of cells, anchored at its top-left.

A merge is not a property of the cells. It is a formula owned by the calc engine: TableModelArchive.merge_owner.formula_store holds one colon-tract AST node per merged rectangle, and the covered cells are simply deleted — Apple leaves them with no record at all, which is why cellValue returns undefined for them rather than "empty".

Every table in every document examined already carries a merge_owner with an owner id, merged or not, so nothing here has to mint a calc engine identity. A table that somehow lacks one is refused rather than guessed at: an owner the engine does not know about is worse than no merge, because the document would load and then behave oddly.

The anchor's value survives; everything the rectangle covers is discarded, exactly as merging does in the app.

Parameters

row

number

column

number

rowCount

number

columnCount

number

Returns

void

Agent Tool

merge_cells


merges()

merges(): MergeRange[]

Defined in: src/tst/tables.ts:621

Merged cell ranges, anchored at their top-left cell.

Two encodings exist and the documented one is not the one current apps use. DataStore.merge_region_map holds packed CellRange values, but no document in the corpus — Numbers or Pages, 2013 through 26.x — actually has one. Real merges live in the calc engine, as colon-tract AST nodes inside TableModelArchive.merge_owner.formula_store. A reader that only knows the region map silently reports zero merges for every merged table it will ever meet, so the formula store is read first and the region map kept as a fallback.

Ranges are deduplicated: a table can carry the same rectangle in both encodings, and the same merge more than once in the formula store.

Returns

MergeRange[]


regroupCategories()

regroupCategories(): number

Defined in: src/tst/tables.ts:2902

Put rows back in the groups their current values call for.

The fix for what staleCategoryGroups reports. Returns the number of rows that moved — zero when the tree was already correct, in which case the archive is rewritten to the same bytes.

Throws if a row's value has no group: see TableCategories.regroup for why creating one is refused.

Returns

number


removeCellControl()

removeCellControl(row, column): boolean

Defined in: src/tst/tables.ts:2768

Take the widget off a cell, keeping its value. Returns false if none.

Parameters

row

number

column

number

Returns

boolean


richTextStorage()

richTextStorage(row, column): IwaObject | undefined

Defined in: src/tst/tables.ts:1694

The TSWP storage backing a rich-text cell, for editing its runs.

Parameters

row

number

column

number

Returns

IwaObject | undefined


rowHeight()

rowHeight(row): number

Defined in: src/tst/tables.ts:1777

Height of a row in points, falling back to the table default.

Parameters

row

number

Returns

number


setBands()

setBands(bands): void

Defined in: src/tst/tables.ts:1744

Change how many leading rows/columns are header bands, and how those bands behave.

Bands are presentation only — cell storage is identical either way — so this is a safe edit that does not touch the tiles. Counts are clamped to the table's real size: a header count past the last row would leave the app with no body.

Parameters

bands
footerRows?

number

freezeHeaderColumns?

boolean

freezeHeaderRows?

boolean

Keep header rows on screen while scrolling (Numbers).

headerColumns?

number

headerRows?

number

repeatHeaderColumns?

boolean

repeatHeaderRows?

boolean

Repeat header rows on every page the table spans (Pages/Numbers print).

Returns

void

Agent Tool

set_table_bands


setCell()

setCell(row, column, input, options?): void

Defined in: src/tst/tables.ts:1127

Write a value into an existing cell.

Presentation the record already carries — cell and text style ids, number formats, comments, conditional styles — is preserved, except that format ids tied to the old value type are dropped when the type changes (a date format on a number cell would render nonsense). Writing a literal also clears any formula on the cell.

Rich text ({ type: "richText" }) cannot be written: the value lives in a separate TSWP storage object. Set plain text instead, or edit the existing rich-text storage through richTextStorage.

Parameters

row

number

column

number

input

CellInput

options?

WriteOptions = {}

Returns

void

Agent Tool

set_cells


setCellControl()

setCellControl(row, column, control, options?): number

Defined in: src/tst/tables.ts:2595

Put a data-entry widget on a cell — checkbox, star rating, slider or stepper.

The spec is interned in the table's control table exactly as strings and formats are, and the cell's record points at it through CONTROL_ID. Identical specs are shared: a column of checkboxes is one archive and forty pointers, which is what the app writes.

The value still lives in the cell, and the widget only changes how it is edited. A checkbox therefore needs a boolean in its cell and a slider a number; writing the widget without the value gives a control with nothing to show, so the value is set here when one is supplied.

A pop-up menu additionally needs a chooser_control_popup_model — a separate archive holding the list of choices — which is created here and shared between cells given the same items. That part is built from the vendored schema rather than measured against a real menu, so it is the one widget here nobody has yet seen work; see buildPopupMenuModel. setPopupMenu still attaches a model a caller already has.

Parameters

row

number

column

number

control

{ value?: boolean; widget: "checkbox"; } | { value?: number; widget: "starRating"; } | { increment: number; maximum: number; minimum: number; value?: number; widget: "slider" | "stepper"; } | { items: readonly PopupItem[]; startsWithFirstItem?: boolean; value?: string | number; widget: "popupMenu"; }

Type Literal

{ items: readonly PopupItem[]; startsWithFirstItem?: boolean; value?: string | number; widget: "popupMenu"; }

items

readonly PopupItem[]

startsWithFirstItem?

boolean

Whether the menu starts on its first choice rather than blank.

Measured: with this off, Numbers offers the model's None entry as a selectable row above the real choices. With it on — the default — the menu shows only the items given here.

value?

string | number

widget

"popupMenu"

options?

WriteOptions = {}

Returns

number


setCellFormat()

setCellFormat(row, column, format): void

Defined in: src/tst/tables.ts:711

Set how a cell's value is displayed.

A cell shows one format, so any format the record already carried is cleared first — leaving a stale currency id beside a new date id would make the display depend on which flag the app happens to read first.

Parameters

row

number

column

number

format

CellFormat

Returns

void

Agent Tool

set_cell_format


setCellFormatting()

setCellFormatting(row, column, formatting): void

Defined in: src/tst/tables.ts:2261

Style one cell: fill, borders, padding, vertical alignment, wrapping.

A new cell style is created, based on the cell's current one so unspecified properties are inherited rather than lost, registered in the table's style table and referenced from the cell record. Styling a cell therefore never disturbs its neighbours, even when they shared a style.

Parameters

row

number

column

number

formatting

CellFormatting

Returns

void


setCells()

setCells(row, column, values, options?): void

Defined in: src/tst/tables.ts:1681

Write a rectangular block anchored at row,column.

Parameters

row

number

column

number

values

readonly readonly CellInput[][]

options?

WriteOptions = {}

Returns

void


setColumnWidth()

setColumnWidth(column, points): void

Defined in: src/tst/tables.ts:1806

Set one column's width in points.

Parameters

column

number

points

number

Returns

void

Agent Tool

modify_table


setConditionalRules()

setConditionalRules(row, column, conditions, span?): number

Defined in: src/tst/tables.ts:2340

Attach a conditional-formatting rule set to a cell, or to a block of them via span.

(row, column) first, like every other cell method — the reader conditionalRules is positional, and taking a range object here made the pair read as two unrelated APIs.

The set is interned in the table's conditional-style table and every cell in the range points at it — which is how the app writes it too: three sets cover 1921 cells in one corpus document, because a rule is authored once and applied to a column.

Only the four comparisons whose predicate_type has been observed can be written. > and >= are predicted to be 7 and 8, and a rule stored under a wrong code is one the condition editor shows as a different condition while the formula says the truth — a disagreement that is very hard to spot. Refused rather than guessed.

Parameters

row

number

column

number

conditions

readonly ConditionalCondition[]

span?
columnCount?

number

rowCount?

number

Returns

number


setConditionalStyleKey()

setConditionalStyleKey(row, column, key): void

Defined in: src/tst/tables.ts:2492

Apply an existing rule set to another cell.

Only re-points a cell at a set the table already interns — the sets themselves come from the app. That covers the common edit (extend this conditional format to more cells) without asserting a rule layout no fixture demonstrates.

Parameters

row

number

column

number

key

number | undefined

Returns

void


setFormula()

setFormula(row, column, formula, options?): void

Defined in: src/tst/tables.ts:1204

Write a formula into a cell.

The formula is compiled to a TSCE AST, interned in the table's formula table, and the cell's record points at it — the same three steps the app performs. Relative references are stored as offsets from this cell, so =A1+1 in B2 and in B3 compile to different bytes, exactly as in the app.

Nothing here evaluates. A cell record carries the formula and its cached result, and the apps display the cache until the engine recalculates. value is that cache: supply it and the cell reads correctly before any app has touched the file; omit it and whatever the cell held is kept, which is right when the formula reproduces the value already there and wrong otherwise. There is no third option that does not involve implementing Apple's calc engine.

The dependency tracker is not written — and does not need to be. The calc engine keeps its own per-cell ledger (TSCE.FormulaOwnerDependenciesArchive) that this method leaves alone. Numbers rebuilds it on open rather than trusting it: the e2e recompute probe writes a formula with a deliberately wrong cached value and the app reports the recomputed result on every npm run test:e2e.

Refuses a function it has no index for rather than inventing one — see authorableFunctions() for the 272 it knows.

Parameters

row

number

column

number

formula

string | FormulaExpression

options?

WriteOptions & object = {}

Returns

void

Agent Tool

set_formula


setPopupMenu()

setPopupMenu(row, column, popupModelId, options?): number

Defined in: src/tst/tables.ts:2747

Point a cell at a pop-up menu model that already exists.

Kept alongside setCellControl, which builds a model from a list of items, for the case where a caller already has one — from another cell, or another document — and wants that exact archive shared rather than a second copy of the same choices.

itemType decides the cell's format, and the default is "string" because text menus are the common case. Passing the wrong one leaves a numeric menu formatted as text; passing none on a numeric menu does the same. This path shipped for a while with no format at all, which is the defect that made every other widget invisible — a spec without a format is a control the app never draws.

Parameters

row

number

column

number

popupModelId

bigint

options?
itemType?

"string" | "number"

startsWithFirstItem?

boolean

Returns

number


setRangeFormat()

setRangeFormat(row, column, rowCount, columnCount, format): void

Defined in: src/tst/tables.ts:732

Apply one format across a rectangular block.

Parameters

row

number

column

number

rowCount

number

columnCount

number

format

CellFormat

Returns

void

Agent Tool

set_cell_format


setRangeFormatting()

setRangeFormatting(row, column, rowCount, columnCount, formatting): void

Defined in: src/tst/tables.ts:2286

Apply the same formatting to a rectangular block of cells — fill, borders, padding, alignment, wrap — leaving every cell's value untouched.

Parameters

row

number

column

number

rowCount

number

columnCount

number

formatting

CellFormatting

Returns

void

Agent Tool

format_cells


setRow()

setRow(row, values, options?): void

Defined in: src/tst/tables.ts:1674

Write a whole row left-to-right, padding with empties.

Parameters

row

number

values

readonly CellInput[]

options?

WriteOptions = {}

Returns

void


setRowHeight()

setRowHeight(row, points): void

Defined in: src/tst/tables.ts:1795

Set an explicit row height; 0 restores the table default.

Parameters

row

number

points

number

Returns

void

Agent Tool

modify_table


staleCategoryGroups()

staleCategoryGroups(): object[]

Defined in: src/tst/tables.ts:2880

Groups whose cached membership no longer matches the cells.

The group tree is what the app worked out last time it grouped the rows; editing cells here does not regroup them. Unlike a table of contents, the staleness is checkable, because the grouping column's values are in the table.

Returns

object[]


tableStyle()

tableStyle(): TableStyleHandle | undefined

Defined in: src/tst/tables.ts:2212

The table's own style (banded rows, grid strokes, visibility toggles).

Editing it affects every table sharing the style — Numbers' stock themes give each table its own, but a document built by duplication may not. styleTable is where per-cell styles live instead.

Returns

TableStyleHandle | undefined


uidMap()

uidMap(): ColumnRowUidMap

Defined in: src/tst/tables.ts:2853

Row and column identities, for the parts of the format that address cells by UID rather than position.

Returns

ColumnRowUidMap


undecodedPreBncCells()

undecodedPreBncCells(): number

Defined in: src/tst/tables.ts:1059

How many pre-BNC cells this table holds that cells could not decode — zero for a v5 table, and zero for a pre-BNC table that read cleanly.

Exposed because a partial read is the one outcome a caller must be able to detect: cells() returning fewer rows than the file contains is otherwise indistinguishable from a sparse table.

Returns

number


unmergeCells()

unmergeCells(row, column): boolean

Defined in: src/tst/tables.ts:1543

Remove the merge anchored at a cell, returning false if there is none.

The cells it covered come back empty, which is what the app does: the values they held before merging were discarded at merge time and are not recoverable from the file.

Parameters

row

number

column

number

Returns

boolean

Agent Tool

merge_cells

MIT licensed. Independently made — not by Apple in California. Not affiliated with or endorsed by Apple Inc.