UNPKG

json-joy

Version:

Collection of libraries for building collaborative editing apps.

42 lines (41 loc) 1.21 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); /** * @ignore */ children(): void; /** * @ignore */ child(): undefined; /** * @ignore */ container(): JsonNode | undefined; view(): View; /** * @ignore */ api: undefined | unknown; name(): string; toString(tab?: string): string; }