json-joy
Version:
Collection of libraries for building collaborative editing apps.
53 lines (52 loc) • 1.55 kB
TypeScript
import type { JsonNode } from '..';
import { type ITimestampStruct } from '../../../json-crdt-patch/clock';
import { AbstractRga, type Chunk } from '../rga/AbstractRga';
/**
* @ignore
* @category CRDT Node
*/
export declare class BinChunk implements Chunk<Uint8Array> {
readonly id: ITimestampStruct;
span: number;
del: boolean;
data: Uint8Array | undefined;
len: number;
p: BinChunk | undefined;
l: BinChunk | undefined;
r: BinChunk | undefined;
p2: BinChunk | undefined;
l2: BinChunk | undefined;
r2: BinChunk | undefined;
s: BinChunk | undefined;
constructor(id: ITimestampStruct, span: number, buf: Uint8Array | undefined);
merge(data: Uint8Array): void;
split(ticks: number): BinChunk;
delete(): void;
clone(): BinChunk;
view(): Uint8Array;
}
/**
* Represents the `bin` type in JSON CRDT. The `bin` is a blob of binary data,
* powered by a Replicated Growable Array (RGA) algorithm.
*
* @category CRDT Node
*/
export declare class BinNode extends AbstractRga<Uint8Array> implements JsonNode<Uint8Array> {
/** @ignore */
private _view;
view(): Uint8Array;
/** @ignore */
children(): void;
/** @ignore */
child(): undefined;
/** @ignore */
container(): JsonNode | undefined;
/** @ignore */
api: undefined | unknown;
name(): string;
/** @ignore */
createChunk(id: ITimestampStruct, buf: Uint8Array | undefined): BinChunk;
/** @ignore */
protected onChange(): void;
protected toStringName(): string;
}