UNPKG

nodedb-json

Version:

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

17 lines (16 loc) 615 B
import type { QueryOptions, QueryResult } from '../types'; export interface QueryIndexLookup { hasIndexOnField(field: string): boolean; getItemIndexesByField(field: string, value: any): number[]; } export declare class QueryEngine { private readonly indexes?; constructor(indexes?: QueryIndexLookup | undefined); execute<T>(data: T[], options?: QueryOptions<T>): QueryResult<T>; validateQueryOptions(options: QueryOptions<any>): void; private applyFilter; private getIndexedCandidateIndexes; private getIndexLookupValues; private isOperatorObject; private applySelect; }