@sheetwrite/coretype
Queue, version, connection, or error transition emitted by synchronization.
- Package
@sheetwrite/core- Source
packages/core/src/sync.ts#L202
Variants 12
{ type: "state"; state: SyncStateSnapshotinterface SyncStateSnapshot {
connection: SyncConnectionState;
activity: SyncActivityState;
pendingCount: number;
pendingOperations: number;
pendingEncodedBytes: number;
pendingCapacity: SyncPendingCapacityState;
serverVersion: number;
}interface SyncStateSnapshot {
connection: SyncConnectionState;
activity: SyncActivityState;
pendingCount: number;
pendingOperations: number;
pendingEncodedBytes: number;
pendingCapacity: SyncPendingCapacityState;
serverVersion: number;
}interface SyncStateSnapshot {
connection: SyncConnectionState;
activity: SyncActivityState;
pendingCount: number;
pendingOperations: number;
pendingEncodedBytes: number;
pendingCapacity: SyncPendingCapacityState;
serverVersion: number;
}Immutable observable synchronization state.API reference → }{ type: "restored"; pending: readonly SyncMutationRecordinterface SyncMutationRecord {
status: SyncMutationStatus;
documentId: string;
baseVersion: number;
clientMutationId: string;
readonly operations: readonly DocumentOp[];
}interface SyncMutationRecord {
status: SyncMutationStatus;
documentId: string;
baseVersion: number;
clientMutationId: string;
readonly operations: readonly DocumentOp[];
}interface SyncMutationRecord {
status: SyncMutationStatus;
documentId: string;
baseVersion: number;
clientMutationId: string;
readonly operations: readonly DocumentOp[];
}Pending commit paired with its current synchronization status.API reference →[] }{ type: "persisting"; mutation: SyncMutationRecordinterface SyncMutationRecord {
status: SyncMutationStatus;
documentId: string;
baseVersion: number;
clientMutationId: string;
readonly operations: readonly DocumentOp[];
}interface SyncMutationRecord {
status: SyncMutationStatus;
documentId: string;
baseVersion: number;
clientMutationId: string;
readonly operations: readonly DocumentOp[];
}interface SyncMutationRecord {
status: SyncMutationStatus;
documentId: string;
baseVersion: number;
clientMutationId: string;
readonly operations: readonly DocumentOp[];
}Pending commit paired with its current synchronization status.API reference → }{ type: "pending"; mutation: SyncMutationRecordinterface SyncMutationRecord {
status: SyncMutationStatus;
documentId: string;
baseVersion: number;
clientMutationId: string;
readonly operations: readonly DocumentOp[];
}interface SyncMutationRecord {
status: SyncMutationStatus;
documentId: string;
baseVersion: number;
clientMutationId: string;
readonly operations: readonly DocumentOp[];
}interface SyncMutationRecord {
status: SyncMutationStatus;
documentId: string;
baseVersion: number;
clientMutationId: string;
readonly operations: readonly DocumentOp[];
}Pending commit paired with its current synchronization status.API reference → }{ type: "sending"; mutation: SyncMutationRecordinterface SyncMutationRecord {
status: SyncMutationStatus;
documentId: string;
baseVersion: number;
clientMutationId: string;
readonly operations: readonly DocumentOp[];
}interface SyncMutationRecord {
status: SyncMutationStatus;
documentId: string;
baseVersion: number;
clientMutationId: string;
readonly operations: readonly DocumentOp[];
}interface SyncMutationRecord {
status: SyncMutationStatus;
documentId: string;
baseVersion: number;
clientMutationId: string;
readonly operations: readonly DocumentOp[];
}Pending commit paired with its current synchronization status.API reference → }{ type: "acknowledged"; clientMutationId: string; version: number; duplicate: boolean;}{ type: "conflict"; mutation: SyncMutationRecordinterface SyncMutationRecord {
status: SyncMutationStatus;
documentId: string;
baseVersion: number;
clientMutationId: string;
readonly operations: readonly DocumentOp[];
}interface SyncMutationRecord {
status: SyncMutationStatus;
documentId: string;
baseVersion: number;
clientMutationId: string;
readonly operations: readonly DocumentOp[];
}interface SyncMutationRecord {
status: SyncMutationStatus;
documentId: string;
baseVersion: number;
clientMutationId: string;
readonly operations: readonly DocumentOp[];
}Pending commit paired with its current synchronization status.API reference →; response: Extract<PersistenceCommitResponsetype PersistenceCommitResponse =
| { status: "applied"; version: number; clientMutationId: string }
| {
status: "duplicate";
version: number;
clientMutationId: string;
}
| {
status: "conflict";
currentVersion: number;
operationsSinceBase?: readonly VersionedOperation[];
snapshot?: WorkbookSnapshot;
};type PersistenceCommitResponse =
| { status: "applied"; version: number; clientMutationId: string }
| {
status: "duplicate";
version: number;
clientMutationId: string;
}
| {
status: "conflict";
currentVersion: number;
operationsSinceBase?: readonly VersionedOperation[];
snapshot?: WorkbookSnapshot;
};type PersistenceCommitResponse =
| {
status: "applied";
version: number;
clientMutationId: string;
}
| {
status: "duplicate";
version: number;
clientMutationId: string;
}
| {
status: "conflict";
currentVersion: number;
operationsSinceBase?: readonly VersionedOperation[];
snapshot?: WorkbookSnapshot;
};Applied, duplicate, or conflict acknowledgement from persistence. applied confirms the submitted operations unchanged; normalization must conflict.API reference →, { status: "conflict" }>;}{ type: "remote-applied"; operation: VersionedOperationinterface VersionedOperation {
version: number;
readonly operations: readonly DocumentOp[];
clientMutationId?: string;
}interface VersionedOperation {
version: number;
readonly operations: readonly DocumentOp[];
clientMutationId?: string;
}interface VersionedOperation {
version: number;
readonly operations: readonly DocumentOp[];
clientMutationId?: string;
}Remote document operations paired with a contiguous server version.API reference → }{ type: "reload-required"; expectedVersion: number; receivedVersion: number; snapshot?: WorkbookSnapshotinterface WorkbookSnapshot {
schemaVersion: 1;
documentId?: string;
version?: number;
workbook: {
activeSheet: SheetId;
namedRanges?: NamedRangeSnapshot[];
};
sheets: SheetSnapshot[];
}interface WorkbookSnapshot {
schemaVersion: 1;
documentId?: string;
version?: number;
workbook: {
activeSheet: SheetId;
namedRanges?: NamedRangeSnapshot[];
};
sheets: SheetSnapshot[];
}interface WorkbookSnapshot {
schemaVersion: 1;
documentId?: string;
version?: number;
workbook: {
activeSheet: SheetId;
namedRanges?: NamedRangeSnapshot[];
};
sheets: SheetSnapshot[];
}Schema-versioned serializable workbook document.API reference →;}{ type: "reloaded"; serverVersion: number; pending: readonly SyncMutationRecordinterface SyncMutationRecord {
status: SyncMutationStatus;
documentId: string;
baseVersion: number;
clientMutationId: string;
readonly operations: readonly DocumentOp[];
}interface SyncMutationRecord {
status: SyncMutationStatus;
documentId: string;
baseVersion: number;
clientMutationId: string;
readonly operations: readonly DocumentOp[];
}interface SyncMutationRecord {
status: SyncMutationStatus;
documentId: string;
baseVersion: number;
clientMutationId: string;
readonly operations: readonly DocumentOp[];
}Pending commit paired with its current synchronization status.API reference →[];}{ type: "storage-error"; error: unknown; clientMutationId?: string;}{ type: "error"; error: unknown; clientMutationId?: string }Declaration
View full TypeScript declaration
export type SyncCoordinatorEvent = | { type: "state"; state: SyncStateSnapshotinterface SyncStateSnapshot {
connection: SyncConnectionState;
activity: SyncActivityState;
pendingCount: number;
pendingOperations: number;
pendingEncodedBytes: number;
pendingCapacity: SyncPendingCapacityState;
serverVersion: number;
}interface SyncStateSnapshot {
connection: SyncConnectionState;
activity: SyncActivityState;
pendingCount: number;
pendingOperations: number;
pendingEncodedBytes: number;
pendingCapacity: SyncPendingCapacityState;
serverVersion: number;
}interface SyncStateSnapshot {
connection: SyncConnectionState;
activity: SyncActivityState;
pendingCount: number;
pendingOperations: number;
pendingEncodedBytes: number;
pendingCapacity: SyncPendingCapacityState;
serverVersion: number;
}Immutable observable synchronization state.API reference →; } | { type: "restored"; pending: readonly SyncMutationRecordinterface SyncMutationRecord {
status: SyncMutationStatus;
documentId: string;
baseVersion: number;
clientMutationId: string;
readonly operations: readonly DocumentOp[];
}interface SyncMutationRecord {
status: SyncMutationStatus;
documentId: string;
baseVersion: number;
clientMutationId: string;
readonly operations: readonly DocumentOp[];
}interface SyncMutationRecord {
status: SyncMutationStatus;
documentId: string;
baseVersion: number;
clientMutationId: string;
readonly operations: readonly DocumentOp[];
}Pending commit paired with its current synchronization status.API reference →[]; } | { type: "persisting"; mutation: SyncMutationRecordinterface SyncMutationRecord {
status: SyncMutationStatus;
documentId: string;
baseVersion: number;
clientMutationId: string;
readonly operations: readonly DocumentOp[];
}interface SyncMutationRecord {
status: SyncMutationStatus;
documentId: string;
baseVersion: number;
clientMutationId: string;
readonly operations: readonly DocumentOp[];
}interface SyncMutationRecord {
status: SyncMutationStatus;
documentId: string;
baseVersion: number;
clientMutationId: string;
readonly operations: readonly DocumentOp[];
}Pending commit paired with its current synchronization status.API reference →; } | { type: "pending"; mutation: SyncMutationRecordinterface SyncMutationRecord {
status: SyncMutationStatus;
documentId: string;
baseVersion: number;
clientMutationId: string;
readonly operations: readonly DocumentOp[];
}interface SyncMutationRecord {
status: SyncMutationStatus;
documentId: string;
baseVersion: number;
clientMutationId: string;
readonly operations: readonly DocumentOp[];
}interface SyncMutationRecord {
status: SyncMutationStatus;
documentId: string;
baseVersion: number;
clientMutationId: string;
readonly operations: readonly DocumentOp[];
}Pending commit paired with its current synchronization status.API reference →; } | { type: "sending"; mutation: SyncMutationRecordinterface SyncMutationRecord {
status: SyncMutationStatus;
documentId: string;
baseVersion: number;
clientMutationId: string;
readonly operations: readonly DocumentOp[];
}interface SyncMutationRecord {
status: SyncMutationStatus;
documentId: string;
baseVersion: number;
clientMutationId: string;
readonly operations: readonly DocumentOp[];
}interface SyncMutationRecord {
status: SyncMutationStatus;
documentId: string;
baseVersion: number;
clientMutationId: string;
readonly operations: readonly DocumentOp[];
}Pending commit paired with its current synchronization status.API reference →; } | { type: "acknowledged"; clientMutationId: string; version: number; duplicate: boolean; } | { type: "conflict"; mutation: SyncMutationRecordinterface SyncMutationRecord {
status: SyncMutationStatus;
documentId: string;
baseVersion: number;
clientMutationId: string;
readonly operations: readonly DocumentOp[];
}interface SyncMutationRecord {
status: SyncMutationStatus;
documentId: string;
baseVersion: number;
clientMutationId: string;
readonly operations: readonly DocumentOp[];
}interface SyncMutationRecord {
status: SyncMutationStatus;
documentId: string;
baseVersion: number;
clientMutationId: string;
readonly operations: readonly DocumentOp[];
}Pending commit paired with its current synchronization status.API reference →; response: Extract< PersistenceCommitResponsetype PersistenceCommitResponse =
| { status: "applied"; version: number; clientMutationId: string }
| {
status: "duplicate";
version: number;
clientMutationId: string;
}
| {
status: "conflict";
currentVersion: number;
operationsSinceBase?: readonly VersionedOperation[];
snapshot?: WorkbookSnapshot;
};type PersistenceCommitResponse =
| { status: "applied"; version: number; clientMutationId: string }
| {
status: "duplicate";
version: number;
clientMutationId: string;
}
| {
status: "conflict";
currentVersion: number;
operationsSinceBase?: readonly VersionedOperation[];
snapshot?: WorkbookSnapshot;
};type PersistenceCommitResponse =
| {
status: "applied";
version: number;
clientMutationId: string;
}
| {
status: "duplicate";
version: number;
clientMutationId: string;
}
| {
status: "conflict";
currentVersion: number;
operationsSinceBase?: readonly VersionedOperation[];
snapshot?: WorkbookSnapshot;
};Applied, duplicate, or conflict acknowledgement from persistence. applied confirms the submitted operations unchanged; normalization must conflict.API reference →, { status: "conflict"; } >; } | { type: "remote-applied"; operation: VersionedOperationinterface VersionedOperation {
version: number;
readonly operations: readonly DocumentOp[];
clientMutationId?: string;
}interface VersionedOperation {
version: number;
readonly operations: readonly DocumentOp[];
clientMutationId?: string;
}interface VersionedOperation {
version: number;
readonly operations: readonly DocumentOp[];
clientMutationId?: string;
}Remote document operations paired with a contiguous server version.API reference →; } | { type: "reload-required"; expectedVersion: number; receivedVersion: number; snapshot?: WorkbookSnapshotinterface WorkbookSnapshot {
schemaVersion: 1;
documentId?: string;
version?: number;
workbook: {
activeSheet: SheetId;
namedRanges?: NamedRangeSnapshot[];
};
sheets: SheetSnapshot[];
}interface WorkbookSnapshot {
schemaVersion: 1;
documentId?: string;
version?: number;
workbook: {
activeSheet: SheetId;
namedRanges?: NamedRangeSnapshot[];
};
sheets: SheetSnapshot[];
}interface WorkbookSnapshot {
schemaVersion: 1;
documentId?: string;
version?: number;
workbook: {
activeSheet: SheetId;
namedRanges?: NamedRangeSnapshot[];
};
sheets: SheetSnapshot[];
}Schema-versioned serializable workbook document.API reference →; } | { type: "reloaded"; serverVersion: number; pending: readonly SyncMutationRecordinterface SyncMutationRecord {
status: SyncMutationStatus;
documentId: string;
baseVersion: number;
clientMutationId: string;
readonly operations: readonly DocumentOp[];
}interface SyncMutationRecord {
status: SyncMutationStatus;
documentId: string;
baseVersion: number;
clientMutationId: string;
readonly operations: readonly DocumentOp[];
}interface SyncMutationRecord {
status: SyncMutationStatus;
documentId: string;
baseVersion: number;
clientMutationId: string;
readonly operations: readonly DocumentOp[];
}Pending commit paired with its current synchronization status.API reference →[]; } | { type: "storage-error"; error: unknown; clientMutationId?: string; } | { type: "error"; error: unknown; clientMutationId?: string; };