Nfsv4FsClient.d.ts 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. /// <reference types="node" />
  2. import type { NfsFsClient, Nfsv4Client } from './types';
  3. import * as misc from 'memfs/lib/node/types/misc';
  4. import * as opts from 'memfs/lib/node/types/options';
  5. import * as structs from '../structs';
  6. export declare class Nfsv4FsClient implements NfsFsClient {
  7. readonly fs: Nfsv4Client;
  8. constructor(fs: Nfsv4Client);
  9. private readonly openOwnerSeqids;
  10. private readonly defaultOpenOwnerId;
  11. private makeOpenOwnerKey;
  12. private nextOpenOwnerSeqid;
  13. private createDefaultOpenOwner;
  14. private attrNumsToBitmap;
  15. private parsePath;
  16. private navigateToParent;
  17. private navigateToPath;
  18. private encodeData;
  19. private decodeData;
  20. readonly closeStateid: (openOwner: structs.Nfsv4OpenOwner, stateid: structs.Nfsv4Stateid) => Promise<void>;
  21. readonly readFile: (id: misc.TFileHandle, options?: opts.IReadFileOptions | string) => Promise<misc.TDataOut>;
  22. readonly writeFile: (id: misc.TFileHandle, data: misc.TPromisesData, options?: opts.IWriteFileOptions) => Promise<void>;
  23. readonly stat: (path: misc.PathLike, options?: opts.IStatOptions) => Promise<misc.IStats>;
  24. readonly lstat: (path: misc.PathLike, options?: opts.IStatOptions) => Promise<misc.IStats>;
  25. readonly mkdir: (path: misc.PathLike, options?: misc.TMode | opts.IMkdirOptions) => Promise<string | undefined>;
  26. readonly readdir: (path: misc.PathLike, options?: opts.IReaddirOptions | string) => Promise<misc.TDataOut[] | misc.IDirent[]>;
  27. readonly appendFile: (path: misc.TFileHandle, data: misc.TData, options?: opts.IAppendFileOptions | string) => Promise<void>;
  28. readonly truncate: (path: misc.PathLike, len?: number) => Promise<void>;
  29. readonly unlink: (path: misc.PathLike) => Promise<void>;
  30. readonly rmdir: (path: misc.PathLike, options?: opts.IRmdirOptions) => Promise<void>;
  31. readonly rm: (path: misc.PathLike, options?: opts.IRmOptions) => Promise<void>;
  32. readonly access: (path: misc.PathLike, mode?: number) => Promise<void>;
  33. readonly rename: (oldPath: misc.PathLike, newPath: misc.PathLike) => Promise<void>;
  34. readonly copyFile: (src: misc.PathLike, dest: misc.PathLike, flags?: misc.TFlagsCopy) => Promise<void>;
  35. readonly realpath: (path: misc.PathLike, options?: opts.IRealpathOptions | string) => Promise<misc.TDataOut>;
  36. readonly link: (existingPath: misc.PathLike, newPath: misc.PathLike) => Promise<void>;
  37. readonly symlink: (target: misc.PathLike, path: misc.PathLike, type?: misc.symlink.Type) => Promise<void>;
  38. readonly utimes: (path: misc.PathLike, atime: misc.TTime, mtime: misc.TTime) => Promise<void>;
  39. readonly readlink: (path: misc.PathLike, options?: opts.IOptions) => Promise<misc.TDataOut>;
  40. readonly opendir: (path: misc.PathLike, options?: opts.IOpendirOptions) => Promise<misc.IDir>;
  41. readonly mkdtemp: (prefix: string, options?: opts.IOptions) => Promise<misc.TDataOut>;
  42. readonly chmod: (path: misc.PathLike, mode: misc.TMode) => Promise<void>;
  43. readonly chown: (path: misc.PathLike, uid: number, gid: number) => Promise<void>;
  44. readonly lchmod: (path: misc.PathLike, mode: misc.TMode) => Promise<void>;
  45. readonly lchown: (path: misc.PathLike, uid: number, gid: number) => Promise<void>;
  46. readonly lutimes: (path: misc.PathLike, atime: misc.TTime, mtime: misc.TTime) => Promise<void>;
  47. readonly open: (path: misc.PathLike, flags?: misc.TFlags, mode?: misc.TMode) => Promise<misc.IFileHandle>;
  48. readonly statfs: (path: misc.PathLike, options?: opts.IStatOptions) => Promise<misc.IStatFs>;
  49. readonly watch: (filename: misc.PathLike, options?: opts.IWatchOptions) => AsyncIterableIterator<{
  50. eventType: string;
  51. filename: string | Buffer;
  52. }>;
  53. readonly glob: (pattern: string, options?: opts.IGlobOptions) => Promise<string[]>;
  54. }