/** * Shared rate-paced HTTP fetcher used by all data sources (OpenInsider, SEC * EDGAR, FINRA). Each source supplies a `SourceConfig` with its own UA, * defaults, and rate-pace interval; per-call options can override defaults. */ export interface HttpFetchOptions { /** Skip the cache for this call. Default: cache enabled. */ cache?: boolean; /** Override the source's default cache TTL. */ ttlMs?: number; /** Override the source's default Accept header. */ accept?: string; /** * HTTP statuses that resolve to `null` instead of throwing. Defaults to the * source's `defaultNullStatuses`. Used by FINRA where 403 = file missing. */ nullStatuses?: number[]; /** Extra headers merged after the source defaults (e.g. Yahoo's Cookie). */ headers?: Record; } export interface SourceConfig { /** Identifier used in error messages and as the rate-pace key. */ name: string; /** Sent as the User-Agent header on every request. */ userAgent: string; /** Cache TTL in ms. Applied to every fetch from this source. */ defaultTtlMs: number; /** Default Accept header. Callers can override per-call via `accept`. */ defaultAccept: string; /** Minimum ms between requests for this source (rate pacing). 0 = no pacing. */ minIntervalMs?: number; /** Per-request timeout in ms. Default 30s. */ timeoutMs?: number; /** Statuses resolved to null. Callers can override per-call via `nullStatuses`. */ defaultNullStatuses?: number[]; } /** * Fetch a URL as text with rate-pacing, caching, and retry-once-on-5xx. * Returns `null` only if the response status matches `nullStatuses`. */ export declare function fetchHttp(url: string, config: SourceConfig, options?: HttpFetchOptions): Promise; /** * Binary variant of `fetchHttp` for ZIP / octet-stream downloads. */ export declare function fetchHttpBinary(url: string, config: SourceConfig, options?: HttpFetchOptions): Promise;