View as Markdown

API reference: @salmonui/data-grid/engine

LocalDataSourceinterface

import type { LocalDataSource } from '@salmonui/data-grid/engine';

Also exported from @salmonui/data-grid.

interface LocalDataSource<Row> extends DataSource<Row> {
    readonly mode: 'local';
    getRows(): readonly Row[];
    setRows(rows: readonly Row[]): void;
    patch(patch: LocalDataPatch<Row>): void;
    write(request: WriteRequest<Row>): Promise<WriteResult<Row>>;
    subscribe(listener: (event: DataSourceEvent<Row>) => void): () => void;
}
LocalDataSource members (9, 3 inherited)
NameSignatureDescription
modereadonly mode: 'local';
getRowsgetRows(): readonly Row[];
setRowssetRows(rows: readonly Row[]): void;
patchpatch(patch: LocalDataPatch<Row>): void;
writewrite(request: WriteRequest<Row>): Promise<WriteResult<Row>>;
subscribesubscribe(listener: (event: DataSourceEvent<Row>) => void): () => void;
readinheritedread: (request: DataSourceRequest) => DataSourceResult<Row> | Promise<DataSourceResult<Row>>;
invalidateoptionalinheritedinvalidate?: ((scope?: "all" | "counts" | "facets" | "rows" | undefined) => void);

Drops cached results; engine.refresh() calls it with 'all' before re-reading. Must not notify.

capabilitiesoptionalinheritedcapabilities?: Partial<DataSourceCapabilities>;