/** * Dynamic Parser Registry * * Fetches parser configurations from the Python API and caches them. * Falls back to static parsers on failure. */ import { ParserConfig } from "./parsers.js"; export interface ParserOptions { parser_id: string; timeout: number; enabled: boolean; proxy?: string; user_agent?: string; custom_params?: Record; } export interface RegistryConfig { apiUrl: string; apiKey?: string; cacheTtlMs: number; enableDynamic: boolean; } export declare class ParserRegistry { private parsers; private parserOptions; private defaultOptions; private lastFetch; private lastOptionsFetch; private fetchPromise; private optionsFetchPromise; private config; private initialized; constructor(config?: Partial); /** * Get all parsers, fetching from API if cache is stale */ getParsers(): Promise; /** * Get a parser by ID */ getParserById(id: string): Promise; /** * Get a parser by A-Parser name */ getParserByAParserName(name: string): Promise; /** * Get parsers by category */ getParsersByCategory(category: string): Promise; /** * Get all categories */ getCategories(): Promise; /** * Force refresh of parser cache */ refresh(): Promise; /** * Get static parsers (no API call) */ getStaticParsers(): ParserConfig[]; /** * Get options for a specific parser */ getParserOptions(parserId: string): Promise; /** * Get timeout for a parser */ getParserTimeout(parserId: string): Promise; /** * Check if parser is enabled */ isParserEnabled(parserId: string): Promise; /** * Ensure options are fetched */ private ensureOptionsFetched; /** * Fetch parser options from API */ private fetchOptions; /** * Fetch parsers from API */ private fetchParsers; /** * Transform API parser response to ParserConfig */ private transformParser; private log; } /** * Get the global parser registry instance */ export declare function getRegistry(config?: Partial): ParserRegistry; /** * Reset the global registry (for testing) */ export declare function resetRegistry(): void; //# sourceMappingURL=parser-registry.d.ts.map