json-joy
Version:
Collection of libraries for building collaborative editing apps.
26 lines (25 loc) • 865 B
TypeScript
import { type ITimestampStruct } from '../../../json-crdt-patch/clock';
import type { IChunkSlice } from './types';
import type { Stateful } from '../types';
import type { Printable } from 'tree-dump/lib/types';
import type { Chunk } from '../../../json-crdt/nodes/rga';
export declare class ChunkSlice<T = string> implements IChunkSlice<T>, Stateful, Printable {
/** Start offset of the slice within the chunk. */
off: number;
/** Length of the slice. */
len: number;
constructor(
/** Chunk from which slice is computed. */
chunk: Chunk<T>,
/** Start offset of the slice within the chunk. */
off: number,
/** Length of the slice. */
len: number);
readonly chunk: Chunk<T>;
id(): ITimestampStruct;
key(): string;
view(): T;
hash: number;
refresh(): number;
toString(tab?: string): string;
}