UNPKG

synapse-react-client

Version:

[![npm version](https://badge.fury.io/js/synapse-react-client.svg)](https://badge.fury.io/js/synapse-react-client) [![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettie

49 lines 1.52 kB
import { GridModel } from '@/components/DataGrid/DataGridTypes'; type DataGridWebSocketConstructorArgs = { replicaId: number; url: string; onGridReady?: () => void; onStatusChange?: (isOpen: boolean, instance: DataGridWebSocket) => void; onModelCreate?: (model: GridModel) => void; maxPayloadSizeBytes?: number; socket?: WebSocket; model?: GridModel | null; patchThrottleMs?: number; }; export declare class DataGridWebSocket { private socket; private model; private messageCounter; private replicaId; private verboseEncoder; private maxPayloadSizeBytes; private throttledSendPatch; private snapshotDecoder; private onModelCreate; private onGridReady; private onStatusChange; constructor(args: DataGridWebSocketConstructorArgs); private attachSocketHandlers; disconnect(): void; /** * Flushes the local model clock and sends the resulting patch (or a clock-sync * message) to the server so that both sides converge. */ private sendClockSync; private handleMessage; private handleResponse; private handlePatchPayload; private handleSnapshotPayload; private handleResponseComplete; private handleNotification; private sendMessage; sendPatch(): void; /** * @returns true if one or more patches were sent */ private sendPatchImmediate; private sendSyncMessage; private fetchAndDecodeSnapshot; } export {}; //# sourceMappingURL=DataGridWebSocket.d.ts.map