FsaNodeFsOpenFile.d.ts 979 B

123456789101112131415161718192021222324
  1. import type * as fsa from '../fsa/types';
  2. import type * as misc from '../node/types/misc';
  3. /**
  4. * Represents an open file. Stores additional metadata about the open file, such
  5. * as the seek position.
  6. */
  7. export declare class FsaNodeFsOpenFile {
  8. readonly fd: number;
  9. readonly createMode: misc.TMode;
  10. readonly flags: number;
  11. readonly file: fsa.IFileSystemFileHandle;
  12. readonly filename: string;
  13. protected seek: number;
  14. /**
  15. * This influences the behavior of the next write operation. On the first
  16. * write we want to overwrite the file or keep the existing data, depending
  17. * with which flags the file was opened. On subsequent writes we want to
  18. * append to the file.
  19. */
  20. protected keepExistingData: boolean;
  21. constructor(fd: number, createMode: misc.TMode, flags: number, file: fsa.IFileSystemFileHandle, filename: string);
  22. close(): Promise<void>;
  23. write(data: ArrayBufferView, seek: number | null): Promise<void>;
  24. }