import { ExtractContext, InitialQueryBuilder, QueryBuilder } from './builder/index.js';
import { Context, InferResultType, RootObjectResultConstraint, RootQueryBuilder, RootQueryFn } from './builder/types.js';
/**
 * Configuration options for queryOnce
 */
export interface QueryOnceConfig<TContext extends Context> {
    /**
     * Query builder function that defines the query
     */
    query: ((q: InitialQueryBuilder) => QueryBuilder<TContext> & RootObjectResultConstraint<TContext>) | (QueryBuilder<TContext> & RootObjectResultConstraint<TContext>);
}
/**
 * Executes a one-shot query and returns the results as an array.
 *
 * This function creates a live query collection, preloads it, extracts the results,
 * and automatically cleans up the collection. It's ideal for:
 * - AI/LLM context building
 * - Data export
 * - Background processing
 * - Testing
 *
 * @param queryFn - A function that receives the query builder and returns a query
 * @returns A promise that resolves to an array of query results
 *
 * @example
 * ```typescript
 * // Basic query
 * const users = await queryOnce((q) =>
 *   q.from({ user: usersCollection })
 * )
 *
 * // With filtering and projection
 * const activeUserNames = await queryOnce((q) =>
 *   q.from({ user: usersCollection })
 *    .where(({ user }) => eq(user.active, true))
 *    .select(({ user }) => ({ name: user.name }))
 * )
 * ```
 */
export declare function queryOnce<TQueryFn extends (q: InitialQueryBuilder) => QueryBuilder<any>, TQuery extends QueryBuilder<any> = ReturnType<TQueryFn>>(queryFn: TQueryFn & RootQueryFn<TQuery>): Promise<InferResultType<ExtractContext<TQuery>>>;
/**
 * Executes a one-shot query using a configuration object.
 *
 * @param config - Configuration object with the query function
 * @returns A promise that resolves to an array of query results
 *
 * @example
 * ```typescript
 * const recentOrders = await queryOnce({
 *   query: (q) =>
 *     q.from({ order: ordersCollection })
 *      .orderBy(({ order }) => desc(order.createdAt))
 *      .limit(100),
 * })
 * ```
 */
export declare function queryOnce<TQuery extends QueryBuilder<any>>(config: QueryOnceConfig<ExtractContext<TQuery>> & {
    query: RootQueryFn<TQuery> | RootQueryBuilder<TQuery>;
}): Promise<InferResultType<ExtractContext<TQuery>>>;
