import { ListParams } from "@authhero/adapter-interfaces";
/**
 * Options for fetching all resources with pagination.
 */
export interface FetchAllOptions {
    /**
     * The field to use for cursor-based pagination.
     * This field should be unique and sortable (e.g., 'id', 'created_at').
     * @default 'id'
     */
    cursorField?: string;
    /**
     * The sort order for the cursor field.
     * @default 'asc'
     */
    sortOrder?: "asc" | "desc";
    /**
     * Maximum number of items to fetch per page.
     * @default 100
     */
    pageSize?: number;
    /**
     * Maximum total items to fetch (for safety).
     * Set to -1 for unlimited.
     * @default 10000
     */
    maxItems?: number;
    /**
     * Optional filter query (Lucene-style).
     */
    q?: string;
}
/**
 * Fetches all resources from a paginated list endpoint by iterating through pages.
 *
 * Uses cursor-based pagination by filtering on a sortable field (like 'id') to ensure
 * consistent results even if data changes between requests.
 *
 * @param listFn - The list function from the adapter (e.g., adapters.tenants.list)
 * @param itemsKey - The key in the response that contains the array of items (e.g., 'tenants', 'users')
 * @param options - Pagination options
 * @returns Promise resolving to an array of all items
 *
 * @example
 * ```typescript
 * // Fetch all tenants
 * const allTenants = await fetchAll(
 *   (params) => adapters.tenants.list(params),
 *   'tenants'
 * );
 *
 * // Fetch all users for a tenant with custom options
 * const allUsers = await fetchAll(
 *   (params) => adapters.users.list(tenantId, params),
 *   'users',
 *   { cursorField: 'user_id', pageSize: 50 }
 * );
 * ```
 */
export declare function fetchAll<T>(listFn: (params: ListParams) => Promise<any>, itemsKey: string, options?: FetchAllOptions): Promise<T[]>;
