statUtils.d.ts 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. /// <reference types="node" />
  2. /// <reference types="node" />
  3. import { BigIntStats, Stats } from 'fs';
  4. import { Filename } from './path';
  5. export declare const DEFAULT_MODE: number;
  6. export declare class DirEntry {
  7. name: Filename;
  8. mode: number;
  9. isBlockDevice(): boolean;
  10. isCharacterDevice(): boolean;
  11. isDirectory(): boolean;
  12. isFIFO(): boolean;
  13. isFile(): boolean;
  14. isSocket(): boolean;
  15. isSymbolicLink(): boolean;
  16. }
  17. export declare class StatEntry {
  18. uid: number;
  19. gid: number;
  20. size: number;
  21. blksize: number;
  22. atimeMs: number;
  23. mtimeMs: number;
  24. ctimeMs: number;
  25. birthtimeMs: number;
  26. atime: Date;
  27. mtime: Date;
  28. ctime: Date;
  29. birthtime: Date;
  30. dev: number;
  31. ino: number;
  32. mode: number;
  33. nlink: number;
  34. rdev: number;
  35. blocks: number;
  36. isBlockDevice(): boolean;
  37. isCharacterDevice(): boolean;
  38. isDirectory(): boolean;
  39. isFIFO(): boolean;
  40. isFile(): boolean;
  41. isSocket(): boolean;
  42. isSymbolicLink(): boolean;
  43. }
  44. export declare class BigIntStatsEntry {
  45. uid: bigint;
  46. gid: bigint;
  47. size: bigint;
  48. blksize: bigint;
  49. atimeMs: bigint;
  50. mtimeMs: bigint;
  51. ctimeMs: bigint;
  52. birthtimeMs: bigint;
  53. atimeNs: bigint;
  54. mtimeNs: bigint;
  55. ctimeNs: bigint;
  56. birthtimeNs: bigint;
  57. atime: Date;
  58. mtime: Date;
  59. ctime: Date;
  60. birthtime: Date;
  61. dev: bigint;
  62. ino: bigint;
  63. mode: bigint;
  64. nlink: bigint;
  65. rdev: bigint;
  66. blocks: bigint;
  67. isBlockDevice(): boolean;
  68. isCharacterDevice(): boolean;
  69. isDirectory(): boolean;
  70. isFIFO(): boolean;
  71. isFile(): boolean;
  72. isSocket(): boolean;
  73. isSymbolicLink(): boolean;
  74. }
  75. export declare function makeDefaultStats(): StatEntry;
  76. export declare function makeEmptyStats(): Stats | BigIntStats;
  77. /**
  78. * Mutates the provided stats object to zero it out then returns it for convenience
  79. */
  80. export declare function clearStats(stats: Stats | BigIntStats): Stats | BigIntStats;
  81. export declare function convertToBigIntStats(stats: Stats): BigIntStats;
  82. export declare function areStatsEqual(a: Stats | BigIntStatsEntry, b: Stats | BigIntStatsEntry): boolean;