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.

60 lines 2.54 kB
import { Awareness } from 'y-protocols/awareness'; import { Transaction, UndoManager, YArrayEvent, YMapEvent, YTextEvent } from 'yjs'; import Connector from "../connector/connector.abstract"; import { Native, RvPath } from "../native/native.type"; import ProxyOptions from "../proxy/proxy-options.interface"; import { EventType } from "../subscriber/event-type.enum"; import { Subscriber, DeepSubscriber, SyncedSubscriber, KeySubscriber } from "../subscriber/subscriber"; export default abstract class RhineVarBase<T extends object = any> { private _native; private _parent; private _origin; constructor(_native: Native, _parent?: RhineVarBase | null, _origin?: RhineVarBase<T>); private _options; private _connector; private _undoManager; private _awareness; private _clientId; isRoot(): boolean; getParent(): RhineVarBase | null; getNative(): Native; getRoot(): RhineVarBase; getOptions(): ProxyOptions; getConnector(): Connector | null; getUndoManager(): UndoManager | null; getAwareness(): Awareness | null; getClientId(): number; transact<K>(fn: (transaction: Transaction) => K, origin?: any): K; 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