import type { Dirent } from "node:fs"; import type { MatcherContext, Total } from "./patterns/matcherContext.js"; import type { MatcherStream } from "./patterns/matcherStream.js"; import type { Resource } from "./patterns/resource.js"; import type { ScanOptions } from "./types.js"; import { type RuleMatch } from "./patterns/rule.js"; export type WalkOptions = { relPath: string; lowerRelPath?: string; parentPath: string; entry: Dirent; resource: Resource; stream: MatcherStream | undefined; scanOptions: Required; depth: number; }; export type WalkResult = { path: string; parentPath: string; match: RuleMatch; includeParent: boolean; tooDeep: boolean; next: 0 | 1; depth: number; isDir: boolean; }; export type WalkTotal = { type?: "total"; dir: string; files: number; matched: number; dirs: number; depth: number; ignored: boolean; }; /** * @since 0.11.0 */ export declare function walkIncludes(options: WalkOptions, cb: (err: Error | null, result: WalkResult) => void): void; /** * Patches the {@link MatcherContext} with the given result. */ export declare function walkPatchResult(ctx: MatcherContext, r: WalkResult): void; /** * Patches the {@link MatcherContext} with the given total. */ export declare function walkPatchTotal(ctx: MatcherContext, maxDepth: number, t: WalkTotal): void; /** * Propagates totals from child directories to their parents. */ export declare function propagateTotals(total: Map): void;