import type { OperationVariables } from "@apollo/client";
import type { Unmasked } from "@apollo/client/masking";
import type { ApolloCache } from "../cache.js";
import type { AllFieldsModifier, Modifiers } from "./common.js";
import { DataProxy } from "./DataProxy.js";
export declare namespace Cache {
    type WatchCallback<TData = unknown> = (diff: Cache.DiffResult<TData>, lastDiff?: Cache.DiffResult<TData>) => void;
    interface ReadOptions<TVariables = OperationVariables, TData = unknown> extends DataProxy.Query<TVariables, TData> {
        rootId?: string;
        previousResult?: any;
        optimistic: boolean;
        returnPartialData?: boolean;
    }
    interface WriteOptions<TData = unknown, TVariables = OperationVariables> extends Omit<DataProxy.Query<TVariables, TData>, "id">, Omit<DataProxy.WriteOptions<TData>, "data"> {
        dataId?: string;
        result: Unmasked<TData>;
    }
    interface DiffOptions<TData = unknown, TVariables = OperationVariables> extends Omit<ReadOptions<TVariables, TData>, "rootId"> {
    }
    interface WatchOptions<TData = unknown, TVariables = OperationVariables> extends DiffOptions<TData, TVariables> {
        watcher?: object;
        immediate?: boolean;
        callback: WatchCallback<TData>;
        lastDiff?: DiffResult<TData>;
    }
    interface EvictOptions {
        id?: string;
        fieldName?: string;
        args?: Record<string, any>;
        broadcast?: boolean;
    }
    interface ResetOptions {
        discardWatches?: boolean;
    }
    interface ModifyOptions<Entity extends Record<string, any> = Record<string, any>> {
        id?: string;
        fields: Modifiers<Entity> | AllFieldsModifier<Entity>;
        optimistic?: boolean;
        broadcast?: boolean;
    }
    interface BatchOptions<TCache extends ApolloCache, TUpdateResult = void> {
        update(cache: TCache): TUpdateResult;
        optimistic?: string | boolean;
        removeOptimistic?: string;
        onWatchUpdated?: (this: TCache, watch: Cache.WatchOptions, diff: Cache.DiffResult<any>, lastDiff?: Cache.DiffResult<any> | undefined) => any;
    }
    export import DiffResult = DataProxy.DiffResult;
    export import ReadQueryOptions = DataProxy.ReadQueryOptions;
    export import ReadFragmentOptions = DataProxy.ReadFragmentOptions;
    export import WriteQueryOptions = DataProxy.WriteQueryOptions;
    export import WriteFragmentOptions = DataProxy.WriteFragmentOptions;
    export import UpdateQueryOptions = DataProxy.UpdateQueryOptions;
    export import UpdateFragmentOptions = DataProxy.UpdateFragmentOptions;
    export import Fragment = DataProxy.Fragment;
}
//# sourceMappingURL=Cache.d.ts.map
