/** * Represents options for walking through a directory structure. * * @template T - The type of the entries yielded by the walk. * @template TEntry - The runtime-specific type of the entries. */ interface WalkOptions { /** * Set to `true` to recursively walk through subdirectories. * * @default false */ recursive?: boolean; /** * Return `false` to skip the entry from being yielded. * * Excluding directories will *not* prevent them from being recursed into. * If you want to prevent recursion into a directory, use {@link recurse}. * * By default, all entries are included. */ include?: (entry: TEntry) => boolean; /** * Return `false` to skip recursing into the directory. * * The directory will still be yielded, use {@link include} to skip yielding it. * * By default, all directories are recursed into. * * #### Note: * Called only if {@link recursive} is `true`. */ recurse?: (entry: TEntry) => boolean; /** * Transform the entry before yielding it. */ transform?: (entry: TEntry) => T | PromiseLike; /** * Callback for when an entry is excluded. */ onExcluded?: (entry: TEntry) => void; } /** * Walks through a directory, using the Breadth-First Search (BFS) algorithm. * It scan a directory before its subdirectories. * * @template T - The type of the entries yielded by the walk. */ declare function walk(_path: string | string[], _options?: WalkOptions): AsyncGenerator, void, unknown>; export { walk }; export type { WalkOptions };