import { Prettify } from "../common"; import { IndexQueryInput, QueryResultSet } from "../index-data/query-config/query-input-config"; import { RemoteJoinerOptions, RemoteJoinerQuery } from "../joiner"; import { RemoteQueryEntryPoints } from "./remote-query-entry-points"; import { RemoteQueryInput, RemoteQueryObjectConfig, RemoteQueryObjectFromStringResult } from "./remote-query-object-from-string"; export type RemoteQueryFunctionReturnPagination = { skip: number; take: number; count: number; }; /** * The GraphResultSet presents a typed output for the * result returned by the underlying remote query */ export type GraphResultSet = { data: TEntry extends keyof RemoteQueryEntryPoints ? RemoteQueryEntryPoints[TEntry][] : any[]; metadata?: RemoteQueryFunctionReturnPagination; }; /** * QueryGraphFunction is a wrapper on top of remoteQuery * that simplifies the input it accepts and returns * a normalized/consistent output. */ export type QueryGraphFunction = { (queryConfig: RemoteQueryInput, options?: RemoteJoinerOptions): Promise>>; }; /** * QueryIndexFunction is a wrapper on top of indexModule * that simplifies the input it accepts and returns * a normalized/consistent output. */ export type QueryIndexFunction = { (queryOptions: IndexQueryInput): Promise>>; }; export type RemoteQueryFunction = { /** * Query wrapper to provide specific API's and pre processing around remoteQuery.query * @param queryConfig * @param options */ (queryConfig: RemoteQueryObjectConfig, options?: RemoteJoinerOptions): Promise; /** * Query wrapper to provide specific API's and pre processing around remoteQuery.query * @param queryConfig * @param options */ >(queryConfig: TConfig, options?: RemoteJoinerOptions): Promise; /** * Query wrapper to provide specific API's and pre processing around remoteQuery.query * @param query * @param options */ (query: RemoteJoinerQuery, options?: RemoteJoinerOptions): Promise; /** * Graph function uses the remoteQuery under the hood and * returns a result set */ graph: QueryGraphFunction; /** * Index function uses the index module to query and remoteQuery to hydrate the data * returns a result set */ index: QueryIndexFunction; /** * Query wrapper to provide specific GraphQL like API around remoteQuery.query * @param query * @param variables * @param options */ gql: (query: string, variables?: Record, options?: RemoteJoinerOptions) => Promise; }; export interface Query { /** * Query wrapper to provide specific API's and pre processing around remoteQuery.query * @param queryConfig * @param options */ query(queryConfig: RemoteQueryObjectConfig, options?: RemoteJoinerOptions): Promise; /** * Query wrapper to provide specific API's and pre processing around remoteQuery.query * @param queryConfig * @param options */ query>(queryConfig: TConfig, options?: RemoteJoinerOptions): Promise; /** * Query wrapper to provide specific API's and pre processing around remoteQuery.query * @param query * @param options */ query(query: RemoteJoinerQuery, options?: RemoteJoinerOptions): Promise; /** * Graph function uses the remoteQuery under the hood and * returns a result set */ graph: QueryGraphFunction; /** * Query wrapper to provide specific GraphQL like API around remoteQuery.query * @param query * @param variables * @param options */ gql: (query: string, variables?: Record, options?: RemoteJoinerOptions) => Promise; } //# sourceMappingURL=remote-query.d.ts.map