UNPKG

@signaldb/core

Version:

SignalDB is a client-side database that provides a simple MongoDB-like interface to the data with first-class typescript support to achieve an optimistic UI. Data persistence can be achieved by using storage providers that store the data through a JSON in

16 lines (15 loc) 819 B
import type IndexProvider from '../types/IndexProvider'; import type { BaseItem } from './types'; /** * creates an index for a specific field but uses an external map to store the index * @param field name of the field * @param index the external map to use for the index * @returns an index provider to pass to the `indices` option of the collection constructor */ export declare function createExternalIndex<T extends BaseItem<I> = BaseItem, I = any>(field: string, index: Map<string, Set<number>>): IndexProvider<T, I>; /** * creates an index for a specific field * @param field name of the field * @returns an index provider to pass to the `indices` option of the collection constructor */ export default function createIndex<T extends BaseItem<I> = BaseItem, I = any>(field: string): IndexProvider<T, I>;