UNPKG

json-joy

Version:

Collection of libraries for building collaborative editing apps.

20 lines (19 loc) 790 B
import { type ITimestampStruct } from '../../json-crdt-patch/clock'; import type { JsonNode } from '..'; import type { Printable } from 'tree-dump/lib/types'; export declare abstract class ExtNode<N extends JsonNode, View = unknown> implements JsonNode<View>, Printable { readonly data: N; abstract readonly extId: number; readonly id: ITimestampStruct; constructor(data: N); /** * @todo Maybe hardcode this as `ext` to be inline with other classes. And retrieve extension names differently. */ abstract name(): string; abstract view(): View; children(callback: (node: JsonNode) => void): void; child?(): N; container(): JsonNode | undefined; api: undefined | unknown; toString(tab?: string, parentId?: ITimestampStruct): string; }