UNPKG

nodedb-json

Version:

A lightweight JSON-based database for Node.js with TypeScript support, indexing, and complex query capabilities

9 lines (8 loc) 1.02 kB
import type { IndexDefinition, IndexDefinitions, IndexStore, IndexValueMode } from '../types'; export declare function hasIndexDefinition(definitions: IndexDefinitions, key: string): boolean; export declare function hasIndexOnField(definitions: IndexDefinitions, key: string, field: string): boolean; export declare function assertUniqueIndexesForKey(definitions: IndexDefinitions, key: string, data: any[], valueMode?: IndexValueMode): void; export declare function assertUniqueIndexForDefinition(key: string, data: any[], indexDefinition: IndexDefinition, valueMode?: IndexValueMode): void; export declare function buildIndex(store: IndexStore, key: string, data: any[], indexDef: IndexDefinition, valueMode?: IndexValueMode): void; export declare function getItemIndexByField(store: IndexStore, key: string, field: string, value: any, valueMode?: IndexValueMode): number; export declare function getItemIndexesByField(store: IndexStore, key: string, field: string, value: any, valueMode?: IndexValueMode): number[];