/** * Shared utilities for asset path detection and resolution */ /** * File extensions that are considered assets */ export declare const ASSET_EXTENSIONS: readonly ["png", "jpg", "jpeg", "gif", "svg", "webp", "ico", "woff", "woff2", "ttf", "eot", "otf", "json", "css", "js", "mjs", "wasm", "webm", "mp4", "m4v", "mov", "avi", "mkv", "flv", "wmv", "ogg", "ogv", "mp3", "m4a", "aac", "oga", "flac", "wav"]; /** * Creates a regex pattern for matching asset paths in string literals * Matches: * 1. Explicit paths: "/path", "./path", "../path" * 2. Webpack-style paths: "static/path", "assets/path", etc. * * @param extensions - Array of file extensions to match (without dots) * @param flags - Regex flags (default: 'gi') * @returns RegExp for matching quoted asset paths */ export declare function createAssetPathPattern(extensions?: readonly string[], flags?: string): RegExp; /** * Resolves an asset path reference to its location in the build directory * Handles three types of paths: * 1. Absolute paths from build root: "/static/logo.svg" -> "static/logo.svg" * 2. Explicit relative paths: "./logo.svg", "../logo.svg" * 3. Webpack-style paths (no leading slash/dots): "static/logo.svg" -> "static/logo.svg" * * @param ref - The referenced path from the source file * @param sourceFile - The file containing the reference (relative to baseDir) * @param baseDir - The build directory root * @returns Path relative to baseDir */ export declare function resolveAssetPath(ref: string, sourceFile: string, baseDir: string): string; /** * Checks if a URL should be skipped during analysis/rewriting * Skips: * - External URLs (http://, https://, //) * - Data URIs (data:) * - Blob URLs (blob:) * - Special webpack placeholders (__webpack_*, __NEXT_*) */ export declare function shouldSkipUrl(url: string): boolean; //# sourceMappingURL=utils.d.ts.map