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.
9 lines • 1.06 kB
TypeScript
import { Transaction, YArrayEvent, YMapEvent, YTextEvent } from 'yjs';
import { RvPath } from "../native/native.type";
import { EventType } from "./event-type.enum";
import { StoredRhineVar } from "../var/rhine-var.type";
export type Subscriber<T> = (type: EventType, key: keyof T, value: T[keyof T] extends object ? T[keyof T] | StoredRhineVar<T[keyof T]> : T[keyof T], oldValue: T[keyof T], nativeEvent: YMapEvent<any> | YArrayEvent<any> | YTextEvent, nativeTransaction: Transaction) => void;
export type KeySubscriber<T> = (type: EventType, value: T[keyof T] extends object ? T[keyof T] | StoredRhineVar<T[keyof T]> : T[keyof T], oldValue: T[keyof T], nativeEvent: YMapEvent<any> | YArrayEvent<any> | YTextEvent, nativeTransaction: Transaction) => void;
export type DeepSubscriber<T> = (type: EventType, path: RvPath, value: any | StoredRhineVar, oldValue: any, nativeEvent: YMapEvent<any> | YArrayEvent<any> | YTextEvent, nativeTransaction: Transaction) => void;
export type SyncedSubscriber = (synced: boolean) => void;
//# sourceMappingURL=subscriber.d.ts.map