import type { DocumentNode } from "graphql";
import type { Cache } from "@apollo/client/cache";
import type { FetchResult } from "@apollo/client/link/core";
import type { ObservableQuery } from "./ObservableQuery.js";
import type { QueryManager } from "./QueryManager.js";
import type { ErrorPolicy, WatchQueryOptions } from "./watchQueryOptions.js";
export declare const enum CacheWriteBehavior {
    FORBID = 0,
    OVERWRITE = 1,
    MERGE = 2
}
export declare class QueryInfo {
    readonly queryId: string;
    document: DocumentNode | null;
    lastRequestId: number;
    variables?: Record<string, any>;
    stopped: boolean;
    private cancelWatch?;
    private cache;
    constructor(queryManager: QueryManager, queryId?: string);
    init(query: {
        document: DocumentNode;
        variables: Record<string, any> | undefined;
    }): this;
    resetDiff(): void;
    getDiff(): Cache.DiffResult<any>;
    private lastDiff?;
    private updateLastDiff;
    private getDiffOptions;
    setDiff(diff: Cache.DiffResult<any> | null): void;
    readonly observableQuery: ObservableQuery<any, any> | null;
    setObservableQuery(oq: ObservableQuery<any, any> | null): void;
    stop(): void;
    private cancel;
    private lastWatch?;
    private updateWatch;
    private lastWrite?;
    resetLastWrite(): void;
    private shouldWrite;
    markResult<T>(result: FetchResult<T>, document: DocumentNode, options: Pick<WatchQueryOptions, "variables" | "fetchPolicy" | "errorPolicy">, cacheWriteBehavior: CacheWriteBehavior): void;
}
export declare function shouldWriteResult<T>(result: FetchResult<T>, errorPolicy?: ErrorPolicy): boolean;
//# sourceMappingURL=QueryInfo.d.ts.map
