UNPKG

@fireproof/database

Version:
31 lines (30 loc) 1.03 kB
import type { ClockHead, MapFn, QueryOpts, IdxMeta } from './types'; import { IndexBlockstore } from './transaction'; import { IndexTree } from './indexer-helpers'; import { CRDT } from './crdt'; export declare function index({ _crdt }: { _crdt: CRDT; }, name: string, mapFn?: MapFn, meta?: IdxMeta): Index; export declare class Index { blocks: IndexBlockstore; crdt: CRDT; name: string | null; mapFn: MapFn | null; mapFnString: string; byKey: IndexTree; byId: IndexTree; indexHead: ClockHead | undefined; includeDocsDefault: boolean; initError: Error | null; ready: Promise<void>; constructor(crdt: CRDT, name: string, mapFn?: MapFn, meta?: IdxMeta); applyMapFn(name: string, mapFn?: MapFn, meta?: IdxMeta): void; query(opts?: QueryOpts): Promise<{ rows: import("./types").IndexRow[]; }>; _hydrateIndex(): Promise<void>; _updateIndex(): Promise<(IdxMeta & import("./types").CarCommit) | { byId: IndexTree; byKey: IndexTree; }>; }