import type { Stats } from 'fs'; /** * Options for creating a glob matcher */ export interface GlobMatcherOptions { /** * Patterns for files to include (glob patterns) * @default ['**'] - match all files */ include?: string[]; /** * Patterns for files to exclude (glob patterns) */ exclude?: string[]; /** * The root directory for matching. If provided, absolute paths will be * converted to relative paths before matching against patterns. * This is necessary because chokidar v4 passes absolute paths to the * ignored callback even when a cwd is specified. */ rootDir?: string; } /** * Creates a function that returns true if a path should be ignored by chokidar. * * The function is used as chokidar v4's `ignored` callback, which is consulted * both for files (to decide whether to watch them) and for directories (to * decide whether to descend into them). Chokidar v4 removed native glob support, * so this replicates chokidar v3's behavior using picomatch. * * The path is classified using the `Stats` chokidar provides (when available): * - Exclude patterns always take precedence and prune both files and directories. * - A **directory** is only pruned by excludes. It is never ignored merely for * failing the include filter, because nested files may still match — pruning * it would silently drop the entire subtree (the root cause of the original * bug where `include: ['src/**\/*.ts']` matched nothing). * - A **file** must match an include pattern to be watched. * - When `Stats` is absent (chokidar invokes the callback both with and without * stats during traversal), the path is kept if it either matches a file * include pattern or is a potential ancestor directory of one. * * @param options - The include and exclude patterns * @returns A function that takes a path (and optional stats) and returns true if it should be ignored */ export declare function createIgnoreMatcher(options: GlobMatcherOptions): (filePath: string, stats?: Stats) => boolean; //# sourceMappingURL=glob-matcher.d.ts.map