@tauri-apps/plugin-fs 3.0.0-alpha.1 → 3.0.0-alpha.3

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.
@@ -82,9 +82,15 @@
82
82
  */
83
83
  import { BaseDirectory } from '@tauri-apps/api/path';
84
84
  import { Resource } from '@tauri-apps/api/core';
85
+ /**
86
+ * Defines how the offset given to {@linkcode FileHandle.seek} is interpreted.
87
+ */
85
88
  declare enum SeekMode {
89
+ /** The offset is relative to the start of the file. */
86
90
  Start = 0,
91
+ /** The offset is relative to the current cursor position. */
87
92
  Current = 1,
93
+ /** The offset is relative to the end of the file. */
88
94
  End = 2
89
95
  }
90
96
  /**
@@ -251,6 +257,8 @@ declare class FileHandle extends Resource {
251
257
  * await file.close();
252
258
  * ```
253
259
  *
260
+ * @param buffer The buffer the file contents are read into.
261
+ * @returns A promise resolving to the number of bytes read, or `null` when the end of the file was reached.
254
262
  * @since 2.0.0
255
263
  */
256
264
  read(buffer: Uint8Array): Promise<number | null>;
@@ -284,6 +292,9 @@ declare class FileHandle extends Resource {
284
292
  * await file.close();
285
293
  * ```
286
294
  *
295
+ * @param offset The number of bytes the cursor is moved by.
296
+ * @param whence Defines the position the `offset` is relative to.
297
+ * @returns A promise resolving to the new cursor position, relative to the start of the file.
287
298
  * @since 2.0.0
288
299
  */
289
300
  seek(offset: number, whence: SeekMode): Promise<number>;
@@ -299,6 +310,7 @@ declare class FileHandle extends Resource {
299
310
  * await file.close();
300
311
  * ```
301
312
  *
313
+ * @returns A promise resolving to the metadata of this file.
302
314
  * @since 2.0.0
303
315
  */
304
316
  stat(): Promise<FileInfo>;
@@ -324,6 +336,7 @@ declare class FileHandle extends Resource {
324
336
  * await file.close();
325
337
  * ```
326
338
  *
339
+ * @param len The length the file is truncated or extended to, in bytes. When not provided the entire file contents are truncated.
327
340
  * @since 2.0.0
328
341
  */
329
342
  truncate(len?: number): Promise<void>;
@@ -345,11 +358,15 @@ declare class FileHandle extends Resource {
345
358
  * await file.close();
346
359
  * ```
347
360
  *
361
+ * @param data The bytes written to the file.
362
+ * @returns A promise resolving to the number of bytes written.
348
363
  * @since 2.0.0
349
364
  */
350
365
  write(data: Uint8Array): Promise<number>;
351
366
  }
352
367
  /**
368
+ * Options for the `create` function, which creates or truncates a file.
369
+ *
353
370
  * @since 2.0.0
354
371
  */
355
372
  interface CreateOptions {
@@ -368,10 +385,15 @@ interface CreateOptions {
368
385
  * await file.close();
369
386
  * ```
370
387
  *
388
+ * @param path The path of the file, relative to `options.baseDir` when it is provided.
389
+ * @param options Options defining the base directory of `path`.
390
+ * @returns A promise resolving to the handle of the created file.
371
391
  * @since 2.0.0
372
392
  */
373
393
  declare function create(path: string | URL, options?: CreateOptions): Promise<FileHandle>;
374
394
  /**
395
+ * Options for the `open` function, defining how the file is opened and which operations are allowed on it.
396
+ *
375
397
  * @since 2.0.0
376
398
  */
377
399
  interface OpenOptions {
@@ -437,10 +459,15 @@ interface OpenOptions {
437
459
  * await file.close();
438
460
  * ```
439
461
  *
462
+ * @param path The path of the file, relative to `options.baseDir` when it is provided.
463
+ * @param options Options defining the base directory of `path` and how the file is opened.
464
+ * @returns A promise resolving to the handle of the open file.
440
465
  * @since 2.0.0
441
466
  */
442
467
  declare function open(path: string | URL, options?: OpenOptions): Promise<FileHandle>;
443
468
  /**
469
+ * Options for the `copyFile` function, defining the base directory of each path.
470
+ *
444
471
  * @since 2.0.0
445
472
  */
446
473
  interface CopyFileOptions {
@@ -457,10 +484,15 @@ interface CopyFileOptions {
457
484
  * await copyFile('app.conf', 'app.conf.bk', { fromPathBaseDir: BaseDirectory.AppConfig, toPathBaseDir: BaseDirectory.AppConfig });
458
485
  * ```
459
486
  *
487
+ * @param fromPath The path of the file to copy from.
488
+ * @param toPath The path of the file to copy to.
489
+ * @param options Options defining the base directory of each path.
460
490
  * @since 2.0.0
461
491
  */
462
492
  declare function copyFile(fromPath: string | URL, toPath: string | URL, options?: CopyFileOptions): Promise<void>;
463
493
  /**
494
+ * Options for the `mkdir` function, which creates a directory.
495
+ *
464
496
  * @since 2.0.0
465
497
  */
466
498
  interface MkdirOptions {
@@ -481,10 +513,14 @@ interface MkdirOptions {
481
513
  * await mkdir('users', { baseDir: BaseDirectory.AppLocalData });
482
514
  * ```
483
515
  *
516
+ * @param path The path of the directory to create.
517
+ * @param options Options defining the base directory of `path`, the directory permissions and whether intermediate directories are created.
484
518
  * @since 2.0.0
485
519
  */
486
520
  declare function mkdir(path: string | URL, options?: MkdirOptions): Promise<void>;
487
521
  /**
522
+ * Options for the `readDir` function, which lists the entries of a directory.
523
+ *
488
524
  * @since 2.0.0
489
525
  */
490
526
  interface ReadDirOptions {
@@ -514,24 +550,29 @@ interface DirEntry {
514
550
  * ```typescript
515
551
  * import { readDir, BaseDirectory } from '@tauri-apps/plugin-fs';
516
552
  * import { join } from '@tauri-apps/api/path';
517
- * const dir = "users"
518
- * const entries = await readDir('users', { baseDir: BaseDirectory.AppLocalData });
519
- * processEntriesRecursively(dir, entries);
553
+ * const dir = 'users';
554
+ * const entries = await readDir(dir, { baseDir: BaseDirectory.AppLocalData });
555
+ * await processEntriesRecursively(dir, entries);
520
556
  * async function processEntriesRecursively(parent, entries) {
521
557
  * for (const entry of entries) {
522
558
  * console.log(`Entry: ${entry.name}`);
523
559
  * if (entry.isDirectory) {
524
- * const dir = await join(parent, entry.name);
525
- * processEntriesRecursively(dir, await readDir(dir, { baseDir: BaseDirectory.AppLocalData }))
560
+ * const entryPath = await join(parent, entry.name);
561
+ * await processEntriesRecursively(entryPath, await readDir(entryPath, { baseDir: BaseDirectory.AppLocalData }));
526
562
  * }
527
563
  * }
528
564
  * }
529
565
  * ```
530
566
  *
567
+ * @param path The path of the directory to read.
568
+ * @param options Options defining the base directory of `path`.
569
+ * @returns A promise resolving to the list of entries in the directory.
531
570
  * @since 2.0.0
532
571
  */
533
572
  declare function readDir(path: string | URL, options?: ReadDirOptions): Promise<DirEntry[]>;
534
573
  /**
574
+ * Options for the functions that read a file, such as `readFile` and `readTextFile`.
575
+ *
535
576
  * @since 2.0.0
536
577
  */
537
578
  interface ReadFileOptions {
@@ -549,6 +590,9 @@ interface ReadFileOptions {
549
590
  * const contents = await readFile('avatar.png', { baseDir: BaseDirectory.Resource });
550
591
  * ```
551
592
  *
593
+ * @param path The path of the file to read.
594
+ * @param options Options defining the base directory of `path`.
595
+ * @returns A promise resolving to the contents of the file as bytes.
552
596
  * @since 2.0.0
553
597
  */
554
598
  declare function readFile(path: string | URL, options?: ReadFileOptions): Promise<Uint8Array<ArrayBuffer>>;
@@ -560,6 +604,9 @@ declare function readFile(path: string | URL, options?: ReadFileOptions): Promis
560
604
  * const contents = await readTextFile('app.conf', { baseDir: BaseDirectory.AppConfig });
561
605
  * ```
562
606
  *
607
+ * @param path The path of the file to read.
608
+ * @param options Options defining the base directory of `path` and the text encoding.
609
+ * @returns A promise resolving to the contents of the file as a string.
563
610
  * @since 2.0.0
564
611
  */
565
612
  declare function readTextFile(path: string | URL, options?: ReadFileOptions): Promise<string>;
@@ -576,10 +623,15 @@ declare function readTextFile(path: string | URL, options?: ReadFileOptions): Pr
576
623
  * You could also call {@linkcode AsyncIterableIterator.next} to advance the
577
624
  * iterator so you can lazily read the next line whenever you want.
578
625
  *
626
+ * @param path The path of the file to read.
627
+ * @param options Options defining the base directory of `path` and the text encoding.
628
+ * @returns A promise resolving to an iterator over the lines of the file.
579
629
  * @since 2.0.0
580
630
  */
581
631
  declare function readTextFileLines(path: string | URL, options?: ReadFileOptions): Promise<AsyncIterableIterator<string>>;
582
632
  /**
633
+ * Options for the `remove` function, which deletes a file or a directory.
634
+ *
583
635
  * @since 2.0.0
584
636
  */
585
637
  interface RemoveOptions {
@@ -598,10 +650,14 @@ interface RemoveOptions {
598
650
  * await remove('users', { baseDir: BaseDirectory.AppLocalData });
599
651
  * ```
600
652
  *
653
+ * @param path The path of the file or directory to remove.
654
+ * @param options Options defining the base directory of `path` and whether directories are removed recursively.
601
655
  * @since 2.0.0
602
656
  */
603
657
  declare function remove(path: string | URL, options?: RemoveOptions): Promise<void>;
604
658
  /**
659
+ * Options for the `rename` function, defining the base directory of each path.
660
+ *
605
661
  * @since 2.0.0
606
662
  */
607
663
  interface RenameOptions {
@@ -623,10 +679,15 @@ interface RenameOptions {
623
679
  * await rename('avatar.png', 'deleted.png', { oldPathBaseDir: BaseDirectory.App, newPathBaseDir: BaseDirectory.AppLocalData });
624
680
  * ```
625
681
  *
682
+ * @param oldPath The path of the file or directory to rename.
683
+ * @param newPath The path the file or directory is renamed to.
684
+ * @param options Options defining the base directory of each path.
626
685
  * @since 2.0.0
627
686
  */
628
687
  declare function rename(oldPath: string | URL, newPath: string | URL, options?: RenameOptions): Promise<void>;
629
688
  /**
689
+ * Options for the `stat` and `lstat` functions, which read the metadata of a path.
690
+ *
630
691
  * @since 2.0.0
631
692
  */
632
693
  interface StatOptions {
@@ -644,6 +705,9 @@ interface StatOptions {
644
705
  * console.log(fileInfo.isFile); // true
645
706
  * ```
646
707
  *
708
+ * @param path The path of the file or directory to inspect.
709
+ * @param options Options defining the base directory of `path`.
710
+ * @returns A promise resolving to the metadata of the file or directory.
647
711
  * @since 2.0.0
648
712
  */
649
713
  declare function stat(path: string | URL, options?: StatOptions): Promise<FileInfo>;
@@ -659,10 +723,15 @@ declare function stat(path: string | URL, options?: StatOptions): Promise<FileIn
659
723
  * console.log(fileInfo.isFile); // true
660
724
  * ```
661
725
  *
726
+ * @param path The path of the file, directory or symlink to inspect.
727
+ * @param options Options defining the base directory of `path`.
728
+ * @returns A promise resolving to the metadata of the path itself.
662
729
  * @since 2.0.0
663
730
  */
664
731
  declare function lstat(path: string | URL, options?: StatOptions): Promise<FileInfo>;
665
732
  /**
733
+ * Options for the `truncate` function, which truncates or extends a file.
734
+ *
666
735
  * @since 2.0.0
667
736
  */
668
737
  interface TruncateOptions {
@@ -687,10 +756,15 @@ interface TruncateOptions {
687
756
  * console.log(data); // "Hello W"
688
757
  * ```
689
758
  *
759
+ * @param path The path of the file to truncate or extend.
760
+ * @param len The length the file is resized to, in bytes. Defaults to `0`.
761
+ * @param options Options defining the base directory of `path`.
690
762
  * @since 2.0.0
691
763
  */
692
764
  declare function truncate(path: string | URL, len?: number, options?: TruncateOptions): Promise<void>;
693
765
  /**
766
+ * Options for the `writeFile` and `writeTextFile` functions, defining how the file is opened before writing to it.
767
+ *
694
768
  * @since 2.0.0
695
769
  */
696
770
  interface WriteFileOptions {
@@ -716,22 +790,31 @@ interface WriteFileOptions {
716
790
  * await writeFile('file.txt', data, { baseDir: BaseDirectory.AppLocalData });
717
791
  * ```
718
792
  *
793
+ * @param path The path of the file to write to.
794
+ * @param data The bytes written to the file, either as a buffer or as a stream of chunks.
795
+ * @param options Options defining the base directory of `path` and how the file is opened.
719
796
  * @since 2.0.0
720
797
  */
721
798
  declare function writeFile(path: string | URL, data: Uint8Array | ReadableStream<Uint8Array>, options?: WriteFileOptions): Promise<void>;
722
799
  /**
723
- * Writes UTF-8 string `data` to the given `path`, by default creating a new file if needed, else overwriting.
724
- @example
725
- * ```typescript
726
- * import { writeTextFile, BaseDirectory } from '@tauri-apps/plugin-fs';
727
- *
728
- * await writeTextFile('file.txt', "Hello world", { baseDir: BaseDirectory.AppLocalData });
729
- * ```
730
- *
731
- * @since 2.0.0
732
- */
800
+ * Writes UTF-8 string `data` to the given `path`, by default creating a new file if needed, else overwriting.
801
+ *
802
+ * @example
803
+ * ```typescript
804
+ * import { writeTextFile, BaseDirectory } from '@tauri-apps/plugin-fs';
805
+ *
806
+ * await writeTextFile('file.txt', "Hello world", { baseDir: BaseDirectory.AppLocalData });
807
+ * ```
808
+ *
809
+ * @param path The path of the file to write to.
810
+ * @param data The UTF-8 string written to the file.
811
+ * @param options Options defining the base directory of `path` and how the file is opened.
812
+ * @since 2.0.0
813
+ */
733
814
  declare function writeTextFile(path: string | URL, data: string, options?: WriteFileOptions): Promise<void>;
734
815
  /**
816
+ * Options for the `exists` function, which checks whether a path exists.
817
+ *
735
818
  * @since 2.0.0
736
819
  */
737
820
  interface ExistsOptions {
@@ -747,10 +830,15 @@ interface ExistsOptions {
747
830
  * await exists('avatar.png', { baseDir: BaseDirectory.AppData });
748
831
  * ```
749
832
  *
833
+ * @param path The path to check.
834
+ * @param options Options defining the base directory of `path`.
835
+ * @returns A promise resolving to `true` when the path exists, `false` otherwise.
750
836
  * @since 2.0.0
751
837
  */
752
838
  declare function exists(path: string | URL, options?: ExistsOptions): Promise<boolean>;
753
839
  /**
840
+ * Options for the `watchImmediate` function, which reports file system changes as they happen.
841
+ *
754
842
  * @since 2.0.0
755
843
  */
756
844
  interface WatchOptions {
@@ -760,33 +848,78 @@ interface WatchOptions {
760
848
  baseDir?: BaseDirectory;
761
849
  }
762
850
  /**
851
+ * Options for the `watch` function, which reports file system changes after a debounce delay.
852
+ *
763
853
  * @since 2.0.0
764
854
  */
765
855
  interface DebouncedWatchOptions extends WatchOptions {
766
- /** Debounce delay */
856
+ /**
857
+ * The debounce delay in milliseconds. Changes that happen within this
858
+ * window are grouped and reported together. Defaults to `2000`.
859
+ */
767
860
  delayMs?: number;
768
861
  }
769
862
  /**
863
+ * Additional attributes of a {@linkcode WatchEvent}.
864
+ *
865
+ * @since 3.0.0
866
+ */
867
+ interface WatchEventAttributes {
868
+ /** Tracker ID that groups related events, e.g. both sides of a rename. */
869
+ tracker?: number;
870
+ /**
871
+ * `rescan` means some events may have been missed, so any file or folder might have been modified.
872
+ */
873
+ flag?: 'rescan';
874
+ /** Short string identifying the details of an `other` event. */
875
+ info?: string;
876
+ /** Short string identifying the backend that generated the event. */
877
+ source?: string;
878
+ }
879
+ /**
880
+ * A file system event.
881
+ *
882
+ * The event kind is flattened into the event: `type` is the top-level kind and,
883
+ * for `access`, `create`, `modify` and `remove` events, `kind` (and `mode` when available)
884
+ * refines it.
885
+ *
886
+ * @example
887
+ * ```typescript
888
+ * import { watch } from '@tauri-apps/plugin-fs';
889
+ * await watch('/path/to/file', (event) => {
890
+ * if (event.type === 'modify' && event.kind === 'data') {
891
+ * console.log('data changed', event.paths, event.mode);
892
+ * }
893
+ * });
894
+ * ```
895
+ *
770
896
  * @since 2.0.0
771
897
  */
772
- interface WatchEvent {
773
- type: WatchEventKind;
898
+ type WatchEvent = WatchEventKind & {
774
899
  paths: string[];
775
- attrs: unknown;
776
- }
900
+ attrs: WatchEventAttributes;
901
+ };
777
902
  /**
903
+ * The kind of file system change described by a `WatchEvent`.
904
+ *
778
905
  * @since 2.0.0
779
906
  */
780
- type WatchEventKind = 'any' | {
781
- access: WatchEventKindAccess;
782
- } | {
783
- create: WatchEventKindCreate;
784
- } | {
785
- modify: WatchEventKindModify;
786
- } | {
787
- remove: WatchEventKindRemove;
788
- } | 'other';
907
+ type WatchEventKind = {
908
+ type: 'any';
909
+ } | ({
910
+ type: 'access';
911
+ } & WatchEventKindAccess) | ({
912
+ type: 'create';
913
+ } & WatchEventKindCreate) | ({
914
+ type: 'modify';
915
+ } & WatchEventKindModify) | ({
916
+ type: 'remove';
917
+ } & WatchEventKindRemove) | {
918
+ type: 'other';
919
+ };
789
920
  /**
921
+ * Describes how a file or directory was accessed.
922
+ *
790
923
  * @since 2.0.0
791
924
  */
792
925
  type WatchEventKindAccess = {
@@ -801,6 +934,8 @@ type WatchEventKindAccess = {
801
934
  kind: 'other';
802
935
  };
803
936
  /**
937
+ * Describes which kind of entry was created.
938
+ *
804
939
  * @since 2.0.0
805
940
  */
806
941
  type WatchEventKindCreate = {
@@ -813,6 +948,8 @@ type WatchEventKindCreate = {
813
948
  kind: 'other';
814
949
  };
815
950
  /**
951
+ * Describes what was modified on a file or directory.
952
+ *
816
953
  * @since 2.0.0
817
954
  */
818
955
  type WatchEventKindModify = {
@@ -830,6 +967,8 @@ type WatchEventKindModify = {
830
967
  kind: 'other';
831
968
  };
832
969
  /**
970
+ * Describes which kind of entry was removed.
971
+ *
833
972
  * @since 2.0.0
834
973
  */
835
974
  type WatchEventKindRemove = {
@@ -842,21 +981,49 @@ type WatchEventKindRemove = {
842
981
  kind: 'other';
843
982
  };
844
983
  /**
845
- * @since 2.0.0
984
+ * A file system watcher. Call {@linkcode Watcher.close} to stop watching.
985
+ *
986
+ * @since 3.0.0
846
987
  */
847
- type UnwatchFn = () => void;
988
+ declare class Watcher extends Resource {
989
+ }
848
990
  /**
849
991
  * Watch changes (after a delay) on files or directories.
850
992
  *
993
+ * @example
994
+ * ```typescript
995
+ * import { watch, BaseDirectory } from '@tauri-apps/plugin-fs';
996
+ * const watcher = await watch('app.conf', (event) => console.log(event), { baseDir: BaseDirectory.AppConfig });
997
+ * // when you're done watching:
998
+ * await watcher.close();
999
+ * ```
1000
+ *
851
1001
  * @since 2.0.0
852
1002
  */
853
- declare function watch(paths: string | string[] | URL | URL[], cb: (event: WatchEvent) => void, options?: DebouncedWatchOptions): Promise<UnwatchFn>;
1003
+ declare function watch(paths: string | string[] | URL | URL[], cb: (event: WatchEvent) => void, options?: DebouncedWatchOptions): Promise<Watcher>;
854
1004
  /**
855
1005
  * Watch changes on files or directories.
856
1006
  *
1007
+ * @example
1008
+ * ```typescript
1009
+ * import { watchImmediate, BaseDirectory } from '@tauri-apps/plugin-fs';
1010
+ * const watcher = await watchImmediate('app.conf', (event) => console.log(event), { baseDir: BaseDirectory.AppConfig });
1011
+ * // when you're done watching:
1012
+ * await watcher.close();
1013
+ * ```
1014
+ *
857
1015
  * @since 2.0.0
858
1016
  */
859
- declare function watchImmediate(paths: string | string[] | URL | URL[], cb: (event: WatchEvent) => void, options?: WatchOptions): Promise<UnwatchFn>;
1017
+ declare function watchImmediate(paths: string | string[] | URL | URL[], cb: (event: WatchEvent) => void, options?: WatchOptions): Promise<Watcher>;
1018
+ /**
1019
+ * Options for the `size` function.
1020
+ *
1021
+ * @since 2.6.0
1022
+ */
1023
+ interface SizeOptions {
1024
+ /** Base directory for `path`. */
1025
+ baseDir?: BaseDirectory;
1026
+ }
860
1027
  /**
861
1028
  * Get the size of a file or directory. For files, the `stat` functions can be used as well.
862
1029
  *
@@ -870,9 +1037,12 @@ declare function watchImmediate(paths: string | string[] | URL | URL[], cb: (eve
870
1037
  * console.log(dirSize); // 1024
871
1038
  * ```
872
1039
  *
1040
+ * @param path The path of the file or directory to measure.
1041
+ * @param options Options defining the base directory of `path` (since 2.6.0).
1042
+ * @returns A promise resolving to the size in bytes.
873
1043
  * @since 2.1.0
874
1044
  */
875
- declare function size(path: string | URL): Promise<number>;
1045
+ declare function size(path: string | URL, options?: SizeOptions): Promise<number>;
876
1046
  /**
877
1047
  * Starts accessing a security-scoped resource for the given file URL.
878
1048
  * This should be called when you're accessing a file that was opened
@@ -897,6 +1067,7 @@ declare function size(path: string | URL): Promise<number>;
897
1067
  * // ... use the resource ...
898
1068
  * ```
899
1069
  *
1070
+ * @param path The path or `file://` URL of the resource to start accessing.
900
1071
  * @since 2.5.0
901
1072
  */
902
1073
  declare function startAccessingSecurityScopedResource(path: string | URL): Promise<void>;
@@ -921,8 +1092,9 @@ declare function startAccessingSecurityScopedResource(path: string | URL): Promi
921
1092
  * await stopAccessingSecurityScopedResource(filePath);
922
1093
  * ```
923
1094
  *
1095
+ * @param path The path or `file://` URL of the resource to stop accessing.
924
1096
  * @since 2.5.0
925
1097
  */
926
1098
  declare function stopAccessingSecurityScopedResource(path: string | URL): Promise<void>;
927
- export type { CreateOptions, OpenOptions, CopyFileOptions, MkdirOptions, DirEntry, ReadDirOptions, ReadFileOptions, RemoveOptions, RenameOptions, StatOptions, TruncateOptions, WriteFileOptions, ExistsOptions, FileInfo, WatchOptions, DebouncedWatchOptions, WatchEvent, WatchEventKind, WatchEventKindAccess, WatchEventKindCreate, WatchEventKindModify, WatchEventKindRemove, UnwatchFn };
928
- export { BaseDirectory, FileHandle, create, open, copyFile, mkdir, readDir, readFile, readTextFile, readTextFileLines, remove, rename, SeekMode, stat, lstat, truncate, writeFile, writeTextFile, exists, watch, watchImmediate, size, startAccessingSecurityScopedResource, stopAccessingSecurityScopedResource };
1099
+ export type { CreateOptions, OpenOptions, CopyFileOptions, MkdirOptions, DirEntry, ReadDirOptions, ReadFileOptions, RemoveOptions, RenameOptions, StatOptions, TruncateOptions, WriteFileOptions, ExistsOptions, SizeOptions, FileInfo, WatchOptions, DebouncedWatchOptions, WatchEvent, WatchEventAttributes, WatchEventKind, WatchEventKindAccess, WatchEventKindCreate, WatchEventKindModify, WatchEventKindRemove };
1100
+ export { BaseDirectory, FileHandle, Watcher, create, open, copyFile, mkdir, readDir, readFile, readTextFile, readTextFileLines, remove, rename, SeekMode, stat, lstat, truncate, writeFile, writeTextFile, exists, watch, watchImmediate, size, startAccessingSecurityScopedResource, stopAccessingSecurityScopedResource };