import { Stats } from "node:fs"; //#region index.d.ts /** A directory path, either as a string or a Uint8Array for raw byte paths. */ export type Dir = string | Uint8Array; /** Options for `rrdir`, `rrdirAsync`, and `rrdirSync`. */ export 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"]`. Supports `*`, `**` and `?`. Default: `undefined`. */ include?: Array; /** Path globs to exclude, e.g. `["**.js"]`. Supports `*`, `**` and `?`. Excluding a directory prunes its subtree. Default: `undefined`. */ exclude?: Array; /** Whether `include` and `exclude` match case-insensitively. Default: `false`. */ insensitive?: boolean; }; /** A directory entry returned by `rrdir`, `rrdirAsync`, and `rrdirSync`. */ export 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. Always `false` when `options.followSymlinks` is set. `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. Holds only one directory level in memory at a time. */ export declare function rrdir(dir: T, opts?: RRDirOpts): AsyncGenerator>; /** Recursively read a directory, returning all entries as an array. Memory usage is `O(n)`. */ export declare function rrdirAsync(dir: T, opts?: RRDirOpts): Promise>>; /** Synchronously recursively read a directory, returning all entries as an array. Memory usage is `O(n)`. */ export declare function rrdirSync(dir: T, opts?: RRDirOpts): Array>; //#endregion