Projects canonical document transactions into host-owned row changes.
The bridge only owns compact data-space identity arrays. It never writes to
defaultRows, never renders, and never creates a second document store.
Members 5
constructor
columnKeys Current semantic column keys in canonical column order.
columnKeys: (sheet?: SheetId) => readonly string[];
project Project an applied Grid change as an accepted, transformed, or remote result.
reconcile Reconcile a canonical transaction response without synchronizing host rows implicitly.
rowIds Current data-space row identities; visual sort and filters do not affect this order.
rowIds: (sheet?: SheetId) => readonly (Id | null)[]
Declaration
View full TypeScript declaration
columnKeys: (sheet?: SheetId) => readonly string[]; rowIds: (sheet?: SheetId) => readonly (Id | null)[];
Referenced by
Workspace packages depending on @sheetwrite/svelte
@sheetwrite/docs-startdependency
Public exports naming RowBridge
type RowBridgeId = string | number;type RowBridgeId = string | number;type RowBridgeId =
string | number;A stable host identity for one data-space row.API reference →type CellScalar = string | number | boolean | null;type CellScalar = string | number | boolean | null;type CellScalar =
| string
| number
| boolean
| null;A scalar that can be displayed directly.API reference →interface RowBridgeOptions<
Row extends Record<string, CellScalar>,
Id extends RowBridgeId = RowBridgeId,
> {
readonly columns: readonly RowBridgeColumn<Row>[];
readonly defaultRows: readonly Row[];
readonly getRowId: (row: Row, index: number) => Id;
readonly sheet?: SheetId;
readonly createRowId?: (context: RowBridgeInsertContext) => Id;
readonly maxRecentTransactions?: number;
}interface RowBridgeOptions<
Row extends Record<string, CellScalar>,
Id extends RowBridgeId = RowBridgeId,
> {
readonly columns: readonly RowBridgeColumn<Row>[];
readonly defaultRows: readonly Row[];
readonly getRowId: (row: Row, index: number) => Id;
readonly sheet?: SheetId;
readonly createRowId?: (context: RowBridgeInsertContext) => Id;
readonly maxRecentTransactions?: number;
}interface RowBridgeOptions<
Row extends Record<
string,
CellScalar
>,
Id extends RowBridgeId =
RowBridgeId,
> {
readonly columns: readonly RowBridgeColumn<Row>[];
readonly defaultRows: readonly Row[];
readonly getRowId: (
row: Row,
index: number,
) => Id;
readonly sheet?: SheetId;
readonly createRowId?: (
context: RowBridgeInsertContext,
) => Id;
readonly maxRecentTransactions?: number;
}Options for the framework-neutral, opt-in row bridge.API reference →type SheetId = string;type SheetId = string;type SheetId = string;Stable identifier used to address a workbook sheet.API reference →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 DocumentOp =
| {
op: "set";
addr: CellAddress;
value: CellValue;
style?: CellStyle;
}
| { op: "setRange"; range: Range; cells: SnapshotCell[] }
| { op: "setBlock"; range: Range; block: PackedCellBlock }
| {
op: "restoreBlock";
range: Range;
encoding: "deflate-json-v1";
decodedBytes: number;
data: string;
// … 100 more lines — see the API reference
}type DocumentOp =
| {
op: "set";
addr: CellAddress;
value: CellValue;
style?: CellStyle;
}
| { op: "setRange"; range: Range; cells: SnapshotCell[] }
| { op: "setBlock"; range: Range; block: PackedCellBlock }
| {
op: "restoreBlock";
range: Range;
encoding: "deflate-json-v1";
decodedBytes: number;
data: string;
// … 100 more lines — see the API reference
}type DocumentOp =
| {
op: "set";
addr: CellAddress;
value: CellValue;
style?: CellStyle;
}
| {
op: "setRange";
range: Range;
cells: SnapshotCell[];
}
| {
op: "setBlock";
range: Range;
block: PackedCellBlock;
}
| {
op: "restoreBlock";
// … 175 more lines — see the API reference
}Exhaustive serializable operation union for workbook mutations.API reference →interface RowBridgeProjection<
Id extends RowBridgeId = RowBridgeId,
> {
readonly status: RowBridgeReconciliationStatus;
readonly transaction: RowBridgeTransaction;
readonly deltas: readonly RowBridgeDelta<Id>[];
}interface RowBridgeProjection<
Id extends RowBridgeId = RowBridgeId,
> {
readonly status: RowBridgeReconciliationStatus;
readonly transaction: RowBridgeTransaction;
readonly deltas: readonly RowBridgeDelta<Id>[];
}interface RowBridgeProjection<
Id extends RowBridgeId =
RowBridgeId,
> {
readonly status: RowBridgeReconciliationStatus;
readonly transaction: RowBridgeTransaction;
readonly deltas: readonly RowBridgeDelta<Id>[];
}Result of projection or reconciliation.API reference →interface RowBridgeReconciliationInput<
Id extends RowBridgeId = RowBridgeId,
> {
readonly status: RowBridgeReconciliationStatus;
readonly transactionId?: string;
readonly source?: OperationSource;
readonly version?: number;
readonly operations?: readonly DocumentOp[];
readonly requestedOperations?: readonly DocumentOp[];
readonly event?: ChangeEvent;
readonly commitReason?: CommitReason;
readonly _type?: Id;
}interface RowBridgeReconciliationInput<
Id extends RowBridgeId = RowBridgeId,
> {
readonly status: RowBridgeReconciliationStatus;
readonly transactionId?: string;
readonly source?: OperationSource;
readonly version?: number;
readonly operations?: readonly DocumentOp[];
readonly requestedOperations?: readonly DocumentOp[];
readonly event?: ChangeEvent;
readonly commitReason?: CommitReason;
readonly _type?: Id;
}interface RowBridgeReconciliationInput<
Id extends RowBridgeId =
RowBridgeId,
> {
readonly status: RowBridgeReconciliationStatus;
readonly transactionId?: string;
readonly source?: OperationSource;
readonly version?: number;
readonly operations?: readonly DocumentOp[];
readonly requestedOperations?: readonly DocumentOp[];
readonly event?: ChangeEvent;
readonly commitReason?: CommitReason;
readonly _type?: Id;
}Input to RowBridge.reconcile.API reference →