@evobug_com/safe-ts-feature-node 0.2.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/node-api.json +48 -85
- package/package.json +162 -3
- package/safe/buffer.d.ts +155 -0
- package/safe/buffer.js +582 -0
- package/safe/child_process.d.ts +32 -0
- package/safe/child_process.js +21 -0
- package/safe/core.d.ts +36 -0
- package/safe/core.js +25 -0
- package/safe/crypto.d.ts +105 -0
- package/safe/crypto.js +205 -0
- package/safe/dgram.d.ts +26 -0
- package/safe/dgram.js +76 -0
- package/safe/dns/promises.d.ts +136 -0
- package/safe/dns/promises.js +262 -0
- package/safe/errors.d.ts +155 -0
- package/safe/errors.js +32 -0
- package/safe/events.d.ts +11 -0
- package/safe/events.js +14 -0
- package/safe/ffi.d.ts +23 -0
- package/safe/ffi.js +57 -0
- package/safe/fs/promises.d.ts +168 -0
- package/safe/fs/promises.js +366 -0
- package/safe/fs.d.ts +201 -0
- package/safe/fs.js +422 -0
- package/safe/globals.d.ts +87 -0
- package/safe/globals.js +232 -0
- package/safe/http.d.ts +34 -0
- package/safe/http.js +85 -0
- package/safe/http2.d.ts +26 -0
- package/safe/http2.js +61 -0
- package/safe/https.d.ts +21 -0
- package/safe/https.js +29 -0
- package/safe/inspector/promises.d.ts +200 -0
- package/safe/inspector/promises.js +13 -0
- package/safe/inspector.d.ts +8 -0
- package/safe/inspector.js +13 -0
- package/safe/module.d.ts +21 -0
- package/safe/module.js +45 -0
- package/safe/net.d.ts +11 -0
- package/safe/net.js +17 -0
- package/safe/os.d.ts +20 -0
- package/safe/os.js +29 -0
- package/safe/perf_hooks.d.ts +11 -0
- package/safe/perf_hooks.js +12 -0
- package/safe/process.d.ts +31 -0
- package/safe/process.js +97 -0
- package/safe/punycode.d.ts +10 -0
- package/safe/punycode.js +21 -0
- package/safe/querystring.d.ts +11 -0
- package/safe/querystring.js +21 -0
- package/safe/readline/promises.d.ts +12 -0
- package/safe/readline/promises.js +13 -0
- package/safe/runtime.d.ts +10 -0
- package/safe/runtime.js +16 -0
- package/safe/sqlite.d.ts +54 -0
- package/safe/sqlite.js +118 -0
- package/safe/stream/consumers.d.ts +19 -0
- package/safe/stream/consumers.js +54 -0
- package/safe/stream/promises.d.ts +26 -0
- package/safe/stream/promises.js +22 -0
- package/safe/stream/web.d.ts +18 -0
- package/safe/stream/web.js +37 -0
- package/safe/stream.d.ts +29 -0
- package/safe/stream.js +62 -0
- package/safe/tls.d.ts +27 -0
- package/safe/tls.js +65 -0
- package/safe/url.d.ts +28 -0
- package/safe/url.js +57 -0
- package/safe/util.d.ts +13 -0
- package/safe/util.js +25 -0
- package/safe/v8.d.ts +28 -0
- package/safe/v8.js +85 -0
- package/safe/vm.d.ts +23 -0
- package/safe/vm.js +69 -0
- package/safe/wasi.d.ts +10 -0
- package/safe/wasi.js +20 -0
- package/safe/worker_threads.d.ts +31 -0
- package/safe/worker_threads.js +62 -0
- package/safe/zlib.d.ts +61 -0
- package/safe/zlib.js +214 -0
- package/safe-ts.json +1722 -490
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
// Generated from node-api.json and @types/node by `npm run generate:safe` (packages/pack-kit/generate.ts): do not edit.
|
|
2
|
+
/// <reference types="node" />
|
|
3
|
+
import type { Result } from "@evobug_com/safe-ts-std/result";
|
|
4
|
+
import type { NodeError, SystemError } from "../errors.js";
|
|
5
|
+
import type * as $buffer from "node:buffer";
|
|
6
|
+
import type * as $events from "node:events";
|
|
7
|
+
import type * as $fs from "node:fs";
|
|
8
|
+
import type * as $fsPromises from "node:fs/promises";
|
|
9
|
+
export * from "node:fs/promises";
|
|
10
|
+
|
|
11
|
+
/** `access()` (node:fs/promises), with what it rejects with returned as an `Err`: `Error [E*] {errno, syscall: 'access', path}`. */
|
|
12
|
+
export declare function access(path: $fs.PathLike, mode?: number): Promise<Result<void, SystemError<"access", { path: string }>>>;
|
|
13
|
+
/** `appendFile()` (node:fs/promises), with what it rejects with returned as an `Err`: `Error [E*] {errno, syscall: 'open' | 'write', path?}`. */
|
|
14
|
+
export declare function appendFile(path: $fs.PathLike | $fsPromises.FileHandle, data: string | NodeJS.ArrayBufferView | Iterable<string | NodeJS.ArrayBufferView> | AsyncIterable<string | NodeJS.ArrayBufferView>, options?: ($fs.ObjectEncodingOptions & $fsPromises.FlagAndOpenMode & { flush?: boolean | undefined }) | BufferEncoding): Promise<Result<void, SystemError<"open" | "write", { path?: string }>>>;
|
|
15
|
+
/** `chmod()` (node:fs/promises), with what it rejects with returned as an `Err`: `Error [E*] {errno, syscall: 'chmod', path}`. */
|
|
16
|
+
export declare function chmod(path: $fs.PathLike, mode: $fs.Mode): Promise<Result<void, SystemError<"chmod", { path: string }>>>;
|
|
17
|
+
/** `chown()` (node:fs/promises), with what it rejects with returned as an `Err`: `Error [E*] {errno, syscall: 'chown', path}`. */
|
|
18
|
+
export declare function chown(path: $fs.PathLike, uid: number, gid: number): Promise<Result<void, SystemError<"chown", { path: string }>>>;
|
|
19
|
+
/** `FileHandle#close()` (node:fs/promises), with what it rejects with returned as an `Err`: `Error [E*] {errno, syscall: 'close'}`. */
|
|
20
|
+
export declare function close(fileHandle: $fsPromises.FileHandle): Promise<Result<void, SystemError<"close">>>;
|
|
21
|
+
/** `copyFile()` (node:fs/promises), with what it rejects with returned as an `Err`: `Error [E*] {errno, syscall: 'copyfile', path, dest}`. */
|
|
22
|
+
export declare function copyFile(src: $fs.PathLike, dest: $fs.PathLike, mode?: number): Promise<Result<void, SystemError<"copyfile", { path: string; dest: string }>>>;
|
|
23
|
+
/** `cp()` (node:fs/promises), with what it rejects with returned as an `Err`: `Error [E*] {errno, syscall, path?, dest?} | SystemError [ERR_FS_CP_* | ERR_FS_EISDIR] {info, errno, syscall: 'cp', path}`. */
|
|
24
|
+
export declare function cp(source: string | URL, destination: string | URL, opts?: $fs.CopyOptions): Promise<Result<void, SystemError<string, { path?: string; dest?: string }> | NodeError<`ERR_FS_CP_${string}` | "ERR_FS_EISDIR", "SystemError", { info: { errno: number; code: string; message: string; syscall: string; path?: string; dest?: string }; errno: number; syscall: "cp"; path: string }>>>;
|
|
25
|
+
/** `FileHandle#datasync()` (node:fs/promises), with what it rejects with returned as an `Err`: `Error [E*] {errno, syscall: 'fdatasync'}`. */
|
|
26
|
+
export declare function datasync(fileHandle: $fsPromises.FileHandle): Promise<Result<void, SystemError<"fdatasync">>>;
|
|
27
|
+
/** `FileHandle#appendFile()` (node:fs/promises), with what it rejects with returned as an `Err`: `Error [E*] {errno, syscall: 'write'}`. */
|
|
28
|
+
export declare function fileHandleAppendFile(fileHandle: $fsPromises.FileHandle, data: string | NodeJS.ArrayBufferView | Iterable<string | NodeJS.ArrayBufferView> | AsyncIterable<string | NodeJS.ArrayBufferView>, options?: ($fs.ObjectEncodingOptions & $events.Abortable) | BufferEncoding): Promise<Result<void, SystemError<"write">>>;
|
|
29
|
+
/** `FileHandle#chmod()` (node:fs/promises), with what it rejects with returned as an `Err`: `Error [E*] {errno, syscall: 'fchmod'}`. */
|
|
30
|
+
export declare function fileHandleChmod(fileHandle: $fsPromises.FileHandle, mode: $fs.Mode): Promise<Result<void, SystemError<"fchmod">>>;
|
|
31
|
+
/** `FileHandle#chown()` (node:fs/promises), with what it rejects with returned as an `Err`: `Error [E*] {errno, syscall: 'fchown'}`. */
|
|
32
|
+
export declare function fileHandleChown(fileHandle: $fsPromises.FileHandle, uid: number, gid: number): Promise<Result<void, SystemError<"fchown">>>;
|
|
33
|
+
/** `FileHandle#readFile()` (node:fs/promises), with what it rejects with returned as an `Err`: `Error [E*] {errno, syscall: 'fstat' | 'read'}`. */
|
|
34
|
+
export declare function fileHandleReadFile<T extends NodeJS.ArrayBufferView>(fileHandle: $fsPromises.FileHandle, options: Omit<$fs.ReadFileOptionsWithBuffer<T>, "flag">): Promise<Result<$buffer.BufferView<T>, SystemError<"fstat" | "read">>>;
|
|
35
|
+
/** `FileHandle#readFile()` (node:fs/promises), with what it rejects with returned as an `Err`: `Error [E*] {errno, syscall: 'fstat' | 'read'}`. */
|
|
36
|
+
export declare function fileHandleReadFile(fileHandle: $fsPromises.FileHandle, options?: Omit<$fs.ReadFileOptionsWithBufferEncoding, "flag"> | null): Promise<Result<$buffer.NonSharedBuffer, SystemError<"fstat" | "read">>>;
|
|
37
|
+
/** `FileHandle#readFile()` (node:fs/promises), with what it rejects with returned as an `Err`: `Error [E*] {errno, syscall: 'fstat' | 'read'}`. */
|
|
38
|
+
export declare function fileHandleReadFile(fileHandle: $fsPromises.FileHandle, options: Omit<$fs.ReadFileOptionsWithStringEncoding, "flag"> | BufferEncoding): Promise<Result<string, SystemError<"fstat" | "read">>>;
|
|
39
|
+
/** `FileHandle#readFile()` (node:fs/promises), with what it rejects with returned as an `Err`: `Error [E*] {errno, syscall: 'fstat' | 'read'}`. */
|
|
40
|
+
export declare function fileHandleReadFile(fileHandle: $fsPromises.FileHandle, options: Omit<$fs.ReadFileOptions, "flag"> | BufferEncoding | null): Promise<Result<string | $buffer.NonSharedBuffer, SystemError<"fstat" | "read">>>;
|
|
41
|
+
/** `FileHandle#stat()` (node:fs/promises), with what it rejects with returned as an `Err`: `Error [E*] {errno, syscall: 'fstat'}`. */
|
|
42
|
+
export declare function fileHandleStat(fileHandle: $fsPromises.FileHandle, opts?: $fs.StatOptions & { bigint?: false | undefined; }): Promise<Result<$fs.Stats, SystemError<"fstat">>>;
|
|
43
|
+
/** `FileHandle#stat()` (node:fs/promises), with what it rejects with returned as an `Err`: `Error [E*] {errno, syscall: 'fstat'}`. */
|
|
44
|
+
export declare function fileHandleStat(fileHandle: $fsPromises.FileHandle, opts: $fs.StatOptions & { bigint: true; }): Promise<Result<$fs.BigIntStats, SystemError<"fstat">>>;
|
|
45
|
+
/** `FileHandle#stat()` (node:fs/promises), with what it rejects with returned as an `Err`: `Error [E*] {errno, syscall: 'fstat'}`. */
|
|
46
|
+
export declare function fileHandleStat(fileHandle: $fsPromises.FileHandle, opts?: $fs.StatOptions): Promise<Result<$fs.Stats | $fs.BigIntStats, SystemError<"fstat">>>;
|
|
47
|
+
/** `FileHandle#truncate()` (node:fs/promises), with what it rejects with returned as an `Err`: `Error [E*] {errno, syscall: 'ftruncate'}`. */
|
|
48
|
+
export declare function fileHandleTruncate(fileHandle: $fsPromises.FileHandle, len?: number): Promise<Result<void, SystemError<"ftruncate">>>;
|
|
49
|
+
/** `FileHandle#utimes()` (node:fs/promises), with what it rejects with returned as an `Err`: `Error [E*] {errno, syscall: 'futime'}`. */
|
|
50
|
+
export declare function fileHandleUtimes(fileHandle: $fsPromises.FileHandle, atime: $fs.TimeLike, mtime: $fs.TimeLike): Promise<Result<void, SystemError<"futime">>>;
|
|
51
|
+
/** `FileHandle#writeFile()` (node:fs/promises), with what it rejects with returned as an `Err`: `Error [E*] {errno, syscall: 'write'}`. */
|
|
52
|
+
export declare function fileHandleWriteFile(fileHandle: $fsPromises.FileHandle, data: string | NodeJS.ArrayBufferView | Iterable<string | NodeJS.ArrayBufferView> | AsyncIterable<string | NodeJS.ArrayBufferView>, options?: ($fs.ObjectEncodingOptions & $events.Abortable) | BufferEncoding): Promise<Result<void, SystemError<"write">>>;
|
|
53
|
+
/** `lchmod()` (node:fs/promises), with what it rejects with returned as an `Err`: `Error [ERR_METHOD_NOT_IMPLEMENTED]`. */
|
|
54
|
+
export declare function lchmod(path: $fs.PathLike, mode: $fs.Mode): Promise<Result<void, NodeError<"ERR_METHOD_NOT_IMPLEMENTED">>>;
|
|
55
|
+
/** `lchown()` (node:fs/promises), with what it rejects with returned as an `Err`: `Error [E*] {errno, syscall: 'lchown', path}`. */
|
|
56
|
+
export declare function lchown(path: $fs.PathLike, uid: number, gid: number): Promise<Result<void, SystemError<"lchown", { path: string }>>>;
|
|
57
|
+
/** `link()` (node:fs/promises), with what it rejects with returned as an `Err`: `Error [E*] {errno, syscall: 'link', path, dest}`. */
|
|
58
|
+
export declare function link(existingPath: $fs.PathLike, newPath: $fs.PathLike): Promise<Result<void, SystemError<"link", { path: string; dest: string }>>>;
|
|
59
|
+
/** `lstat()` (node:fs/promises), with what it rejects with returned as an `Err`: `Error [E*] {errno, syscall: 'lstat', path}`. */
|
|
60
|
+
export declare function lstat(path: $fs.PathLike, opts?: $fs.StatOptions & { bigint?: false | undefined; }): Promise<Result<$fs.Stats, SystemError<"lstat", { path: string }>>>;
|
|
61
|
+
/** `lstat()` (node:fs/promises), with what it rejects with returned as an `Err`: `Error [E*] {errno, syscall: 'lstat', path}`. */
|
|
62
|
+
export declare function lstat(path: $fs.PathLike, opts: $fs.StatOptions & { bigint: true; }): Promise<Result<$fs.BigIntStats, SystemError<"lstat", { path: string }>>>;
|
|
63
|
+
/** `lstat()` (node:fs/promises), with what it rejects with returned as an `Err`: `Error [E*] {errno, syscall: 'lstat', path}`. */
|
|
64
|
+
export declare function lstat(path: $fs.PathLike, opts?: $fs.StatOptions): Promise<Result<$fs.Stats | $fs.BigIntStats, SystemError<"lstat", { path: string }>>>;
|
|
65
|
+
/** `lutimes()` (node:fs/promises), with what it rejects with returned as an `Err`: `Error [E*] {errno, syscall: 'lutime', path}`. */
|
|
66
|
+
export declare function lutimes(path: $fs.PathLike, atime: $fs.TimeLike, mtime: $fs.TimeLike): Promise<Result<void, SystemError<"lutime", { path: string }>>>;
|
|
67
|
+
/** `mkdir()` (node:fs/promises), with what it rejects with returned as an `Err`: `Error [E*] {errno, syscall: 'mkdir', path}`. */
|
|
68
|
+
export declare function mkdir(path: $fs.PathLike, options: $fs.MakeDirectoryOptions & { recursive: true; }): Promise<Result<string | undefined, SystemError<"mkdir", { path: string }>>>;
|
|
69
|
+
/** `mkdir()` (node:fs/promises), with what it rejects with returned as an `Err`: `Error [E*] {errno, syscall: 'mkdir', path}`. */
|
|
70
|
+
export declare function mkdir(path: $fs.PathLike, options?: $fs.Mode | ($fs.MakeDirectoryOptions & { recursive?: false | undefined; })): Promise<Result<void, SystemError<"mkdir", { path: string }>>>;
|
|
71
|
+
/** `mkdir()` (node:fs/promises), with what it rejects with returned as an `Err`: `Error [E*] {errno, syscall: 'mkdir', path}`. */
|
|
72
|
+
export declare function mkdir(path: $fs.PathLike, options?: $fs.Mode | $fs.MakeDirectoryOptions): Promise<Result<string | undefined, SystemError<"mkdir", { path: string }>>>;
|
|
73
|
+
/** `mkdtemp()` (node:fs/promises), with what it rejects with returned as an `Err`: `Error [E*] {errno, syscall: 'mkdtemp', path}`. */
|
|
74
|
+
export declare function mkdtemp(prefix: string, options?: $fs.ObjectEncodingOptions | BufferEncoding): Promise<Result<string, SystemError<"mkdtemp", { path: string }>>>;
|
|
75
|
+
/** `mkdtemp()` (node:fs/promises), with what it rejects with returned as an `Err`: `Error [E*] {errno, syscall: 'mkdtemp', path}`. */
|
|
76
|
+
export declare function mkdtemp(prefix: string, options: $fs.BufferEncodingOption): Promise<Result<$buffer.NonSharedBuffer, SystemError<"mkdtemp", { path: string }>>>;
|
|
77
|
+
/** `mkdtemp()` (node:fs/promises), with what it rejects with returned as an `Err`: `Error [E*] {errno, syscall: 'mkdtemp', path}`. */
|
|
78
|
+
export declare function mkdtemp(prefix: string, options?: $fs.ObjectEncodingOptions | BufferEncoding): Promise<Result<string | $buffer.NonSharedBuffer, SystemError<"mkdtemp", { path: string }>>>;
|
|
79
|
+
/** `mkdtempDisposable()` (node:fs/promises), with what it rejects with returned as an `Err`: `Error [E*] {errno, syscall: 'mkdtemp', path}`. */
|
|
80
|
+
export declare function mkdtempDisposable(prefix: $fs.PathLike, options?: $fs.EncodingOption): Promise<Result<$fsPromises.DisposableTempDir, SystemError<"mkdtemp", { path: string }>>>;
|
|
81
|
+
/** `open()` (node:fs/promises), with what it rejects with returned as an `Err`: `Error [E*] {errno, syscall: 'open', path}`. */
|
|
82
|
+
export declare function open(path: $fs.PathLike, flags?: string | number, mode?: $fs.Mode): Promise<Result<$fsPromises.FileHandle, SystemError<"open", { path: string }>>>;
|
|
83
|
+
/** `opendir()` (node:fs/promises), with what it rejects with returned as an `Err`: `Error [E*] {errno, syscall: 'opendir', path}`. */
|
|
84
|
+
export declare function opendir(path: $fs.PathLike, options?: $fs.OpenDirOptions): Promise<Result<$fs.Dir, SystemError<"opendir", { path: string }>>>;
|
|
85
|
+
/** `FileHandle#read()` (node:fs/promises), with what it rejects with returned as an `Err`: `Error [E*] {errno, syscall: 'read'}`. */
|
|
86
|
+
export declare function read<T extends NodeJS.ArrayBufferView>(fileHandle: $fsPromises.FileHandle, buffer: T, offset?: number, length?: number, position?: $fs.ReadPosition): Promise<Result<$fsPromises.FileReadResult<T>, SystemError<"read">>>;
|
|
87
|
+
/** `FileHandle#read()` (node:fs/promises), with what it rejects with returned as an `Err`: `Error [E*] {errno, syscall: 'read'}`. */
|
|
88
|
+
export declare function read<T extends NodeJS.ArrayBufferView>(fileHandle: $fsPromises.FileHandle, buffer: T, options?: $fs.ReadOptions): Promise<Result<$fsPromises.FileReadResult<T>, SystemError<"read">>>;
|
|
89
|
+
/** `FileHandle#read()` (node:fs/promises), with what it rejects with returned as an `Err`: `Error [E*] {errno, syscall: 'read'}`. */
|
|
90
|
+
export declare function read<T extends NodeJS.ArrayBufferView = $buffer.NonSharedBuffer>(fileHandle: $fsPromises.FileHandle, options?: $fs.ReadOptionsWithBuffer<T>): Promise<Result<$fsPromises.FileReadResult<T>, SystemError<"read">>>;
|
|
91
|
+
/** `readdir()` (node:fs/promises), with what it rejects with returned as an `Err`: `Error [E*] {errno, syscall: 'scandir', path}`. */
|
|
92
|
+
export declare function readdir(path: $fs.PathLike, options?: ($fs.ObjectEncodingOptions & { withFileTypes?: false | undefined; recursive?: boolean | undefined; }) | BufferEncoding): Promise<Result<string[], SystemError<"scandir", { path: string }>>>;
|
|
93
|
+
/** `readdir()` (node:fs/promises), with what it rejects with returned as an `Err`: `Error [E*] {errno, syscall: 'scandir', path}`. */
|
|
94
|
+
export declare function readdir(path: $fs.PathLike, options: { encoding: "buffer"; withFileTypes?: false | undefined; recursive?: boolean | undefined; } | "buffer"): Promise<Result<$buffer.NonSharedBuffer[], SystemError<"scandir", { path: string }>>>;
|
|
95
|
+
/** `readdir()` (node:fs/promises), with what it rejects with returned as an `Err`: `Error [E*] {errno, syscall: 'scandir', path}`. */
|
|
96
|
+
export declare function readdir(path: $fs.PathLike, options?: ($fs.ObjectEncodingOptions & { withFileTypes?: false | undefined; recursive?: boolean | undefined; }) | BufferEncoding): Promise<Result<string[] | $buffer.NonSharedBuffer[], SystemError<"scandir", { path: string }>>>;
|
|
97
|
+
/** `readdir()` (node:fs/promises), with what it rejects with returned as an `Err`: `Error [E*] {errno, syscall: 'scandir', path}`. */
|
|
98
|
+
export declare function readdir(path: $fs.PathLike, options: $fs.ObjectEncodingOptions & { withFileTypes: true; recursive?: boolean | undefined; }): Promise<Result<$fs.Dirent[], SystemError<"scandir", { path: string }>>>;
|
|
99
|
+
/** `readdir()` (node:fs/promises), with what it rejects with returned as an `Err`: `Error [E*] {errno, syscall: 'scandir', path}`. */
|
|
100
|
+
export declare function readdir(path: $fs.PathLike, options: { encoding: "buffer"; withFileTypes: true; recursive?: boolean | undefined; }): Promise<Result<$fs.Dirent<$buffer.NonSharedBuffer>[], SystemError<"scandir", { path: string }>>>;
|
|
101
|
+
/** `readFile()` (node:fs/promises), with what it rejects with returned as an `Err`: `Error [E*] {errno, syscall: 'open' | 'fstat' | 'read', path?}`. */
|
|
102
|
+
export declare function readFile<T extends NodeJS.ArrayBufferView>(path: $fs.PathLike | $fsPromises.FileHandle, options: $fs.ReadFileOptionsWithBuffer<T>): Promise<Result<$buffer.BufferView<T>, SystemError<"open" | "fstat" | "read", { path?: string }>>>;
|
|
103
|
+
/** `readFile()` (node:fs/promises), with what it rejects with returned as an `Err`: `Error [E*] {errno, syscall: 'open' | 'fstat' | 'read', path?}`. */
|
|
104
|
+
export declare function readFile(path: $fs.PathLike | $fsPromises.FileHandle, options?: $fs.ReadFileOptionsWithBufferEncoding | null): Promise<Result<$buffer.NonSharedBuffer, SystemError<"open" | "fstat" | "read", { path?: string }>>>;
|
|
105
|
+
/** `readFile()` (node:fs/promises), with what it rejects with returned as an `Err`: `Error [E*] {errno, syscall: 'open' | 'fstat' | 'read', path?}`. */
|
|
106
|
+
export declare function readFile(path: $fs.PathLike | $fsPromises.FileHandle, options: $fs.ReadFileOptionsWithStringEncoding | BufferEncoding): Promise<Result<string, SystemError<"open" | "fstat" | "read", { path?: string }>>>;
|
|
107
|
+
/** `readFile()` (node:fs/promises), with what it rejects with returned as an `Err`: `Error [E*] {errno, syscall: 'open' | 'fstat' | 'read', path?}`. */
|
|
108
|
+
export declare function readFile(path: $fs.PathLike | $fsPromises.FileHandle, options: $fs.ReadFileOptions | BufferEncoding | null): Promise<Result<string | $buffer.NonSharedBuffer, SystemError<"open" | "fstat" | "read", { path?: string }>>>;
|
|
109
|
+
/** `readlink()` (node:fs/promises), with what it rejects with returned as an `Err`: `Error [E*] {errno, syscall: 'readlink', path}`. */
|
|
110
|
+
export declare function readlink(path: $fs.PathLike, options?: $fs.ObjectEncodingOptions | BufferEncoding): Promise<Result<string, SystemError<"readlink", { path: string }>>>;
|
|
111
|
+
/** `readlink()` (node:fs/promises), with what it rejects with returned as an `Err`: `Error [E*] {errno, syscall: 'readlink', path}`. */
|
|
112
|
+
export declare function readlink(path: $fs.PathLike, options: $fs.BufferEncodingOption): Promise<Result<$buffer.NonSharedBuffer, SystemError<"readlink", { path: string }>>>;
|
|
113
|
+
/** `readlink()` (node:fs/promises), with what it rejects with returned as an `Err`: `Error [E*] {errno, syscall: 'readlink', path}`. */
|
|
114
|
+
export declare function readlink(path: $fs.PathLike, options?: $fs.ObjectEncodingOptions | string): Promise<Result<string | $buffer.NonSharedBuffer, SystemError<"readlink", { path: string }>>>;
|
|
115
|
+
/** `FileHandle#readv()` (node:fs/promises), with what it rejects with returned as an `Err`: `Error [E*] {errno, syscall: 'read'}`. */
|
|
116
|
+
export declare function readv<TBuffers extends readonly NodeJS.ArrayBufferView[]>(fileHandle: $fsPromises.FileHandle, buffers: TBuffers, position?: number): Promise<Result<$fs.ReadVResult<TBuffers>, SystemError<"read">>>;
|
|
117
|
+
/** `realpath()` (node:fs/promises), with what it rejects with returned as an `Err`: `Error [E*] {errno, syscall: 'realpath', path}`. */
|
|
118
|
+
export declare function realpath(path: $fs.PathLike, options?: $fs.ObjectEncodingOptions | BufferEncoding): Promise<Result<string, SystemError<"realpath", { path: string }>>>;
|
|
119
|
+
/** `realpath()` (node:fs/promises), with what it rejects with returned as an `Err`: `Error [E*] {errno, syscall: 'realpath', path}`. */
|
|
120
|
+
export declare function realpath(path: $fs.PathLike, options: $fs.BufferEncodingOption): Promise<Result<$buffer.NonSharedBuffer, SystemError<"realpath", { path: string }>>>;
|
|
121
|
+
/** `realpath()` (node:fs/promises), with what it rejects with returned as an `Err`: `Error [E*] {errno, syscall: 'realpath', path}`. */
|
|
122
|
+
export declare function realpath(path: $fs.PathLike, options?: $fs.ObjectEncodingOptions | BufferEncoding): Promise<Result<string | $buffer.NonSharedBuffer, SystemError<"realpath", { path: string }>>>;
|
|
123
|
+
/** `rename()` (node:fs/promises), with what it rejects with returned as an `Err`: `Error [E*] {errno, syscall: 'rename', path, dest}`. */
|
|
124
|
+
export declare function rename(oldPath: $fs.PathLike, newPath: $fs.PathLike): Promise<Result<void, SystemError<"rename", { path: string; dest: string }>>>;
|
|
125
|
+
/** `rm()` (node:fs/promises), with what it rejects with returned as an `Err`: `Error [E*] {errno, syscall, path} | SystemError [ERR_FS_EISDIR] {info, errno, syscall: 'rm', path}`. */
|
|
126
|
+
export declare function rm(path: $fs.PathLike, options?: $fs.RmOptions): Promise<Result<void, SystemError<string, { path: string }> | NodeError<"ERR_FS_EISDIR", "SystemError", { info: { errno: number; code: string; message: string; syscall: string; path?: string; dest?: string }; errno: number; syscall: "rm"; path: string }>>>;
|
|
127
|
+
/** `rmdir()` (node:fs/promises), with what it rejects with returned as an `Err`: `Error [E*] {errno, syscall: 'rmdir', path}`. */
|
|
128
|
+
export declare function rmdir(path: $fs.PathLike): Promise<Result<void, SystemError<"rmdir", { path: string }>>>;
|
|
129
|
+
/** `stat()` (node:fs/promises), with what it rejects with returned as an `Err`: `Error [E*] {errno, syscall: 'stat', path}`. */
|
|
130
|
+
export declare function stat(path: $fs.PathLike): Promise<Result<$fs.Stats, SystemError<"stat", { path: string }>>>;
|
|
131
|
+
/** `stat()` (node:fs/promises), with what it rejects with returned as an `Err`: `Error [E*] {errno, syscall: 'stat', path}`. */
|
|
132
|
+
export declare function stat(path: $fs.PathLike, opts?: $fs.StatOptions & { bigint?: false | undefined; throwIfNoEntry?: true | undefined; }): Promise<Result<$fs.Stats, SystemError<"stat", { path: string }>>>;
|
|
133
|
+
/** `stat()` (node:fs/promises), with what it rejects with returned as an `Err`: `Error [E*] {errno, syscall: 'stat', path}`. */
|
|
134
|
+
export declare function stat(path: $fs.PathLike, opts: $fs.StatOptions & { bigint: true; throwIfNoEntry?: true | undefined; }): Promise<Result<$fs.BigIntStats, SystemError<"stat", { path: string }>>>;
|
|
135
|
+
/** `stat()` (node:fs/promises), with what it rejects with returned as an `Err`: `Error [E*] {errno, syscall: 'stat', path}`. */
|
|
136
|
+
export declare function stat(path: $fs.PathLike, opts: $fs.StatOptions & { bigint?: false | undefined; throwIfNoEntry: false; }): Promise<Result<$fs.Stats | undefined, SystemError<"stat", { path: string }>>>;
|
|
137
|
+
/** `stat()` (node:fs/promises), with what it rejects with returned as an `Err`: `Error [E*] {errno, syscall: 'stat', path}`. */
|
|
138
|
+
export declare function stat(path: $fs.PathLike, opts: $fs.StatOptions & { bigint: true; throwIfNoEntry: false; }): Promise<Result<$fs.BigIntStats | undefined, SystemError<"stat", { path: string }>>>;
|
|
139
|
+
/** `stat()` (node:fs/promises), with what it rejects with returned as an `Err`: `Error [E*] {errno, syscall: 'stat', path}`. */
|
|
140
|
+
export declare function stat(path: $fs.PathLike, opts: $fs.StatOptions & { throwIfNoEntry?: true | undefined; }): Promise<Result<$fs.Stats | $fs.BigIntStats, SystemError<"stat", { path: string }>>>;
|
|
141
|
+
/** `stat()` (node:fs/promises), with what it rejects with returned as an `Err`: `Error [E*] {errno, syscall: 'stat', path}`. */
|
|
142
|
+
export declare function stat(path: $fs.PathLike, opts?: $fs.StatOptions): Promise<Result<$fs.Stats | $fs.BigIntStats | undefined, SystemError<"stat", { path: string }>>>;
|
|
143
|
+
/** `statfs()` (node:fs/promises), with what it rejects with returned as an `Err`: `Error [E*] {errno, syscall: 'statfs', path}`. */
|
|
144
|
+
export declare function statfs(path: $fs.PathLike, opts?: $fs.StatFsOptions & { bigint?: false | undefined; }): Promise<Result<$fs.StatsFs, SystemError<"statfs", { path: string }>>>;
|
|
145
|
+
/** `statfs()` (node:fs/promises), with what it rejects with returned as an `Err`: `Error [E*] {errno, syscall: 'statfs', path}`. */
|
|
146
|
+
export declare function statfs(path: $fs.PathLike, opts: $fs.StatFsOptions & { bigint: true; }): Promise<Result<$fs.BigIntStatsFs, SystemError<"statfs", { path: string }>>>;
|
|
147
|
+
/** `statfs()` (node:fs/promises), with what it rejects with returned as an `Err`: `Error [E*] {errno, syscall: 'statfs', path}`. */
|
|
148
|
+
export declare function statfs(path: $fs.PathLike, opts?: $fs.StatFsOptions): Promise<Result<$fs.StatsFs | $fs.BigIntStatsFs, SystemError<"statfs", { path: string }>>>;
|
|
149
|
+
/** `symlink()` (node:fs/promises), with what it rejects with returned as an `Err`: `Error [E*] {errno, syscall: 'symlink', path, dest}`. */
|
|
150
|
+
export declare function symlink(target: $fs.PathLike, path: $fs.PathLike, type?: string): Promise<Result<void, SystemError<"symlink", { path: string; dest: string }>>>;
|
|
151
|
+
/** `FileHandle#sync()` (node:fs/promises), with what it rejects with returned as an `Err`: `Error [E*] {errno, syscall: 'fsync'}`. */
|
|
152
|
+
export declare function sync(fileHandle: $fsPromises.FileHandle): Promise<Result<void, SystemError<"fsync">>>;
|
|
153
|
+
/** `truncate()` (node:fs/promises), with what it rejects with returned as an `Err`: `Error [E*] {errno, syscall: 'open' | 'ftruncate', path?}`. */
|
|
154
|
+
export declare function truncate(path: $fs.PathLike, len?: number): Promise<Result<void, SystemError<"open" | "ftruncate", { path?: string }>>>;
|
|
155
|
+
/** `unlink()` (node:fs/promises), with what it rejects with returned as an `Err`: `Error [E*] {errno, syscall: 'unlink', path}`. */
|
|
156
|
+
export declare function unlink(path: $fs.PathLike): Promise<Result<void, SystemError<"unlink", { path: string }>>>;
|
|
157
|
+
/** `utimes()` (node:fs/promises), with what it rejects with returned as an `Err`: `Error [E*] {errno, syscall: 'utime', path}`. */
|
|
158
|
+
export declare function utimes(path: $fs.PathLike, atime: $fs.TimeLike, mtime: $fs.TimeLike): Promise<Result<void, SystemError<"utime", { path: string }>>>;
|
|
159
|
+
/** `FileHandle#write()` (node:fs/promises), with what it rejects with returned as an `Err`: `Error [E*] {errno, syscall: 'write'}`. */
|
|
160
|
+
export declare function write<TBuffer extends NodeJS.ArrayBufferView>(fileHandle: $fsPromises.FileHandle, buffer: TBuffer, offset?: number, length?: number, position?: number): Promise<Result<{ bytesWritten: number; buffer: TBuffer; }, SystemError<"write">>>;
|
|
161
|
+
/** `FileHandle#write()` (node:fs/promises), with what it rejects with returned as an `Err`: `Error [E*] {errno, syscall: 'write'}`. */
|
|
162
|
+
export declare function write<TBuffer extends Uint8Array>(fileHandle: $fsPromises.FileHandle, buffer: TBuffer, options?: { offset?: number; length?: number; position?: number }): Promise<Result<{ bytesWritten: number; buffer: TBuffer; }, SystemError<"write">>>;
|
|
163
|
+
/** `FileHandle#write()` (node:fs/promises), with what it rejects with returned as an `Err`: `Error [E*] {errno, syscall: 'write'}`. */
|
|
164
|
+
export declare function write(fileHandle: $fsPromises.FileHandle, data: string, position?: number, encoding?: BufferEncoding): Promise<Result<{ bytesWritten: number; buffer: string; }, SystemError<"write">>>;
|
|
165
|
+
/** `writeFile()` (node:fs/promises), with what it rejects with returned as an `Err`: `Error [E*] {errno, syscall: 'open' | 'write', path?}`. */
|
|
166
|
+
export declare function writeFile(file: $fs.PathLike | $fsPromises.FileHandle, data: string | NodeJS.ArrayBufferView | Iterable<string | NodeJS.ArrayBufferView> | AsyncIterable<string | NodeJS.ArrayBufferView>, options?: ($fs.ObjectEncodingOptions & { mode?: $fs.Mode | undefined; flag?: $fs.OpenMode | undefined; /** * If all data is successfully written to the file, and `flush` * is `true`, `filehandle.sync()` is used to flush the data. * @default false */ flush?: boolean | undefined; } & $events.Abortable) | BufferEncoding): Promise<Result<void, SystemError<"open" | "write", { path?: string }>>>;
|
|
167
|
+
/** `FileHandle#writev()` (node:fs/promises), with what it rejects with returned as an `Err`: `Error [E*] {errno, syscall: 'write'}`. */
|
|
168
|
+
export declare function writev<TBuffers extends readonly NodeJS.ArrayBufferView[]>(fileHandle: $fsPromises.FileHandle, buffers: TBuffers, position?: number): Promise<Result<$fs.WriteVResult<TBuffers>, SystemError<"write">>>;
|
|
@@ -0,0 +1,366 @@
|
|
|
1
|
+
// @safe-ts std
|
|
2
|
+
// Generated from node-api.json and @types/node by `npm run generate:safe` (packages/pack-kit/generate.ts): do not edit.
|
|
3
|
+
import * as $module from "node:fs/promises";
|
|
4
|
+
import { Err } from "@evobug_com/safe-ts-std/result";
|
|
5
|
+
import { failed, ok } from "../runtime.js";
|
|
6
|
+
export * from "node:fs/promises";
|
|
7
|
+
|
|
8
|
+
export function access(...args) {
|
|
9
|
+
try {
|
|
10
|
+
return Promise.resolve($module.access(...args)).then(ok, failed);
|
|
11
|
+
} catch (error) {
|
|
12
|
+
return Promise.resolve(new Err(error));
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export function appendFile(...args) {
|
|
17
|
+
try {
|
|
18
|
+
return Promise.resolve($module.appendFile(...args)).then(ok, failed);
|
|
19
|
+
} catch (error) {
|
|
20
|
+
return Promise.resolve(new Err(error));
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export function chmod(...args) {
|
|
25
|
+
try {
|
|
26
|
+
return Promise.resolve($module.chmod(...args)).then(ok, failed);
|
|
27
|
+
} catch (error) {
|
|
28
|
+
return Promise.resolve(new Err(error));
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export function chown(...args) {
|
|
33
|
+
try {
|
|
34
|
+
return Promise.resolve($module.chown(...args)).then(ok, failed);
|
|
35
|
+
} catch (error) {
|
|
36
|
+
return Promise.resolve(new Err(error));
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export function close(self, ...args) {
|
|
41
|
+
try {
|
|
42
|
+
return Promise.resolve(self.close(...args)).then(ok, failed);
|
|
43
|
+
} catch (error) {
|
|
44
|
+
return Promise.resolve(new Err(error));
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export function copyFile(...args) {
|
|
49
|
+
try {
|
|
50
|
+
return Promise.resolve($module.copyFile(...args)).then(ok, failed);
|
|
51
|
+
} catch (error) {
|
|
52
|
+
return Promise.resolve(new Err(error));
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export function cp(...args) {
|
|
57
|
+
try {
|
|
58
|
+
return Promise.resolve($module.cp(...args)).then(ok, failed);
|
|
59
|
+
} catch (error) {
|
|
60
|
+
return Promise.resolve(new Err(error));
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export function datasync(self, ...args) {
|
|
65
|
+
try {
|
|
66
|
+
return Promise.resolve(self.datasync(...args)).then(ok, failed);
|
|
67
|
+
} catch (error) {
|
|
68
|
+
return Promise.resolve(new Err(error));
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export function fileHandleAppendFile(self, ...args) {
|
|
73
|
+
try {
|
|
74
|
+
return Promise.resolve(self.appendFile(...args)).then(ok, failed);
|
|
75
|
+
} catch (error) {
|
|
76
|
+
return Promise.resolve(new Err(error));
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
export function fileHandleChmod(self, ...args) {
|
|
81
|
+
try {
|
|
82
|
+
return Promise.resolve(self.chmod(...args)).then(ok, failed);
|
|
83
|
+
} catch (error) {
|
|
84
|
+
return Promise.resolve(new Err(error));
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
export function fileHandleChown(self, ...args) {
|
|
89
|
+
try {
|
|
90
|
+
return Promise.resolve(self.chown(...args)).then(ok, failed);
|
|
91
|
+
} catch (error) {
|
|
92
|
+
return Promise.resolve(new Err(error));
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
export function fileHandleReadFile(self, ...args) {
|
|
97
|
+
try {
|
|
98
|
+
return Promise.resolve(self.readFile(...args)).then(ok, failed);
|
|
99
|
+
} catch (error) {
|
|
100
|
+
return Promise.resolve(new Err(error));
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
export function fileHandleStat(self, ...args) {
|
|
105
|
+
try {
|
|
106
|
+
return Promise.resolve(self.stat(...args)).then(ok, failed);
|
|
107
|
+
} catch (error) {
|
|
108
|
+
return Promise.resolve(new Err(error));
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
export function fileHandleTruncate(self, ...args) {
|
|
113
|
+
try {
|
|
114
|
+
return Promise.resolve(self.truncate(...args)).then(ok, failed);
|
|
115
|
+
} catch (error) {
|
|
116
|
+
return Promise.resolve(new Err(error));
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
export function fileHandleUtimes(self, ...args) {
|
|
121
|
+
try {
|
|
122
|
+
return Promise.resolve(self.utimes(...args)).then(ok, failed);
|
|
123
|
+
} catch (error) {
|
|
124
|
+
return Promise.resolve(new Err(error));
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
export function fileHandleWriteFile(self, ...args) {
|
|
129
|
+
try {
|
|
130
|
+
return Promise.resolve(self.writeFile(...args)).then(ok, failed);
|
|
131
|
+
} catch (error) {
|
|
132
|
+
return Promise.resolve(new Err(error));
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
export function lchmod(...args) {
|
|
137
|
+
try {
|
|
138
|
+
return Promise.resolve($module.lchmod(...args)).then(ok, failed);
|
|
139
|
+
} catch (error) {
|
|
140
|
+
return Promise.resolve(new Err(error));
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
export function lchown(...args) {
|
|
145
|
+
try {
|
|
146
|
+
return Promise.resolve($module.lchown(...args)).then(ok, failed);
|
|
147
|
+
} catch (error) {
|
|
148
|
+
return Promise.resolve(new Err(error));
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
export function link(...args) {
|
|
153
|
+
try {
|
|
154
|
+
return Promise.resolve($module.link(...args)).then(ok, failed);
|
|
155
|
+
} catch (error) {
|
|
156
|
+
return Promise.resolve(new Err(error));
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
export function lstat(...args) {
|
|
161
|
+
try {
|
|
162
|
+
return Promise.resolve($module.lstat(...args)).then(ok, failed);
|
|
163
|
+
} catch (error) {
|
|
164
|
+
return Promise.resolve(new Err(error));
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
export function lutimes(...args) {
|
|
169
|
+
try {
|
|
170
|
+
return Promise.resolve($module.lutimes(...args)).then(ok, failed);
|
|
171
|
+
} catch (error) {
|
|
172
|
+
return Promise.resolve(new Err(error));
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
export function mkdir(...args) {
|
|
177
|
+
try {
|
|
178
|
+
return Promise.resolve($module.mkdir(...args)).then(ok, failed);
|
|
179
|
+
} catch (error) {
|
|
180
|
+
return Promise.resolve(new Err(error));
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
export function mkdtemp(...args) {
|
|
185
|
+
try {
|
|
186
|
+
return Promise.resolve($module.mkdtemp(...args)).then(ok, failed);
|
|
187
|
+
} catch (error) {
|
|
188
|
+
return Promise.resolve(new Err(error));
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
export function mkdtempDisposable(...args) {
|
|
193
|
+
try {
|
|
194
|
+
return Promise.resolve($module.mkdtempDisposable(...args)).then(ok, failed);
|
|
195
|
+
} catch (error) {
|
|
196
|
+
return Promise.resolve(new Err(error));
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
export function open(...args) {
|
|
201
|
+
try {
|
|
202
|
+
return Promise.resolve($module.open(...args)).then(ok, failed);
|
|
203
|
+
} catch (error) {
|
|
204
|
+
return Promise.resolve(new Err(error));
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
export function opendir(...args) {
|
|
209
|
+
try {
|
|
210
|
+
return Promise.resolve($module.opendir(...args)).then(ok, failed);
|
|
211
|
+
} catch (error) {
|
|
212
|
+
return Promise.resolve(new Err(error));
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
export function read(self, ...args) {
|
|
217
|
+
try {
|
|
218
|
+
return Promise.resolve(self.read(...args)).then(ok, failed);
|
|
219
|
+
} catch (error) {
|
|
220
|
+
return Promise.resolve(new Err(error));
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
export function readdir(...args) {
|
|
225
|
+
try {
|
|
226
|
+
return Promise.resolve($module.readdir(...args)).then(ok, failed);
|
|
227
|
+
} catch (error) {
|
|
228
|
+
return Promise.resolve(new Err(error));
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
export function readFile(...args) {
|
|
233
|
+
try {
|
|
234
|
+
return Promise.resolve($module.readFile(...args)).then(ok, failed);
|
|
235
|
+
} catch (error) {
|
|
236
|
+
return Promise.resolve(new Err(error));
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
export function readlink(...args) {
|
|
241
|
+
try {
|
|
242
|
+
return Promise.resolve($module.readlink(...args)).then(ok, failed);
|
|
243
|
+
} catch (error) {
|
|
244
|
+
return Promise.resolve(new Err(error));
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
export function readv(self, ...args) {
|
|
249
|
+
try {
|
|
250
|
+
return Promise.resolve(self.readv(...args)).then(ok, failed);
|
|
251
|
+
} catch (error) {
|
|
252
|
+
return Promise.resolve(new Err(error));
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
export function realpath(...args) {
|
|
257
|
+
try {
|
|
258
|
+
return Promise.resolve($module.realpath(...args)).then(ok, failed);
|
|
259
|
+
} catch (error) {
|
|
260
|
+
return Promise.resolve(new Err(error));
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
export function rename(...args) {
|
|
265
|
+
try {
|
|
266
|
+
return Promise.resolve($module.rename(...args)).then(ok, failed);
|
|
267
|
+
} catch (error) {
|
|
268
|
+
return Promise.resolve(new Err(error));
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
export function rm(...args) {
|
|
273
|
+
try {
|
|
274
|
+
return Promise.resolve($module.rm(...args)).then(ok, failed);
|
|
275
|
+
} catch (error) {
|
|
276
|
+
return Promise.resolve(new Err(error));
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
export function rmdir(...args) {
|
|
281
|
+
try {
|
|
282
|
+
return Promise.resolve($module.rmdir(...args)).then(ok, failed);
|
|
283
|
+
} catch (error) {
|
|
284
|
+
return Promise.resolve(new Err(error));
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
export function stat(...args) {
|
|
289
|
+
try {
|
|
290
|
+
return Promise.resolve($module.stat(...args)).then(ok, failed);
|
|
291
|
+
} catch (error) {
|
|
292
|
+
return Promise.resolve(new Err(error));
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
export function statfs(...args) {
|
|
297
|
+
try {
|
|
298
|
+
return Promise.resolve($module.statfs(...args)).then(ok, failed);
|
|
299
|
+
} catch (error) {
|
|
300
|
+
return Promise.resolve(new Err(error));
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
export function symlink(...args) {
|
|
305
|
+
try {
|
|
306
|
+
return Promise.resolve($module.symlink(...args)).then(ok, failed);
|
|
307
|
+
} catch (error) {
|
|
308
|
+
return Promise.resolve(new Err(error));
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
export function sync(self, ...args) {
|
|
313
|
+
try {
|
|
314
|
+
return Promise.resolve(self.sync(...args)).then(ok, failed);
|
|
315
|
+
} catch (error) {
|
|
316
|
+
return Promise.resolve(new Err(error));
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
export function truncate(...args) {
|
|
321
|
+
try {
|
|
322
|
+
return Promise.resolve($module.truncate(...args)).then(ok, failed);
|
|
323
|
+
} catch (error) {
|
|
324
|
+
return Promise.resolve(new Err(error));
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
export function unlink(...args) {
|
|
329
|
+
try {
|
|
330
|
+
return Promise.resolve($module.unlink(...args)).then(ok, failed);
|
|
331
|
+
} catch (error) {
|
|
332
|
+
return Promise.resolve(new Err(error));
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
export function utimes(...args) {
|
|
337
|
+
try {
|
|
338
|
+
return Promise.resolve($module.utimes(...args)).then(ok, failed);
|
|
339
|
+
} catch (error) {
|
|
340
|
+
return Promise.resolve(new Err(error));
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
export function write(self, ...args) {
|
|
345
|
+
try {
|
|
346
|
+
return Promise.resolve(self.write(...args)).then(ok, failed);
|
|
347
|
+
} catch (error) {
|
|
348
|
+
return Promise.resolve(new Err(error));
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
export function writeFile(...args) {
|
|
353
|
+
try {
|
|
354
|
+
return Promise.resolve($module.writeFile(...args)).then(ok, failed);
|
|
355
|
+
} catch (error) {
|
|
356
|
+
return Promise.resolve(new Err(error));
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
export function writev(self, ...args) {
|
|
361
|
+
try {
|
|
362
|
+
return Promise.resolve(self.writev(...args)).then(ok, failed);
|
|
363
|
+
} catch (error) {
|
|
364
|
+
return Promise.resolve(new Err(error));
|
|
365
|
+
}
|
|
366
|
+
}
|