UNPKG

json-joy

Version:

Collection of libraries for building collaborative editing apps.

29 lines (28 loc) 1.3 kB
import type { Patch } from '../../json-crdt-patch'; import { ClockTable } from '../../json-crdt-patch/codec/clock/ClockTable'; import type { Decoder } from '../codec/indexed/binary/Decoder'; import type { Encoder } from '../codec/indexed/binary/Encoder'; import type { IndexedFields, IndexedNodeFields } from '../codec/indexed/binary/types'; import { PartialEditModel } from './PartialEditModel'; import type { FieldEdits } from './types'; export declare class PartialEdit { protected readonly decoder: Decoder; protected readonly encoder: Encoder; readonly clockTable: ClockTable; /** List of fields/nodes to fetch before applying the patches. */ loadList: Set<string>; doc: PartialEditModel | null; constructor(decoder: Decoder, encoder: Encoder, clockTable?: ClockTable); populateLoadList(patch: Patch): void; getFieldsToLoad(): Set<string>; loadPartialModel(fields: IndexedNodeFields): PartialEditModel; applyPatch(patch: Patch): void; populateClockTable(): void; getFieldEdits(): FieldEdits; } export declare class PartialEditFactory { protected readonly decoder: Decoder; protected readonly encoder: Encoder; constructor(decoder: Decoder, encoder: Encoder); startPartialEdit(clockBlob: IndexedFields['c']): PartialEdit; }