UNPKG

json-joy

Version:

Collection of libraries for building collaborative editing apps.

33 lines (32 loc) 1.58 kB
import * as nodes from '../../../nodes'; import { ClockEncoder } from '../../../../json-crdt-patch/codec/clock/ClockEncoder'; import { CrdtWriter } from '../../../../json-crdt-patch/util/binary/CrdtWriter'; import { type ITimestampStruct } from '../../../../json-crdt-patch/clock'; import { CborEncoder } from '@jsonjoy.com/json-pack/lib/cbor/CborEncoder'; import { CRDT_MAJOR_OVERLAY } from '../../structural/binary/constants'; import type { Model } from '../../../model'; export declare class Encoder { protected clockEncoder: ClockEncoder; protected time: number; protected doc: Model; protected readonly viewEncoder: CborEncoder<CrdtWriter>; protected readonly metaEncoder: CborEncoder<CrdtWriter>; protected index: number; encode(doc: Model<any>): [view: Uint8Array, meta: Uint8Array]; encodeLogical(model: Model): void; protected encodeClockTable(x0: number, x: number): void; protected readonly cTableEntry: (entry: { clock: ITimestampStruct; }) => void; protected readonly ts: (ts: ITimestampStruct) => void; protected cRoot(root: nodes.RootNode): void; protected writeTL(majorOverlay: CRDT_MAJOR_OVERLAY, length: number): void; protected cNode(node: nodes.JsonNode): void; protected cCon(node: nodes.ConNode): void; protected cVal(node: nodes.ValNode): void; protected cObj(node: nodes.ObjNode): void; protected cVec(node: nodes.VecNode): void; protected cStr(node: nodes.StrNode): void; protected cBin(node: nodes.BinNode): void; protected cArr(node: nodes.ArrNode): void; }