import type { ConfigFactory, UnresolvedConfigHandler } from './adapters/ConfigFactory'; import { type MOSConfig } from './config'; import type { MOSProxyLogger } from './logger'; import type { MOSConfigInput } from './types'; export interface ConfigResolutionOptions { /** Either a static config (normalized once) or a per-request factory returning a full config. */ input: MOSConfigInput | ConfigFactory; onUnresolved: UnresolvedConfigHandler | null; maxCachedConfigs: number; logger: MOSProxyLogger; } /** Thrown when no config could be resolved for a request and the host has no last-known-good fallback. */ export declare class ConfigUnresolvableError extends Error { readonly host: string; constructor(host: string, options?: { cause?: unknown; }); } /** * Resolves the config for a request. A static config is normalized once up front. A factory runs per * request and its result is normalized and cached by content. If the factory throws or its config * won't normalize, we fall back to the handler, then the host's last-known-good config, then throw. */ export declare class ConfigResolution { private readonly source; private readonly onUnresolved; private readonly maxCachedConfigs; private readonly logger; private readonly cache; private readonly lastGoodByHost; constructor(opts: ConfigResolutionOptions); resolve(request: Request): Promise; private remember; private rememberGood; private touch; private logFailure; private failOver; }