/* eslint-disable camelcase */ import { SearchDelegatorName } from '~/interfaces/named-query'; import { ISearchResult } from '~/interfaces/search'; export type QueryTerms = { match: string[], not_match: string[], phrase: string[], not_phrase: string[], prefix: string[], not_prefix: string[], tag: string[], not_tag: string[], } export type ParsedQuery = { queryString: string, terms?: QueryTerms, delegatorName?: string } export interface SearchQueryParser { parseSearchQuery(queryString: string): Promise } export interface SearchResolver{ resolve(parsedQuery: ParsedQuery): Promise<[SearchDelegator, SearchableData | null]> } export interface SearchDelegator { name?: SearchDelegatorName search(data: SearchableData | null, user, userGroups, option): Promise> } export type SearchableData = { queryString: string terms: QueryTerms }