@sheetwrite/core/shellinterface
Disposable controller for the framework-neutral spreadsheet shell.
- Package
@sheetwrite/core/shell- Source
packages/core/src/shell/spreadsheet-shell.ts#L34
Members 7
grid The single grid the shell owns; use it for data, search, and actions.
readonly 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 →;element The shell's root element (already appended to the mount host).
readonly element: HTMLElement;setTheme
setTheme(theme: Partial<Themeinterface 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 →>): void;setReadOnly
setReadOnly(readOnly: boolean): void;setGridConfig Reconfigure the grid; the shell keeps its own toolbar/tabs suppressed.
setGridConfig(config: GridConfiginterface GridConfig {
toolbar?: boolean | ToolbarItem[];
bold?: boolean;
italic?: boolean;
align?: boolean;
textColor?: boolean;
fillColor?: boolean;
border?: boolean;
clearFormat?: boolean;
merge?: boolean;
sort?: boolean;
export?: boolean;
icons?: Partial<Record<ToolbarActionName, ToolbarIcon>>;
contextMenu?: boolean | ContextMenuItems;
undo?: boolean;
// … 4 more lines — see the API reference
}interface GridConfig {
toolbar?: boolean | ToolbarItem[];
bold?: boolean;
italic?: boolean;
align?: boolean;
textColor?: boolean;
fillColor?: boolean;
border?: boolean;
clearFormat?: boolean;
merge?: boolean;
sort?: boolean;
export?: boolean;
icons?: Partial<Record<ToolbarActionName, ToolbarIcon>>;
contextMenu?: boolean | ContextMenuItems;
undo?: boolean;
// … 4 more lines — see the API reference
}interface GridConfig {
toolbar?:
boolean | ToolbarItem[];
bold?: boolean;
italic?: boolean;
align?: boolean;
textColor?: boolean;
fillColor?: boolean;
border?: boolean;
clearFormat?: boolean;
merge?: boolean;
sort?: boolean;
export?: boolean;
icons?: Partial<
Record<
ToolbarActionName,
ToolbarIcon
>
>;
// … 12 more lines — see the API reference
}Toolbar / feature configuration. When config is set the built-in toolbar is shown; control flags default to true except the opt-in export flag.API reference → | undefined): void;setActiveSheet
setActiveSheet(id: SheetIdtype SheetId = string;type SheetId = string;type SheetId = string;Stable identifier used to address a workbook sheet.API reference →): void;destroy
destroy(): void;Declaration
View full TypeScript declaration
export interface SpreadsheetShell { readonly 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 →; readonly element: HTMLElement; setTheme(theme: Partial<Themeinterface 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 →>): void; setReadOnly(readOnly: boolean): void; setGridConfig(config: GridConfiginterface GridConfig {
toolbar?: boolean | ToolbarItem[];
bold?: boolean;
italic?: boolean;
align?: boolean;
textColor?: boolean;
fillColor?: boolean;
border?: boolean;
clearFormat?: boolean;
merge?: boolean;
sort?: boolean;
export?: boolean;
icons?: Partial<Record<ToolbarActionName, ToolbarIcon>>;
contextMenu?: boolean | ContextMenuItems;
undo?: boolean;
// … 4 more lines — see the API reference
}interface GridConfig {
toolbar?: boolean | ToolbarItem[];
bold?: boolean;
italic?: boolean;
align?: boolean;
textColor?: boolean;
fillColor?: boolean;
border?: boolean;
clearFormat?: boolean;
merge?: boolean;
sort?: boolean;
export?: boolean;
icons?: Partial<Record<ToolbarActionName, ToolbarIcon>>;
contextMenu?: boolean | ContextMenuItems;
undo?: boolean;
// … 4 more lines — see the API reference
}interface GridConfig {
toolbar?:
boolean | ToolbarItem[];
bold?: boolean;
italic?: boolean;
align?: boolean;
textColor?: boolean;
fillColor?: boolean;
border?: boolean;
clearFormat?: boolean;
merge?: boolean;
sort?: boolean;
export?: boolean;
icons?: Partial<
Record<
ToolbarActionName,
ToolbarIcon
>
>;
// … 12 more lines — see the API reference
}Toolbar / feature configuration. When config is set the built-in toolbar is shown; control flags default to true except the opt-in export flag.API reference → | undefined): void; setActiveSheet(id: SheetIdtype SheetId = string;type SheetId = string;type SheetId = string;Stable identifier used to address a workbook sheet.API reference →): void; destroy(): void;}