UNPKG

collaborative-ui

Version:

React component library for building real-time collaborative editing applications.

29 lines (28 loc) 1.33 kB
import type { Model, Patch } from 'json-joy/lib/json-crdt'; import { BehaviorSubject } from 'rxjs'; import type { Log } from 'json-joy/lib/json-crdt/log/Log'; import { JsonCrdtPatchState } from '../JsonCrdtPatch/JsonCrdtPatchState'; import { JsonCrdtModelState } from '../JsonCrdtModel/JsonCrdtModelState'; export type JsonCrdtLogView = 'text' | 'timeline' | 'model'; export interface JsonCrdtLogStateOpts { view?: JsonCrdtLogView; } export declare class JsonCrdtLogState { readonly log: Log<any>; readonly view$: BehaviorSubject<JsonCrdtLogView>; readonly pinned$: BehaviorSubject<Patch | "start" | null>; readonly pinnedModel$: BehaviorSubject<Model<import("json-joy/lib/json-crdt").JsonNode<any>> | null>; readonly timelineScroll$: BehaviorSubject<number>; readonly readonlyEnforced$: BehaviorSubject<number>; readonly patchState: JsonCrdtPatchState; readonly modelState: JsonCrdtModelState; constructor(log: Log<any>, { view }?: JsonCrdtLogStateOpts); readonly setView: (view: JsonCrdtLogView) => void; readonly pin: (patch: "start" | Patch | null) => void; readonly next: () => void; readonly prev: () => void; readonly pause: () => void; readonly play: () => void; readonly togglePlay: () => void; readonly setTimelineScroll: (scroll: number) => void; }