import type { ExecutionResult } from 'graphql'; import type { Maybe, Plugin, PromiseOrValue, YogaInitialContext } from 'graphql-yoga'; import type { BuildResponseCacheKeyFunction as EnvelopBuildResponseCacheKeyFunction, Cache as EnvelopCache, ResponseCacheExtensions as EnvelopResponseCacheExtensions, UseResponseCacheParameter as UseEnvelopResponseCacheParameter } from '@envelop/response-cache'; import { createInMemoryCache as envelopCreateInMemoryCache } from '@envelop/response-cache'; export { cacheControlDirective, hashSHA256 } from '@envelop/response-cache'; export type BuildResponseCacheKeyFunction = (params: Parameters[0] & { request: Request; }) => ReturnType; export type UseResponseCacheParameter = Omit & { cache?: Cache; session: (request: Request, context: TContext) => PromiseOrValue>; enabled?: (request: Request, context: TContext) => boolean; buildResponseCacheKey?: BuildResponseCacheKeyFunction; }; export interface ResponseCachePluginExtensions { http?: { headers?: Record; }; responseCache?: EnvelopResponseCacheExtensions; [key: string]: unknown; } export interface Cache extends EnvelopCache { get(key: string): PromiseOrValue, ResponseCachePluginExtensions>>>; } export declare function useResponseCache(options: UseResponseCacheParameter): Plugin; export declare const createInMemoryCache: (...args: Parameters) => Cache;