import type { ASTNode, DocumentNode, FieldNode } from "graphql";
import type { ApolloCache } from "@apollo/client/cache";
import type { FetchResult } from "@apollo/client/link/core";
import type { FragmentMap, StoreObject } from "@apollo/client/utilities";
import type { ApolloClient } from "./ApolloClient.js";
import type { OperationVariables, Resolvers } from "./types.js";
export type Resolver = (rootValue?: any, args?: any, context?: any, info?: {
    field: FieldNode;
    fragmentMap: FragmentMap;
}) => any;
export type FragmentMatcher = (rootValue: any, typeCondition: string, context: any) => boolean;
type LocalStateOptions = {
    cache: ApolloCache;
    client?: ApolloClient;
    resolvers?: Resolvers | Resolvers[];
    fragmentMatcher?: FragmentMatcher;
};
export declare class LocalState {
    private cache;
    private client?;
    private resolvers?;
    private fragmentMatcher?;
    private selectionsToResolveCache;
    constructor({ cache, client, resolvers, fragmentMatcher, }: LocalStateOptions);
    addResolvers(resolvers: Resolvers | Resolvers[]): void;
    setResolvers(resolvers: Resolvers | Resolvers[]): void;
    getResolvers(): Resolvers;
    runResolvers<TData>({ document, remoteResult, context, variables, onlyRunForcedResolvers, }: {
        document: DocumentNode | null;
        remoteResult: FetchResult<TData>;
        context?: Record<string, any>;
        variables?: Record<string, any>;
        onlyRunForcedResolvers?: boolean;
    }): Promise<FetchResult<TData>>;
    setFragmentMatcher(fragmentMatcher: FragmentMatcher): void;
    getFragmentMatcher(): FragmentMatcher | undefined;
    clientQuery(document: DocumentNode): DocumentNode | null;
    serverQuery(document: DocumentNode): DocumentNode | null;
    prepareContext(context?: Record<string, any>): {
        cache: ApolloCache;
        getCacheKey(obj: StoreObject): string | undefined;
    };
    addExportedVariables<TVars extends OperationVariables>(document: DocumentNode, variables?: TVars, context?: {}): Promise<TVars>;
    shouldForceResolvers(document: ASTNode): boolean;
    private buildRootValueFromCache;
    private resolveDocument;
    private resolveSelectionSet;
    private resolveField;
    private resolveSubSelectedArray;
    private collectSelectionsToResolve;
}
export {};
//# sourceMappingURL=LocalState.d.ts.map
