/** * Shared extraction helpers for parser functions * Reduces code duplication across HTML, CSS, JS, JSON, and SVG parsers */ /** * Options for pattern-based extraction */ export interface ExtractionOptions { /** The file content to search */ content: string; /** Base directory for resolving absolute paths */ baseDir: string; /** Path to the file being parsed (for resolving relative paths) */ filePath: string; /** Regex patterns to match (can be array of RegExp) */ patterns: RegExp | RegExp[]; /** Optional filter function to skip certain URLs (defaults to allowing all) */ shouldSkip?: (url: string) => boolean; /** Optional custom path resolver (defaults to standard resolution logic) */ resolvePath?: (ref: string, fileDir: string, baseDir: string) => string; } /** * Default path resolution logic used across all parsers * Handles both absolute paths (starting with /) and relative paths */ export declare function defaultPathResolver(ref: string, fileDir: string, baseDir: string): string; /** * Extracts file references from content using regex patterns * This is the core extraction logic shared by all parser functions * * @param options - Extraction configuration options * @returns Array of resolved file paths */ export declare function extractReferencesFromPatterns(options: ExtractionOptions): string[]; /** * Common URL skip predicates */ export declare const UrlSkipPredicates: { /** * Skips external URLs and data URIs * Used by HTML parser and others */ skipExternalAndData: (url: string) => boolean; /** * Skips only external HTTP(S) URLs and protocol-relative URLs * Used by CSS parser */ skipExternal: (url: string) => boolean; /** * Allows only relative paths (starting with ./ ../ or /) * Used by JavaScript parser for import statements */ allowOnlyRelative: (url: string) => boolean; }; //# sourceMappingURL=extractionHelpers.d.ts.map