/** * Glob pattern matching utilities. * * This module provides glob pattern matching functionality that works * in both Node.js and browser environments. It's used by the file system * utilities but can also be used standalone for pattern matching. * * @module */ /** * Convert a glob pattern to a RegExp. * * Supports: * - `*` - Match any characters except path separator * - `**` - Match any characters including path separator * - `?` - Match single character * - `[abc]` - Character class * - `{a,b,c}` - Alternation * - `!pattern` - Negation (when used in ignore list) * * Results are cached for performance. * * @param pattern - Glob pattern to convert * @param options - Conversion options * @returns Compiled RegExp */ export declare function globToRegex(pattern: string, options?: { dot?: boolean; }): RegExp; /** * Normalize path separators to forward slashes. * * This is used to ensure consistent path matching regardless of platform. * * @param filePath - Path to normalize * @returns Path with forward slashes */ export declare function normalizePath(filePath: string): string; /** * Test if a path matches a glob pattern. * * @param filePath - File path to test * @param pattern - Glob pattern * @param options - Match options * @returns True if path matches pattern */ export declare function matchGlob(filePath: string, pattern: string, options?: { dot?: boolean; }): boolean; /** * Test if a path matches any of the given patterns. * * This is more efficient than calling matchGlob multiple times * because it avoids normalizing the path repeatedly. * * @param filePath - File path to test * @param patterns - Array of glob patterns * @param options - Match options * @returns True if path matches any pattern */ export declare function matchGlobAny(filePath: string, patterns: string[], options?: { dot?: boolean; }): boolean; /** * Create a pre-compiled matcher for multiple patterns. * * This is useful when you need to match many files against the same * set of patterns - it avoids repeated regex compilation. * * @param patterns - Array of glob patterns * @param options - Match options * @returns A function that tests if a path matches any pattern */ export declare function createGlobMatcher(patterns: string[], options?: { dot?: boolean; }): (filePath: string) => boolean; /** * Clear the regex cache. * * This is mainly useful for testing or memory-sensitive applications. */ export declare function clearGlobCache(): void;