import type { IViewLocker, Identifier, IObjectStorage } from '../interfaces/index.ts'; /** * In-memory Projection View, which suspends get()'s until it is ready */ export declare class InMemoryView implements IViewLocker, IObjectStorage { #private; static factory(): TView; protected _map: Map; /** Whether the view is restored */ get ready(): boolean; /** Number of records in the View */ get size(): number; constructor(); /** Lock the view to prevent concurrent modifications */ lock(): Promise; /** Release the lock */ unlock(): Promise; /** Create a Promise which will resolve to a first emitted event of a given type */ once(eventType: 'ready'): Promise; /** * Check if view contains a record with a given key. * This is the only synchronous method, so make sure to check the `ready` flag, if necessary * * @deprecated Use `async get()` instead */ has(key: Identifier): boolean; /** Get record with a given key; await until the view is restored */ get(key: Identifier, options?: { nowait?: boolean; }): Promise; /** * Get record with a given key synchronously */ getSync(key: Identifier): TRecord | undefined; /** Get all records matching an optional filter */ getAll(filter?: (r: TRecord | undefined, i: Identifier) => boolean): Promise>; /** Create record with a given key and value */ create(key: Identifier, value?: TRecord): Promise; /** Update existing view record */ update(key: Identifier, update: (r: TRecord) => TRecord): Promise; /** Update existing view record or create new */ updateEnforcingNew(key: Identifier, update: (r?: TRecord) => TRecord): Promise; /** Update all records that match filter criteria */ updateAll(filter: (r: TRecord) => boolean, update: (r: TRecord) => TRecord): Promise; /** Update existing record */ private _update; /** Delete record */ delete(key: Identifier): Promise; /** Delete all records that match filter criteria */ deleteAll(filter: (r?: TRecord) => boolean): Promise; /** Get view summary as string */ toString(): string; }