import type { AppContext } from './context'; export type DynamicConfigFetcher = (ctx: AppContext) => Promise; interface DynamicConfigBase { interval?: number; /** * Transform raw response data into the stored config value. * Use this to apply defaults, remap fields, or coerce types. */ transform?: (raw: unknown) => unknown; } interface DynamicConfigWithUrl extends DynamicConfigBase { /** Source URL fetched via the built-in HTTP GET. */ url: string; /** Static headers. */ headers?: Record; /** Dynamic headers. */ dynamicHeaders?: Record Promise>; fetch?: never; filePath?: never; } interface DynamicConfigWithFetch extends DynamicConfigBase { url?: never; headers?: never; dynamicHeaders?: never; /** Custom fetcher for the raw config value. */ fetch: DynamicConfigFetcher; filePath?: never; } interface DynamicConfigWithFile extends DynamicConfigBase { url?: never; headers?: never; dynamicHeaders?: never; fetch?: never; /** Path to the file to read the config from. */ filePath: string; } export type DynamicConfigSetup = DynamicConfigWithUrl | DynamicConfigWithFetch | DynamicConfigWithFile; export declare class DynamicConfigPoller { ctx: AppContext; private namespace; private dynamicConfigSetup; constructor(ctx: AppContext, namespace: string, dynamicConfigSetup: DynamicConfigSetup); startPolling: () => Promise; private getPollTimeout; private onSuccess; private onError; } export {};