export type RuntimeResourceKind = 'theme' | 'translation' | 'both'; export interface RuntimeConfigMeta { version?: string; updatedAt?: string; hash?: string; schemaVersion?: string; } type RuntimeUpdateBase = { version?: string; hash?: string; url?: string; }; export type RuntimeUpdateEvent = (RuntimeUpdateBase & { resource: 'translation'; lang: string; }) | (RuntimeUpdateBase & { resource: 'theme'; theme: string; }) | (RuntimeUpdateBase & { resource: 'both'; lang: string; theme: string; }) | (RuntimeUpdateBase & { resource?: undefined; }); export type RuntimeUpdateSource = 'sse' | 'stream' | 'manual' | 'bootstrap'; export interface RuntimeConfigLoadResult { data: T; meta: RuntimeConfigMeta; source: 'network' | 'cache' | 'fallback'; hash: string; } export interface RuntimeConfigCheckResult { updated: boolean; meta: RuntimeConfigMeta; hash: string; } export interface RuntimeConfigStoreContract { get(key: string): Promise | null>; set(key: string, value: RuntimeConfigLoadResult): Promise; remove(key: string): Promise; } export interface RuntimeConfigLoaderOptions { fallbackData: T; appId?: string; schemaVersion?: string; resource: RuntimeResourceKind; logger?: { debug: (message: string, data?: Record) => void; warn: (message: string, data?: Record) => void; error: (message: string, error?: Error, data?: Record) => void; }; store?: RuntimeConfigStoreContract | null; parser?: (response: Response) => Promise; } export interface RuntimeUpdateAdapterOptions { resource: RuntimeResourceKind; logger?: { debug: (message: string, data?: Record) => void; warn: (message: string, data?: Record) => void; }; transform?: (event: MessageEvent) => RuntimeUpdateEvent | null; withCredentials?: boolean; eventType?: string; } export {};