| | |
| | | /** |
| | | * The `fs/promises` API provides asynchronous file system methods that return |
| | | * promises. |
| | | * |
| | | * The promise APIs use the underlying Node.js threadpool to perform file |
| | | * system operations off the event loop thread. These operations are not |
| | | * synchronized or threadsafe. Care must be taken when performing multiple |
| | | * concurrent modifications on the same file or data corruption may occur. |
| | | * @since v10.0.0 |
| | | */ |
| | | declare module "node:fs/promises" { |
| | | import { NonSharedBuffer } from "node:buffer"; |
| | | import { Abortable } from "node:events"; |
| | |
| | | CopyOptions, |
| | | Dir, |
| | | Dirent, |
| | | DisposableTempDir, |
| | | EncodingOption, |
| | | GlobOptions, |
| | | GlobOptionsWithFileTypes, |
| | |
| | | prefix: string, |
| | | options?: ObjectEncodingOptions | BufferEncoding | null, |
| | | ): Promise<string | NonSharedBuffer>; |
| | | interface DisposableTempDir extends AsyncDisposable { |
| | | /** |
| | | * The path of the created directory. |
| | | */ |
| | | path: string; |
| | | /** |
| | | * A function which removes the created directory. |
| | | */ |
| | | remove(): Promise<void>; |
| | | /** |
| | | * The same as `remove`. |
| | | */ |
| | | [Symbol.asyncDispose](): Promise<void>; |
| | | } |
| | | /** |
| | | * The resulting Promise holds an async-disposable object whose `path` property |
| | | * holds the created directory path. When the object is disposed, the directory |