Payload map for events emitted by a Grid.
Members 14
change
selection
scroll
scroll: { scrollTop: number; firstRow: number; lastRow: number; scrollLeft: number; firstVisibleColumn: number | null; lastVisibleColumn: number | null; };
edit-begin
edit-commit
search
command-state-change Command availability or formatting activity changed.
mutation-rejected
active-sheet Emitted after the visible sheet changes (direct call or cross-sheet scroll).
"active-sheet": { sheet: SheetId };
hyperlink-activate
"hyperlink-activate": HyperlinkActivationEvent;
theme-change Emitted after setTheme or replaceTheme changes the base theme.
"theme-change": { theme: Theme };
Emitted after `setTheme` or `replaceTheme` changes the base theme. Holds a copy.
renderer-fallback Emitted once when the worker renderer could not be constructed and the grid fell back to the main-thread canvas renderer.
datasource-error
export-error Built-in toolbar/context-menu export failed after its action was dispatched.
Declaration
View full TypeScript declaration
export interface GridEvents {
firstVisibleColumn: number | null;
lastVisibleColumn: number | null;
"hyperlink-activate": HyperlinkActivationEvent;
Referenced by
Workspace packages depending on @sheetwrite/core
@sheetwrite/benchdependency
@sheetwrite/docs-startdependency
@sheetwrite/reactdependency
@sheetwrite/sveltedependency
@sheetwrite/vuedependency
@sheetwrite/xlsxdependency
Public exports naming GridEvents
interface ChangeEvent {
transaction: Transaction;
changes: CellChange[];
commitReason: CommitReason;
source: OperationSource;
epoch?: number;
}interface ChangeEvent {
transaction: Transaction;
changes: CellChange[];
commitReason: CommitReason;
source: OperationSource;
epoch?: number;
}interface ChangeEvent {
transaction: Transaction;
changes: CellChange[];
commitReason: CommitReason;
source: OperationSource;
epoch?: number;
}Payload of the change event; flows OUT for API submission/reconcile.API reference →type Selection =
| { kind: "cell"; addr: CellAddress }
| { kind: "range"; range: Range }
| { kind: "row"; sheet: SheetId; row: number }
| { kind: "column"; sheet: SheetId; col: number }
| { kind: "multi"; ranges: Range[] };type Selection =
| { kind: "cell"; addr: CellAddress }
| { kind: "range"; range: Range }
| { kind: "row"; sheet: SheetId; row: number }
| { kind: "column"; sheet: SheetId; col: number }
| { kind: "multi"; ranges: Range[] };type Selection =
| {
kind: "cell";
addr: CellAddress;
}
| {
kind: "range";
range: Range;
}
| {
kind: "row";
sheet: SheetId;
row: number;
}
| {
kind: "column";
sheet: SheetId;
col: number;
}
// … 4 more lines — see the API reference
}Current cell, range, row, column, or multi-range selection.API reference →interface CellAddress {
sheet: SheetId;
row: number;
col: number;
}interface CellAddress {
sheet: SheetId;
row: number;
col: number;
}interface CellAddress {
sheet: SheetId;
row: number;
col: number;
}Zero-based address of one cell on a stable sheet ID.API reference →type CellValue =
| { kind: "literal"; value: CellScalar }
| { kind: "ref"; target: CellAddress }
| { kind: "formula"; src: string };type CellValue =
| { kind: "literal"; value: CellScalar }
| { kind: "ref"; target: CellAddress }
| { kind: "formula"; src: string };type CellValue =
| {
kind: "literal";
value: CellScalar;
}
| {
kind: "ref";
target: CellAddress;
}
| {
kind: "formula";
src: string;
};A cell's persisted input: a literal, a cross-reference, or a formula. References resolve through the store's reference graph; formulas resolve in the WASM calculation engine.API reference →interface SearchResult {
query: string;
matches: CellAddress[];
active: number;
}interface SearchResult {
query: string;
matches: CellAddress[];
active: number;
}interface SearchResult {
query: string;
matches: CellAddress[];
active: number;
}Ordered matches and active index produced by a grid search.API reference →interface GridCommandStateChangeEvent {
readonly states: Readonly<
Record<GridCommandName, GridCommandState>
>;
}interface GridCommandStateChangeEvent {
readonly states: Readonly<
Record<GridCommandName, GridCommandState>
>;
}interface GridCommandStateChangeEvent {
readonly states: Readonly<
Record<
GridCommandName,
GridCommandState
>
>;
}Complete command-state snapshot emitted whenever availability or activity can change.API reference →type MutationIssue =
| {
kind: "validation";
severity: "error" | "warning";
ruleId: string;
addr: CellAddress;
value: CellValue;
message: string;
operationIndex: number;
}
| {
kind: "protection";
severity: "error";
protectedRangeId: string;
range: Range;
// … 33 more lines — see the API reference
}type MutationIssue =
| {
kind: "validation";
severity: "error" | "warning";
ruleId: string;
addr: CellAddress;
value: CellValue;
message: string;
operationIndex: number;
}
| {
kind: "protection";
severity: "error";
protectedRangeId: string;
range: Range;
// … 33 more lines — see the API reference
}type MutationIssue =
| {
kind: "validation";
severity:
"error" | "warning";
ruleId: string;
addr: CellAddress;
value: CellValue;
message: string;
operationIndex: number;
}
| {
kind: "protection";
severity: "error";
protectedRangeId: string;
range: Range;
operationIndex: number;
message: string;
}
// … 30 more lines — see the API reference
}Structured warning or rejection produced while applying an operation.API reference →type SheetId = string;type SheetId = string;type SheetId = string;Stable identifier used to address a workbook sheet.API reference →interface Theme {
font: string;
bg: string;
fg: string;
gridLine: string;
headerBg: string;
headerFg: string;
selection: string;
selectionBorder: string;
rowHeight: number;
headerHeight: number;
rowHeaderWidth: number;
searchMatch: string;
searchActiveMatch: string;
highlight: string;
}interface Theme {
font: string;
bg: string;
fg: string;
gridLine: string;
headerBg: string;
headerFg: string;
selection: string;
selectionBorder: string;
rowHeight: number;
headerHeight: number;
rowHeaderWidth: number;
searchMatch: string;
searchActiveMatch: string;
highlight: string;
}interface Theme {
font: string;
bg: string;
fg: string;
gridLine: string;
headerBg: string;
headerFg: string;
selection: string;
selectionBorder: string;
rowHeight: number;
headerHeight: number;
rowHeaderWidth: number;
searchMatch: string;
searchActiveMatch: string;
highlight: string;
}Resolved canvas colors, typography, and geometry used for painting.API reference →class SheetwriteError
extends Error
implements SheetwriteErrorEnvelope
{
constructor(
code: SheetwriteErrorCode,
operation: SheetwriteErrorOperation,
message: string,
options?: SheetwriteErrorOptions,
);
code:
| "aborted"
| "batch-limit"
| "blocked"
| "buffer-byte-limit"
// … 78 more lines — see the API reference
}class SheetwriteError
extends Error
implements SheetwriteErrorEnvelope
{
constructor(
code: SheetwriteErrorCode,
operation: SheetwriteErrorOperation,
message: string,
options?: SheetwriteErrorOptions,
);
code:
| "aborted"
| "batch-limit"
| "blocked"
| "buffer-byte-limit"
// … 78 more lines — see the API reference
}class SheetwriteError
extends Error
implements
SheetwriteErrorEnvelope
{
constructor(
code: SheetwriteErrorCode,
operation: SheetwriteErrorOperation,
message: string,
options?: SheetwriteErrorOptions,
);
code:
| "aborted"
| "batch-limit"
| "blocked"
| "buffer-byte-limit"
| "buffer-count-limit"
| "buffer-operation-limit"
| "comment-failed"
// … 80 more lines — see the API reference
}Canonical envelope for thrown and callback-delivered Sheetwrite failures.API reference →interface DataSourceRequest {
protocol: 2;
sheet: SheetId;
start: number;
end: number;
columns: readonly DataSourceColumnBand[];
signal: AbortSignal;
revision: number;
}interface DataSourceRequest {
protocol: 2;
sheet: SheetId;
start: number;
end: number;
columns: readonly DataSourceColumnBand[];
signal: AbortSignal;
revision: number;
}interface DataSourceRequest {
protocol: 2;
sheet: SheetId;
start: number;
end: number;
columns: readonly DataSourceColumnBand[];
signal: AbortSignal;
revision: number;
}Cancellable sheet rectangle requested from a DataSource.API reference →