nodedb-json
Version:
A lightweight JSON-based database for Node.js with TypeScript support, indexing, and complex query capabilities
14 lines (13 loc) • 514 B
TypeScript
export type IndexType = 'unique' | 'multi';
export type IndexValueMode = 'strict' | 'coerce';
export interface IndexDefinition<T = Record<string, any>> {
type: IndexType;
field: Extract<keyof T, string>;
}
export interface IndexStore {
[key: string]: {
[fieldValue: string]: number | number[];
};
}
export type IndexDefinitions = Record<string, Record<string, IndexDefinition<any>>>;
export type IndexOptions = Record<string, IndexDefinition<any>[] | Record<string, IndexDefinition<any>>>;