UNPKG

json-joy

Version:

Collection of libraries for building collaborative editing apps.

38 lines (37 loc) 1.26 kB
import { type ITimestampStruct } from '../../../json-crdt-patch/clock'; import type { JsonNode } from '../types'; import type { Printable } from 'tree-dump/lib/types'; /** * Represents the `con` type of the JSON CRDT specification. * * Constant type represents an immutable JSON value. It can be any JSON/CBOR * value including deeply nested objects and arrays, Uint8Array binary data, or * it can store a logical timestamp. The constant value cannot be edited. * * @category CRDT Node */ export declare class ConNode<View = unknown | ITimestampStruct> implements JsonNode<View>, Printable { readonly id: ITimestampStruct; readonly val: View; /** * @param id ID of the CRDT node. * @param val Raw value of the constant. It can be any JSON/CBOR value, or * a logical timestamp {@link Timestamp}. */ constructor(id: ITimestampStruct, val: View); name(): string; /** @ignore */ children(): void; /** @ignore */ child(): undefined; /** @ignore */ container(): JsonNode | undefined; view(): View; /** @ignore */ clone(): ConNode<View>; /** @ignore */ api: undefined | unknown; /** @ignore */ parent: JsonNode | undefined; toString(tab?: string): string; }