/** * Domain Selector Presets - Pre-configured selectors for common government sites * * These presets help extract content more reliably from known government * websites by specifying the correct selectors for their structure. */ /** * Pagination configuration for domain presets */ export interface PaginationPresetConfig { /** Pagination type */ type: 'query_param' | 'path_segment' | 'date_range' | 'reference_based'; /** Parameter name for pagination (e.g., 'page', 'offset', 'cursor') */ paramName?: string; /** Starting value for first page */ startValue?: number | string; /** Increment for page/offset types */ increment?: number; /** CSS selector for next button (for button-based pagination) */ nextButtonSelector?: string; /** API endpoint for paginated results (if different from page URL) */ apiEndpoint?: string; /** Path to data array in API response */ responseDataPath?: string; /** Path to total count in API response */ totalCountPath?: string; /** Path to has-more indicator in API response */ hasMorePath?: string; /** Path to next cursor/token in API response */ nextCursorPath?: string; /** Items per page (for calculating total pages) */ itemsPerPage?: number; /** Date-based pagination config (for legal document registries) */ dateConfig?: { /** Date parameter name */ paramName: string; /** Date format (e.g., 'YYYY-MM-DD', 'YYYYMMDD') */ format: string; /** Start from newest or oldest */ direction: 'newest_first' | 'oldest_first'; }; /** Notes about pagination behavior */ notes?: string; } export interface DomainPreset { domain: string; name: string; selectors: { content: string; title?: string; navigation?: string; footer?: string; sidebar?: string; breadcrumb?: string; lastUpdated?: string; tables?: string; }; waitStrategy?: 'load' | 'domcontentloaded' | 'networkidle'; cookies?: { name: string; value: string; domain: string; }[]; /** Pagination configuration for multi-page content */ pagination?: PaginationPresetConfig; notes?: string; } /** * Spanish government site presets */ export declare const SPAIN_PRESETS: DomainPreset[]; /** * US government site presets */ export declare const US_PRESETS: DomainPreset[]; /** * EU and international presets */ export declare const EU_PRESETS: DomainPreset[]; /** * Legal document site presets with specialized pagination patterns */ export declare const LEGAL_PRESETS: DomainPreset[]; /** * All presets combined */ export declare const ALL_PRESETS: DomainPreset[]; /** * Find the best preset for a URL */ export declare function findPreset(url: string): DomainPreset | undefined; /** * Get content selector for a URL (falls back to common selectors) */ export declare function getContentSelector(url: string): string; /** * Get wait strategy for a URL */ export declare function getWaitStrategy(url: string): 'load' | 'domcontentloaded' | 'networkidle'; /** * Get pagination preset configuration for a URL */ export declare function getPaginationPreset(url: string): PaginationPresetConfig | undefined; /** * Check if a domain has a pagination preset configured */ export declare function hasPaginationPreset(url: string): boolean; /** * Get all domains that have pagination presets configured */ export declare function getDomainsWithPagination(): string[]; /** * Get elements to remove for cleaner extraction */ export declare function getRemovalSelectors(url: string): string[]; /** * Registry for adding custom presets at runtime */ declare class PresetRegistry { private customPresets; add(preset: DomainPreset): void; remove(domain: string): boolean; find(url: string): DomainPreset | undefined; list(): DomainPreset[]; } export declare const presetRegistry: PresetRegistry; export {}; //# sourceMappingURL=domain-presets.d.ts.map