import fetch from 'node-fetch'; import { Configuration } from '../configuration'; interface IndexEntry { id: string; fields: { [key: string]: object; }; } export interface Sort { field: string; descending?: boolean; } export interface Page { limit: number; offset: number; } export interface QueryResults { resultCount: number; limit: number; offset: number; ids: string[]; } export interface SearchResults { resultCount: number; limit: number; offset: number; results: ReadonlyArray | undefined; } export declare type Operator = '=' | '!=' | '>' | '<' | '>=' | '<='; export interface SearchFields { [key: string]: string | string[] | Predicate | Predicate[]; } export interface Predicate { op: Operator; value: string | string[] | number | Date; } export interface SearchPredicate extends Predicate { field: string; } export declare class SearchService { private readonly configuration; private logger; constructor(configuration: Configuration); index(entityName: string, entries: IndexEntry[]): Promise; delete(entityName: string, ...ids: string[]): Promise; deleteAll(entityName: string): Promise; query(entityName: string, fields: SearchFields, sort?: Sort, page?: Page): Promise; private post; private normaliseFields; private toSearchPredicate; } export {};