@bleedingdev/modern-js-utils 3.2.0-ultramodern.5 → 3.2.0-ultramodern.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (271) hide show
  1. package/dist/types/cli/alias.d.ts +20 -0
  2. package/dist/types/cli/applyOptionsChain.d.ts +3 -0
  3. package/dist/types/cli/commands.d.ts +8 -0
  4. package/dist/types/cli/common.d.ts +9 -0
  5. package/dist/types/cli/config.d.ts +4 -0
  6. package/dist/types/cli/constants.d.ts +55 -0
  7. package/dist/types/cli/ensure.d.ts +8 -0
  8. package/dist/types/cli/fs.d.ts +7 -0
  9. package/dist/types/cli/get/config.d.ts +1 -0
  10. package/dist/types/cli/get/data.d.ts +6 -0
  11. package/dist/types/cli/get/index.d.ts +11 -0
  12. package/dist/types/cli/index.d.ts +23 -0
  13. package/dist/types/cli/is/config.d.ts +22 -0
  14. package/dist/types/cli/is/env.d.ts +8 -0
  15. package/dist/types/cli/is/index.d.ts +4 -0
  16. package/dist/types/cli/is/project.d.ts +39 -0
  17. package/dist/types/cli/is/type.d.ts +15 -0
  18. package/dist/types/cli/logger.d.ts +1 -0
  19. package/dist/types/cli/modulePath.d.ts +5 -0
  20. package/dist/types/cli/monorepo.d.ts +9 -0
  21. package/dist/types/cli/package.d.ts +5 -0
  22. package/dist/types/cli/path.d.ts +11 -0
  23. package/dist/types/cli/port.d.ts +12 -0
  24. package/dist/types/cli/prettyInstructions.d.ts +6 -0
  25. package/dist/types/cli/require.d.ts +9 -0
  26. package/dist/types/cli/route.d.ts +4 -0
  27. package/dist/types/cli/runtimeExports.d.ts +5 -0
  28. package/dist/types/cli/tsconfig.d.ts +1 -0
  29. package/dist/types/cli/version.d.ts +4 -0
  30. package/dist/types/cli/watch.d.ts +8 -0
  31. package/dist/types/compiled.d.ts +37 -0
  32. package/dist/types/import.d.ts +5 -0
  33. package/dist/types/index.d.ts +3 -0
  34. package/dist/types/universal/constants.d.ts +47 -0
  35. package/dist/types/universal/index.d.ts +1 -0
  36. package/dist/types/universal/path.d.ts +1 -0
  37. package/dist/types/universal/pluginDagSort.d.ts +1 -0
  38. package/package.json +3 -3
  39. package/dist/compiled/address/index.js +0 -171
  40. package/dist/compiled/address/lib/address.d.ts +0 -28
  41. package/dist/compiled/address/package.json +0 -1
  42. package/dist/compiled/browserslist/index.d.ts +0 -178
  43. package/dist/compiled/browserslist/index.js +0 -1329
  44. package/dist/compiled/browserslist/license +0 -20
  45. package/dist/compiled/browserslist/package.json +0 -1
  46. package/dist/compiled/chalk/index.d.ts +0 -415
  47. package/dist/compiled/chalk/index.js +0 -2368
  48. package/dist/compiled/chalk/license +0 -9
  49. package/dist/compiled/chalk/package.json +0 -1
  50. package/dist/compiled/chokidar/anymatch/index.d.ts +0 -19
  51. package/dist/compiled/chokidar/fsevents.node +0 -0
  52. package/dist/compiled/chokidar/index.js +0 -4162
  53. package/dist/compiled/chokidar/index.js.LICENSE.txt +0 -41
  54. package/dist/compiled/chokidar/license +0 -21
  55. package/dist/compiled/chokidar/package.json +0 -1
  56. package/dist/compiled/chokidar/types/index.d.ts +0 -188
  57. package/dist/compiled/commander/index.js +0 -1540
  58. package/dist/compiled/commander/index.mjs +0 -2
  59. package/dist/compiled/commander/license +0 -22
  60. package/dist/compiled/commander/package.json +0 -1
  61. package/dist/compiled/commander/typings/index.d.ts +0 -890
  62. package/dist/compiled/debug/index.d.ts +0 -54
  63. package/dist/compiled/debug/index.js +0 -621
  64. package/dist/compiled/debug/license +0 -20
  65. package/dist/compiled/debug/ms/index.d.ts +0 -25
  66. package/dist/compiled/debug/package.json +0 -1
  67. package/dist/compiled/dotenv/index.js +0 -101
  68. package/dist/compiled/dotenv/license +0 -23
  69. package/dist/compiled/dotenv/package.json +0 -1
  70. package/dist/compiled/dotenv/types/index.d.ts +0 -59
  71. package/dist/compiled/dotenv-expand/index.d.ts +0 -15
  72. package/dist/compiled/dotenv-expand/index.js +0 -54
  73. package/dist/compiled/dotenv-expand/license +0 -24
  74. package/dist/compiled/dotenv-expand/package.json +0 -1
  75. package/dist/compiled/execa/index.d.ts +0 -564
  76. package/dist/compiled/execa/index.js +0 -1738
  77. package/dist/compiled/execa/license +0 -9
  78. package/dist/compiled/execa/package.json +0 -1
  79. package/dist/compiled/fast-glob/@nodelib/fs.scandir/out/adapters/fs.d.ts +0 -20
  80. package/dist/compiled/fast-glob/@nodelib/fs.scandir/out/index.d.ts +0 -12
  81. package/dist/compiled/fast-glob/@nodelib/fs.scandir/out/providers/async.d.ts +0 -7
  82. package/dist/compiled/fast-glob/@nodelib/fs.scandir/out/settings.d.ts +0 -20
  83. package/dist/compiled/fast-glob/@nodelib/fs.scandir/out/types/index.d.ts +0 -20
  84. package/dist/compiled/fast-glob/@nodelib/fs.stat/out/adapters/fs.d.ts +0 -13
  85. package/dist/compiled/fast-glob/@nodelib/fs.stat/out/index.d.ts +0 -12
  86. package/dist/compiled/fast-glob/@nodelib/fs.stat/out/providers/async.d.ts +0 -4
  87. package/dist/compiled/fast-glob/@nodelib/fs.stat/out/settings.d.ts +0 -16
  88. package/dist/compiled/fast-glob/@nodelib/fs.stat/out/types/index.d.ts +0 -4
  89. package/dist/compiled/fast-glob/@nodelib/fs.walk/out/index.d.ts +0 -14
  90. package/dist/compiled/fast-glob/@nodelib/fs.walk/out/providers/async.d.ts +0 -12
  91. package/dist/compiled/fast-glob/@nodelib/fs.walk/out/readers/async.d.ts +0 -30
  92. package/dist/compiled/fast-glob/@nodelib/fs.walk/out/readers/reader.d.ts +0 -6
  93. package/dist/compiled/fast-glob/@nodelib/fs.walk/out/settings.d.ts +0 -30
  94. package/dist/compiled/fast-glob/@nodelib/fs.walk/out/types/index.d.ts +0 -8
  95. package/dist/compiled/fast-glob/index.js +0 -4665
  96. package/dist/compiled/fast-glob/index.js.LICENSE.txt +0 -38
  97. package/dist/compiled/fast-glob/license +0 -21
  98. package/dist/compiled/fast-glob/out/index.d.ts +0 -27
  99. package/dist/compiled/fast-glob/out/managers/tasks.d.ts +0 -22
  100. package/dist/compiled/fast-glob/out/settings.d.ts +0 -164
  101. package/dist/compiled/fast-glob/out/types/index.d.ts +0 -31
  102. package/dist/compiled/fast-glob/package.json +0 -1
  103. package/dist/compiled/filesize/filesize.d.ts +0 -131
  104. package/dist/compiled/filesize/index.js +0 -198
  105. package/dist/compiled/filesize/index.js.LICENSE.txt +0 -7
  106. package/dist/compiled/filesize/license +0 -28
  107. package/dist/compiled/filesize/package.json +0 -1
  108. package/dist/compiled/fs-extra/index.d.ts +0 -563
  109. package/dist/compiled/fs-extra/index.js +0 -2222
  110. package/dist/compiled/fs-extra/license +0 -15
  111. package/dist/compiled/fs-extra/package.json +0 -1
  112. package/dist/compiled/glob/index.d.ts +0 -91
  113. package/dist/compiled/glob/index.js +0 -2011
  114. package/dist/compiled/glob/license +0 -21
  115. package/dist/compiled/glob/minimatch/index.d.ts +0 -204
  116. package/dist/compiled/glob/package.json +0 -1
  117. package/dist/compiled/globby/index.d.ts +0 -186
  118. package/dist/compiled/globby/index.js +0 -690
  119. package/dist/compiled/globby/license +0 -9
  120. package/dist/compiled/globby/package.json +0 -1
  121. package/dist/compiled/gzip-size/index.d.ts +0 -96
  122. package/dist/compiled/gzip-size/index.js +0 -157
  123. package/dist/compiled/gzip-size/license +0 -9
  124. package/dist/compiled/gzip-size/package.json +0 -1
  125. package/dist/compiled/import-lazy/index.d.ts +0 -26
  126. package/dist/compiled/import-lazy/index.js +0 -45
  127. package/dist/compiled/import-lazy/license +0 -9
  128. package/dist/compiled/import-lazy/package.json +0 -1
  129. package/dist/compiled/inquirer/index.d.ts +0 -997
  130. package/dist/compiled/inquirer/index.js +0 -20167
  131. package/dist/compiled/inquirer/index.js.LICENSE.txt +0 -7
  132. package/dist/compiled/inquirer/lib/objects/choice.d.ts +0 -65
  133. package/dist/compiled/inquirer/lib/objects/choices.d.ts +0 -206
  134. package/dist/compiled/inquirer/lib/objects/separator.d.ts +0 -37
  135. package/dist/compiled/inquirer/lib/ui/baseUI.d.ts +0 -37
  136. package/dist/compiled/inquirer/lib/ui/bottom-bar.d.ts +0 -65
  137. package/dist/compiled/inquirer/lib/ui/prompt.d.ts +0 -104
  138. package/dist/compiled/inquirer/license +0 -22
  139. package/dist/compiled/inquirer/package.json +0 -1
  140. package/dist/compiled/inquirer/through/index.d.ts +0 -25
  141. package/dist/compiled/js-yaml/index.d.ts +0 -154
  142. package/dist/compiled/js-yaml/index.js +0 -2191
  143. package/dist/compiled/js-yaml/index.mjs +0 -2167
  144. package/dist/compiled/js-yaml/index.mjs.LICENSE.txt +0 -1
  145. package/dist/compiled/js-yaml/license +0 -21
  146. package/dist/compiled/js-yaml/package.json +0 -1
  147. package/dist/compiled/json5/index.js +0 -983
  148. package/dist/compiled/json5/lib/index.d.ts +0 -4
  149. package/dist/compiled/json5/lib/parse.d.ts +0 -15
  150. package/dist/compiled/json5/lib/stringify.d.ts +0 -89
  151. package/dist/compiled/json5/package.json +0 -1
  152. package/dist/compiled/lodash/common/array.d.ts +0 -2126
  153. package/dist/compiled/lodash/common/collection.d.ts +0 -1930
  154. package/dist/compiled/lodash/common/common.d.ts +0 -280
  155. package/dist/compiled/lodash/common/date.d.ts +0 -23
  156. package/dist/compiled/lodash/common/function.d.ts +0 -1446
  157. package/dist/compiled/lodash/common/lang.d.ts +0 -1693
  158. package/dist/compiled/lodash/common/math.d.ts +0 -405
  159. package/dist/compiled/lodash/common/number.d.ts +0 -131
  160. package/dist/compiled/lodash/common/object.d.ts +0 -2519
  161. package/dist/compiled/lodash/common/seq.d.ts +0 -210
  162. package/dist/compiled/lodash/common/string.d.ts +0 -788
  163. package/dist/compiled/lodash/common/util.d.ts +0 -1220
  164. package/dist/compiled/lodash/index.d.ts +0 -46
  165. package/dist/compiled/lodash/index.js +0 -1
  166. package/dist/compiled/lodash/index.mjs +0 -1
  167. package/dist/compiled/lodash/license +0 -47
  168. package/dist/compiled/lodash/package.json +0 -1
  169. package/dist/compiled/mime-types/index.d.ts +0 -14
  170. package/dist/compiled/mime-types/index.js +0 -116
  171. package/dist/compiled/mime-types/index.js.LICENSE.txt +0 -13
  172. package/dist/compiled/mime-types/license +0 -23
  173. package/dist/compiled/mime-types/package.json +0 -1
  174. package/dist/compiled/minimist/index.d.ts +0 -95
  175. package/dist/compiled/minimist/index.js +0 -202
  176. package/dist/compiled/minimist/license +0 -18
  177. package/dist/compiled/minimist/package.json +0 -1
  178. package/dist/compiled/nanoid/index.d.ts +0 -91
  179. package/dist/compiled/nanoid/index.js +0 -83
  180. package/dist/compiled/nanoid/index.mjs +0 -69
  181. package/dist/compiled/nanoid/license +0 -20
  182. package/dist/compiled/nanoid/package.json +0 -1
  183. package/dist/compiled/ora/cli-spinners/index.d.ts +0 -125
  184. package/dist/compiled/ora/index.d.ts +0 -277
  185. package/dist/compiled/ora/index.js +0 -3936
  186. package/dist/compiled/ora/index.js.LICENSE.txt +0 -1
  187. package/dist/compiled/ora/license +0 -9
  188. package/dist/compiled/ora/package.json +0 -1
  189. package/dist/compiled/pkg-up/index.d.ts +0 -48
  190. package/dist/compiled/pkg-up/index.js +0 -15
  191. package/dist/compiled/pkg-up/license +0 -9
  192. package/dist/compiled/pkg-up/package.json +0 -1
  193. package/dist/compiled/semver/classes/comparator.d.ts +0 -17
  194. package/dist/compiled/semver/classes/range.d.ts +0 -21
  195. package/dist/compiled/semver/classes/semver.d.ts +0 -62
  196. package/dist/compiled/semver/functions/clean.d.ts +0 -8
  197. package/dist/compiled/semver/functions/cmp.d.ts +0 -16
  198. package/dist/compiled/semver/functions/coerce.d.ts +0 -12
  199. package/dist/compiled/semver/functions/compare-build.d.ts +0 -16
  200. package/dist/compiled/semver/functions/compare-loose.d.ts +0 -5
  201. package/dist/compiled/semver/functions/compare.d.ts +0 -20
  202. package/dist/compiled/semver/functions/diff.d.ts +0 -13
  203. package/dist/compiled/semver/functions/eq.d.ts +0 -9
  204. package/dist/compiled/semver/functions/gt.d.ts +0 -9
  205. package/dist/compiled/semver/functions/gte.d.ts +0 -9
  206. package/dist/compiled/semver/functions/inc.d.ts +0 -15
  207. package/dist/compiled/semver/functions/lt.d.ts +0 -9
  208. package/dist/compiled/semver/functions/lte.d.ts +0 -8
  209. package/dist/compiled/semver/functions/major.d.ts +0 -9
  210. package/dist/compiled/semver/functions/minor.d.ts +0 -9
  211. package/dist/compiled/semver/functions/neq.d.ts +0 -9
  212. package/dist/compiled/semver/functions/parse.d.ts +0 -12
  213. package/dist/compiled/semver/functions/patch.d.ts +0 -9
  214. package/dist/compiled/semver/functions/prerelease.d.ts +0 -12
  215. package/dist/compiled/semver/functions/rcompare.d.ts +0 -15
  216. package/dist/compiled/semver/functions/rsort.d.ts +0 -9
  217. package/dist/compiled/semver/functions/satisfies.d.ts +0 -14
  218. package/dist/compiled/semver/functions/sort.d.ts +0 -9
  219. package/dist/compiled/semver/functions/valid.d.ts +0 -11
  220. package/dist/compiled/semver/index.d.ts +0 -133
  221. package/dist/compiled/semver/index.js +0 -1779
  222. package/dist/compiled/semver/internals/identifiers.d.ts +0 -13
  223. package/dist/compiled/semver/license +0 -15
  224. package/dist/compiled/semver/package.json +0 -1
  225. package/dist/compiled/semver/ranges/gtr.d.ts +0 -14
  226. package/dist/compiled/semver/ranges/intersects.d.ts +0 -13
  227. package/dist/compiled/semver/ranges/ltr.d.ts +0 -14
  228. package/dist/compiled/semver/ranges/max-satisfying.d.ts +0 -14
  229. package/dist/compiled/semver/ranges/min-satisfying.d.ts +0 -14
  230. package/dist/compiled/semver/ranges/min-version.d.ts +0 -10
  231. package/dist/compiled/semver/ranges/outside.d.ts +0 -15
  232. package/dist/compiled/semver/ranges/simplify.d.ts +0 -14
  233. package/dist/compiled/semver/ranges/subset.d.ts +0 -13
  234. package/dist/compiled/semver/ranges/to-comparators.d.ts +0 -9
  235. package/dist/compiled/semver/ranges/valid.d.ts +0 -12
  236. package/dist/compiled/signale/index.d.ts +0 -162
  237. package/dist/compiled/signale/index.js +0 -1704
  238. package/dist/compiled/signale/package.json +0 -1
  239. package/dist/compiled/slash/index.d.ts +0 -25
  240. package/dist/compiled/slash/index.js +0 -32
  241. package/dist/compiled/slash/license +0 -9
  242. package/dist/compiled/slash/package.json +0 -1
  243. package/dist/compiled/strip-ansi/index.d.ts +0 -17
  244. package/dist/compiled/strip-ansi/index.js +0 -34
  245. package/dist/compiled/strip-ansi/license +0 -9
  246. package/dist/compiled/strip-ansi/package.json +0 -1
  247. package/dist/compiled/tsconfig-paths/index.js +0 -629
  248. package/dist/compiled/tsconfig-paths/index.mjs +0 -2
  249. package/dist/compiled/tsconfig-paths/lib/config-loader.d.ts +0 -33
  250. package/dist/compiled/tsconfig-paths/lib/filesystem.d.ts +0 -34
  251. package/dist/compiled/tsconfig-paths/lib/index.d.ts +0 -5
  252. package/dist/compiled/tsconfig-paths/lib/mapping-entry.d.ts +0 -18
  253. package/dist/compiled/tsconfig-paths/lib/match-path-async.d.ts +0 -21
  254. package/dist/compiled/tsconfig-paths/lib/match-path-sync.d.ts +0 -32
  255. package/dist/compiled/tsconfig-paths/lib/register.d.ts +0 -12
  256. package/dist/compiled/tsconfig-paths/lib/try-path.d.ts +0 -15
  257. package/dist/compiled/tsconfig-paths/lib/tsconfig-loader.d.ts +0 -28
  258. package/dist/compiled/tsconfig-paths/license +0 -21
  259. package/dist/compiled/tsconfig-paths/package.json +0 -1
  260. package/dist/compiled/upath/index.js +0 -135
  261. package/dist/compiled/upath/license +0 -22
  262. package/dist/compiled/upath/package.json +0 -1
  263. package/dist/compiled/upath/upath.d.ts +0 -241
  264. package/dist/compiled/url-join/index.d.ts +0 -17
  265. package/dist/compiled/url-join/index.js +0 -61
  266. package/dist/compiled/url-join/license +0 -21
  267. package/dist/compiled/url-join/package.json +0 -1
  268. package/dist/compiled/webpack-chain/index.js +0 -1475
  269. package/dist/compiled/webpack-chain/license +0 -373
  270. package/dist/compiled/webpack-chain/package.json +0 -1
  271. package/dist/compiled/webpack-chain/types/index.d.ts +0 -599
