import type { Adapter } from './adapter'; import type { AdapterRequestContext } from './AdapterRequestContext'; export interface AdapterContext { set(key: string, value: T): void; get(key: string): T | undefined; } /** * A function that is called by luvio after the context is loaded. The context * will be empty in default environment, but might contain previous context * in durable environments. */ export type OnContextLoaded = (context: AdapterContext) => Promise; export type AdapterWithContext = (config: C, context: AdapterContext, requestContext?: AdapterRequestContext) => ReturnType>;