import type { Observable } from "rxjs";
import type { ApolloClient, OperationVariables } from "@apollo/client";
import type { WatchFragmentOptions, WatchFragmentResult } from "@apollo/client/cache";
import type { MaybeMasked } from "@apollo/client/masking";
import type { PromiseWithState } from "@apollo/client/utilities";
import type { FragmentKey } from "./types.js";
type FragmentRefPromise<TData> = PromiseWithState<TData>;
type Listener<TData> = (promise: FragmentRefPromise<TData>) => void;
interface FragmentReferenceOptions {
    autoDisposeTimeoutMs?: number;
    onDispose?: () => void;
}
export declare class FragmentReference<TData = unknown, TVariables extends OperationVariables = OperationVariables> {
    readonly observable: Observable<WatchFragmentResult<TData>>;
    readonly key: FragmentKey;
    promise: FragmentRefPromise<MaybeMasked<TData>>;
    private resolve;
    private reject;
    private subscription;
    private listeners;
    private autoDisposeTimeoutId?;
    private references;
    constructor(client: ApolloClient, watchFragmentOptions: WatchFragmentOptions<TData, TVariables> & {
        from: string;
    }, options: FragmentReferenceOptions);
    listen(listener: Listener<MaybeMasked<TData>>): () => void;
    retain(): () => void;
    private dispose;
    private onDispose;
    private subscribeToFragment;
    private handleNext;
    private handleError;
    private deliver;
    private createPendingPromise;
    private getDiff;
}
export {};
//# sourceMappingURL=FragmentReference.d.ts.map
