FsPromises.d.ts 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  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 access: (...args: any[]) => Promise<any>;
  62. readonly chmod: (...args: any[]) => Promise<any>;
  63. readonly chown: (...args: any[]) => Promise<any>;
  64. readonly copyFile: (...args: any[]) => Promise<any>;
  65. readonly lchmod: (...args: any[]) => Promise<any>;
  66. readonly lchown: (...args: any[]) => Promise<any>;
  67. readonly link: (...args: any[]) => Promise<any>;
  68. readonly lstat: (...args: any[]) => Promise<any>;
  69. readonly mkdir: (...args: any[]) => Promise<any>;
  70. readonly mkdtemp: (...args: any[]) => Promise<any>;
  71. readonly readdir: (...args: any[]) => Promise<any>;
  72. readonly readlink: (...args: any[]) => Promise<any>;
  73. readonly realpath: (...args: any[]) => Promise<any>;
  74. readonly rename: (...args: any[]) => Promise<any>;
  75. readonly rmdir: (...args: any[]) => Promise<any>;
  76. readonly rm: (...args: any[]) => Promise<any>;
  77. readonly stat: (...args: any[]) => Promise<any>;
  78. readonly symlink: (...args: any[]) => Promise<any>;
  79. readonly truncate: (...args: any[]) => Promise<any>;
  80. readonly unlink: (...args: any[]) => Promise<any>;
  81. readonly utimes: (...args: any[]) => Promise<any>;
  82. readonly readFile: (id: misc.TFileHandle, options?: opts.IReadFileOptions | string) => Promise<misc.TDataOut>;
  83. readonly appendFile: (path: misc.TFileHandle, data: misc.TData, options?: opts.IAppendFileOptions | string) => Promise<void>;
  84. readonly open: (path: misc.PathLike, flags?: misc.TFlags, mode?: misc.TMode) => Promise<any>;
  85. readonly writeFile: (id: misc.TFileHandle, data: misc.TPromisesData, options?: opts.IWriteFileOptions) => Promise<void>;
  86. readonly watch: () => never;
  87. }