import { type InferQuery, type IQuery } from "./IQuery"; export interface IQuerySource, TQuery extends IQuery = IQuery> { /** * Run a query and return promise with the result. */ query(query: TQuery): Promise; /** * Fetch a single optional entity. */ fetch(query: TQuery): Promise; /** * Find required entity; if not found, an error should be thrown. */ find(query: TQuery): Promise; /** * Get an entity (required) by the given id. */ get(id: string): Promise; /** * Return count of items by the given query. */ count(query: TQuery): Promise; /** * General method for converting input filter from a query into an output (for example, applying fulltext). */ withFilter(query: TQuery): InferQuery.Filter | undefined; } export declare namespace QuerySourceInfer { type Entity = T extends IQuerySource ? U : T; type Query = T extends IQuerySource ? U : T; } //# sourceMappingURL=IQuerySource.d.ts.map