import { Stats } from "node:fs"; //#region index.d.ts /** A directory path, either as a string or a Uint8Array for raw byte paths. */ type Dir = string | Uint8Array; /** Options for `rrdir`, `rrdirAsync`, and `rrdirSync`. */ type RRDirOpts = { /** Whether to throw immediately when reading an entry fails. Default: `false`. */strict?: boolean; /** Whether to include `entry.stats`. Will reduce performance. Default: `false`. */ stats?: boolean; /** Whether to follow symlinks for both recursion and `stat` calls. Default: `false`. */ followSymlinks?: boolean; /** Path globs to include, e.g. `["**.map"]`. Default: `undefined`. */ include?: Array; /** Path globs to exclude, e.g. `["**.js"]`. Default: `undefined`. */ exclude?: Array; /** Whether `include` and `exclude` match case-insensitively. Default: `false`. */ insensitive?: boolean; }; /** A directory entry returned by `rrdir`, `rrdirAsync`, and `rrdirSync`. */ type Entry = { /** The path to the entry, will be relative if `dir` is given relative. If `dir` is a `Uint8Array`, this will be too. Always present. */path: T; /** Boolean indicating whether the entry is a directory. `undefined` on error. */ directory?: boolean; /** Boolean indicating whether the entry is a symbolic link. `undefined` on error. */ symlink?: boolean; /** A [`fs.stats`](https://nodejs.org/api/fs.html#fs_class_fs_stats) object, present when `options.stats` is set. `undefined` on error. */ stats?: Stats; /** Any error encountered while reading this entry. `undefined` on success. */ err?: Error; }; /** Recursively read a directory via async iterator. Memory usage is `O(1)`. */ declare function rrdir(dir: T, opts?: RRDirOpts): AsyncGenerator>; /** Recursively read a directory, returning all entries as an array. Memory usage is `O(n)`. */ declare function rrdirAsync(dir: T, opts?: RRDirOpts): Promise>>; /** Synchronously recursively read a directory, returning all entries as an array. Memory usage is `O(n)`. */ declare function rrdirSync(dir: T, opts?: RRDirOpts): Array>; //#endregion export { Dir, Entry, RRDirOpts, rrdir, rrdirAsync, rrdirSync };