@sheetwrite/core/shellinterface
Host elements and feature options used to create a spreadsheet shell.
- Package
@sheetwrite/core/shell- Source
packages/core/src/shell/spreadsheet-shell.ts#L22
Members 5
grid Options for the single grid the shell owns.
grid: GridOptionsinterface GridOptions {
workbook: Workbook;
data?: ColumnarData;
datasource?: DataSource;
datasourceStorage?: DataSourceStorageOptions;
renderer?: "canvas" | "worker";
workerUrl?: string | URL;
theme?: Partial<Theme>;
readOnly?: boolean;
protectionResolver?: ProtectionResolver;
mutationPolicy?: MutationPolicyMode;
transactionResourceLimits?: Partial<TransactionResourceLimits>;
renderers?: Record<string, CellRenderer>;
overscan?: number;
minColumns?: number;
// … 2 more lines — see the API reference
}interface GridOptions {
workbook: Workbook;
data?: ColumnarData;
datasource?: DataSource;
datasourceStorage?: DataSourceStorageOptions;
renderer?: "canvas" | "worker";
workerUrl?: string | URL;
theme?: Partial<Theme>;
readOnly?: boolean;
protectionResolver?: ProtectionResolver;
mutationPolicy?: MutationPolicyMode;
transactionResourceLimits?: Partial<TransactionResourceLimits>;
renderers?: Record<string, CellRenderer>;
overscan?: number;
minColumns?: number;
// … 2 more lines — see the API reference
}interface GridOptions {
workbook: Workbook;
data?: ColumnarData;
datasource?: DataSource;
datasourceStorage?: DataSourceStorageOptions;
renderer?: "canvas" | "worker";
workerUrl?: string | URL;
theme?: Partial<Theme>;
readOnly?: boolean;
protectionResolver?: ProtectionResolver;
mutationPolicy?: MutationPolicyMode;
transactionResourceLimits?: Partial<TransactionResourceLimits>;
renderers?: Record<
string,
CellRenderer
>;
overscan?: number;
minColumns?: number;
config?: GridConfig;
}Workbook, data, rendering, policy, and built-in UI options used to create a Grid.API reference →;Options for the single grid the shell owns. `initSheetwrite` must already be awaited.
toolbar Toolbar items (default: the full built-in action set).
toolbar?: readonly ToolbarIteminterface ToolbarItem {
action?: ToolbarActionName;
onClick?: (grid: Grid) => void;
icon?: ToolbarIcon;
title?: string;
}interface ToolbarItem {
action?: ToolbarActionName;
onClick?: (grid: Grid) => void;
icon?: ToolbarIcon;
title?: string;
}interface ToolbarItem {
action?: ToolbarActionName;
onClick?: (grid: Grid) => void;
icon?: ToolbarIcon;
title?: string;
}Built-in, separator, or custom callback item in the grid toolbar.API reference →[];onChange Event callbacks forwarded from the owned grid.
onChange?: (event: ChangeEventinterface 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 →) => void;onSelectionChange
onSelectionChange?: (selection: Selectiontype 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 → | null) => void;onReady
onReady?: (grid: Gridinterface Grid {
readonly store: Store;
readonly actions: GridActions;
setActiveSheet(id: SheetId): void;
scrollToCell(addr: CellAddress): void;
getCellAtPoint(
clientX: number,
clientY: number,
): CellAddress | null;
getActiveSheet(): SheetId;
getCellInput(row: number, col: number): CellInputSnapshot | null;
getSelection(): Selection | null;
setSelection(sel: Selection | null): void;
setTheme(theme: Partial<Theme>): void;
replaceTheme(theme: Partial<Theme> | undefined): void;
// … 106 more lines — see the API reference
}interface Grid {
readonly store: Store;
readonly actions: GridActions;
setActiveSheet(id: SheetId): void;
scrollToCell(addr: CellAddress): void;
getCellAtPoint(
clientX: number,
clientY: number,
): CellAddress | null;
getActiveSheet(): SheetId;
getCellInput(row: number, col: number): CellInputSnapshot | null;
getSelection(): Selection | null;
setSelection(sel: Selection | null): void;
setTheme(theme: Partial<Theme>): void;
replaceTheme(theme: Partial<Theme> | undefined): void;
// … 106 more lines — see the API reference
}interface Grid {
readonly store: Store;
readonly actions: GridActions;
setActiveSheet(
id: SheetId,
): void;
scrollToCell(
addr: CellAddress,
): void;
getCellAtPoint(
clientX: number,
clientY: number,
): CellAddress | null;
getActiveSheet(): SheetId;
getCellInput(
row: number,
col: number,
): CellInputSnapshot | null;
getSelection(): Selection | null;
// … 229 more lines — see the API reference
}Imperative grid handle for document commands, events, rendering, and teardown.API reference →) => void;Declaration
View full TypeScript declaration
export interface SpreadsheetShellOptions { grid: GridOptionsinterface GridOptions {
workbook: Workbook;
data?: ColumnarData;
datasource?: DataSource;
datasourceStorage?: DataSourceStorageOptions;
renderer?: "canvas" | "worker";
workerUrl?: string | URL;
theme?: Partial<Theme>;
readOnly?: boolean;
protectionResolver?: ProtectionResolver;
mutationPolicy?: MutationPolicyMode;
transactionResourceLimits?: Partial<TransactionResourceLimits>;
renderers?: Record<string, CellRenderer>;
overscan?: number;
minColumns?: number;
// … 2 more lines — see the API reference
}interface GridOptions {
workbook: Workbook;
data?: ColumnarData;
datasource?: DataSource;
datasourceStorage?: DataSourceStorageOptions;
renderer?: "canvas" | "worker";
workerUrl?: string | URL;
theme?: Partial<Theme>;
readOnly?: boolean;
protectionResolver?: ProtectionResolver;
mutationPolicy?: MutationPolicyMode;
transactionResourceLimits?: Partial<TransactionResourceLimits>;
renderers?: Record<string, CellRenderer>;
overscan?: number;
minColumns?: number;
// … 2 more lines — see the API reference
}interface GridOptions {
workbook: Workbook;
data?: ColumnarData;
datasource?: DataSource;
datasourceStorage?: DataSourceStorageOptions;
renderer?: "canvas" | "worker";
workerUrl?: string | URL;
theme?: Partial<Theme>;
readOnly?: boolean;
protectionResolver?: ProtectionResolver;
mutationPolicy?: MutationPolicyMode;
transactionResourceLimits?: Partial<TransactionResourceLimits>;
renderers?: Record<
string,
CellRenderer
>;
overscan?: number;
minColumns?: number;
config?: GridConfig;
}Workbook, data, rendering, policy, and built-in UI options used to create a Grid.API reference →; toolbar?: readonly ToolbarIteminterface ToolbarItem {
action?: ToolbarActionName;
onClick?: (grid: Grid) => void;
icon?: ToolbarIcon;
title?: string;
}interface ToolbarItem {
action?: ToolbarActionName;
onClick?: (grid: Grid) => void;
icon?: ToolbarIcon;
title?: string;
}interface ToolbarItem {
action?: ToolbarActionName;
onClick?: (grid: Grid) => void;
icon?: ToolbarIcon;
title?: string;
}Built-in, separator, or custom callback item in the grid toolbar.API reference →[]; onChange?: (event: ChangeEventinterface 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 →) => void; onSelectionChange?: (selection: Selectiontype 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 → | null) => void; onReady?: (grid: Gridinterface Grid {
readonly store: Store;
readonly actions: GridActions;
setActiveSheet(id: SheetId): void;
scrollToCell(addr: CellAddress): void;
getCellAtPoint(
clientX: number,
clientY: number,
): CellAddress | null;
getActiveSheet(): SheetId;
getCellInput(row: number, col: number): CellInputSnapshot | null;
getSelection(): Selection | null;
setSelection(sel: Selection | null): void;
setTheme(theme: Partial<Theme>): void;
replaceTheme(theme: Partial<Theme> | undefined): void;
// … 106 more lines — see the API reference
}interface Grid {
readonly store: Store;
readonly actions: GridActions;
setActiveSheet(id: SheetId): void;
scrollToCell(addr: CellAddress): void;
getCellAtPoint(
clientX: number,
clientY: number,
): CellAddress | null;
getActiveSheet(): SheetId;
getCellInput(row: number, col: number): CellInputSnapshot | null;
getSelection(): Selection | null;
setSelection(sel: Selection | null): void;
setTheme(theme: Partial<Theme>): void;
replaceTheme(theme: Partial<Theme> | undefined): void;
// … 106 more lines — see the API reference
}interface Grid {
readonly store: Store;
readonly actions: GridActions;
setActiveSheet(
id: SheetId,
): void;
scrollToCell(
addr: CellAddress,
): void;
getCellAtPoint(
clientX: number,
clientY: number,
): CellAddress | null;
getActiveSheet(): SheetId;
getCellInput(
row: number,
col: number,
): CellInputSnapshot | null;
getSelection(): Selection | null;
// … 229 more lines — see the API reference
}Imperative grid handle for document commands, events, rendering, and teardown.API reference →) => void;}