import type { Entity, EntityQueryOptions } from "../toolbox.js"; import type { GenericRecord } from "@webiny/api/types.js"; export interface QueryAllParams { entity: Entity; partitionKey: string; options?: EntityQueryOptions; } export interface QueryOneParams extends QueryAllParams { options?: Omit; } export interface QueryParams extends QueryAllParams { previous?: any; } export interface QueryResult { result: any | null; items: T[]; } /** * Will run the query to fetch the first possible item from the database. */ export declare const queryOne: (params: QueryOneParams) => Promise; export declare const queryOneClean: (params: QueryOneParams) => Promise; /** * Will run the query to fetch the results no matter how many iterations it needs to go through. */ export declare const queryAll: (params: QueryAllParams) => Promise; export declare const queryAllClean: (params: QueryAllParams) => Promise; export interface IQueryPageResponse { items: T[]; lastEvaluatedKey: GenericRecord; } export declare const queryPerPage: (params: QueryAllParams) => Promise>; export declare const queryPerPageClean: (params: QueryAllParams) => Promise>; /** * Will run the query to fetch the results no matter how many iterations it needs to go through. * Results of each iteration will be passed to the provided callback */ export declare const queryAllWithCallback: (params: QueryAllParams, callback: (items: T[]) => Promise) => Promise;