type CachePayload<Data = unknown> = {
    data: Data;
    lastModified: number;
    maxAge: number;
};
type QueryKey = ReadonlyArray<unknown> | URL;
declare class CacheApiAdaptor {
    private cacheName;
    private maxAge;
    constructor(ctx?: {
        cacheName?: string;
        maxAge?: number;
    });
    retrieve<Data = unknown>(key: QueryKey): Promise<CachePayload<Data> | null>;
    update<Data = unknown>(key: QueryKey, value: Data | Response, options?: {
        maxAge?: number;
    }): Promise<void>;
    delete(key: QueryKey): Promise<void>;
    /**
     * Builds the full cache key for the suspense cache.
     *
     * @param key Key for the item in the suspense cache.
     * @returns The fully-formed cache key for the suspense cache.
     */
    buildCacheKey(key: ReadonlyArray<unknown>): string;
}

type ExecutionContext = {
    waitUntil(promise: Promise<any>): void;
    passThroughOnException(): void;
};
declare const getCFExecutionContext: () => ExecutionContext;
declare const defineCFExecutionContext: <T extends ExecutionContext, Func extends (...args: any) => any>(context: T, func: Func) => any;

type RetryDelay<Error = unknown> = number | ((failureCount: number, error: Error) => number);
type CreateQuery<Data = unknown, Error = unknown> = {
    queryKey?: QueryKey | null;
    queryFn: () => Promise<Data>;
    staleTime?: number;
    gcTime?: number;
    revalidate?: boolean;
    retry?: number | ((failureCount: number, error: Error) => boolean);
    retryDelay?: RetryDelay<Error>;
    executionCtx?: ExecutionContext;
    cacheName?: string;
    throwOnError?: boolean;
    enabled?: boolean | ((data: Data) => boolean);
    revalidateMode?: 'default' | 'probabilistic';
};
declare const createQuery: <Data = unknown, Error = unknown>({ queryKey, queryFn, gcTime, staleTime, revalidate, retry, retryDelay, executionCtx, cacheName, throwOnError, enabled, revalidateMode, }: CreateQuery<Data, Error>) => Promise<{
    data: Data | null;
    error: Error | null;
    invalidate: () => Promise<void> | void;
    lastModified: number | null;
}>;

export { CacheApiAdaptor as C, type QueryKey as Q, type CreateQuery as a, createQuery as c, defineCFExecutionContext as d, getCFExecutionContext as g };
