import type { Canvas } from '../../interfaces/canvas'; import { CollabAction, CollabActionSerialized } from './collab-action'; import { CollabTimestamp } from './primitives'; /** * A collaboration engine, which manages collaboration for a diagram. * @private */ export declare class CollabEngine { /** * Canvas that this collaboration engine belongs to. * @private */ readonly canvas: Canvas; /** * The local replica ID. */ readonly replicaId: string; /** * Event handler for when we request to send a message to the server. */ onSend?: (message: CollabActionSerialized) => void; /** * Whether we have joined (or are joining) a room on the server. */ isInRoom: boolean; constructor(canvas: Canvas); /** * Returns a fresh timestamp, suitable for use by new CollabActions. */ freshTimestamp(): CollabTimestamp; /** * Returns a fresh unique ID, suitable for use by new CollabActions. */ freshId(): string; /** * Performs the action - immediately locally, and eventually for remote collaborators. */ doCollaboratively(action: CollabAction): void; /** * Processes a message received from the server. * * The message is assumed to be non-redundant (in particular, not one of * our own messages) and delivered after all prior messages on the server. */ receive(message: CollabActionSerialized): void; }