@@ -45,35 +45,35 @@ export declare class Stats {
4545 get birthtime ( ) : Date
4646}
4747
48- export declare function access ( path : string , mode ?: number | undefined | null ) : Promise < unknown >
48+ export declare function access ( path : string , mode ?: number | undefined | null ) : Promise < void >
4949
5050export declare function accessSync ( path : string , mode ?: number | undefined | null ) : void
5151
5252export declare function appendFile (
5353 path : string ,
5454 data : string | Buffer ,
5555 options ?: WriteFileOptions | undefined | null ,
56- ) : Promise < unknown >
56+ ) : Promise < void >
5757
5858export declare function appendFileSync (
5959 path : string ,
6060 data : string | Buffer ,
6161 options ?: WriteFileOptions | undefined | null ,
6262) : void
6363
64- export declare function chmod ( path : string , mode : number ) : Promise < unknown >
64+ export declare function chmod ( path : string , mode : number ) : Promise < void >
6565
6666export declare function chmodSync ( path : string , mode : number ) : void
6767
68- export declare function chown ( path : string , uid : number , gid : number ) : Promise < unknown >
68+ export declare function chown ( path : string , uid : number , gid : number ) : Promise < void >
6969
7070export declare function chownSync ( path : string , uid : number , gid : number ) : void
7171
72- export declare function copyFile ( src : string , dest : string , mode ?: number | undefined | null ) : Promise < unknown >
72+ export declare function copyFile ( src : string , dest : string , mode ?: number | undefined | null ) : Promise < void >
7373
7474export declare function copyFileSync ( src : string , dest : string , mode ?: number | undefined | null ) : void
7575
76- export declare function cp ( src : string , dest : string , options ?: CpOptions | undefined | null ) : Promise < unknown >
76+ export declare function cp ( src : string , dest : string , options ?: CpOptions | undefined | null ) : Promise < void >
7777
7878export interface CpOptions {
7979 recursive ?: boolean
@@ -91,17 +91,21 @@ export interface CpOptions {
9191
9292export declare function cpSync ( src : string , dest : string , options ?: CpOptions | undefined | null ) : void
9393
94- export declare function exists ( path : string ) : Promise < unknown >
94+ export declare function exists ( path : string ) : Promise < boolean >
9595
9696export declare function existsSync ( path : string ) : boolean
9797
98- export declare function glob ( pattern : string , options ?: GlobOptions | undefined | null ) : Promise < unknown >
98+ export declare function glob (
99+ pattern : string ,
100+ options ?: GlobOptions | undefined | null ,
101+ ) : Promise < Array < string > | Array < Dirent > >
99102
100103export interface GlobOptions {
101104 cwd ?: string
102105 withFileTypes ?: boolean
103106 exclude ?: Array < string >
104107 concurrency ?: number
108+ /** Respect .gitignore / .ignore files (default: true) */
105109 gitIgnore ?: boolean
106110}
107111
@@ -110,15 +114,15 @@ export declare function globSync(
110114 options ?: GlobOptions | undefined | null ,
111115) : Array < string > | Array < Dirent >
112116
113- export declare function link ( existingPath : string , newPath : string ) : Promise < unknown >
117+ export declare function link ( existingPath : string , newPath : string ) : Promise < void >
114118
115119export declare function linkSync ( existingPath : string , newPath : string ) : void
116120
117- export declare function lstat ( path : string ) : Promise < unknown >
121+ export declare function lstat ( path : string ) : Promise < Stats >
118122
119123export declare function lstatSync ( path : string ) : Stats
120124
121- export declare function mkdir ( path : string , options ?: MkdirOptions | undefined | null ) : Promise < unknown >
125+ export declare function mkdir ( path : string , options ?: MkdirOptions | undefined | null ) : Promise < string | null >
122126
123127export interface MkdirOptions {
124128 recursive ?: boolean
@@ -127,29 +131,19 @@ export interface MkdirOptions {
127131
128132export declare function mkdirSync ( path : string , options ?: MkdirOptions | undefined | null ) : string | null
129133
130- export declare function mkdtemp ( prefix : string ) : Promise < unknown >
134+ export declare function mkdtemp ( prefix : string ) : Promise < string >
131135
132136export declare function mkdtempSync ( prefix : string ) : string
133137
134- export declare function readdir ( path : string , options ?: ReaddirOptions | undefined | null ) : Promise < unknown >
135-
136- /** * Reads the contents of a directory.
137- * @param {string | Buffer | URL } path
138- * @param {string | {
139- * encoding?: string;
140- * withFileTypes?: boolean;
141- * recursive?: boolean;
142- * }} [options]
143- * @param {(
144- * err?: Error,
145- * files?: string[] | Buffer[] | Dirent[]
146- * ) => any} callback
147- * @returns {void }
148- */
138+ export declare function readdir (
139+ path : string ,
140+ options ?: ReaddirOptions | undefined | null ,
141+ ) : Promise < Array < string > | Array < Dirent > >
142+
149143export interface ReaddirOptions {
150144 /**
151145 * File name encoding. 'utf8' (default) returns strings.
152- * 'buffer' returns Buffer objects for each name.
146+ * 'buffer' returns Buffer objects for each name (not yet supported, treated as 'utf8') .
153147 * Other values are treated as 'utf8'.
154148 */
155149 encoding ?: string
@@ -164,7 +158,7 @@ export declare function readdirSync(
164158 options ?: ReaddirOptions | undefined | null ,
165159) : Array < string > | Array < Dirent >
166160
167- export declare function readFile ( path : string , options ?: ReadFileOptions | undefined | null ) : Promise < unknown >
161+ export declare function readFile ( path : string , options ?: ReadFileOptions | undefined | null ) : Promise < string | Buffer >
168162
169163export interface ReadFileOptions {
170164 encoding ?: string
@@ -173,21 +167,21 @@ export interface ReadFileOptions {
173167
174168export declare function readFileSync ( path : string , options ?: ReadFileOptions | undefined | null ) : string | Buffer
175169
176- export declare function readlink ( path : string ) : Promise < unknown >
170+ export declare function readlink ( path : string ) : Promise < string >
177171
178172export declare function readlinkSync ( path : string ) : string
179173
180- export declare function realpath ( path : string ) : Promise < unknown >
174+ export declare function realpath ( path : string ) : Promise < string >
181175
182176export declare function realpathSync ( path : string ) : string
183177
184- export declare function rename ( oldPath : string , newPath : string ) : Promise < unknown >
178+ export declare function rename ( oldPath : string , newPath : string ) : Promise < void >
185179
186180export declare function renameSync ( oldPath : string , newPath : string ) : void
187181
188- export declare function rm ( path : string , options ?: RmOptions | undefined | null ) : Promise < unknown >
182+ export declare function rm ( path : string , options ?: RmOptions | undefined | null ) : Promise < void >
189183
190- export declare function rmdir ( path : string ) : Promise < unknown >
184+ export declare function rmdir ( path : string ) : Promise < void >
191185
192186export declare function rmdirSync ( path : string ) : void
193187
@@ -197,8 +191,7 @@ export declare function rmdirSync(path: string): void
197191 * - `force`: When true, silently ignore errors when path does not exist.
198192 * - `recursive`: When true, remove directory and all its contents.
199193 * - `maxRetries`: If an `EBUSY`, `EMFILE`, `ENFILE`, `ENOTEMPTY`, or `EPERM` error is
200- * encountered, Node.js retries the operation with a linear backoff of `retryDelay` ms longer on
201- * each try. This option represents the number of retries.
194+ * encountered, retries with a linear backoff of `retryDelay` ms on each try.
202195 * - `retryDelay`: The amount of time in milliseconds to wait between retries (default 100ms).
203196 * - `concurrency` (hyper-fs extension): Number of parallel threads for recursive removal.
204197 */
@@ -212,31 +205,41 @@ export interface RmOptions {
212205
213206export declare function rmSync ( path : string , options ?: RmOptions | undefined | null ) : void
214207
215- export declare function stat ( path : string ) : Promise < unknown >
208+ export declare function stat ( path : string ) : Promise < Stats >
216209
217210export declare function statSync ( path : string ) : Stats
218211
219- export declare function symlink ( target : string , path : string , symlinkType ?: string | undefined | null ) : Promise < unknown >
212+ export declare function symlink (
213+ target : string ,
214+ path : string ,
215+ /** On Windows: 'file' | 'dir' | 'junction'. Ignored on Unix. */
216+ symlinkType ?: string | undefined | null ,
217+ ) : Promise < void >
220218
221- export declare function symlinkSync ( target : string , path : string , symlinkType ?: string | undefined | null ) : void
219+ export declare function symlinkSync (
220+ target : string ,
221+ path : string ,
222+ /** On Windows: 'file' | 'dir' | 'junction'. Ignored on Unix. */
223+ symlinkType ?: string | undefined | null ,
224+ ) : void
222225
223- export declare function truncate ( path : string , len ?: number | undefined | null ) : Promise < unknown >
226+ export declare function truncate ( path : string , len ?: number | undefined | null ) : Promise < void >
224227
225228export declare function truncateSync ( path : string , len ?: number | undefined | null ) : void
226229
227- export declare function unlink ( path : string ) : Promise < unknown >
230+ export declare function unlink ( path : string ) : Promise < void >
228231
229232export declare function unlinkSync ( path : string ) : void
230233
231- export declare function utimes ( path : string , atime : number , mtime : number ) : Promise < unknown >
234+ export declare function utimes ( path : string , atime : number , mtime : number ) : Promise < void >
232235
233236export declare function utimesSync ( path : string , atime : number , mtime : number ) : void
234237
235238export declare function writeFile (
236239 path : string ,
237240 data : string | Buffer ,
238241 options ?: WriteFileOptions | undefined | null ,
239- ) : Promise < unknown >
242+ ) : Promise < void >
240243
241244export interface WriteFileOptions {
242245 encoding ?: string
0 commit comments