FsPromises.d.ts 3.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. import type * as opts from './types/options';
  2. import type * as misc from './types/misc';
  3. import type { FsCallbackApi, FsPromisesApi } from './types';
  4. export declare class FsPromises implements FsPromisesApi {
  5. protected readonly fs: FsCallbackApi;
  6. readonly FileHandle: new (...args: unknown[]) => misc.IFileHandle;
  7. readonly constants: {
  8. O_RDONLY: number;
  9. O_WRONLY: number;
  10. O_RDWR: number;
  11. S_IFMT: number;
  12. S_IFREG: number;
  13. S_IFDIR: number;
  14. S_IFCHR: number;
  15. S_IFBLK: number;
  16. S_IFIFO: number;
  17. S_IFLNK: number;
  18. S_IFSOCK: number;
  19. O_CREAT: number;
  20. O_EXCL: number;
  21. O_NOCTTY: number;
  22. O_TRUNC: number;
  23. O_APPEND: number;
  24. O_DIRECTORY: number;
  25. O_NOATIME: number;
  26. O_NOFOLLOW: number;
  27. O_SYNC: number;
  28. O_SYMLINK: number;
  29. O_DIRECT: number;
  30. O_NONBLOCK: number;
  31. S_IRWXU: number;
  32. S_IRUSR: number;
  33. S_IWUSR: number;
  34. S_IXUSR: number;
  35. S_IRWXG: number;
  36. S_IRGRP: number;
  37. S_IWGRP: number;
  38. S_IXGRP: number;
  39. S_IRWXO: number;
  40. S_IROTH: number;
  41. S_IWOTH: number;
  42. S_IXOTH: number;
  43. F_OK: number;
  44. R_OK: number;
  45. W_OK: number;
  46. X_OK: number;
  47. UV_FS_SYMLINK_DIR: number;
  48. UV_FS_SYMLINK_JUNCTION: number;
  49. UV_FS_COPYFILE_EXCL: number;
  50. UV_FS_COPYFILE_FICLONE: number;
  51. UV_FS_COPYFILE_FICLONE_FORCE: number;
  52. COPYFILE_EXCL: number;
  53. COPYFILE_FICLONE: number;
  54. COPYFILE_FICLONE_FORCE: number;
  55. };
  56. constructor(fs: FsCallbackApi, FileHandle: new (...args: unknown[]) => misc.IFileHandle);
  57. readonly cp: (...args: any[]) => Promise<any>;
  58. readonly opendir: (...args: any[]) => Promise<any>;
  59. readonly statfs: (...args: any[]) => Promise<any>;
  60. readonly lutimes: (...args: any[]) => Promise<any>;
  61. readonly glob: (...args: any[]) => Promise<any>;
  62. readonly access: (...args: any[]) => Promise<any>;
  63. readonly chmod: (...args: any[]) => Promise<any>;
  64. readonly chown: (...args: any[]) => Promise<any>;
  65. readonly copyFile: (...args: any[]) => Promise<any>;
  66. readonly lchmod: (...args: any[]) => Promise<any>;
  67. readonly lchown: (...args: any[]) => Promise<any>;
  68. readonly link: (...args: any[]) => Promise<any>;
  69. readonly lstat: (...args: any[]) => Promise<any>;
  70. readonly mkdir: (...args: any[]) => Promise<any>;
  71. readonly mkdtemp: (...args: any[]) => Promise<any>;
  72. readonly readdir: (...args: any[]) => Promise<any>;
  73. readonly readlink: (...args: any[]) => Promise<any>;
  74. readonly realpath: (...args: any[]) => Promise<any>;
  75. readonly rename: (...args: any[]) => Promise<any>;
  76. readonly rmdir: (...args: any[]) => Promise<any>;
  77. readonly rm: (...args: any[]) => Promise<any>;
  78. readonly stat: (...args: any[]) => Promise<any>;
  79. readonly symlink: (...args: any[]) => Promise<any>;
  80. readonly truncate: (...args: any[]) => Promise<any>;
  81. readonly unlink: (...args: any[]) => Promise<any>;
  82. readonly utimes: (...args: any[]) => Promise<any>;
  83. readonly readFile: (id: misc.TFileHandle, options?: opts.IReadFileOptions | string) => Promise<misc.TDataOut>;
  84. readonly appendFile: (path: misc.TFileHandle, data: misc.TData, options?: opts.IAppendFileOptions | string) => Promise<void>;
  85. readonly open: (path: misc.PathLike, flags?: misc.TFlags, mode?: misc.TMode) => Promise<any>;
  86. readonly writeFile: (id: misc.TFileHandle, data: misc.TPromisesData, options?: opts.IWriteFileOptions) => Promise<void>;
  87. readonly watch: (filename: misc.PathLike, options?: opts.IWatchOptions | string) => AsyncIterableIterator<{
  88. eventType: string;
  89. filename: string | Buffer;
  90. }>;
  91. }