import { DocumentNode } from "@0no-co/graphql.web"; import { Option, Result } from "@bloodyowl/boxed"; import { Connection, Edge } from "../types"; import type { CacheEntry } from "./entry"; export type SchemaConfig = { interfaceToTypes: Record; }; type ConnectionInfo = { cacheEntry: CacheEntry; document: DocumentNode; variables: Record; pathInQuery: PropertyKey[]; fieldVariables: Record; }; export declare class ClientCache { cache: Map; operationCache: Map>>>; interfaceToType: Record>; connectionCache: Map; connectionRefCount: number; constructor(schemaConfig: SchemaConfig); registerConnectionInfo(info: ConnectionInfo): number; isTypeCompatible(typename: string, typeCondition: string): boolean; dump(): Map; getOperationFromCache(documentNode: DocumentNode, variables: Record): Option>; setOperationInCache(documentNode: DocumentNode, variables: Record, data: Result): void; getFromCache(cacheKey: symbol, requestedKeys: Set): Option; getFromCacheWithoutKey(cacheKey: symbol): Option; get(cacheKey: symbol): Option; getOrCreateEntry(cacheKey: symbol, defaultValue: CacheEntry): unknown; set(cacheKey: symbol, entry: CacheEntry): void; updateConnection(connection: Connection, config: { prepend: Edge[]; } | { append: Edge[]; } | { remove: string[]; }): void; } export {};