import type { DocumentTypeDecoration, ResultOf, VariablesOf } from "@graphql-typed-document-node/core"; import type { ApolloClient, DataState, ObservableQuery, OperationVariables } from "@apollo/client"; import type { MaybeMasked } from "@apollo/client/masking"; import type { DecoratedPromise } from "@apollo/client/utilities/internal"; import type { QueryKey } from "./types.js"; type QueryRefPromise["dataState"]> = DecoratedPromise, TStates>>; type Listener["dataState"]> = (promise: QueryRefPromise) => void; declare const QUERY_REFERENCE_SYMBOL: unique symbol; declare const PROMISE_SYMBOL: unique symbol; declare const QUERY_REF_BRAND: unique symbol; declare const PRELOADED_QUERY_REF_BRAND: unique symbol; /** * A `QueryReference` is an opaque object returned by `useBackgroundQuery`. * A child component reading the `QueryReference` via `useReadQuery` will * suspend until the promise resolves. */ export interface QueryRef["dataState"] = "complete" | "streaming"> { /** * @internal * * @deprecated This is an internal API and should not be used directly. This can be removed or changed at any time. */ [QUERY_REF_BRAND]?(variables: TVariables): { data: TData; states: TStates; }; } export declare namespace QueryRef { type ForQuery, TStates extends DataState>["dataState"] = "complete" | "streaming"> = QueryRef, VariablesOf, TStates>; } /** * @internal * For usage in internal helpers only. * * @deprecated This is an internal API and should not be used directly. This can be removed or changed at any time. */ interface WrappedQueryRef["dataState"] = "complete" | "streaming"> extends QueryRef { /** * @internal * * @deprecated This is an internal API and should not be used directly. This can be removed or changed at any time. */ readonly [QUERY_REFERENCE_SYMBOL]: InternalQueryReference; /** * @internal * * @deprecated This is an internal API and should not be used directly. This can be removed or changed at any time. */ [PROMISE_SYMBOL]: QueryRefPromise; } /** * A `QueryReference` is an opaque object returned by `useBackgroundQuery`. * A child component reading the `QueryReference` via `useReadQuery` will * suspend until the promise resolves. */ export interface PreloadedQueryRef["dataState"] = "complete" | "streaming"> extends QueryRef { /** * @internal * * @deprecated This is an internal API and should not be used directly. This can be removed or changed at any time. */ [PRELOADED_QUERY_REF_BRAND]: typeof PRELOADED_QUERY_REF_BRAND; } interface InternalQueryReferenceOptions { onDispose?: () => void; autoDisposeTimeoutMs?: number; } export declare function wrapQueryRef["dataState"]>(internalQueryRef: InternalQueryReference): WrappedQueryRef; export declare function assertWrappedQueryRef["dataState"]>(queryRef: QueryRef): asserts queryRef is WrappedQueryRef; export declare function assertWrappedQueryRef["dataState"]>(queryRef: QueryRef | undefined | null): asserts queryRef is WrappedQueryRef | undefined | null; export declare function getWrappedPromise["dataState"]>(queryRef: WrappedQueryRef): QueryRefPromise; export declare function unwrapQueryRef["dataState"]>(queryRef: WrappedQueryRef): InternalQueryReference; export declare function unwrapQueryRef["dataState"]>(queryRef: Partial>): undefined | InternalQueryReference; export declare function updateWrappedQueryRef["dataState"]>(queryRef: WrappedQueryRef, promise: QueryRefPromise): void; declare const OBSERVED_CHANGED_OPTIONS: readonly ["context", "errorPolicy", "fetchPolicy", "refetchWritePolicy", "returnPartialData"]; type ObservedOptions = Pick; export declare class InternalQueryReference["dataState"] = DataState["dataState"]> { result: ObservableQuery.Result, TStates>; readonly key: QueryKey; readonly observable: ObservableQuery; promise: QueryRefPromise; private queue; private subscription; private listeners; private autoDisposeTimeoutId?; private resolve; private reject; private references; private softReferences; constructor(observable: ObservableQuery, options: InternalQueryReferenceOptions); get disposed(): boolean; get watchQueryOptions(): ObservableQuery.Options; reinitialize(): void; retain(): () => void; softRetain(): () => void; didChangeOptions(watchQueryOptions: ObservedOptions): boolean; applyOptions(watchQueryOptions: ObservedOptions): QueryRefPromise; listen(listener: Listener): () => void; refetch(variables: OperationVariables | undefined): Promise>; fetchMore(options: ObservableQuery.FetchMoreOptions): Promise>; private dispose; private onDispose; private handleNext; private deliver; private initiateFetch; private subscribeToQuery; private setResult; private shouldReject; private createPendingPromise; } export {}; //# sourceMappingURL=QueryReference.d.ts.map