@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,367 @@
1
+ import { ReadStream } from "./read-stream.js";
2
+ import { WriteStream } from "./write-stream.js";
3
+ import { Stats } from "./stats.js";
4
+ import { ReadableStream } from "node:stream/web";
5
+ import { Buffer } from "node:buffer";
6
+ import type { Abortable } from 'node:events';
7
+ import type { FlagAndOpenMode, FileReadResult, FileReadOptions, OpenFlags } from './types/index.js';
8
+ import type { FileHandle as IFileHandle, CreateReadStreamOptions, CreateWriteStreamOptions } from 'node:fs/promises';
9
+ import type { ObjectEncodingOptions, Mode, OpenMode, PathLike, StatOptions, BigIntStats, WriteVResult, ReadVResult, ReadPosition } from 'node:fs';
10
+ import type { Interface as ReadlineInterface } from 'node:readline';
11
+ export declare class FileHandle implements IFileHandle {
12
+ readonly options: {
13
+ path: PathLike;
14
+ flags?: OpenFlags;
15
+ mode?: Mode;
16
+ };
17
+ /** Not part of the default implementation, used internal by gjsify */
18
+ private _file;
19
+ /** Not part of the default implementation, used internal by gjsify */
20
+ private static instances;
21
+ constructor(options: {
22
+ path: PathLike;
23
+ flags?: OpenFlags;
24
+ mode?: Mode;
25
+ });
26
+ /**
27
+ * The numeric file descriptor managed by the {FileHandle} object.
28
+ * @since v10.0.0
29
+ */
30
+ readonly fd: number;
31
+ /** Not part of the default implementation, used internal by gjsify */
32
+ static getInstance(fd: number): FileHandle;
33
+ /**
34
+ * Alias of `filehandle.writeFile()`.
35
+ *
36
+ * When operating on file handles, the mode cannot be changed from what it was set
37
+ * to with `fsPromises.open()`. Therefore, this is equivalent to `filehandle.writeFile()`.
38
+ * @since v10.0.0
39
+ * @return Fulfills with `undefined` upon success.
40
+ */
41
+ appendFile(data: string | Uint8Array, options?: (ObjectEncodingOptions & FlagAndOpenMode) | BufferEncoding | null): Promise<void>;
42
+ /**
43
+ * Changes the ownership of the file. A wrapper for [`chown(2)`](http://man7.org/linux/man-pages/man2/chown.2.html).
44
+ * @since v10.0.0
45
+ * @param uid The file's new owner's user id.
46
+ * @param gid The file's new group's group id.
47
+ * @return Fulfills with `undefined` upon success.
48
+ */
49
+ chown(uid: number, gid: number): Promise<void>;
50
+ /**
51
+ * Modifies the permissions on the file. See [`chmod(2)`](http://man7.org/linux/man-pages/man2/chmod.2.html).
52
+ * @since v10.0.0
53
+ * @param mode the file mode bit mask.
54
+ * @return Fulfills with `undefined` upon success.
55
+ */
56
+ chmod(mode: Mode): Promise<void>;
57
+ /**
58
+ * Unlike the 16 kb default `highWaterMark` for a `stream.Readable`, the stream
59
+ * returned by this method has a default `highWaterMark` of 64 kb.
60
+ *
61
+ * `options` can include `start` and `end` values to read a range of bytes from
62
+ * the file instead of the entire file. Both `start` and `end` are inclusive and
63
+ * start counting at 0, allowed values are in the
64
+ * \[0, [`Number.MAX_SAFE_INTEGER`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER)\] range. If `start` is
65
+ * omitted or `undefined`, `filehandle.createReadStream()` reads sequentially from
66
+ * the current file position. The `encoding` can be any one of those accepted by `Buffer`.
67
+ *
68
+ * If the `FileHandle` points to a character device that only supports blocking
69
+ * reads (such as keyboard or sound card), read operations do not finish until data
70
+ * is available. This can prevent the process from exiting and the stream from
71
+ * closing naturally.
72
+ *
73
+ * By default, the stream will emit a `'close'` event after it has been
74
+ * destroyed. Set the `emitClose` option to `false` to change this behavior.
75
+ *
76
+ * ```js
77
+ * import { open } from 'node:fs/promises';
78
+ *
79
+ * const fd = await open('/dev/input/event0');
80
+ * // Create a stream from some character device.
81
+ * const stream = fd.createReadStream();
82
+ * setTimeout(() => {
83
+ * stream.close(); // This may not close the stream.
84
+ * // Artificially marking end-of-stream, as if the underlying resource had
85
+ * // indicated end-of-file by itself, allows the stream to close.
86
+ * // This does not cancel pending read operations, and if there is such an
87
+ * // operation, the process may still not be able to exit successfully
88
+ * // until it finishes.
89
+ * stream.push(null);
90
+ * stream.read(0);
91
+ * }, 100);
92
+ * ```
93
+ *
94
+ * If `autoClose` is false, then the file descriptor won't be closed, even if
95
+ * there's an error. It is the application's responsibility to close it and make
96
+ * sure there's no file descriptor leak. If `autoClose` is set to true (default
97
+ * behavior), on `'error'` or `'end'` the file descriptor will be closed
98
+ * automatically.
99
+ *
100
+ * An example to read the last 10 bytes of a file which is 100 bytes long:
101
+ *
102
+ * ```js
103
+ * import { open } from 'node:fs/promises';
104
+ *
105
+ * const fd = await open('sample.txt');
106
+ * fd.createReadStream({ start: 90, end: 99 });
107
+ * ```
108
+ * @since v16.11.0
109
+ */
110
+ createReadStream(options?: CreateReadStreamOptions): ReadStream;
111
+ /**
112
+ * `options` may also include a `start` option to allow writing data at some
113
+ * position past the beginning of the file, allowed values are in the
114
+ * \[0, [`Number.MAX_SAFE_INTEGER`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER)\] range. Modifying a file rather than
115
+ * replacing it may require the `flags` `open` option to be set to `r+` rather than
116
+ * the default `r`. The `encoding` can be any one of those accepted by `Buffer`.
117
+ *
118
+ * If `autoClose` is set to true (default behavior) on `'error'` or `'finish'`the file descriptor will be closed automatically. If `autoClose` is false,
119
+ * then the file descriptor won't be closed, even if there's an error.
120
+ * It is the application's responsibility to close it and make sure there's no
121
+ * file descriptor leak.
122
+ *
123
+ * By default, the stream will emit a `'close'` event after it has been
124
+ * destroyed. Set the `emitClose` option to `false` to change this behavior.
125
+ * @since v16.11.0
126
+ */
127
+ createWriteStream(options?: CreateWriteStreamOptions): WriteStream;
128
+ /**
129
+ * Forces all currently queued I/O operations associated with the file to the
130
+ * operating system's synchronized I/O completion state. Refer to the POSIX [`fdatasync(2)`](http://man7.org/linux/man-pages/man2/fdatasync.2.html) documentation for details.
131
+ *
132
+ * Unlike `filehandle.sync` this method does not flush modified metadata.
133
+ * @since v10.0.0
134
+ * @return Fulfills with `undefined` upon success.
135
+ */
136
+ datasync(): Promise<void>;
137
+ /**
138
+ * Request that all data for the open file descriptor is flushed to the storage
139
+ * device. The specific implementation is operating system and device specific.
140
+ * Refer to the POSIX [`fsync(2)`](http://man7.org/linux/man-pages/man2/fsync.2.html) documentation for more detail.
141
+ * @since v10.0.0
142
+ * @return Fufills with `undefined` upon success.
143
+ */
144
+ sync(): Promise<void>;
145
+ /**
146
+ * Reads data from the file and stores that in the given buffer.
147
+ *
148
+ * If the file is not modified concurrently, the end-of-file is reached when the
149
+ * number of bytes read is zero.
150
+ * @since v10.0.0
151
+ * @param buffer A buffer that will be filled with the file data read.
152
+ * @param offset The location in the buffer at which to start filling.
153
+ * @param length The number of bytes to read.
154
+ * @param position The location where to begin reading data from the file. If `null`, data will be read from the current file position, and the position will be updated. If `position` is an
155
+ * integer, the current file position will remain unchanged.
156
+ * @return Fulfills upon success with an object with two properties:
157
+ */
158
+ read<T extends NodeJS.ArrayBufferView>(buffer: T, offset?: number | null, length?: number | null, position?: ReadPosition | null): Promise<FileReadResult<T>>;
159
+ read<T extends NodeJS.ArrayBufferView = Buffer>(options?: FileReadOptions<T>): Promise<FileReadResult<T>>;
160
+ /**
161
+ * Returns a `ReadableStream` that may be used to read the files data.
162
+ *
163
+ * An error will be thrown if this method is called more than once or is called after the `FileHandle` is closed
164
+ * or closing.
165
+ *
166
+ * ```js
167
+ * import { open } from 'node:fs/promises';
168
+ *
169
+ * const file = await open('./some/file/to/read');
170
+ *
171
+ * for await (const chunk of file.readableWebStream())
172
+ * console.log(chunk);
173
+ *
174
+ * await file.close();
175
+ * ```
176
+ *
177
+ * While the `ReadableStream` will read the file to completion, it will not close the `FileHandle` automatically. User code must still call the `fileHandle.close()` method.
178
+ *
179
+ * @since v17.0.0
180
+ * @experimental
181
+ */
182
+ readableWebStream(): ReadableStream;
183
+ /**
184
+ * Asynchronously reads the entire contents of a file.
185
+ *
186
+ * If `options` is a string, then it specifies the `encoding`.
187
+ *
188
+ * The `FileHandle` has to support reading.
189
+ *
190
+ * If one or more `filehandle.read()` calls are made on a file handle and then a`filehandle.readFile()` call is made, the data will be read from the current
191
+ * position till the end of the file. It doesn't always read from the beginning
192
+ * of the file.
193
+ * @since v10.0.0
194
+ * @return Fulfills upon a successful read with the contents of the file. If no encoding is specified (using `options.encoding`), the data is returned as a {Buffer} object. Otherwise, the
195
+ * data will be a string.
196
+ */
197
+ readFile(options?: {
198
+ encoding?: null | undefined;
199
+ flag?: OpenMode | undefined;
200
+ } | null): Promise<Buffer<ArrayBuffer>>;
201
+ /**
202
+ * Asynchronously reads the entire contents of a file. The underlying file will _not_ be closed automatically.
203
+ * The `FileHandle` must have been opened for reading.
204
+ * @param options An object that may contain an optional flag.
205
+ * If a flag is not provided, it defaults to `'r'`.
206
+ */
207
+ readFile(options: {
208
+ encoding: BufferEncoding;
209
+ flag?: OpenMode | undefined;
210
+ } | BufferEncoding): Promise<string>;
211
+ /**
212
+ * Convenience method to create a `readline` interface and stream over the file. For example:
213
+ *
214
+ * ```js
215
+ * import { open } from 'node:fs/promises';
216
+ *
217
+ * const file = await open('./some/file/to/read');
218
+ *
219
+ * for await (const line of file.readLines()) {
220
+ * console.log(line);
221
+ * }
222
+ * ```
223
+ *
224
+ * @since v18.11.0
225
+ * @param options See `filehandle.createReadStream()` for the options.
226
+ */
227
+ readLines(options?: CreateReadStreamOptions): ReadlineInterface;
228
+ /**
229
+ * @since v10.0.0
230
+ * @return Fulfills with an {fs.Stats} for the file.
231
+ */
232
+ stat(opts?: StatOptions & {
233
+ bigint?: false | undefined;
234
+ }): Promise<Stats>;
235
+ stat(opts: StatOptions & {
236
+ bigint: true;
237
+ }): Promise<BigIntStats>;
238
+ /**
239
+ * Truncates the file.
240
+ *
241
+ * If the file was larger than `len` bytes, only the first `len` bytes will be
242
+ * retained in the file.
243
+ *
244
+ * The following example retains only the first four bytes of the file:
245
+ *
246
+ * ```js
247
+ * import { open } from 'node:fs/promises';
248
+ *
249
+ * let filehandle = null;
250
+ * try {
251
+ * filehandle = await open('temp.txt', 'r+');
252
+ * await filehandle.truncate(4);
253
+ * } finally {
254
+ * await filehandle?.close();
255
+ * }
256
+ * ```
257
+ *
258
+ * If the file previously was shorter than `len` bytes, it is extended, and the
259
+ * extended part is filled with null bytes (`'\0'`):
260
+ *
261
+ * If `len` is negative then `0` will be used.
262
+ * @since v10.0.0
263
+ * @param [len=0]
264
+ * @return Fulfills with `undefined` upon success.
265
+ */
266
+ truncate(len?: number): Promise<void>;
267
+ /**
268
+ * Change the file system timestamps of the object referenced by the `FileHandle` then resolves the promise with no arguments upon success.
269
+ * @since v10.0.0
270
+ */
271
+ utimes(atime: string | number | Date, mtime: string | number | Date): Promise<void>;
272
+ /**
273
+ * Asynchronously writes data to a file, replacing the file if it already exists.`data` can be a string, a buffer, an
274
+ * [AsyncIterable](https://tc39.github.io/ecma262/#sec-asynciterable-interface) or
275
+ * [Iterable](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols#The_iterable_protocol) object.
276
+ * The promise is resolved with no arguments upon success.
277
+ *
278
+ * If `options` is a string, then it specifies the `encoding`.
279
+ *
280
+ * The `FileHandle` has to support writing.
281
+ *
282
+ * It is unsafe to use `filehandle.writeFile()` multiple times on the same file
283
+ * without waiting for the promise to be resolved (or rejected).
284
+ *
285
+ * If one or more `filehandle.write()` calls are made on a file handle and then a`filehandle.writeFile()` call is made, the data will be written from the
286
+ * current position till the end of the file. It doesn't always write from the
287
+ * beginning of the file.
288
+ * @since v10.0.0
289
+ */
290
+ writeFile(data: string | Uint8Array, options?: (ObjectEncodingOptions & FlagAndOpenMode & Abortable) | BufferEncoding | null): Promise<void>;
291
+ /**
292
+ * Write `buffer` to the file.
293
+ *
294
+ * The promise is resolved with an object containing two properties:
295
+ *
296
+ * It is unsafe to use `filehandle.write()` multiple times on the same file
297
+ * without waiting for the promise to be resolved (or rejected). For this
298
+ * scenario, use `filehandle.createWriteStream()`.
299
+ *
300
+ * On Linux, positional writes do not work when the file is opened in append mode.
301
+ * The kernel ignores the position argument and always appends the data to
302
+ * the end of the file.
303
+ * @since v10.0.0
304
+ * @param [offset=0] The start position from within `buffer` where the data to write begins.
305
+ * @param [length=buffer.byteLength - offset] The number of bytes from `buffer` to write.
306
+ * @param position The offset from the beginning of the file where the data from `buffer` should be written. If `position` is not a `number`, the data will be written at the current position.
307
+ * See the POSIX pwrite(2) documentation for more detail.
308
+ */
309
+ write<TBuffer extends NodeJS.ArrayBufferView>(buffer: TBuffer, offset?: number | null, length?: number | null, position?: number | null): Promise<{
310
+ bytesWritten: number;
311
+ buffer: TBuffer;
312
+ }>;
313
+ write<TBuffer extends Uint8Array>(buffer: TBuffer, options?: {
314
+ offset?: number;
315
+ length?: number;
316
+ position?: number;
317
+ }): Promise<{
318
+ bytesWritten: number;
319
+ buffer: TBuffer;
320
+ }>;
321
+ write(data: string, position?: number | null, encoding?: BufferEncoding | null): Promise<{
322
+ bytesWritten: number;
323
+ buffer: string;
324
+ }>;
325
+ /**
326
+ * Write an array of [ArrayBufferView](https://developer.mozilla.org/en-US/docs/Web/API/ArrayBufferView) s to the file.
327
+ *
328
+ * The promise is resolved with an object containing a two properties:
329
+ *
330
+ * It is unsafe to call `writev()` multiple times on the same file without waiting
331
+ * for the promise to be resolved (or rejected).
332
+ *
333
+ * On Linux, positional writes don't work when the file is opened in append mode.
334
+ * The kernel ignores the position argument and always appends the data to
335
+ * the end of the file.
336
+ * @since v12.9.0
337
+ * @param position The offset from the beginning of the file where the data from `buffers` should be written. If `position` is not a `number`, the data will be written at the current
338
+ * position.
339
+ */
340
+ writev<TBuffers extends readonly NodeJS.ArrayBufferView[]>(buffers: TBuffers, position?: number): Promise<WriteVResult<TBuffers>>;
341
+ /**
342
+ * Read from a file and write to an array of [ArrayBufferView](https://developer.mozilla.org/en-US/docs/Web/API/ArrayBufferView) s
343
+ * @since v13.13.0, v12.17.0
344
+ * @param position The offset from the beginning of the file where the data should be read from. If `position` is not a `number`, the data will be read from the current position.
345
+ * @return Fulfills upon success an object containing two properties:
346
+ */
347
+ readv<TBuffers extends readonly NodeJS.ArrayBufferView[]>(buffers: TBuffers, position?: number): Promise<ReadVResult<TBuffers>>;
348
+ /**
349
+ * Closes the file handle after waiting for any pending operation on the handle to
350
+ * complete.
351
+ *
352
+ * ```js
353
+ * import { open } from 'node:fs/promises';
354
+ *
355
+ * let filehandle;
356
+ * try {
357
+ * filehandle = await open('thefile.txt', 'r');
358
+ * } finally {
359
+ * await filehandle?.close();
360
+ * }
361
+ * ```
362
+ * @since v10.0.0
363
+ * @return Fulfills with `undefined` upon success.
364
+ */
365
+ close(): Promise<void>;
366
+ [Symbol.asyncDispose](): Promise<void>;
367
+ }
@@ -0,0 +1,17 @@
1
+ import { EventEmitter } from 'node:events';
2
+ import type { FSWatcher as IFSWatcher } from 'node:fs';
3
+ export declare class FSWatcher extends EventEmitter implements IFSWatcher {
4
+ constructor(filename: string, options: any, listener: any);
5
+ close(): void;
6
+ /**
7
+ * When called, requests that the Node.js event loop not exit so long as the
8
+ * FSWatcher is active. Calling ref() multiple times has no effect.
9
+ */
10
+ ref(): this;
11
+ /**
12
+ * When called, the active FSWatcher will not require the Node.js event loop
13
+ * to remain active. Calling unref() multiple times has no effect.
14
+ */
15
+ unref(): this;
16
+ }
17
+ export default FSWatcher;
@@ -0,0 +1,149 @@
1
+ import { existsSync, readdirSync, readFileSync, writeFileSync, mkdirSync, rmdirSync, unlinkSync, watch, mkdtempSync, rmSync, statSync, openSync, realpathSync, symlinkSync, lstatSync, renameSync, copyFileSync, accessSync, appendFileSync, readlinkSync, linkSync, truncateSync, chmodSync, chownSync } from './sync.js';
2
+ import { open, close, read, write, rm, realpath, readdir, symlink, lstat, stat, rename, copyFile, access, appendFile, readlink, truncate, chmod, chown, mkdir, rmdir, readFile, writeFile, unlink, link } from './callback.js';
3
+ import FSWatcher from './fs-watcher.js';
4
+ import { createReadStream, ReadStream } from './read-stream.js';
5
+ import { createWriteStream, WriteStream } from './write-stream.js';
6
+ import * as promises from './promises.js';
7
+ import { Stats, BigIntStats } from './stats.js';
8
+ import { Dirent } from './dirent.js';
9
+ export declare const constants: {
10
+ F_OK: number;
11
+ R_OK: number;
12
+ W_OK: number;
13
+ X_OK: number;
14
+ COPYFILE_EXCL: number;
15
+ COPYFILE_FICLONE: number;
16
+ COPYFILE_FICLONE_FORCE: number;
17
+ O_RDONLY: number;
18
+ O_WRONLY: number;
19
+ O_RDWR: number;
20
+ O_CREAT: number;
21
+ O_EXCL: number;
22
+ O_TRUNC: number;
23
+ O_APPEND: number;
24
+ O_SYNC: number;
25
+ O_NONBLOCK: number;
26
+ O_DIRECTORY: number;
27
+ O_NOFOLLOW: number;
28
+ S_IFMT: number;
29
+ S_IFREG: number;
30
+ S_IFDIR: number;
31
+ S_IFCHR: number;
32
+ S_IFBLK: number;
33
+ S_IFIFO: number;
34
+ S_IFLNK: number;
35
+ S_IFSOCK: number;
36
+ S_IRWXU: number;
37
+ S_IRUSR: number;
38
+ S_IWUSR: number;
39
+ S_IXUSR: number;
40
+ S_IRWXG: number;
41
+ S_IRGRP: number;
42
+ S_IWGRP: number;
43
+ S_IXGRP: number;
44
+ S_IRWXO: number;
45
+ S_IROTH: number;
46
+ S_IWOTH: number;
47
+ S_IXOTH: number;
48
+ };
49
+ export { FSWatcher, Stats, BigIntStats, Dirent, existsSync, readdirSync, readFileSync, writeFileSync, mkdirSync, rmdirSync, unlinkSync, mkdtempSync, rmSync, statSync, openSync, realpathSync, symlinkSync, lstatSync, renameSync, copyFileSync, accessSync, appendFileSync, readlinkSync, linkSync, truncateSync, chmodSync, chownSync, watch, createReadStream, ReadStream, createWriteStream, WriteStream, promises, open, close, read, write, rm, realpath, readdir, symlink, lstat, stat, rename, copyFile, access, appendFile, readlink, truncate, chmod, chown, mkdir, rmdir, readFile, writeFile, unlink, link, };
50
+ declare const _default: {
51
+ FSWatcher: typeof FSWatcher;
52
+ Stats: typeof Stats;
53
+ BigIntStats: typeof BigIntStats;
54
+ Dirent: typeof Dirent;
55
+ constants: {
56
+ F_OK: number;
57
+ R_OK: number;
58
+ W_OK: number;
59
+ X_OK: number;
60
+ COPYFILE_EXCL: number;
61
+ COPYFILE_FICLONE: number;
62
+ COPYFILE_FICLONE_FORCE: number;
63
+ O_RDONLY: number;
64
+ O_WRONLY: number;
65
+ O_RDWR: number;
66
+ O_CREAT: number;
67
+ O_EXCL: number;
68
+ O_TRUNC: number;
69
+ O_APPEND: number;
70
+ O_SYNC: number;
71
+ O_NONBLOCK: number;
72
+ O_DIRECTORY: number;
73
+ O_NOFOLLOW: number;
74
+ S_IFMT: number;
75
+ S_IFREG: number;
76
+ S_IFDIR: number;
77
+ S_IFCHR: number;
78
+ S_IFBLK: number;
79
+ S_IFIFO: number;
80
+ S_IFLNK: number;
81
+ S_IFSOCK: number;
82
+ S_IRWXU: number;
83
+ S_IRUSR: number;
84
+ S_IWUSR: number;
85
+ S_IXUSR: number;
86
+ S_IRWXG: number;
87
+ S_IRGRP: number;
88
+ S_IWGRP: number;
89
+ S_IXGRP: number;
90
+ S_IRWXO: number;
91
+ S_IROTH: number;
92
+ S_IWOTH: number;
93
+ S_IXOTH: number;
94
+ };
95
+ existsSync: typeof existsSync;
96
+ readdirSync: typeof readdirSync;
97
+ readFileSync: typeof readFileSync;
98
+ writeFileSync: typeof writeFileSync;
99
+ mkdirSync: typeof mkdirSync;
100
+ rmdirSync: typeof rmdirSync;
101
+ unlinkSync: typeof unlinkSync;
102
+ mkdtempSync: typeof mkdtempSync;
103
+ rmSync: typeof rmSync;
104
+ statSync: typeof statSync;
105
+ openSync: typeof openSync;
106
+ realpathSync: typeof realpathSync;
107
+ symlinkSync: typeof symlinkSync;
108
+ lstatSync: typeof lstatSync;
109
+ renameSync: typeof renameSync;
110
+ copyFileSync: typeof copyFileSync;
111
+ accessSync: typeof accessSync;
112
+ appendFileSync: typeof appendFileSync;
113
+ readlinkSync: typeof readlinkSync;
114
+ linkSync: typeof linkSync;
115
+ truncateSync: typeof truncateSync;
116
+ chmodSync: typeof chmodSync;
117
+ chownSync: typeof chownSync;
118
+ watch: typeof watch;
119
+ createReadStream: typeof createReadStream;
120
+ ReadStream: typeof ReadStream;
121
+ createWriteStream: typeof createWriteStream;
122
+ WriteStream: typeof WriteStream;
123
+ promises: typeof promises;
124
+ open: typeof open;
125
+ close: typeof close;
126
+ read: typeof read;
127
+ write: typeof write;
128
+ rm: typeof rm;
129
+ realpath: typeof realpath;
130
+ readdir: typeof readdir;
131
+ symlink: typeof symlink;
132
+ lstat: typeof lstat;
133
+ stat: typeof stat;
134
+ rename: typeof rename;
135
+ copyFile: typeof copyFile;
136
+ access: typeof access;
137
+ appendFile: typeof appendFile;
138
+ readlink: typeof readlink;
139
+ truncate: typeof truncate;
140
+ chmod: typeof chmod;
141
+ chown: typeof chown;
142
+ mkdir: typeof mkdir;
143
+ rmdir: typeof rmdir;
144
+ readFile: typeof readFile;
145
+ writeFile: typeof writeFile;
146
+ unlink: typeof unlink;
147
+ link: typeof link;
148
+ };
149
+ export default _default;