UNPKG

rhine-var

Version:

Variables that support multi-user collaboration and persistence, making collaboration and variable operations as simple as possible, with strict and well-defined type hints.

57 lines 2.42 kB
import { Transaction, UndoManager, YArrayEvent, YMapEvent, YTextEvent } from "yjs"; import { Awareness } from "y-protocols/awareness"; import { Native, RvPath } from "../native/native.type"; import { EventType } from "../subscriber/event-type.enum"; import { Subscriber, DeepSubscriber, SyncedSubscriber, KeySubscriber } from "../subscriber/subscriber"; import Connector from "../connector/connector.abstract"; import ProxyOptions from "../proxy/proxy-options.interface"; export default abstract class RhineVarBase<T extends object = any> { native: Native; parent: RhineVarBase | null; _origin: RhineVarBase<T>; constructor(native: Native, parent?: RhineVarBase | null, _origin?: RhineVarBase<T>); private _options; private _connector; private _undoManager; private _awareness; private _clientId; isRoot(): boolean; root(): RhineVarBase; getOptions(): ProxyOptions; getConnector(): Connector | null; getUndoManager(): UndoManager | null; getAwareness(): Awareness | null; getClientId(): number; private _initialize; afterSynced(callback: () => void): void; waitSynced(): Promise<unknown>; json(): T; private _removeBuiltInProperty; frozenJson(): T; jsonString(indent?: number): string; private syncedSubscribers; subscribeSynced(callback: SyncedSubscriber): () => void; unsubscribeSynced(callback: SyncedSubscriber): void; unsubscribeAllSynced(): void; private emitSynced; private subscribers; subscribe(subscriber: Subscriber<T>): () => void; unsubscribe(subscriber: Subscriber<T>): void; unsubscribeAll(): void; private keySubscribers; subscribeKey(key: keyof T, subscriber: KeySubscriber<T>): () => void; unsubscribeKey(subscriber: KeySubscriber<T>): void; unsubscribeAllKey(): void; private emit; private deepSubscribers; subscribeDeep(subscriber: DeepSubscriber<T>): () => void; unsubscribeDeep(subscriber: DeepSubscriber<T>): void; unsubscribeAllDeep(): void; emitDeep(type: EventType, path: RvPath, value: any, oldValue: any, nativeEvent: YMapEvent<any> | YArrayEvent<any> | YTextEvent, nativeTransaction: Transaction): void; private observer; private syncedObserver; observe(): void; unobserve(): void; } export declare const RHINE_VAR_PREDEFINED_PROPERTIES: Set<string | symbol>; //# sourceMappingURL=rhine-var-base.class.d.ts.map