Each section lists what changed in 0.7.0 and what replaces it. "Before" code is 0.6 code, and "after" code is 0.7.0 code.
Update packages together
Install the latest 0.7 release (0.7.2) for every @sheetwrite/* package that
you use. Packages from different versions are not supported together. After
this guide, follow the upgrade checklists in the
0.7.1 and
0.7.2 release notes.
The main API changes, one per row. The sections below show each change in full: Sort, Revisions move to version history and Add-on registration.
| 0.6 | 0.7.0 |
|---|---|
grid. | grid. |
grid. | grid. |
grid. sorted the view | grid. sorts the cells |
new Revision | await History |
import "@sheetwrite/ | await init |
await init | await init |
Sort






Sort commands now move the cells, as Excel's Sort does. The display-only sort of 0.6 is called a view sort and has its own methods. See Sort cells in place and Display views.
| 0.6 API | 0.7.0 |
|---|---|
grid. sorted the view | Changed: sorts the cells in place, as Excel's quick sort does. For the view sort, use grid. |
grid. | Removed: use grid. |
grid. | Removed: use grid. |
store. | Removed: use store. |
store. | Removed: use store. |
Before:
// Now sorts the cells, not the view.grid.sortBy(2, false);
// Removed: use setViewSort.grid.setSort([{ col: 2, ascending: false }, { col: 0, ascending: true }]);store.sortByMulti("s1", [{ col: 2, ascending: false }]);After, to keep the display-only sort:
]);}
}After, to move the cells as Excel does:
}
{ hasHeader: true }, );}An in-place sort is one undoable change, sent to collaborators as the new
permuteRows operation with the new "sort" commit reason. A server or handler that
checks every operation or commit reason must accept them; see
Document operations.
Revisions move to version history
RevisionCoordinator and its types are removed. Version history in
@sheetwrite/core/history lists, reads and restores versions through a
HistoryStorageAdapter. See
Opt-in version archives
and Restoring versions.
| Removed | Use instead |
|---|---|
Revision, Revision, Revision | History |
Revision | History, or the built-in Memory and Indexed |
Revision | History (list) behind History |
Revision | History |
Revision | History; the restore is an ordinary commit through Persistence or commit |
Revision, Revision | History, which returns History pages |
Revision | History, then create |
Revision, Revision, Revision | History |
The revision- error code and the revision error operation | History codes |
A server that kept revisions as full snapshots can serve them through a
HistoryStorageAdapter, or start a history archive from its current snapshot
with HistoryArchive.initialize and record commits with CommitJournal.
Before:
const revisions = new RevisionCoordinator(revisionAdapter, { documentId, serverVersion });const [latest] = await revisions.list();const preview = await revisions.preview(previewHost, latest.version);await revisions.restore(latest.version, crypto.randomUUID());After:
export async function restoreLatest( previewHost: HTMLElement,) {
}A restore is an ordinary commit, so the server no longer needs a separate
restore endpoint. A server that records history attaches a CommitJournal, as
MemoryPersistenceAdapter.recordHistory does.
Sync and history
| Change | What to do |
|---|---|
New Sync stamps each pending commit. Versioned has author and committed. | Pass the signed-in user's ID to record who made each change. While a history journal is attached, a commit without author is rejected with commit-. |
Comment calls (load, create, reply, resolve, mutate) accept a final Abort. An abort or destroy() rejects with the signal's reason and emits no error event. A sync send aborted by set or destroy() rejects with an Abort instead of sync-, and the commit stays pending. | Treat these Abort rejections as cancellation. Do not compare them with the old string messages. |
Coordinator teardown and sync disconnection pass an Abort reason to transport adapters. | Check signal. in your adapter instead of matching a string reason. |
| Unmounting a React, Vue or Svelte grid destroys it and aborts its pending work. | Destroy host-created sync and collaboration coordinators yourself when the view is removed. |
rebase copies a local operation only when a remote row or column change rewrites it, so its result can hold your own operation objects. | Treat the result as read-only. Your operations are still never modified. |
});}Document operations
0.7.0 adds these document operations: permuteRows (sort), moveCells
(cut and paste, and Insert and Delete that shift cells), setRelationship
and removeRelationship (data model), setMeasure and removeMeasure
(measures), setExternalLinks (linked workbooks), setQuery and
removeQuery (saved queries) and setDashboardItem and removeDashboardItem
(dashboards). A sheet can have kind: "dashboard".
setSheetMeta can carry tabColor. The commit reasons "sort" and
"restore" are new, and "cut" is no longer emitted: cut leaves its cells in
place until the paste moves them. RowBridgeMetadataDelta.metadata can be
"relationship". Update server-side validation and every switch over
operations, commit reasons or metadata kinds before you accept 0.7.0 clients.
Before:
const ACCEPTED = new Set(["set", "setRange", "setBlock", "clearRange"]);// A cut arrived as a clear with the "cut" reason, and the paste as ordinary cell writes.After:
"set", "setRange", "setBlock", "clearRange", "permuteRows", "moveCells",]);
// A cut and paste is one moveCells; Insert and Delete that shift cells add `shift: true`.}Add-on registration
0.7.0 installs add-ons in one way: initSheetwrite({ engine, source, addons }),
plus per-grid settings in createGrid(host, { addons: { [name]: settings } }). Each add-on package
exports a factory named <name>Addon.
Before:
import "@sheetwrite/charts/register";import "@sheetwrite/xlsx/register";import * as formulas from "@sheetwrite/formulas";
await initSheetwrite(undefined, formulas);After:
| 0.6 | 0.7.0 |
|---|---|
import "@sheetwrite/ or register | init |
import "@sheetwrite/ or register | init |
set, set | An add-on whose setup calls context. |
set, set, set | An add-on whose setup calls context. |
init | init |
Custom functions, saved queries, the version history commands, external
links and formula assist are new in 0.7.0 and install the same way:
functionsAddon, queriesAddon, historyAddon, externalLinksAddon and
formulaAssistAddon (from @sheetwrite/formula-assist).
Add-ons set up once, in list order. A name listed twice in one call rejects
with invalid-argument; a name installed by an earlier call is kept. Settings
in createGrid for an add-on that initSheetwrite did not install reject with
invalid-argument. Each add-on loads its heavy code on first use. The XLSX codec
loads on the first XLSX call, and the chart drawing code and the query engine
when a grid that uses them is created. The history panel loads on its first
command.
Errors and cancellation
Core failures have one shape: a SheetwriteError with a stable code and
operation. An abort is
not a failure: it rejects with the signal's reason. See
Error handling.
| 0.6 behavior | 0.7.0 |
|---|---|
Bad host input threw Range, Type or Error from resolve, validate, create, create, legacy, decode, assert and custom Cell results | A Sheetwrite with code invalid-; operations store, transaction, render, row- and resource- are new |
| An unknown sheet ID threw a plain error | not-, operation store, with context. |
A bad limit override threw limit or Type | invalid- everywhere |
Operations comments and export- | Renamed to comment and xlsx- |
datasource- context copied column keys | Holds column and the first 64 bands; read the keys from event. |
A WASM trap threw an untyped Runtime | engine- (operation engine); the grid emits engine- and becomes read-only |
renderer- errors told the cause in the message | error.: spawn, crash, protocol, timeout or fatal |
An aborted XLSX or CSV/TSV call rejected with code: "aborted" | Rejects with signal.; persistence and IndexedDB storage keep aborted |
grid. kept reading after destroy() | Rejects with an Abort |
<Sheetwrite> in Vue and Svelte threw a plain Error for a bad height/fill | invalid-, operation create- |
<Sheetwrite> in React accepted both or neither of height and fill, and Svelte checked them after the grid mounted. Vue typed fill as boolean | React, Vue and Svelte throw invalid- (operation create-) while rendering, before a grid mounts. Vue types fill as fill?: true |
revision-, revision | Removed with Revision; see Revisions move to version history |
Before:
// Bad options threw a RangeError.try { bridge = createRowBridge(options);} catch (error) { if (error instanceof RangeError) showInvalidOptions(error.message);}
// An abort had the code "aborted".try { snapshot = await fromXlsxWorkbookFile(file, { signal });} catch (error) { if (error.code === "aborted") return; throw error;}After:
// Bad options: "invalid-argument".export function describeFailure(error: unknown): string {
case "invalid-argument": case "engine-failed": return "The engine stopped. Reload the document to continue."; default: }}
// An abort: check the signal. try { } catch (error) { if (signal.aborted) return undefined; throw error; }}After engine-failed, destroy the grid, call initSheetwrite() again and
create a new grid from the last saved document. If you switch over
SheetwriteErrorCode or SheetwriteErrorOperation without a default case,
add the new values.
Methods that return a result
Synchronous sort, filter, hidden-row, row-group and view-clear methods of the
store return the same ApplyTransactionResult as applyTransaction, so you can
see a rejected or empty change. They are setColumnFilter, filterBy,
hideRows, showRows, groupRows, ungroupRows, setGroupCollapsed,
clearView and grid.sortBy. Code that implements these method types, or
assigns them to a callback type that returns void, must update the return type.
Before:
store.hideRows("s1", [4, 5]); // returned undefinedAfter:
}Cell style sanitizing
sanitizeHyperlinkStyle is removed; use sanitizeCellStyle instead. The same check guards
hyperlinks, table styles and pasted cells, and applies Excel's font size range
of 1 to 409 points and #rrggbb colors.
Before:
const style = sanitizeHyperlinkStyle(untrusted);After:
}Chart views are read-only
ChartView.chart is now the store's own chart definition instead of a deep
copy. Its type is ReadonlyChartDefinition, read-only all the way down, and
development builds freeze it, so a write throws. To change a chart, edit a copy
and commit it with grid.setChart. grid.getCharts(sheet) returns copies.
Before:
view.chart.title = "Revenue";grid.setChart(view.chart, sheet);After:
}Stylesheet parts
@sheetwrite/core/styles.css now imports the stylesheet in parts, and the command icon sheet is its own file, styles/icons.svg, instead of a data: URL. An app that imports styles.css looks the same.
| Change | What to do |
|---|---|
icons. loads icons. from beside it. | Nothing with Vite, webpack or Next.js. With esbuild, give . files a loader, for example loader: { ".. Without one, the build fails with No loader is configured for ".. |
The default icon sheet is a file from your origin, not a data: URL. | If you set -- only because your Content Security Policy blocks data: images, you can remove it. |
The parts are published under @sheetwrite/ and in each framework adapter. | To ship less CSS, import only the parts your grid uses; see Stylesheet parts. |
| The AutoFilter header buttons and the sheet tab menu draw their glyphs from the icon sheet. | If you import the parts yourself, include icons. on a grid that shows filters or sheet tabs. styles. includes it. |
Direct engine calls
Most apps never call the engine directly. If you call CellStore from
@sheetwrite/wasm or @sheetwrite/formulas yourself, these methods change.
From 0.7.2, both packages export functions that take and return plain values,
so the code you wrote for 0.6 changes little.
| 0.6 | 0.7.2 |
|---|---|
set with one string per entry | set, with one string per entry as before. set and set do the same for set and set. |
convert; scalar formula / formula | formulas and formulas, which return every formula in input order. For one formula, pass a list of one. Core's Xlsx is unchanged. |
Pivot, Pivot | take, take. Each hands the buffer over once and leaves it empty. |
Cell, set, set | Removed: use set, set or set. |
Diff, Diff | Removed: consume the page arrays, then call compare to start the next page; read the length of a returned page array. |
set returned nothing and accepted any name | Returns whether it named the sheet. Like rename, it refuses an empty name, a name another sheet holds in any case, and another sheet's id, and then changes nothing. |
search( matched query as plain text | query takes Excel's wildcards: *, ?, and ~ before a literal *, ? or ~. A sixth argument, formulas, matches a formula cell by its formula text; without it, cells match by their values. |
Before:
// Now UTF-8 bytes and offsets.cells.setSparseBlock(sheet, row, col, rows, cols, offsets, kinds, numbers, texts, styles, formulaOffsets, formulaSources, referenceOffsets, referenceTargets);
// Now takeNames() and takeTypes().const names = fields.names();const types = fields.types();After, from 0.7.2:
import { setSparseCells } from "@sheetwrite/wasm";
// The same arrays, with one string per entry.setSparseCells(cells, sheet, { row, col, rows, cols, offsets, kinds, numbers, texts, styles, formulaOffsets, formulaSources, referenceOffsets, referenceTargets });
// Take each buffer once.const names = fields.takeNames();const types = fields.takeTypes();fields.free();XLSX formula conversion takes the list and returns every formula, in input order. An unchanged formula is the string you passed.
Before:
const converted = engine.convertXlsxFormulas(sources, true);After, from 0.7.2:
import { formulasToXlsx } from "@sheetwrite/wasm";
const converted = formulasToXlsx(engine, sources);The functions call the raw methods, which stay as the low-level transport.
Most code should use the functions. setSparseBlock, setBlockPacked and
setColumnBlockPacked take the text cells as one UTF-8 buffer and the byte
offset of each, which packTexts(texts) builds. convertXlsxFormulas(joined, ends, exporting, changedIndices) takes the sources joined, their cumulative
UTF-16 ends and a Uint32Array with one slot per source, and returns only the
changed formulas. 0.7.0 and 0.7.1 have only the raw methods. See
Call the engine directly.
Keyboard defaults
The grid's keys follow Excel. These default keys are new, and each is a
KeyboardAction that config.keyboard.bindings can rebind or turn off with
null. A host context-menu item that already uses one of them now throws a
shortcut-conflict error. See
Keyboard shortcuts.
| Keys (Ctrl, or Cmd on a Mac) | Actions |
|---|---|
| Ctrl+B or Ctrl+2, Ctrl+I or Ctrl+3, Ctrl+U or Ctrl+4, Ctrl+5 | bold, italic, underline, strikethrough |
| Ctrl+; and Ctrl+Shift+; | insert, insert |
| Ctrl+A | select: the current region, then the whole sheet |
| Ctrl+D and Ctrl+R | fill, fill |
| Ctrl+Shift+~, !, @, #, $, % and ^ | format, format, format, format, format, format, format |
| Ctrl+9, Ctrl+Shift+9, Ctrl+0, Ctrl+Shift+0 | hide, unhide, hide, unhide |
| Ctrl++ and Ctrl+- | insert, delete |
| Ctrl+1 | format |
| Ctrl+Alt+V (Ctrl+Cmd+V on a Mac) | paste |
| Ctrl+Shift+L | toggle |
| Ctrl+PageDown and Ctrl+PageUp, or Ctrl+Alt+PageDown and Ctrl+Alt+PageUp | next, previous |
| Shift+F11 | insert |
Backspace is no longer a clearContents key: it clears only the active cell
and opens the editor, as in Excel. Delete still clears the selection's values,
and now keeps their formats, as Excel's Delete does; in 0.6 it also removed
number formats and styles. grid.actions.clearContents() does the same. Enter
and Tab move the active cell instead of opening the editor; F2 opens it.
Before:
const config = { contextMenu: [{ id: "bookmark", label: "Bookmark", shortcut: "Mod+B", onClick: addBookmark }],};After:
return { // Bold keeps Ctrl+2, so Ctrl+B stays with your command. ], };}The active cell of a selection
Extending a selection with Shift+Arrow, Shift-click or a drag keeps the cell
where it started active, as in Excel. A range, row, column or multi selection
reports that cell as active when it is not the selection's first cell, and
setSelection accepts it. Code that took the far corner of a range as the cell
the user edits must read active instead.
Before:
const selection = grid.getSelection();const cell = selection.kind === "range" ? selection.range.end : selection.addr;After:
case "cell": case "range": case "row": case "column": case "multi": { } }}Find and Replace
Search works as Excel's Find does. See Search.
| 0.6 | 0.7.0 |
|---|---|
* and ? in a query matched themselves | They are wildcards: * matches any run of characters and ? one character. Search for a literal one with ~* or ~?. |
| A formula cell matched by its result | It matches by its formula text unless look. Replace rewrites formula text. |
search searched the whole sheet | With more than one cell selected on the active sheet, it searches only the selection. Select one cell, or pass within: "workbook", to search more. |
A number matched by its stored value (0.15 found a cell showing 15%) | A number in a number format matches by its text: Look in Formulas by the formula bar's text (15%), Look in Values by the shown text ($4.50). |
search, find, find and replace moved a highlight | They also select the match and scroll to it, so typing after Find edits that cell. |
Before:
grid.search("5*"); // cells that hold the text "5*"grid.search("1200"); // also formula cells whose result is 1200After:
}
}Paste and data validation
A paste works as Excel's does with data validation: the pasted values land
unchecked, and the cells the paste covers take the copied cells' rules in place
of their own, as one undo step. In 0.6 a paste kept the target's rules and
silently dropped each value a rule rejected. Paste Values and a paste from
another application keep the target's rules. The store no longer checks
validation for a commit with the "paste" reason. A paste of cells copied in
the same grid also brings their notes and conditional formats.
To keep the target cells' rules, as 0.6 did, set paste.keepValidation. A
value that a reject rule refuses is then not pasted, and the status bar names
the refused cells.
Before:
createGrid(host, { workbook, config: { toolbar: true } });After:
workbook, });}Validation rule and filter types
DataValidationCondition and ColumnFilter have new members. A switch over
their kind that lists every case, or code that reads a field without
checking the kind, must handle them.
| Type | New in 0.7.0 |
|---|---|
Data | { kind: "any" }, { kind: "time", ... }, { kind: "custom", formula }, and a list from a range or a name, { kind: "list", source: "=$H$2:$H$5" }, which has no values |
Data | min, max and value can be formula text, such as "=TODAY()", as well as a number |
Data | in, error, error, show, input and input |
Column | { kind: "custom", join, conditions } for Excel's custom AutoFilter, and { kind: "dynamic", type } for its Date Filters |
Before:
function choices(rule) { return rule.condition.kind === "list" ? rule.condition.values : [];}After:
// A list from a range or a defined name has `source` instead of `values`.}Sheet names
validateSheetName reports the new code reserved for History, which Excel
reserves. A user's rename to History is refused; adding a sheet, undo, a
version restore and XLSX files keep the name. New sheets from the + button,
the tab menu's Insert and Shift+F11 are named Sheet4, with no space, instead
of Sheet 4.
Before:
const messages = { blank: "Enter a name.", "too-long": "Use 31 characters or fewer.", "forbidden-character": "Remove : \\ / ? * [ or ].", "edge-apostrophe": "Remove the apostrophe at the start or end.", duplicate: "Another sheet has this name.",};After:
blank: "Enter a name.", "too-long": "Use 31 characters or fewer.", "forbidden-character": "Remove : \\ / ? * [ or ].", "edge-apostrophe": "Remove the apostrophe at the start or end.", reserved: "History is reserved.", duplicate: "Another sheet has this name.",};Behavior changes you will notice
Excel sort order
Every sort uses Excel's sort order. Text compares without case in Excel's
character order and skips apostrophes and hyphens. Errors sort after FALSE and
TRUE and are equal to each other. Blank cells are last in both directions. A
saved view sort with mixed-case text, errors, or blank
cells in a descending sort shows a different order after the upgrade. Sorting a
spilled column uses the spilled values.
Sort commands and the view sort
Sort A to Z and Sort Z to A in the ribbon, the toolbar and the column menu move the cells. One undo restores them. To sort only the displayed rows, use Sort View A to Z, Sort View Z to A, or "Sort view only" in the Sort panel (Data › Custom Sort; Excel calls this button Data › Sort). A view sort is still saved with the sheet.
Imported worksheet sort state
An imported worksheet sortState is no longer applied as a view sort. Excel
writes it after a sort that already moved the cells, so the rows keep the
order Excel saved. It is kept as Sheet.sortState and written back on export,
and the "sortState did not cover every data row" import warning is removed. An
in-place sort of a table body records the table's sort state, so Excel shows
the sort on the table's header buttons.
INFO and other new functions
INFO is new in both engines. It returns the sheet count for "numfile" and
"Automatic" for "recalc", and #N/A for "directory", "origin",
"osversion", "release" and "system", which describe the desktop program. Workbooks that showed
#NAME? for an Excel function that 0.7.0 adds now show a result. See the
formula function contract.
Formula results that match Excel
| Change |
|---|
Operators read number text as VALUE does: ="1,000"+0 is 1000 and ="2024-01-31"+0 is 45322. A space inside a number is text (=VALUE( is #VALUE!), date text with trailing words is #VALUE!, and the criterion "inf" is text. |
ROUND, TEXT, CHOOSE, INDEX, SUMIF, FLOOR, CEILING, TRIM and other functions give Excel's result; numbers become text with 15 significant digits. |
SUBTOTAL accepts codes 101 to 111 and skips hidden rows; AGGREGATE options 1, 3, 5 and 7 skip hidden rows; a subtotal does not count another subtotal. |
Paste, fill and conditional-format rules rewrite references with the engine's rules: =SUM( pasted one column right is =SUM(, and a reference that leaves the sheet becomes #REF!. shift needs init first. |
| XLSX import expands shared formulas with the same rule, so a shared whole-column reference moves with each cell. |
A row or column insert that a sheet cannot hold changes nothing; add, remove, insert and remove return false. A transaction whose add or add would pass max, max, max or max is rejected with a resource- issue that names the limit. Insert Row and Insert Column show the limit in an alert. |
A reference to another workbook, such as [Budget., keeps its text and shows #REF! until the workbook has values for the link. Before, the unquoted form was a syntax error and a quoted form made the whole formula #REF!. |
A sheet rename or delete, a row or column insert or delete, a tab move and a table change keep the formula text as written and change only its references. Renaming Sales to Sales Data turns =Sales!A1+1 into ='Sales Data'!A1+1, not =(. |
Moving rows or columns (move, move) moves the cells, as Excel's Cut and Insert Cut Cells does. References follow the moved cells instead of becoming #REF!. A range loses a moved row at its edge and grows by one that lands inside it. A move that would split a table is refused. |
Cut no longer empties its cells: it marks them, and the next paste moves them with the new move operation, as Excel's Cut and Paste does. References to the moved cells follow them, and the move is one undo step. A server or store that checks operation kinds must accept move; the "cut" commit reason is no longer emitted. See Cut and paste moves cells. |
Array formulas whose size comes from a cell, such as =SEQUENCE(, spill in every formula of a recalculation; the third and later ones no longer show #NUM!. |
On paged data, INDEX that returns one cell shows #LOADING! only until that cell loads, and a short text result no longer shows #NUM! when other cells of its area hold a lot of text. |
GROUPBY and PIVOTBY compute large sources that Excel computes: their source rows no longer count against the 2,000,000-operation limit. A call that places more than 16,777,216 rows into groups returns #NUM!. |
GETPIVOTDATA is no longer volatile. It recalculates when its pivot's output changes, as in Excel, not on every edit. |
A function that takes one value, such as ABS, ROUND, LEN, UPPER, DATE, or the full engine's FACT and TEXTBEFORE, runs once for each element when it gets an array or a range, and spills the results, as in Excel 365. =ABS( spills three results where it gave the first cell's, and shows #SPILL! where the cells below hold values. =SUM( adds every length instead of the first. |
IF, IFERROR, IFNA, IFS, SWITCH and CHOOSE take an array or a range: =IF( spills one result per cell, where it gave #VALUE! or only the first result. |
=IF( gives FALSE instead of 0, as in Excel. An empty branch, as in =IF(, =IF( or =IFERROR(1/0,), gives 0 instead of an empty result. |
A formula whose result is an empty cell, such as =C1 with C1 empty, an INDEX or lookup that finds an empty cell, or a gap in a spilled range, holds 0, as in Excel. It shows 0, counts in COUNT, is not ISBLANK or COUNTBLANK, and filters, sort, Find and Ctrl+Arrow treat it as 0; XLSX export writes the 0. In 0.6 it showed empty. ="" still shows nothing, and a function given the empty cell itself, such as SUM( or ISBLANK(, still sees a blank. |
Grid markup and loading
| Change | What to do |
|---|---|
The toolbar, the ribbon and the compact ribbon render one command model. The . classes are gone; each command element has a data- attribute. The built-in toolbar loads with the ribbon's chunk. | Select commands by data- in styles and tests, and wait for the toolbar after the grid mounts. |
Grid command flags (Command) choose ribbon commands too. | Check the ribbon after changing a flag such as export. |
| The find bar loads on first open. | Open it with grid. or Ctrl+F before looking for .. Expect one more lazy chunk. |
Typing, fill, paste or a remote edit inside a spill keeps the value and shows #SPILL! on the anchor. | Nothing; clearing the value restores the array. |
| Saved hidden rows, collapsed groups and filters apply at load. | Nothing; SUBTOTAL no longer counts rows that a saved filter hides. |
The number-format box and grid. show the column's number when the cell's style sets none. | Nothing; a cell in a percentage column no longer shows "General". |
Each paint writes the screen-reader mirror as its last step. A scroll listener runs before that write. | A scroll listener that reads the mirror sees the previous paint's rows. |
Editing, filters and sheets
| Change | What to do |
|---|---|
| AutoComplete is on: typing a text entry completes it from the same column, and Enter stores the completed entry. | Set config: { auto to turn it off. |
An entry typed into a cell keeps the cell's formatting, bold and number format included. What a user types into a Text (@) cell stays text, so 0123 keeps its zero. | Nothing. parse takes the cell's number format as an optional third argument, for a formula bar of your own. |
A new column type, general, reads typing as Excel's General format does: 42 is a number, 15% is 0.15 shown as 0%, 1/2/2024 is a date, '007 is the text 007. The columns Sheetwrite makes itself are general: new sheets, add without columns, the empty columns right of a sheet's own, XLSX imports without one number format per column, and an adapter's Simple without type. In 0.6 they were text, which kept typed numbers and dates as text. | Handle general where your code switches on Column.. Set type: "text" on a column whose entries must stay text, such as codes with leading zeros. A 0.6 peer refuses a snapshot or patch with a general column, so update collaborating clients together. parse takes the column's number locale as an optional fourth argument. |
| Insert, delete, hide and auto-fit row and column commands act on every row or column of the selection. | Nothing. |
| Undo and redo select the cells they change; a change on another sheet makes that sheet active. | Nothing. |
| Column filters keep through inserted and deleted rows, and move with their columns. In 0.6 any row or column edit cleared them. | Nothing. |
| XLSX import turns rows an Excel AutoFilter hid into filtered rows, not hidden rows. | Nothing. Clearing the filter shows them, as in Excel. |
| A cut over a filtered range moves the rows the filter hides too, as in Excel. Copy, delete, formatting and the fill handle still act only on the rows the filter shows. | Nothing. |
A pasted block over a filtered range or rows hidden with Hide Rows writes into consecutive sheet rows, the hidden rows included, as in Excel, and says "This paste wrote into N hidden rows". In 0.6 it wrote only into the rows a filter showed. One copied value pasted over a filtered selection still fills only the shown cells. The context menu's Paste Options then offers Paste into visible rows only (grid., new context-menu action paste). | Nothing. Under a view sort a block still takes the shown rows. A host's own context menu can add { action: "paste. |
| New sheets from the + button, Insert and Shift+F11 start with columns A to Z and 1,000 rows, instead of one column and 100 rows. The + button adds the sheet after the active one. | Nothing. A sheet added with add without columns fills the grid's width with empty columns. |
A number with no format, General or @ shows as Excel's General: 2026, not 2,026, and 1.23457 for a long number. | Update tests that expected thousands separators or three decimals. |
XLSX export writes a text column in Excel's Text format @, and import reads an @ column as text. | Nothing; 007 keeps its zero through a round trip. |
The Name Box goes to a cell on a hidden row. While that cell is active, the selection event has selection: null and names the cell in sheet. | Handle selection: null with a sheet where you read the selection event. |
A paste the grid refuses, a paste too large for the sheet included, resolves the new Clipboard "rejected" instead of "done" or rejecting. | Add the case where you switch over Clipboard. |
setBlock cell arrays
| Change | What to do |
|---|---|
An accessor entry in setBlock arrays is now read once instead of rejected. grid., grid. and Sheetwrite read each entry of a set's block. and block. once, by index, into a private copy. Validation, the store, history, sync and the change event use that copy. A getter that throws gives a Sheetwrite with code invalid- and operation transaction. Only those two arrays change. Every other set field (range, formulas, refs, style), every other operation type, holes, non-finite numbers and byte limits keep the same validation. Getters there are still rejected without running. store. returns and emits a copy of a transaction that contains set. | Nothing, unless you relied on the rejection or on getting your own patches array back. Changing your arrays after the call no longer reaches the document. |
Dense workbooks past maxDenseCells
| Change | What to do |
|---|---|
A dense-storage workbook no longer stops at max (5,000,000 cells). In 0.6.1 a snapshot past it failed with Snapshot. Now the sheets past it load in local pages, which are never evicted and always loaded, so they still behave as dense sheets (is is false). A row or column insert that would pass it moves the sheet into local pages instead of being refused. | Nothing, unless you load untrusted snapshots: see the next row. |
| With the default limits, the most cells an untrusted dense-storage snapshot can make the engine hold rises from 5,000,000 to 25,000,000: 5,000,000 dense and 20,000,000 in local pages. A sheet filled to the full local budget held 625 MB of WASM memory in our measurement. | To keep 0.6.1's ceiling, pass snapshot; any lower value bounds local pages. Lowering max also lowers what the engine allocates densely: the store gives both limits to the engine. |
Local sheets share a new limit, max in Snapshot (20,000,000 cells by default, also the engine's ceiling). A snapshot past it fails with Snapshot, and an add or add that would pass it is rejected with a resource- issue whose resource is local-. That code replaces dense-, which pre-release builds of 0.7.0 reported for an insert past max. max and max are capped at the engine's ceilings (5,000,000 and 20,000,000); a larger value acts as the ceiling. | Match local- where you matched dense-. |
Before:
// 0.6.1 refused a snapshot past 5,000,000 cells.const grid = createGridFromSnapshot(host, untrusted);After:
});}How 0.7.0 compares with 0.5.4 and 0.6.1
The same workloads ran against the published 0.5.4 and 0.6.1 packages and against the 0.7.0 release commit on two machines. Recalculation takes about a third of 0.6.1's time, XLSX import about two thirds, and 100,000 loaded formulas hold less memory; the engine download grows by 28–32%. The workloads, raw samples and noise are in the comparison results.
Upgrade from earlier versions
If you upgrade from a version before 0.6.0, first read Upgrade to 0.6.0.
interface GridImperative grid handle for document commands, events, rendering, and teardown.API referenceclass SheetwriteStoreStable public facade and the sole transaction, epoch, policy, and event barrier.API referencefunction showLargestFirst(grid: Grid): ApplyTransactionResultgrid: GridAPI referenceGrid.setViewSort(keys: readonly SortKey[]): ApplyTransactionResultSort the rows shown on the active sheet without moving any cell. Rows sort by keys (first key primary; stable); an empty list clears the view sort. The keys are saved with the sheet and export to XLSX as sortState.API referenceSortKey.col: numberZero-based index of the column to sort by.API referenceSortKey.ascending: booleantrue sorts smallest first (A to Z for text); false the reverse.API referencefunction showLargestFirstInStore(store: SheetwriteStore): ApplyTransactionResultstore: SheetwriteStoreAPI referenceSheetwriteStore.setViewSort(sheet: SheetId, keys: readonly SortKey[]): ApplyTransactionResultSort the rows shown on a sheet without moving any cell. Rows sort by keys (first key primary; stable); an empty list clears the view sort. The keys are saved in the sheet and export to XLSX as sortState. To move the cells, as Excel's Sort does, use sortRange.API referencefunction sortFocusRegion(grid: Grid): ApplyTransactionResultGrid.sortBy(col: number, ascending?: boolean): ApplyTransactionResultSort by column col, as Excel's quick sort does. It sorts the cells of the table body that holds the focus cell, or else of the selected range, or else of the current region around the focus cell. A first row of text over other values stays as a header.API referencefunction sortOrders(grid: Grid): ApplyTransactionResultGrid.sortRange(range: Range, keys: readonly SortKey[], options?: { hasHeader?: boolean; }): ApplyTransactionResultSort the cells of range in place, as Excel's Sort does. It is one undoable change that collaborators receive as one transaction. With hasHeader the first row stays. Merged cells of different sizes reject the sort and emit mutation-rejected.API referenceRange.sheet: stringStable ID of the sheet the range is on.API referenceRange.start: { row: number; col: number; }Zero-based row and column of one corner cell, included in the range.API referencerow: numberRow index, counting from 0 at the sheet's first row.API referencecol: numberColumn index, counting from 0 at the sheet's first column.API referenceRange.end: { row: number; col: number; }Zero-based row and column of the opposite corner cell, also included.API referencehasHeader?: boolean | undefinedfunction createGridFromSnapshot(host: HTMLElement, snapshot: unknown, options?: SnapshotGridOptions): GridMount a grid over a saved snapshot. The snapshot must be validated and have no unsaved changes. The grid owns and disposes the hydrated store just like one created through createGrid.API referenceclass SyncCoordinatorKeeps a document in sync with a server while edits show at once. The sync is deterministic, optimistic and works over any transport. Local rendering is never blocked: changes queue immediately, while hosts explicitly call sendNext or retry to perform network work.API referenceclass HistoryArchiveOpt-in archive of named and automatic versions for one document. It stores content-addressed checkpoints plus the committed transactions since each one, through a host HistoryStorageAdapter. A grid that never imports this module has no history state. Calls that change the archive run one at a time. Each publishes atomically, so a failure or abort leaves the last durable version readable.API referenceinterface HistoryStorageAdapterAtomic storage seam for local databases and host-owned history backends.API referencefunction restoreLatest(grid: Grid, sync: SyncCoordinator, storage: HistoryStorageAdapter, previewHost: HTMLElement): Promise<ApplyTransactionResult | undefined>interface HTMLElementThe HTMLElement interface represents any HTML element. Some elements directly implement this interface, while others implement it via an interface that inherits it. MDN Referenceconst archive: HistoryArchiveAPI referenceHistoryArchive.open(options: HistoryArchiveOptions, signal?: AbortSignal): Promise<HistoryArchive>Open an archive by reading its manifest only; no workbook is loaded.API referenceHistoryArchiveOptions.documentId: stringID of the document whose history the archive keeps.API referenceHistoryArchiveOptions.storage: HistoryStorageAdapterWhere the archive stores its records, such as IndexedDB storage from @sheetwrite/core/browser-history.const page: HistoryListPageAPI referenceHistoryArchive.listVersions(options?: ListVersionsOptions): Promise<HistoryListPage>One bounded page of version metadata, newest first.API referenceListVersionsOptions.maxEntries?: number | undefinedChanges per page, from 1 to 1,000; default 1,000.API referenceconst latest: HistoryVersionAPI referenceHistoryListPage.versions: readonly HistoryVersion[]Version markers on this page, newest first.API referenceundefined: undefinedconst snapshot: WorkbookSnapshotAPI referenceHistoryArchive.readVersion(id: string, signal?: AbortSignal): Promise<WorkbookSnapshot>Rebuild the document of one version. A reader lease keeps its records alive while a concurrent prune runs; the lease is released on every exit. The archive keeps the rebuilt version for the calls that follow, until releaseMemory.API referenceHistoryVersion.id: stringContent ID of the marker fields.API referenceconst preview: GridAPI referencepreviewHost: HTMLElementreadOnly?: boolean | undefinedDisables mutating interactions while preserving navigation and selection.API referenceGrid.destroy(): voidFree everything this grid owns: its DOM, listeners, timers, renderer, worker and caches, and the store that it created. Call it when the host view is removed; a second call does nothing.API referenceHistoryArchive.restoreVersion(grid: Grid, id: string, scope: HistoryRestoreScope, options?: HistoryRestoreOptions): Promise<ApplyTransactionResult>Restore one version, or one sheet or range of it, on grid as one undoable transaction. The version is rebuilt in a private engine instance, or taken from the last readVersion or restore, and compared with the grid's current document; the difference is committed as one atomic restore, which SyncCoordinator sends as one transaction that is never rebased. With options.sync, the coordinator must be online with no pending or conflicted commits. When its server version is the archive head, the grid holds the head, so only the checkpoint pages where the version and the head differ are read and written again (see selectRestorePages). A change to the grid while the version is read, or a scope that cuts a merged cell or hyperlink, rejects before anything changes. See the restore section of the persistence guide for what each scope covers.API referencekind: "workbook""dashboard" adds a dashboard, which ignores rowCount and columns.API referenceHistoryRestoreOptions.sync?: SyncCoordinator | undefinedThe grid's coordinator in a shared document; the restore then needs an idle queue.interface PersistenceAdapterHost load and commit contract for versioned workbook persistence.API referencefunction connect(grid: Grid, adapter: PersistenceAdapter, userId: string): SyncCoordinatorconstructor SyncCoordinator(grid: Grid, adapter: PersistenceAdapter, options: SyncCoordinatorOptions): SyncCoordinatorStarts syncing grid through adapter: from now on, each local change is queued and sent in order. With pendingStorage, saved changes load first.API referenceadapter: PersistenceAdapterAPI referenceSyncCoordinatorOptions.documentId: stringID of the document to sync; every pending commit carries it.API referenceSyncCoordinatorOptions.serverVersion: numberServer version of the snapshot the grid was created from.API referenceSyncCoordinatorOptions.authorId?: string | undefinedAuthenticated ID of the person editing through this grid. Each new pending commit carries it to the authority, which records it in history. Restored commits keep the author they were made with. At most maxMutationIdBytes UTF-8 bytes.API referenceuserId: stringtype DocumentOp = { op: "set"; addr: CellAddress; value: CellValue; style?: CellStyle; } | { op: "setRange"; range: Range; cells: SnapshotCell[]; } | { op: "setBlock"; range: Range; block: PackedCellBlock; } | { op: "restoreBlock"; range: Range; encoding: "deflate-json-v1"; decodedBytes: number; data: string; } | { op: "setRangeStyle"; range: Range; style: Partial<CellStyle> | null; } | { op: "clearRange"; range: Range; contents?: boolean; style?: boolean; } | { op: "permuteRows"; range: Range; encoding: "u32le-base64-v1"; order: string; } | { op: "addRows"; sheet: SheetId; at: number; count: number; } | ... 41 more ... | ...Exhaustive serializable operation union for workbook mutations.API referenceconst ACCEPTED: Set<"addColumns" | "addMerge" | "addRows" | "addSheet" | "addTable" | "clearRange" | "moveCells" | "moveColumns" | "moveRows" | "moveSheet" | "permuteRows" | "removeChart" | "removeColumns" | "removeDashboardItem" | "removeHyperlink" | "removeMeasure" | "removeMerge" | "removeNamedRange" | "removePivot" | "removeProtectedRange" | "removeQuery" | "removeRelationship" | "removeRows" | "removeSheet" | "removeTable" | "removeValidationRule" | "renameSheet" | "restoreBlock" | "set" | "setBlock" | "setCalculation" | "setChart" | "setColumn" | ... 16 more ... | "updateTable">var Set: new <"addColumns" | "addMerge" | "addRows" | "addSheet" | "addTable" | "clearRange" | "moveCells" | "moveColumns" | "moveRows" | "moveSheet" | "permuteRows" | "removeChart" | "removeColumns" | "removeDashboardItem" | "removeHyperlink" | "removeMeasure" | "removeMerge" | "removeNamedRange" | "removePivot" | "removeProtectedRange" | "removeQuery" | "removeRelationship" | "removeRows" | "removeSheet" | "removeTable" | "removeValidationRule" | "renameSheet" | "restoreBlock" | "set" | "setBlock" | "setCalculation" | "setChart" | "setColumn" | ... 16 more ... | "updateTable">(iterable?: Iterable<...> | ... 1 more ... | undefined) => Set<...>Set<"addColumns" | "addMerge" | "addRows" | "addSheet" | "addTable" | "clearRange" | "moveCells" | "moveColumns" | "moveRows" | "moveSheet" | "permuteRows" | "removeChart" | ... 37 more ... | "updateTable">.has(value: "addColumns" | "addMerge" | "addRows" | "addSheet" | "addTable" | "clearRange" | "moveCells" | "moveColumns" | "moveRows" | "moveSheet" | "permuteRows" | "removeChart" | "removeColumns" | "removeDashboardItem" | "removeHyperlink" | "removeMeasure" | "removeMerge" | "removeNamedRange" | "removePivot" | "removeProtectedRange" | "removeQuery" | "removeRelationship" | "removeRows" | "removeSheet" | "removeTable" | "removeValidationRule" | "renameSheet" | "restoreBlock" | "set" | "setBlock" | "setCalculation" | "setChart" | "setColumn" | ... 16 more ... | "updateTable"): booleanop: DocumentOpAPI referenceop: "addColumns" | "addMerge" | "addRows" | "addSheet" | "addTable" | "clearRange" | "moveCells" | "moveColumns" | "moveRows" | "moveSheet" | "permuteRows" | "removeChart" | "removeColumns" | "removeDashboardItem" | "removeHyperlink" | "removeMeasure" | "removeMerge" | "removeNamedRange" | "removePivot" | "removeProtectedRange" | "removeQuery" | "removeRelationship" | "removeRows" | "removeSheet" | "removeTable" | "removeValidationRule" | "renameSheet" | "restoreBlock" | "set" | "setBlock" | "setCalculation" | "setChart" | "setColumn" | ... 16 more ... | "updateTable"The comparison. beginsWith, endsWith, contains and notContains take text; the others take a number (a date is its serial) or text.API referencefunction chartsAddon(): SheetwriteAddonThe charts add-on. It makes core's openChartViews(store) return live chart views, and grids created after initSheetwrite draw their charts as SVG. Without it, a grid shows a plain frame with the chart title. The SVG code loads when the first grid is created, not with the first chunk.API referencefunction initSheetwrite(options?: InitSheetwriteOptions): Promise<void>Load one WASM engine and install add-ons before createGrid.API referencemodule "@sheetwrite/formulas"Cells that hold a formula, as row-major offset and source text such as =A1*2.API referencefunction xlsxAddon(): SheetwriteAddonThe XLSX add-on. It installs the workbook and table XLSX backends that core's fromXlsx* and toXlsx* functions and grid.exportXlsx use. The codec loads on the first XLSX call, so installing the add-on at startup adds no codec code to the first chunk.API referenceInitSheetwriteOptions.engine?: SheetwriteEngine | undefinedEngine module; defaults to @sheetwrite/wasm. Pass @sheetwrite/formulas for the full engine.API referenceInitSheetwriteOptions.addons?: readonly SheetwriteAddon<unknown>[] | undefinedAdd-ons to install, in this order, after the engine loads. A name listed twice rejects; a name installed by an earlier call is kept.API referencefunction fromXlsxWorkbookFile(file: Blob, options?: XlsxWorkbookOptions): Promise<WorkbookSnapshot>Import a File/Blob. The built-in backend reads it without buffering the compressed workbook.API referencefunction isSheetwriteError(value: unknown): value is SheetwriteErrorEnvelopeCheck whether a value is a Sheetwrite error. It matches same-realm errors, cross-realm errors, and serialized failure envelopes by shape: a string name and message, a non-empty string code and operation, and a JSON-safe context when present. The guard does not check code against a list, so a code from a newer Sheetwrite still passes; handle unknown codes in the default branch of a switch.API referenceerror: unknownerror: SheetwriteErrorEnvelopeAPI referenceSheetwriteErrorEnvelope.code: SheetwriteErrorCodeStable failure category to branch on, such as "resource-limit".API referenceSheetwriteErrorEnvelope.operation: SheetwriteErrorOperationThe Sheetwrite operation that failed, such as "xlsx-import".API referenceSheetwriteErrorEnvelope.message: stringHuman-readable explanation for logs; branch on code, not on this text.API referencefunction importFile(file: Blob, signal: AbortSignal): Promise<WorkbookSnapshot | undefined>API referenceinterface BlobThe Blob interface represents a blob, which is a file-like object of immutable, raw data; they can be read as text or binary data, or converted into a ReadableStream so its methods can be used for processing the data. MDN Referenceinterface AbortSignalThe AbortSignal interface represents a signal object that allows you to communicate with an asynchronous operation (such as a fetch request) and abort it if required via an AbortController object. MDN Referencefile: BlobXlsxWorkbookOptions.signal?: AbortSignal | undefinedChecked before the work and once per ZIP entry, worksheet and chunk of cells. After it fires, the call rejects (or the stream errors) with signal.reason, not with a SheetwriteError.API referencevar error: unknownsignal: AbortSignalAbortSignal.aborted: booleanThe aborted read-only property returns a value that indicates whether the asynchronous operations the signal is communicating with are aborted (true) or not (false). MDN Referencefunction hideDrafts(store: SheetwriteStore, rows: readonly number[]): booleanAPI referenceconst result: ApplyTransactionResultAPI referenceSheetwriteStore.hideRows(sheet: SheetId, rows: readonly number[]): ApplyTransactionResultHides the given zero-based rows as one undoable change.API referencerows: readonly number[]status: "applied" | "conflict" | "noop" | "rejected"ok when the measure can be calculated; otherwise why it cannot.API referencevar console: ConsoleConsole.warn(...data: any[]): voidThe console.warn() static method outputs a warning message to the console at the "warning" log level. The message is only displayed to the user if the console is configured to display warning output. In most cases, the log level is configured within the console UI. The message may receive special formatting, such as yellow colors and a warning icon. MDN Referenceconst result: { status: "rejected"; epoch: number; issues: MutationIssue[]; }API referenceissues: MutationIssue[]API referencefunction sanitizeCellStyle(value: unknown): CellStyle | nullA safe copy of an untrusted cell style, or null when it is invalid. The copy is plain and bounded; the result is null when value is not a plain object of known style fields or any field breaks its rule. The same rule guards hyperlinks, table styles and pasted cells.API referencefunction safeStyle(untrusted: unknown): CellStyleAPI referenceuntrusted: unknowninterface ChartViewRead-only rendering input for one chart, refreshed on chart-change events; development builds freeze it.API referencetype SheetId = stringStable identifier used to address a workbook sheet.API referencefunction retitleChart(grid: Grid, sheet: SheetId, view: ChartView, title: string): ApplyTransactionResult | undefinedsheet: stringconst chart: ChartDefinition | undefinedAPI referenceGrid.getCharts(sheet?: SheetId): readonly ChartDefinition[]Clones of the chart definitions on sheet (default: the active sheet).API referenceReadonlyArray<ChartDefinition>.find(predicate: (value: ChartDefinition, index: number, obj: readonly ChartDefinition[]) => unknown, thisArg?: any): ChartDefinition | undefinedReturns the value of the first element in the array where predicate is true, and undefined otherwise.candidate: ChartDefinitionAPI referenceChartDefinition.id: stringStable ID, unique on the sheet.API referenceview: ChartViewAPI referenceChartView.chart: { readonly id: string; readonly kind: ChartKind; readonly title?: string; readonly axes?: { readonly xTitle?: string; readonly yTitle?: string; readonly multiLevelLabels?: boolean; } | undefined; readonly legend?: "none" | "top" | "right" | "bottom" | "left"; readonly anchor: { readonly row: number; readonly col: number; readonly offsetX: number; readonly offsetY: number; readonly width: number; readonly height: number; }; readonly series: readonly { readonly name?: string; readonly nameRange?: "#REF!" | { readonly sheet: SheetId; readonly start: { readonly row: number; readonly col: number; }; readonly end: ...; } | undefined; readonly values: "#REF!" | ...; readonly categories?: "#REF!" | ... 1 more ... | undefined; }[]; readonly pivot?: string; readonly pivotValues?: ... | undefined; }The store's own definition, not a copy. The store replaces a chart when it changes and never writes into one. Development builds freeze it, so a write throws; copy it (for example with structuredClone) to edit it.API referenceid: stringStable ID, unique on the sheet.API referenceGrid.setChart(chart: ChartDefinition, sheet?: SheetId): ApplyTransactionResultInsert or replace the chart with chart.id as one undo entry. sheet defaults to the active sheet; chart IDs are unique only within a sheet.API referenceconst chart: ChartDefinitionAPI referenceChartDefinition.title?: string | undefinedText above the chart; undefined shows no title.API referenceinterface GridConfigWhich built-in chrome and commands the grid shows. When config is set the built-in toolbar is shown; control flags default to true except the opt-in export and keyboardSettings flags.API referenceGridConfig.keyboard?: boolean | KeyboardOptions | ((e: KeyboardEvent, grid: Grid) => boolean) | undefinedBuilt-in keyboard handling. true (default) keeps Excel's default bindings. An object replaces individual action bindings; omitted actions keep their defaults, and null disables an action's keys. For example: { bindings: { copy: { key: "c", mod: true, shift: true } } }. Menu hints and toolbar titles use these same bindings. false disables all built-in keys. A function intercepts each keydown before the defaults; return true to consume it, false to let the built-in handler continue.API referenceKeyboardOptions.bindings?: Partial<Record<KeyboardAction, readonly KeyShortcut[] | KeyShortcut | null>> | undefinedShortcut overrides by action name; actions you leave out keep their default keys.API referencebold?: readonly KeyShortcut[] | KeyShortcut | null | undefinedAPI referenceGridConfig.contextMenu?: boolean | ContextMenuItems | undefinedBuilt-in menu, disabled menu, static rows, or a request-aware row factory.API referenceContextMenuItem.id?: string | undefinedStable host identifier, exposed as data-context-menu-item.API referenceContextMenuItem.label?: string | undefinedMenu row text. Defaults per action.API referenceContextMenuItem.shortcut?: KeyShortcut | KeyboardAction | undefinedA bound action name or a custom key combination. An explicit combination registers onClick as a keyboard command; action names only reference the existing built-in binding. Both forms display platform-aware labels. For example, shortcut: "copy" follows the configured Copy binding, while shortcut: "Mod+Shift+K" binds this item's onClick callback. See KeyboardOptions for built-in action overrides.API referenceContextMenuItem.onClick?: ((grid: Grid, cell: CellAddress | null) => void) | undefinedCustom click handler; receives the grid and the right-clicked cell (null if none).API referenceaddBookmark: () => voidinterface CellAddressZero-based address of one cell on a stable sheet ID.API referenceconst selection: Selection | nullAPI referenceGrid.getSelection(): Selection | nullThe current selection, or null when nothing is selected.API referenceconst selection: SelectionAPI referencekind: "cell" | "column" | "multi" | "range" | "row"Selects one addressed cell. Selects one inclusive rectangular range. Selects an entire data row. Selects an entire column. Selects multiple, potentially disjoint rectangles.API referenceconst selection: { kind: "cell"; addr: CellAddress; }API referenceaddr: CellAddressZero-based data address of the selected cell.API referenceconst selection: { kind: "range"; range: Range; active?: CellAddress; }active?: CellAddress | undefinedThe active cell, where typing edits, when it is not the range's start cell.API referenceCellAddress.sheet: stringStable ID of the sheet (not its display name).API referencerange: RangeData-space bounds of the selected rectangle.API referenceconst selection: { kind: "row"; sheet: SheetId; row: number; active?: CellAddress; }active?: CellAddress | undefinedThe active cell, where typing edits, when it is not the row's first cell.API referencesheet: stringStable ID of the containing sheet.API referenceCellAddress.row: numberRow index, counting from 0 at the sheet's first row.API referencerow: numberZero-based data-row index.API referenceCellAddress.col: numberColumn index, counting from 0 at the sheet's first column.API referenceconst selection: { kind: "column"; sheet: SheetId; col: number; active?: CellAddress; }active?: CellAddress | undefinedThe active cell, where typing edits, when it is not the column's first cell.API referencecol: numberZero-based column index.API referenceconst last: RangeAPI referenceconst selection: { kind: "multi"; ranges: Range[]; active?: CellAddress; }ranges: Range[]Data-space rectangles comprising the selection.API referenceArray<Range>.length: numberGets or sets the length of the array. This is a number one higher than the highest index in the array.active?: CellAddress | undefinedThe active cell, where typing edits, when it is not the last range's start cell.API referencefunction findLiteralStar(grid: Grid): SearchResultGrid.search(query: string, opts?: SearchOptions): SearchResultFind cells matching query, with Excel's wildcards (*, ?, ~). It highlights matches, selects the first, emits search, returns the result. On the active sheet a selection of more than one cell limits the search to it, as in Excel; the selection stays and the active cell moves to the match.API referencefunction findResult(grid: Grid): SearchResultSearchOptions.lookIn?: "formulas" | "notes" | "values" | undefinedWhat a cell is searched by, as Excel's "Look in" sets. It is a formula cell's formula text ("formulas", the default) or its result ("values"), or the cell's note ("notes"). Replace rewrites formula text only when looking in formulas, and note text when looking in notes.API referencefunction createGrid(host: HTMLElement, opts: GridOptions): GridCreates and mounts an imperative Grid in the supplied host element.API referenceinterface GridOptionsWorkbook, data, rendering, policy, and built-in UI options used to create a Grid.API referencefunction mountGrid(host: HTMLElement, workbook: GridOptions["workbook"]): Gridworkbook: WorkbookAPI referencehost: HTMLElementGridOptions.workbook: WorkbookLive workbook schema adopted by the store and updated by document operations.GridOptions.config?: GridConfig | undefinedBuilt-in UI controls; providing an object enables the toolbar unless toolbar is false.API referenceGridConfig.toolbar?: boolean | ToolbarItem[] | undefinedShow the built-in toolbar (true), hide it (false), or supply a custom item list. The toolbar shows the ribbon's commands on one row, with the rest in a "More commands" menu.API referenceGridConfig.paste?: { keepValidation?: boolean; } | undefinedHow a paste treats the cells it lands on.API referencekeepValidation?: boolean | undefinedKeep the data validation rules of the cells a paste covers (default false). Excel's paste, the default, gives them the copied cells' rules and lands every value unchecked. With true, the cells keep their rules, a value a reject rule refuses is not pasted, a value a warn rule refuses lands, and the status bar names both kinds of cell with a "Select them" button.type CellScalar = string | number | boolean | nullA scalar that can be displayed directly.API referenceinterface DataValidationRuleOne stable, range-scoped data-entry rule. Blank cells are allowed unless disabled.API referenceconst condition: DataValidationConditionWhat a value must satisfy, such as a list of choices or a number range.API referencerule: DataValidationRuleAPI referenceconst condition: DataValidationConditionWhat a value must satisfy, such as a list of choices or a number range.API referenceconst condition: { kind: "list"; values: readonly CellScalar[]; allowCustom?: boolean; }What a value must satisfy, such as a list of choices or a number range.API referencevalues: readonly CellScalar[]Cells that hold the values to plot.API referencetype SheetNameIssueCode = "blank" | "duplicate" | "edge-apostrophe" | "forbidden-character" | "reserved" | "too-long"Stable reason codes returned by worksheet-name validation.API referencetype Record<K extends string | number | symbol, T> = { [P in K]: T; }Construct a type with a set of properties K of type Tblank: stringreserved: stringduplicate: stringfunction openUntrusted(host: HTMLElement, untrusted: unknown): GridAPI referencesnapshotResourceLimits?: Partial<SnapshotResourceLimits> | undefinedOverrides canonical validation/allocation ceilings for this snapshot load.API referencemaxLocalPagedCells?: number | undefinedMost cells in total across local sheets. Local sheets are the sheets of a dense-storage workbook past maxDenseCells, which the engine keeps in pages it never evicts; defaults to 20,000,000, the engine's ceiling. A larger value is capped at the ceiling; 0 refuses every sheet past maxDenseCells.API reference