@gjsify/fs 0.0.3 → 0.1.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.
Files changed (91) hide show
  1. package/README.md +31 -2
  2. package/lib/esm/callback.js +251 -15
  3. package/lib/esm/dirent.js +47 -6
  4. package/lib/esm/encoding.js +2 -3
  5. package/lib/esm/errors.js +13 -0
  6. package/lib/esm/file-handle.js +108 -66
  7. package/lib/esm/fs-watcher.js +44 -7
  8. package/lib/esm/index.js +140 -5
  9. package/lib/esm/promises.js +290 -69
  10. package/lib/esm/read-stream.js +82 -57
  11. package/lib/esm/stats.js +138 -18
  12. package/lib/esm/sync.js +293 -44
  13. package/lib/esm/write-stream.js +4 -4
  14. package/lib/types/callback.d.ts +233 -0
  15. package/lib/types/dirent.d.ts +77 -0
  16. package/lib/types/encoding.d.ts +6 -0
  17. package/lib/types/errors.d.ts +7 -0
  18. package/lib/types/file-handle.d.ts +367 -0
  19. package/lib/types/fs-watcher.d.ts +17 -0
  20. package/lib/types/index.d.ts +149 -0
  21. package/lib/types/promises.d.ts +158 -0
  22. package/lib/types/read-stream.d.ts +21 -0
  23. package/lib/types/stats.d.ts +67 -0
  24. package/lib/types/sync.d.ts +109 -0
  25. package/lib/types/types/encoding-option.d.ts +2 -0
  26. package/lib/types/types/file-read-options.d.ts +15 -0
  27. package/lib/types/types/file-read-result.d.ts +4 -0
  28. package/lib/types/types/flag-and-open-mode.d.ts +5 -0
  29. package/lib/types/types/index.d.ts +6 -0
  30. package/lib/types/types/open-flags.d.ts +1 -0
  31. package/lib/types/types/read-options.d.ts +5 -0
  32. package/lib/types/utils.d.ts +2 -0
  33. package/lib/types/write-stream.d.ts +45 -0
  34. package/package.json +22 -34
  35. package/src/callback.spec.ts +284 -30
  36. package/src/callback.ts +352 -39
  37. package/src/dirent.ts +56 -8
  38. package/src/encoding.ts +7 -2
  39. package/src/errors.spec.ts +389 -0
  40. package/src/errors.ts +19 -0
  41. package/src/extended.spec.ts +706 -0
  42. package/src/file-handle.spec.ts +104 -23
  43. package/src/file-handle.ts +147 -79
  44. package/src/fs-watcher.ts +55 -8
  45. package/src/index.ts +146 -2
  46. package/src/new-apis.spec.ts +505 -0
  47. package/src/promises.spec.ts +651 -11
  48. package/src/promises.ts +353 -81
  49. package/src/read-stream.ts +98 -74
  50. package/src/stat.spec.ts +22 -14
  51. package/src/stats.ts +176 -75
  52. package/src/streams.spec.ts +455 -0
  53. package/src/symlink.spec.ts +176 -26
  54. package/src/sync.spec.ts +204 -32
  55. package/src/sync.ts +363 -58
  56. package/src/test.mts +7 -2
  57. package/src/types/encoding-option.ts +1 -1
  58. package/src/types/flag-and-open-mode.ts +1 -1
  59. package/src/types/read-options.ts +2 -2
  60. package/src/utils.ts +2 -0
  61. package/src/write-stream.ts +9 -7
  62. package/tsconfig.json +23 -10
  63. package/tsconfig.tsbuildinfo +1 -0
  64. package/lib/cjs/callback.js +0 -112
  65. package/lib/cjs/dirent.js +0 -98
  66. package/lib/cjs/encoding.js +0 -34
  67. package/lib/cjs/file-handle.js +0 -444
  68. package/lib/cjs/fs-watcher.js +0 -50
  69. package/lib/cjs/index.js +0 -95
  70. package/lib/cjs/promises.js +0 -160
  71. package/lib/cjs/read-stream.js +0 -78
  72. package/lib/cjs/stats.js +0 -45
  73. package/lib/cjs/sync.js +0 -126
  74. package/lib/cjs/types/encoding-option.js +0 -0
  75. package/lib/cjs/types/file-read-options.js +0 -0
  76. package/lib/cjs/types/file-read-result.js +0 -0
  77. package/lib/cjs/types/flag-and-open-mode.js +0 -0
  78. package/lib/cjs/types/index.js +0 -6
  79. package/lib/cjs/types/open-flags.js +0 -0
  80. package/lib/cjs/types/read-options.js +0 -0
  81. package/lib/cjs/utils.js +0 -18
  82. package/lib/cjs/write-stream.js +0 -116
  83. package/test/watch.js +0 -1
  84. package/test.gjs.js +0 -35359
  85. package/test.gjs.js.map +0 -7
  86. package/test.gjs.mjs +0 -40570
  87. package/test.gjs.mjs.meta.json +0 -1
  88. package/test.node.js +0 -1479
  89. package/test.node.js.map +0 -7
  90. package/test.node.mjs +0 -710
  91. package/tsconfig.types.json +0 -8
