Owns initialization, replacement, publication, and retirement for framework adapters.
Declaration
function createAdapterGridController<
Referenced by
Workspace packages depending on @sheetwrite/core
@sheetwrite/benchdependency
@sheetwrite/docs-startdependency
@sheetwrite/reactdependency
@sheetwrite/sveltedependency
@sheetwrite/vuedependency
@sheetwrite/xlsxdependency
Public exports naming createAdapterGridController
type RowBridgeId = string | number;type RowBridgeId = string | number;type RowBridgeId =
string | number;A stable host identity for one data-space row.API reference →interface GridAdapterEventHandlers<
Id extends RowBridgeId = RowBridgeId,
> {
onGridChange?: (event: ChangeEvent) => void;
onRowDelta?: RowBridgeHandler<Id>;
onSelectionChange?: (selection: Selection | null) => void;
onViewportChange?: (event: GridEvents["scroll"]) => void;
onEditBegin?: (event: GridEvents["edit-begin"]) => void;
onEditCommit?: (event: GridEvents["edit-commit"]) => void;
onSearch?: (result: GridEvents["search"]) => void;
onActiveSheetChange?: (event: GridEvents["active-sheet"]) => void;
onCommandStateChange?: (
event: GridEvents["command-state-change"],
) => void;
onMutationRejected?: (
// … 12 more lines — see the API reference
}interface GridAdapterEventHandlers<
Id extends RowBridgeId = RowBridgeId,
> {
onGridChange?: (event: ChangeEvent) => void;
onRowDelta?: RowBridgeHandler<Id>;
onSelectionChange?: (selection: Selection | null) => void;
onViewportChange?: (event: GridEvents["scroll"]) => void;
onEditBegin?: (event: GridEvents["edit-begin"]) => void;
onEditCommit?: (event: GridEvents["edit-commit"]) => void;
onSearch?: (result: GridEvents["search"]) => void;
onActiveSheetChange?: (event: GridEvents["active-sheet"]) => void;
onCommandStateChange?: (
event: GridEvents["command-state-change"],
) => void;
onMutationRejected?: (
// … 12 more lines — see the API reference
}interface GridAdapterEventHandlers<
Id extends RowBridgeId =
RowBridgeId,
> {
onGridChange?: (
event: ChangeEvent,
) => void;
onRowDelta?: RowBridgeHandler<Id>;
onSelectionChange?: (
selection: Selection | null,
) => void;
onViewportChange?: (
event: GridEvents["scroll"],
) => void;
onEditBegin?: (
event: GridEvents["edit-begin"],
) => void;
onEditCommit?: (
event: GridEvents["edit-commit"],
// … 29 more lines — see the API reference
}Framework-neutral readiness, change, and error callbacks shared by adapters.API reference →interface GridPublicationAdapter {
publish(grid: Grid | null): void | Promise<void>;
setInitializationState(
state: "loading" | "ready" | "error",
): void;
reportConsumerFailure(thrown: unknown): void;
}interface GridPublicationAdapter {
publish(grid: Grid | null): void | Promise<void>;
setInitializationState(
state: "loading" | "ready" | "error",
): void;
reportConsumerFailure(thrown: unknown): void;
}interface GridPublicationAdapter {
publish(
grid: Grid | null,
): void | Promise<void>;
setInitializationState(
state:
| "loading"
| "ready"
| "error",
): void;
reportConsumerFailure(
thrown: unknown,
): void;
}Inbound hooks implemented by framework adapters for scheduling and imperative-handle publication.API reference →interface AdapterGridController<
Id extends RowBridgeId = RowBridgeId,
> {
mount(host: HTMLElement, input: AdapterGridInput<Id>): void;
update(input: AdapterGridInput<Id>): void;
unmount(): void;
}interface AdapterGridController<
Id extends RowBridgeId = RowBridgeId,
> {
mount(host: HTMLElement, input: AdapterGridInput<Id>): void;
update(input: AdapterGridInput<Id>): void;
unmount(): void;
}interface AdapterGridController<
Id extends RowBridgeId =
RowBridgeId,
> {
mount(
host: HTMLElement,
input: AdapterGridInput<Id>,
): void;
update(
input: AdapterGridInput<Id>,
): void;
unmount(): void;
}Owns adapter attachment and monotonically numbered Grid generations.API reference →