import { Observable, Subject } from 'rxjs'; import type { RxCollection, RxDatabase, RxQuery, RxDocument, Paths } from '../../types'; import { RxStateDocument, RxStateOperation, RxStateModifier } from './types.ts'; /** * RxDB internally used properties are * prefixed with lodash _ to make them less * likely to clash with actual state properties * from the user. */ export declare class RxStateBase { readonly prefix: string; readonly collection: RxCollection; _id: number; _state: T | any; $: Observable; _lastIdQuery: RxQuery | null>; _nonPersisted: { path: string; modifier: RxStateModifier; }[]; _writeQueue: Promise; _initDone: boolean; _instanceId: string; _ownEmits$: Subject; constructor(prefix: string, collection: RxCollection); set(path: Paths | '', modifier: RxStateModifier): Promise; /** * To have deterministic writes, * and to ensure that multiple js realms do not overwrite * each other, the write happens with incremental ids * that would throw conflict errors and trigger a retry. */ _triggerWrite(): Promise; mergeOperationsIntoState(operations: RxStateOperation[]): void; get(path?: Paths): any; get$(path?: Paths): Observable; get$$(path?: Paths): Reactivity; /** * Merges the state operations into a single write row * to store space and make recreating the state from * disc faster. */ _cleanup(): Promise; } export declare function createRxState(database: RxDatabase, prefix: string): Promise>; export declare function mergeOperationsIntoState(state: T, operations: RxStateOperation[]): T;