import { SavedStateTree } from "../core"; import { Serializer } from "./serializers"; /** * Serializer for a batch of message stacks sent by [[Collab]]s, * represented as an array of `(Uint8Array | string)[]`. * * [[IRuntime]] implementations may use [[instance]] * to convert a batch of Collab messages into a single Uint8Array. * * As a common-case * optimization, this serializer applies suffix compression to * message stacks: shared (string) suffixes will only appear once * in the serialized message. That helps when stacks contain * Collab paths and there are multiple messages from Collabs in * similar parts of the Collab tree. * * This is a singleton class; use [[instance]] * instead of the constructor. */ export declare class MessageStacksSerializer implements Serializer<(Uint8Array | string)[][]> { private constructor(); static instance: MessageStacksSerializer; serialize(value: (string | Uint8Array)[][]): Uint8Array; deserialize(message: Uint8Array): (string | Uint8Array)[][]; private serializeEdgeLabels; private deserializeEdgeLabels; } /** * Serializer for a [[SavedStateTree]], i.e., an output of [[Collab.save]]. * * [[IRuntime]] implementations may use [[instance]] * to convert Collabs's saved states into a single Uint8Array. * * This is a singleton class; use [[instance]] * instead of the constructor. */ export declare class SavedStateTreeSerializer implements Serializer { private constructor(); static instance: SavedStateTreeSerializer; serialize(value: SavedStateTree): Uint8Array; deserialize(message: Uint8Array): SavedStateTree; private toMessage; private fromMessage; }