@@ -0,0 +1,233 @@
1
+ import { PathLike, OpenMode, Mode, ReadPosition, ReadAsyncOptions, NoParamCallback, RmOptions, RmDirOptions, MakeDirectoryOptions } from 'node:fs';
2
+ import { Buffer } from 'node:buffer';
3
+ import { Stats, BigIntStats } from './stats.js';
4
+ export declare function stat(path: PathLike, callback: (err: NodeJS.ErrnoException | null, stats: Stats) => void): void;
5
+ export declare function stat(path: PathLike, options: {
6
+ bigint?: boolean;
7
+ }, callback: (err: NodeJS.ErrnoException | null, stats: Stats | BigIntStats) => void): void;
8
+ export declare function lstat(path: PathLike, callback: (err: NodeJS.ErrnoException | null, stats: Stats) => void): void;
9
+ export declare function lstat(path: PathLike, options: {
10
+ bigint?: boolean;
11
+ }, callback: (err: NodeJS.ErrnoException | null, stats: Stats | BigIntStats) => void): void;
12
+ export declare function readdir(path: PathLike, callback: (err: NodeJS.ErrnoException | null, files: string[]) => void): void;
13
+ export declare function readdir(path: PathLike, options: {
14
+ withFileTypes?: boolean;
15
+ encoding?: string;
16
+ recursive?: boolean;
17
+ }, callback: (err: NodeJS.ErrnoException | null, files: string[] | unknown[]) => void): void;
18
+ export declare function realpath(path: PathLike, callback: (err: NodeJS.ErrnoException | null, resolvedPath: string) => void): void;
19
+ export declare function realpath(path: PathLike, options: {
20
+ encoding?: BufferEncoding;
21
+ }, callback: (err: NodeJS.ErrnoException | null, resolvedPath: string) => void): void;
22
+ export declare function symlink(target: PathLike, path: PathLike, callback: NoParamCallback): void;
23
+ export declare function symlink(target: PathLike, path: PathLike, type: string | null, callback: NoParamCallback): void;
24
+ type OpenCallback = (err: NodeJS.ErrnoException | null, fd: number) => void;
25
+ type WriteStrCallback = (err: NodeJS.ErrnoException | null, written: number, str: string) => void;
26
+ type WriteBufCallback = <TBuffer extends NodeJS.ArrayBufferView>(err: NodeJS.ErrnoException | null, written: number, buffer: TBuffer) => void;
27
+ type ReadCallback = (err: NodeJS.ErrnoException | null, bytesRead: number, buffer: NodeJS.ArrayBufferView) => void;
28
+ /**
29
+ * Asynchronous file open. See the POSIX [`open(2)`](http://man7.org/linux/man-pages/man2/open.2.html) documentation for more details.
30
+ *
31
+ * `mode` sets the file mode (permission and sticky bits), but only if the file was
32
+ * created. On Windows, only the write permission can be manipulated; see {@link chmod}.
33
+ *
34
+ * The callback gets two arguments `(err, fd)`.
35
+ *
36
+ * Some characters (`< > : " / \ | ? *`) are reserved under Windows as documented
37
+ * by [Naming Files, Paths, and Namespaces](https://docs.microsoft.com/en-us/windows/desktop/FileIO/naming-a-file). Under NTFS, if the filename contains
38
+ * a colon, Node.js will open a file system stream, as described by [this MSDN page](https://docs.microsoft.com/en-us/windows/desktop/FileIO/using-streams).
39
+ *
40
+ * Functions based on `fs.open()` exhibit this behavior as well:`fs.writeFile()`, `fs.readFile()`, etc.
41
+ * @since v0.0.2
42
+ * @param [flags='r'] See `support of file system `flags``.
43
+ * @param [mode=0o666]
44
+ */
45
+ export declare function open(path: PathLike, flags: OpenMode | undefined, mode: Mode | undefined | null, callback: OpenCallback): void;
46
+ /**
47
+ * Asynchronous open(2) - open and possibly create a file. If the file is created, its mode will be `0o666`.
48
+ * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
49
+ * @param [flags='r'] See `support of file system `flags``.
50
+ */
51
+ export declare function open(path: PathLike, flags: OpenMode | undefined, callback: OpenCallback): void;
52
+ /**
53
+ * Asynchronous open(2) - open and possibly create a file. If the file is created, its mode will be `0o666`.
54
+ * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
55
+ */
56
+ export declare function open(path: PathLike, callback: OpenCallback): void;
57
+ /**
58
+ * Write `buffer` to the file specified by `fd`.
59
+ *
60
+ * `offset` determines the part of the buffer to be written, and `length` is
61
+ * an integer specifying the number of bytes to write.
62
+ *
63
+ * `position` refers to the offset from the beginning of the file where this data
64
+ * should be written. If `typeof position !== 'number'`, the data will be written
65
+ * at the current position. See [`pwrite(2)`](http://man7.org/linux/man-pages/man2/pwrite.2.html).
66
+ *
67
+ * The callback will be given three arguments `(err, bytesWritten, buffer)` where`bytesWritten` specifies how many _bytes_ were written from `buffer`.
68
+ *
69
+ * If this method is invoked as its `util.promisify()` ed version, it returns
70
+ * a promise for an `Object` with `bytesWritten` and `buffer` properties.
71
+ *
72
+ * It is unsafe to use `fs.write()` multiple times on the same file without waiting
73
+ * for the callback. For this scenario, {@link createWriteStream} is
74
+ * recommended.
75
+ *
76
+ * On Linux, positional writes don't work when the file is opened in append mode.
77
+ * The kernel ignores the position argument and always appends the data to
78
+ * the end of the file.
79
+ * @since v0.0.2
80
+ */
81
+ export declare function write<TBuffer extends NodeJS.ArrayBufferView>(fd: number, buffer: TBuffer, offset: number | undefined | null, length: number | undefined | null, position: number | undefined | null, callback: WriteBufCallback): void;
82
+ /**
83
+ * Asynchronously writes `buffer` to the file referenced by the supplied file descriptor.
84
+ * @param fd A file descriptor.
85
+ * @param offset The part of the buffer to be written. If not supplied, defaults to `0`.
86
+ * @param length The number of bytes to write. If not supplied, defaults to `buffer.length - offset`.
87
+ */
88
+ export declare function write<TBuffer extends NodeJS.ArrayBufferView>(fd: number, buffer: TBuffer, offset: number | undefined | null, length: number | undefined | null, callback: WriteBufCallback): void;
89
+ /**
90
+ * Asynchronously writes `buffer` to the file referenced by the supplied file descriptor.
91
+ * @param fd A file descriptor.
92
+ * @param offset The part of the buffer to be written. If not supplied, defaults to `0`.
93
+ */
94
+ export declare function write<TBuffer extends NodeJS.ArrayBufferView>(fd: number, buffer: TBuffer, offset: number | undefined | null, callback: WriteBufCallback): void;
95
+ /**
96
+ * Asynchronously writes `buffer` to the file referenced by the supplied file descriptor.
97
+ * @param fd A file descriptor.
98
+ */
99
+ export declare function write<TBuffer extends NodeJS.ArrayBufferView>(fd: number, buffer: TBuffer, callback: WriteBufCallback): void;
100
+ /**
101
+ * Asynchronously writes `string` to the file referenced by the supplied file descriptor.
102
+ * @param fd A file descriptor.
103
+ * @param string A string to write.
104
+ * @param position The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position.
105
+ * @param encoding The expected string encoding.
106
+ */
107
+ export declare function write(fd: number, string: string, position: number | undefined | null, encoding: BufferEncoding | undefined | null, callback: WriteStrCallback): void;
108
+ /**
109
+ * Asynchronously writes `string` to the file referenced by the supplied file descriptor.
110
+ * @param fd A file descriptor.
111
+ * @param string A string to write.
112
+ * @param position The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position.
113
+ */
114
+ export declare function write(fd: number, string: string, position: number | undefined | null, callback: WriteStrCallback): void;
115
+ /**
116
+ * Asynchronously writes `string` to the file referenced by the supplied file descriptor.
117
+ * @param fd A file descriptor.
118
+ * @param string A string to write.
119
+ */
120
+ export declare function write(fd: number, string: string, callback: WriteStrCallback): void;
121
+ /**
122
+ * Read data from the file specified by `fd`.
123
+ *
124
+ * The callback is given the three arguments, `(err, bytesRead, buffer)`.
125
+ *
126
+ * If the file is not modified concurrently, the end-of-file is reached when the
127
+ * number of bytes read is zero.
128
+ *
129
+ * If this method is invoked as its `util.promisify()` ed version, it returns
130
+ * a promise for an `Object` with `bytesRead` and `buffer` properties.
131
+ * @since v0.0.2
132
+ * @param buffer The buffer that the data will be written to.
133
+ * @param offset The position in `buffer` to write the data to.
134
+ * @param length The number of bytes to read.
135
+ * @param position Specifies where to begin reading from in the file. If `position` is `null` or `-1 `, data will be read from the current file position, and the file position will be updated. If
136
+ * `position` is an integer, the file position will be unchanged.
137
+ */
138
+ export declare function read<TBuffer extends NodeJS.ArrayBufferView>(fd: number, buffer: TBuffer, offset: number, length: number, position: ReadPosition | null, callback: (err: NodeJS.ErrnoException | null, bytesRead: number, buffer: TBuffer) => void): void;
139
+ /**
140
+ * Similar to the above `fs.read` function, this version takes an optional `options` object.
141
+ * If not otherwise specified in an `options` object,
142
+ * `buffer` defaults to `Buffer.alloc(16384)`,
143
+ * `offset` defaults to `0`,
144
+ * `length` defaults to `buffer.byteLength`, `- offset` as of Node 17.6.0
145
+ * `position` defaults to `null`
146
+ * @since v12.17.0, 13.11.0
147
+ */
148
+ export declare function read<TBuffer extends NodeJS.ArrayBufferView>(fd: number, options: ReadAsyncOptions<TBuffer>, callback: (err: NodeJS.ErrnoException | null, bytesRead: number, buffer: TBuffer) => void): void;
149
+ export declare function read(fd: number, callback: ReadCallback): void;
150
+ /**
151
+ * Read data from the file specified by `fd`.
152
+ *
153
+ * The callback is given the three arguments, `(err, bytesRead, buffer)`.
154
+ *
155
+ * If the file is not modified concurrently, the end-of-file is reached when the
156
+ * number of bytes read is zero.
157
+ *
158
+ * If this method is invoked as its `util.promisify()` ed version, it returns
159
+ * a promise for an `Object` with `bytesRead` and `buffer` properties.
160
+ * @since v0.0.2
161
+ * @param buffer The buffer that the data will be written to.
162
+ * @param offset The position in `buffer` to write the data to.
163
+ * @param length The number of bytes to read.
164
+ * @param position Specifies where to begin reading from in the file. If `position` is `null` or `-1 `, data will be read from the current file position, and the file position will be updated. If
165
+ * `position` is an integer, the file position will be unchanged.
166
+ */
167
+ export declare function read<TBuffer extends NodeJS.ArrayBufferView>(fd: number, buffer: TBuffer, offset: number, length: number, position: ReadPosition | null, callback: (err: NodeJS.ErrnoException | null, bytesRead: number, buffer: TBuffer) => void): void;
168
+ /**
169
+ * Similar to the above `fs.read` function, this version takes an optional `options` object.
170
+ * If not otherwise specified in an `options` object,
171
+ * `buffer` defaults to `Buffer.alloc(16384)`,
172
+ * `offset` defaults to `0`,
173
+ * `length` defaults to `buffer.byteLength`, `- offset` as of Node 17.6.0
174
+ * `position` defaults to `null`
175
+ * @since v12.17.0, 13.11.0
176
+ */
177
+ export declare function read<TBuffer extends NodeJS.ArrayBufferView>(fd: number, options: ReadAsyncOptions<TBuffer>, callback: (err: NodeJS.ErrnoException | null, bytesRead: number, buffer: TBuffer) => void): void;
178
+ export declare function read(fd: number, callback: ReadCallback): void;
179
+ /**
180
+ * Closes the file descriptor. No arguments other than a possible exception are
181
+ * given to the completion callback.
182
+ *
183
+ * Calling `fs.close()` on any file descriptor (`fd`) that is currently in use
184
+ * through any other `fs` operation may lead to undefined behavior.
185
+ *
186
+ * See the POSIX [`close(2)`](http://man7.org/linux/man-pages/man2/close.2.html) documentation for more detail.
187
+ * @since v0.0.2
188
+ */
189
+ export declare function close(fd: number, callback?: NoParamCallback): void;
190
+ /**
191
+ * Asynchronously removes files and directories (modeled on the standard POSIX `rm`utility). No arguments other than a possible exception are given to the
192
+ * completion callback.
193
+ * @since v14.14.0
194
+ */
195
+ export declare function rm(path: PathLike, callback: NoParamCallback): void;
196
+ export declare function rm(path: PathLike, options: RmOptions, callback: NoParamCallback): void;
197
+ export declare function rename(oldPath: PathLike, newPath: PathLike, callback: NoParamCallback): void;
198
+ export declare function copyFile(src: PathLike, dest: PathLike, callback: NoParamCallback): void;
199
+ export declare function copyFile(src: PathLike, dest: PathLike, mode: number, callback: NoParamCallback): void;
200
+ export declare function access(path: PathLike, callback: NoParamCallback): void;
201
+ export declare function access(path: PathLike, mode: number, callback: NoParamCallback): void;
202
+ export declare function appendFile(path: PathLike, data: string | Uint8Array, callback: NoParamCallback): void;
203
+ export declare function appendFile(path: PathLike, data: string | Uint8Array, options: {
204
+ encoding?: string;
205
+ mode?: number;
206
+ flag?: string;
207
+ } | string, callback: NoParamCallback): void;
208
+ export declare function readlink(path: PathLike, callback: (err: NodeJS.ErrnoException | null, linkString: string) => void): void;
209
+ export declare function readlink(path: PathLike, options: {
210
+ encoding?: string;
211
+ } | string, callback: (err: NodeJS.ErrnoException | null, linkString: string | Buffer) => void): void;
212
+ export declare function truncate(path: PathLike, callback: NoParamCallback): void;
213
+ export declare function truncate(path: PathLike, len: number, callback: NoParamCallback): void;
214
+ export declare function chmod(path: PathLike, mode: Mode, callback: NoParamCallback): void;
215
+ export declare function chown(path: PathLike, uid: number, gid: number, callback: NoParamCallback): void;
216
+ export declare function mkdir(path: PathLike, callback: NoParamCallback): void;
217
+ export declare function mkdir(path: PathLike, options: MakeDirectoryOptions | Mode, callback: NoParamCallback): void;
218
+ export declare function rmdir(path: PathLike, callback: NoParamCallback): void;
219
+ export declare function rmdir(path: PathLike, options: RmDirOptions, callback: NoParamCallback): void;
220
+ export declare function readFile(path: PathLike, callback: (err: NodeJS.ErrnoException | null, data: Buffer) => void): void;
221
+ export declare function readFile(path: PathLike, options: {
222
+ encoding?: string;
223
+ flag?: string;
224
+ } | string, callback: (err: NodeJS.ErrnoException | null, data: string | Buffer) => void): void;
225
+ export declare function writeFile(path: PathLike, data: string | Uint8Array, callback: NoParamCallback): void;
226
+ export declare function writeFile(path: PathLike, data: string | Uint8Array, options: {
227
+ encoding?: string;
228
+ mode?: number;
229
+ flag?: string;
230
+ } | string, callback: NoParamCallback): void;
231
+ export declare function link(existingPath: PathLike, newPath: PathLike, callback: NoParamCallback): void;
232
+ export declare function unlink(path: PathLike, callback: NoParamCallback): void;
233
+ export {};
@@ -0,0 +1,77 @@
1
+ import Gio from '@girs/gio-2.0';
2
+ import type { Dirent as OriginalDirent } from 'node:fs';
3
+ /**
4
+ * A representation of a directory entry, which can be a file or a subdirectory
5
+ * within the directory, as returned by reading from an `fs.Dir`. The
6
+ * directory entry is a combination of the file name and file type pairs.
7
+ *
8
+ * Additionally, when {@link readdir} or {@link readdirSync} is called with
9
+ * the `withFileTypes` option set to `true`, the resulting array is filled with `fs.Dirent` objects, rather than strings or `Buffer` s.
10
+ * @since v10.10.0
11
+ */
12
+ export declare class Dirent implements OriginalDirent {
13
+ /**
14
+ * The file name that this `fs.Dirent` object refers to. The type of this
15
+ * value is determined by the `options.encoding` passed to {@link readdir} or {@link readdirSync}.
16
+ * @since v10.10.0
17
+ */
18
+ name: string;
19
+ /**
20
+ * The path to the parent directory of the file this `fs.Dirent` object refers to.
21
+ * @since v20.12.0, v18.20.0
22
+ */
23
+ parentPath: string;
24
+ private _isFile;
25
+ private _isDirectory;
26
+ private _isBlockDevice;
27
+ private _isCharacterDevice;
28
+ private _isSymbolicLink;
29
+ private _isFIFO;
30
+ private _isSocket;
31
+ /** This is not part of node.fs and is used internal by gjsify */
32
+ protected _file: Gio.File;
33
+ /** This is not part of node.fs and is used internal by gjsify */
34
+ constructor(path: string, filename?: string, fileType?: Gio.FileType);
35
+ /**
36
+ * Classify a SPECIAL file type using the unix::mode attribute from Gio.FileInfo.
37
+ * Falls back to marking nothing if the mode attribute is unavailable.
38
+ */
39
+ private _classifySpecialFile;
40
+ /**
41
+ * Returns `true` if the `fs.Dirent` object describes a regular file.
42
+ * @since v10.10.0
43
+ */
44
+ isFile(): boolean;
45
+ /**
46
+ * Returns `true` if the `fs.Dirent` object describes a file system
47
+ * directory.
48
+ * @since v10.10.0
49
+ */
50
+ isDirectory(): boolean;
51
+ /**
52
+ * Returns `true` if the `fs.Dirent` object describes a block device.
53
+ * @since v10.10.0
54
+ */
55
+ isBlockDevice(): boolean;
56
+ /**
57
+ * Returns `true` if the `fs.Dirent` object describes a character device.
58
+ * @since v10.10.0
59
+ */
60
+ isCharacterDevice(): boolean;
61
+ /**
62
+ * Returns `true` if the `fs.Dirent` object describes a symbolic link.
63
+ * @since v10.10.0
64
+ */
65
+ isSymbolicLink(): boolean;
66
+ /**
67
+ * Returns `true` if the `fs.Dirent` object describes a first-in-first-out
68
+ * (FIFO) pipe.
69
+ * @since v10.10.0
70
+ */
71
+ isFIFO(): boolean;
72
+ /**
73
+ * Returns `true` if the `fs.Dirent` object describes a socket.
74
+ * @since v10.10.0
75
+ */
76
+ isSocket(): boolean;
77
+ }
@@ -0,0 +1,6 @@
1
+ import { Buffer } from 'node:buffer';
2
+ import type { ReadOptions } from './types/index.js';
3
+ import type { ObjectEncodingOptions, BufferEncodingOption } from 'node:fs';
4
+ export declare function getEncodingFromOptions(options?: ReadOptions | ObjectEncodingOptions | BufferEncodingOption, defaultEncoding?: null | BufferEncoding | "buffer"): BufferEncoding | 'buffer';
5
+ export declare function encodeUint8Array(encoding: BufferEncoding | 'buffer', data: Uint8Array): string | Buffer<ArrayBuffer>;
6
+ export declare function decode(str: string, encoding?: string): string;
@@ -0,0 +1,7 @@
1
+ import type { PathLike } from 'node:fs';
2
+ import { isNotFoundError } from '@gjsify/utils';
3
+ export { isNotFoundError };
4
+ /**
5
+ * Create a Node.js-style ErrnoException from a Gio error, with fs-specific path/dest fields.
6
+ */
7
+ export declare function createNodeError(err: any, syscall: string, path: PathLike, dest?: PathLike): NodeJS.ErrnoException;