@@ -1,563 +0,0 @@
1
- // Type definitions for fs-extra 9.0
2
- // Project: https://github.com/jprichardson/node-fs-extra
3
- // Definitions by: Alan Agius <https://github.com/alan-agius4>,
4
- // midknight41 <https://github.com/midknight41>,
5
- // Brendan Forster <https://github.com/shiftkey>,
6
- // Mees van Dijk <https://github.com/mees->,
7
- // Justin Rockwood <https://github.com/jrockwood>,
8
- // Sang Dang <https://github.com/sangdth>,
9
- // Florian Keller <https://github.com/ffflorian>
10
- // Piotr Błażejewicz <https://github.com/peterblazejewicz>
11
- // Tiger Oakes <https://github.com/NotWoods>
12
- // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
13
- // Minimum TypeScript Version: 3.9
14
-
15
- /// <reference types="node" />
16
-
17
- import * as fs from 'fs';
18
- import Stats = fs.Stats;
19
- import PathLike = fs.PathLike;
20
-
21
- export * from 'fs';
22
-
23
- export function copy(src: string, dest: string, options?: CopyOptions): Promise<void>;
24
- export function copy(src: string, dest: string, callback: (err: Error) => void): void;
25
- export function copy(src: string, dest: string, options: CopyOptions, callback: (err: Error) => void): void;
26
- export function copySync(src: string, dest: string, options?: CopyOptionsSync): void;
27
-
28
- export function copyFile(src: string, dest: string, flags?: number): Promise<void>;
29
- export function copyFile(src: string, dest: string, callback: (err: Error) => void): void;
30
- export function copyFile(src: string, dest: string, flags: number, callback: (err: Error) => void): void;
31
-
32
- export function move(src: string, dest: string, options?: MoveOptions): Promise<void>;
33
- export function move(src: string, dest: string, callback: (err: Error) => void): void;
34
- export function move(src: string, dest: string, options: MoveOptions, callback: (err: Error) => void): void;
35
- export function moveSync(src: string, dest: string, options?: MoveOptions): void;
36
-
37
- export function createFile(file: string): Promise<void>;
38
- export function createFile(file: string, callback: (err: Error) => void): void;
39
- export function createFileSync(file: string): void;
40
-
41
- export function createSymlink(src: string, dest: string, type: SymlinkType): Promise<void>;
42
- export function createSymlink(src: string, dest: string, type: SymlinkType, callback?: (err: Error) => void): void;
43
- export function createSymlinkSync(src: string, dest: string, type: SymlinkType): void;
44
-
45
- export function ensureDir(path: string, options?: EnsureOptions | number): Promise<void>;
46
- export function ensureDir(path: string, callback?: (err: Error) => void): void;
47
- export function ensureDir(path: string, options?: EnsureOptions | number, callback?: (err: Error) => void): void;
48
- export function ensureDirSync(path: string, options?: EnsureOptions | number): void;
49
-
50
- export function mkdirs(dir: string): Promise<void>;
51
- export function mkdirs(dir: string, callback: (err: Error) => void): void;
52
- export function mkdirp(dir: string): Promise<void>;
53
- export function mkdirp(dir: string, callback: (err: Error) => void): void;
54
- export function mkdirsSync(dir: string): void;
55
- export function mkdirpSync(dir: string): void;
56
-
57
- export function outputFile(
58
- file: string,
59
- data: any,
60
- options?: WriteFileOptions | BufferEncoding | string,
61
- ): Promise<void>;
62
- export function outputFile(file: string, data: any, callback: (err: Error) => void): void;
63
- export function outputFile(
64
- file: string,
65
- data: any,
66
- options: WriteFileOptions | string,
67
- callback: (err: Error) => void,
68
- ): void;
69
- export function outputFileSync(file: string, data: any, options?: WriteFileOptions | BufferEncoding | string): void;
70
-
71
- export function readJson(file: string, options?: ReadOptions | BufferEncoding | string): Promise<any>;
72
- export function readJson(file: string, callback: (err: Error, jsonObject: any) => void): void;
73
- export function readJson(
74
- file: string,
75
- options: ReadOptions | BufferEncoding | string,
76
- callback: (err: Error, jsonObject: any) => void,
77
- ): void;
78
- export function readJSON(file: string, options?: ReadOptions | BufferEncoding | string): Promise<any>;
79
- export function readJSON(file: string, callback: (err: Error, jsonObject: any) => void): void;
80
- export function readJSON(
81
- file: string,
82
- options: ReadOptions | BufferEncoding | string,
83
- callback: (err: Error, jsonObject: any) => void,
84
- ): void;
85
-
86
- export function readJsonSync(file: string, options?: ReadOptions | BufferEncoding | string): any;
87
- export function readJSONSync(file: string, options?: ReadOptions | BufferEncoding | string): any;
88
-
89
- export function remove(dir: string, callback: (err: Error) => void): void;
90
- export function remove(dir: string, callback?: (err: Error) => void): Promise<void>;
91
- export function removeSync(dir: string): void;
92
-
93
- export function outputJSON(file: string, data: any, options?: WriteOptions | BufferEncoding | string): Promise<void>;
94
- export function outputJSON(
95
- file: string,
96
- data: any,
97
- options: WriteOptions | BufferEncoding | string,
98
- callback: (err: Error) => void,
99
- ): void;
100
- export function outputJSON(file: string, data: any, callback: (err: Error) => void): void;
101
- export function outputJson(file: string, data: any, options?: WriteOptions | BufferEncoding | string): Promise<void>;
102
- export function outputJson(
103
- file: string,
104
- data: any,
105
- options: WriteOptions | BufferEncoding | string,
106
- callback: (err: Error) => void,
107
- ): void;
108
- export function outputJson(file: string, data: any, callback: (err: Error) => void): void;
109
- export function outputJsonSync(file: string, data: any, options?: WriteOptions | BufferEncoding | string): void;
110
- export function outputJSONSync(file: string, data: any, options?: WriteOptions | BufferEncoding | string): void;
111
-
112
- export function writeJSON(file: string, object: any, options?: WriteOptions | BufferEncoding | string): Promise<void>;
113
- export function writeJSON(file: string, object: any, callback: (err: Error) => void): void;
114
- export function writeJSON(
115
- file: string,
116
- object: any,
117
- options: WriteOptions | BufferEncoding | string,
118
- callback: (err: Error) => void,
119
- ): void;
120
- export function writeJson(file: string, object: any, options?: WriteOptions | BufferEncoding | string): Promise<void>;
121
- export function writeJson(file: string, object: any, callback: (err: Error) => void): void;
122
- export function writeJson(
123
- file: string,
124
- object: any,
125
- options: WriteOptions | BufferEncoding | string,
126
- callback: (err: Error) => void,
127
- ): void;
128
-
129
- export function writeJsonSync(file: string, object: any, options?: WriteOptions | BufferEncoding | string): void;
130
- export function writeJSONSync(file: string, object: any, options?: WriteOptions | BufferEncoding | string): void;
131
-
132
- export function ensureFile(path: string): Promise<void>;
133
- export function ensureFile(path: string, callback: (err: Error) => void): void;
134
- export function ensureFileSync(path: string): void;
135
-
136
- export function ensureLink(src: string, dest: string): Promise<void>;
137
- export function ensureLink(src: string, dest: string, callback: (err: Error) => void): void;
138
- // alias for ensureLink
139
- export const createLink: typeof ensureLink;
140
- export function ensureLinkSync(src: string, dest: string): void;
141
- // aliased as
142
- export const createLinkSync: typeof ensureLinkSync;
143
-
144
- export function ensureSymlink(src: string, dest: string, type?: SymlinkType): Promise<void>;
145
- export function ensureSymlink(src: string, dest: string, type: SymlinkType, callback: (err: Error) => void): void;
146
- export function ensureSymlink(src: string, dest: string, callback: (err: Error) => void): void;
147
- export function ensureSymlinkSync(src: string, dest: string, type?: SymlinkType): void;
148
-
149
- export function emptyDir(path: string): Promise<void>;
150
- export function emptyDir(path: string, callback: (err: Error) => void): void;
151
- export const emptydir: typeof emptyDir;
152
-
153
- export function emptyDirSync(path: string): void;
154
- export const emptydirSync: typeof emptyDirSync;
155
-
156
- export function pathExists(path: string): Promise<boolean>;
157
- export function pathExists(path: string, callback: (err: Error, exists: boolean) => void): void;
158
- export function pathExistsSync(path: string): boolean;
159
-
160
- // fs async methods
161
- // copied from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/node/v6/index.d.ts
162
-
163
- export function access(path: PathLike, callback: (err: NodeJS.ErrnoException) => void): void;
164
- export function access(path: PathLike, mode: number, callback: (err: NodeJS.ErrnoException) => void): void;
165
- export function access(path: PathLike, mode?: number): Promise<void>;
166
-
167
- export function appendFile(
168
- file: PathLike | number,
169
- data: any,
170
- options: {
171
- encoding?: BufferEncoding | string | undefined;
172
- mode?: number | string | undefined;
173
- flag?: string | undefined;
174
- },
175
- callback: (err: NodeJS.ErrnoException) => void,
176
- ): void;
177
- export function appendFile(file: PathLike | number, data: any, callback: (err: NodeJS.ErrnoException) => void): void;
178
- export function appendFile(
179
- file: PathLike | number,
180
- data: any,
181
- options?:
182
- | {
183
- encoding?: BufferEncoding | string | undefined;
184
- mode?: number | string | undefined;
185
- flag?: string | undefined;
186
- }
187
- | BufferEncoding
188
- | string,
189
- ): Promise<void>;
190
-
191
- export function chmod(path: PathLike, mode: Mode, callback: (err: NodeJS.ErrnoException) => void): void;
192
- export function chmod(path: PathLike, mode: Mode): Promise<void>;
193
-
194
- export function chown(path: PathLike, uid: number, gid: number): Promise<void>;
195
- export function chown(path: PathLike, uid: number, gid: number, callback: (err: NodeJS.ErrnoException) => void): void;
196
-
197
- export function close(fd: number, callback: (err: NodeJS.ErrnoException) => void): void;
198
- export function close(fd: number): Promise<void>;
199
-
200
- export function fchmod(fd: number, mode: Mode, callback: (err: NodeJS.ErrnoException) => void): void;
201
- export function fchmod(fd: number, mode: Mode): Promise<void>;
202
-
203
- export function fchown(fd: number, uid: number, gid: number, callback: (err: NodeJS.ErrnoException) => void): void;
204
- export function fchown(fd: number, uid: number, gid: number): Promise<void>;
205
-
206
- export function fdatasync(fd: number, callback: () => void): void;
207
- export function fdatasync(fd: number): Promise<void>;
208
-
209
- export function fstat(fd: number, callback: (err: NodeJS.ErrnoException, stats: Stats) => any): void;
210
- export function fstat(fd: number): Promise<Stats>;
211
-
212
- export function fsync(fd: number, callback: (err: NodeJS.ErrnoException) => void): void;
213
- export function fsync(fd: number): Promise<void>;
214
-
215
- export function ftruncate(fd: number, callback: (err: NodeJS.ErrnoException) => void): void;
216
- export function ftruncate(fd: number, len: number, callback: (err: NodeJS.ErrnoException) => void): void;
217
- export function ftruncate(fd: number, len?: number): Promise<void>;
218
-
219
- export function futimes(fd: number, atime: number, mtime: number, callback: (err: NodeJS.ErrnoException) => void): void;
220
- export function futimes(fd: number, atime: Date, mtime: Date, callback: (err: NodeJS.ErrnoException) => void): void;
221
- export function futimes(fd: number, atime: number, mtime: number): Promise<void>;
222
- export function futimes(fd: number, atime: Date, mtime: Date): Promise<void>;
223
-
224
- export function lchown(path: PathLike, uid: number, gid: number, callback: (err: NodeJS.ErrnoException) => void): void;
225
- export function lchown(path: PathLike, uid: number, gid: number): Promise<void>;
226
-
227
- export function link(existingPath: PathLike, newPath: PathLike, callback: (err: NodeJS.ErrnoException) => void): void;
228
- export function link(existingPath: PathLike, newPath: PathLike): Promise<void>;
229
-
230
- export function lstat(path: PathLike, callback: (err: NodeJS.ErrnoException, stats: Stats) => any): void;
231
- export function lstat(path: PathLike): Promise<Stats>;
232
-
233
- /**
234
- * Asynchronous mkdir - creates the directory specified in {path}. Parameter {mode} defaults to 0777.
235
- *
236
- * @param callback No arguments other than a possible exception are given to the completion callback.
237
- */
238
- export function mkdir(path: PathLike, callback: (err: NodeJS.ErrnoException) => void): void;
239
- /**
240
- * Asynchronous mkdir - creates the directory specified in {path}. Parameter {mode} defaults to 0777.
241
- *
242
- * @param callback No arguments other than a possible exception are given to the completion callback.
243
- */
244
- export function mkdir(
245
- path: PathLike,
246
- options: Mode | fs.MakeDirectoryOptions | null,
247
- callback: (err: NodeJS.ErrnoException) => void,
248
- ): void;
249
- export function mkdir(path: PathLike, options?: Mode | fs.MakeDirectoryOptions | null): Promise<void>;
250
- export function mkdirSync(path: PathLike, options?: Mode | fs.MakeDirectoryOptions | null): void;
251
-
252
- export function open(
253
- path: PathLike,
254
- flags: string | number,
255
- callback: (err: NodeJS.ErrnoException, fd: number) => void,
256
- ): void;
257
- export function open(
258
- path: PathLike,
259
- flags: string | number,
260
- mode: Mode,
261
- callback: (err: NodeJS.ErrnoException, fd: number) => void,
262
- ): void;
263
- export function open(path: PathLike, flags: string | number, mode?: Mode | null): Promise<number>;
264
-
265
- export function opendir(path: string, cb: (err: NodeJS.ErrnoException | null, dir: fs.Dir) => void): void;
266
- export function opendir(
267
- path: string,
268
- options: fs.OpenDirOptions,
269
- cb: (err: NodeJS.ErrnoException | null, dir: fs.Dir) => void,
270
- ): void;
271
- export function opendir(path: string, options?: fs.OpenDirOptions): Promise<fs.Dir>;
272
-
273
- export function read<TBuffer extends ArrayBufferView>(
274
- fd: number,
275
- buffer: TBuffer,
276
- offset: number,
277
- length: number,
278
- position: number | null,
279
- callback: (err: NodeJS.ErrnoException, bytesRead: number, buffer: TBuffer) => void,
280
- ): void;
281
- export function read<TBuffer extends ArrayBufferView>(
282
- fd: number,
283
- buffer: TBuffer,
284
- offset: number,
285
- length: number,
286
- position: number | null,
287
- ): Promise<{ bytesRead: number; buffer: TBuffer }>;
288
-
289
- export function readFile(file: PathLike | number, callback: (err: NodeJS.ErrnoException, data: Buffer) => void): void;
290
- export function readFile(
291
- file: PathLike | number,
292
- encoding: BufferEncoding | string,
293
- callback: (err: NodeJS.ErrnoException, data: string) => void,
294
- ): void;
295
- export function readFile(
296
- file: PathLike | number,
297
- options: { flag?: string | undefined } | { encoding: BufferEncoding | string; flag?: string | undefined },
298
- callback: (err: NodeJS.ErrnoException, data: Buffer) => void,
299
- ): void;
300
- export function readFile(
301
- file: PathLike | number,
302
- options: { flag?: string | undefined } | { encoding: BufferEncoding | string; flag?: string | undefined },
303
- ): Promise<string>;
304
- // tslint:disable-next-line:unified-signatures
305
- export function readFile(file: PathLike | number, encoding: BufferEncoding | string): Promise<string>;
306
- export function readFile(file: PathLike | number): Promise<Buffer>;
307
-
308
- export function readdir(path: PathLike, callback: (err: NodeJS.ErrnoException, files: string[]) => void): void;
309
- export function readdir(
310
- path: PathLike,
311
- options: 'buffer' | { encoding: 'buffer'; withFileTypes?: false | undefined },
312
- ): Promise<Buffer[]>;
313
- export function readdir(
314
- path: PathLike,
315
- options?:
316
- | { encoding: BufferEncoding | string | null; withFileTypes?: false | undefined }
317
- | BufferEncoding
318
- | string
319
- | null,
320
- ): Promise<string[]>;
321
- export function readdir(
322
- path: PathLike,
323
- options?: { encoding?: BufferEncoding | string | null | undefined; withFileTypes?: false | undefined },
324
- ): Promise<string[] | Buffer[]>;
325
- export function readdir(
326
- path: PathLike,
327
- options: { encoding?: BufferEncoding | string | null | undefined; withFileTypes: true },
328
- ): Promise<fs.Dirent[]>;
329
-
330
- export function readlink(path: PathLike, callback: (err: NodeJS.ErrnoException, linkString: string) => any): void;
331
- export function readlink(path: PathLike): Promise<string>;
332
-
333
- export function realpath(path: PathLike, callback: (err: NodeJS.ErrnoException, resolvedPath: string) => any): void;
334
- export function realpath(
335
- path: PathLike,
336
- cache: { [path: string]: string },
337
- callback: (err: NodeJS.ErrnoException, resolvedPath: string) => any,
338
- ): void;
339
- export function realpath(path: PathLike, cache?: { [path: string]: string }): Promise<string>;
340
-
341
- /* tslint:disable:unified-signatures */
342
- export namespace realpath {
343
- const native: {
344
- (path: PathLike, options: { encoding: 'buffer' } | 'buffer'): Promise<Buffer>;
345
- (
346
- path: PathLike,
347
- options: { encoding: BufferEncoding | string | null } | BufferEncoding | string | undefined | null,
348
- ): Promise<string>;
349
- (path: PathLike, options: { encoding: BufferEncoding | string | null } | string | undefined | null): Promise<
350
- string | Buffer
351
- >;
352
- (path: PathLike): Promise<string>;
353
- } & typeof fs.realpath.native;
354
- }
355
- /* tslint:enable:unified-signatures */
356
-
357
- export function rename(oldPath: PathLike, newPath: PathLike, callback: (err: NodeJS.ErrnoException) => void): void;
358
- export function rename(oldPath: PathLike, newPath: PathLike): Promise<void>;
359
-
360
- /**
361
- * Asynchronously removes files and directories (modeled on the standard POSIX
362
- * `rm` utility).
363
- *
364
- * Only available in node >= v14.14.0
365
- */
366
- export function rm(
367
- path: PathLike,
368
- options?: {
369
- force?: boolean | undefined;
370
- maxRetries?: number | undefined;
371
- recursive?: boolean | undefined;
372
- retryDelay?: number | undefined;
373
- },
374
- ): Promise<void>;
375
-
376
- /**
377
- * Asynchronous rmdir - removes the directory specified in {path}
378
- *
379
- * @param callback No arguments other than a possible exception are given to the completion callback.
380
- */
381
- export function rmdir(path: PathLike, callback: (err: NodeJS.ErrnoException) => void): void;
382
- export function rmdir(path: PathLike, options?: fs.RmDirOptions): Promise<void>;
383
-
384
- export function stat(path: PathLike, callback: (err: NodeJS.ErrnoException, stats: Stats) => any): void;
385
- export function stat(path: PathLike): Promise<Stats>;
386
-
387
- export function symlink(
388
- target: PathLike,
389
- path: PathLike,
390
- type: SymlinkType | undefined,
391
- callback: (err: NodeJS.ErrnoException) => void,
392
- ): void;
393
- export function symlink(target: PathLike, path: PathLike, callback: (err: NodeJS.ErrnoException) => void): void;
394
- export function symlink(target: PathLike, path: PathLike, type?: SymlinkType): Promise<void>;
395
-
396
- export function truncate(path: PathLike, callback: (err: NodeJS.ErrnoException) => void): void;
397
- export function truncate(path: PathLike, len: number, callback: (err: NodeJS.ErrnoException) => void): void;
398
- export function truncate(path: PathLike, len?: number): Promise<void>;
399
-
400
- /**
401
- * Asynchronous unlink - deletes the file specified in {path}
402
- *
403
- * @param callback No arguments other than a possible exception are given to the completion callback.
404
- */
405
- export function unlink(path: PathLike, callback: (err: NodeJS.ErrnoException) => void): void;
406
- export function unlink(path: PathLike): Promise<void>;
407
-
408
- export function utimes(
409
- path: PathLike,
410
- atime: number,
411
- mtime: number,
412
- callback: (err: NodeJS.ErrnoException) => void,
413
- ): void;
414
- export function utimes(path: PathLike, atime: Date, mtime: Date, callback: (err: NodeJS.ErrnoException) => void): void;
415
- export function utimes(path: PathLike, atime: number, mtime: number): Promise<void>;
416
- export function utimes(path: PathLike, atime: Date, mtime: Date): Promise<void>;
417
-
418
- export function write<TBuffer extends ArrayBufferView>(
419
- fd: number,
420
- buffer: TBuffer,
421
- offset: number,
422
- length: number,
423
- position: number | null,
424
- callback: (err: NodeJS.ErrnoException, written: number, buffer: TBuffer) => void,
425
- ): void;
426
- export function write<TBuffer extends ArrayBufferView>(
427
- fd: number,
428
- buffer: TBuffer,
429
- offset: number,
430
- length: number,
431
- callback: (err: NodeJS.ErrnoException, written: number, buffer: TBuffer) => void,
432
- ): void;
433
- export function write(
434
- fd: number,
435
- data: any,
436
- callback: (err: NodeJS.ErrnoException, written: number, str: string) => void,
437
- ): void;
438
- export function write(
439
- fd: number,
440
- data: any,
441
- offset: number,
442
- callback: (err: NodeJS.ErrnoException, written: number, str: string) => void,
443
- ): void;
444
- export function write(
445
- fd: number,
446
- data: any,
447
- offset: number,
448
- encoding: BufferEncoding | string,
449
- callback: (err: NodeJS.ErrnoException, written: number, str: string) => void,
450
- ): void;
451
- export function write<TBuffer extends ArrayBufferView>(
452
- fd: number,
453
- buffer: TBuffer,
454
- offset?: number,
455
- length?: number,
456
- position?: number | null,
457
- ): Promise<{ bytesWritten: number; buffer: TBuffer }>;
458
- export function write(
459
- fd: number,
460
- data: any,
461
- offset?: number,
462
- encoding?: BufferEncoding | string,
463
- ): Promise<{ bytesWritten: number; buffer: string }>;
464
-
465
- export function writeFile(file: PathLike | number, data: any, callback: (err: NodeJS.ErrnoException) => void): void;
466
- export function writeFile(
467
- file: PathLike | number,
468
- data: any,
469
- options?: WriteFileOptions | BufferEncoding | string,
470
- ): Promise<void>;
471
- export function writeFile(
472
- file: PathLike | number,
473
- data: any,
474
- options: WriteFileOptions | BufferEncoding | string,
475
- callback: (err: NodeJS.ErrnoException) => void,
476
- ): void;
477
-
478
- export function writev(
479
- fd: number,
480
- buffers: NodeJS.ArrayBufferView[],
481
- position: number,
482
- cb: (err: NodeJS.ErrnoException | null, bytesWritten: number, buffers: NodeJS.ArrayBufferView[]) => void,
483
- ): void;
484
- export function writev(
485
- fd: number,
486
- buffers: NodeJS.ArrayBufferView[],
487
- cb: (err: NodeJS.ErrnoException | null, bytesWritten: number, buffers: NodeJS.ArrayBufferView[]) => void,
488
- ): void;
489
- export function writev(fd: number, buffers: NodeJS.ArrayBufferView[], position?: number): Promise<WritevResult>;
490
-
491
- /**
492
- * Asynchronous mkdtemp - Creates a unique temporary directory. Generates six random characters to be appended behind a required prefix to create a unique temporary directory.
493
- *
494
- * @param callback The created folder path is passed as a string to the callback's second parameter.
495
- */
496
- export function mkdtemp(prefix: string): Promise<string>;
497
- export function mkdtemp(prefix: string, callback: (err: NodeJS.ErrnoException, folder: string) => void): void;
498
-
499
- export interface PathEntry {
500
- path: string;
501
- stats: Stats;
502
- }
503
-
504
- export interface PathEntryStream {
505
- read(): PathEntry | null;
506
- }
507
-
508
- export type CopyFilterSync = (src: string, dest: string) => boolean;
509
- export type CopyFilterAsync = (src: string, dest: string) => Promise<boolean>;
510
-
511
- export type SymlinkType = 'dir' | 'file' | 'junction';
512
-
513
- export type Mode = string | number;
514
-
515
- export type ArrayBufferView = NodeJS.TypedArray | DataView;
516
-
517
- export interface CopyOptions {
518
- dereference?: boolean | undefined;
519
- overwrite?: boolean | undefined;
520
- preserveTimestamps?: boolean | undefined;
521
- errorOnExist?: boolean | undefined;
522
- filter?: CopyFilterSync | CopyFilterAsync | undefined;
523
- recursive?: boolean | undefined;
524
- }
525
-
526
- export interface CopyOptionsSync extends CopyOptions {
527
- filter?: CopyFilterSync | undefined;
528
- }
529
-
530
- export interface EnsureOptions {
531
- mode?: number | undefined;
532
- }
533
-
534
- export interface MoveOptions {
535
- overwrite?: boolean | undefined;
536
- limit?: number | undefined;
537
- }
538
-
539
- export interface ReadOptions {
540
- throws?: boolean | undefined;
541
- fs?: object | undefined;
542
- reviver?: any;
543
- encoding?: BufferEncoding | string | undefined;
544
- flag?: string | undefined;
545
- }
546
-
547
- export interface WriteFileOptions {
548
- encoding?: BufferEncoding | string | null | undefined;
549
- flag?: string | undefined;
550
- mode?: number | undefined;
551
- }
552
-
553
- export interface WriteOptions extends WriteFileOptions {
554
- fs?: object | undefined;
555
- replacer?: any;
556
- spaces?: number | string | undefined;
557
- EOL?: string | undefined;
558
- }
559
-
560
- export interface WritevResult {
561
- bytesWritten: number;
562
- buffers: ArrayBufferView[];
563
- }