@types/node 16.11.44 → 16.11.47

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.
node v16.11/README.md CHANGED
@@ -8,7 +8,7 @@ This package contains type definitions for Node.js (https://nodejs.org/).
8
8
  Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node/v16.
9
9
 
10
10
  ### Additional Details
11
- * Last updated: Wed, 13 Jul 2022 21:02:29 GMT
11
+ * Last updated: Sat, 30 Jul 2022 21:02:21 GMT
12
12
  * Dependencies: none
13
13
  * Global values: `AbortController`, `AbortSignal`, `__dirname`, `__filename`, `console`, `exports`, `gc`, `global`, `module`, `process`, `require`
14
14
 
node v16.11/crypto.d.ts CHANGED
@@ -3602,7 +3602,7 @@ declare module 'crypto' {
3602
3602
  * Valid key usages depend on the key algorithm (identified by `cryptokey.algorithm.name`).
3603
3603
  * @since v15.0.0
3604
3604
  */
3605
- readonly usages: KeyUsage;
3605
+ readonly usages: KeyUsage[];
3606
3606
  }
3607
3607
  /**
3608
3608
  * The `CryptoKeyPair` is a simple dictionary object with `publicKey` and `privateKey` properties, representing an asymmetric key pair.
node v16.11/fs.d.ts CHANGED
@@ -3723,7 +3723,7 @@ declare module 'fs' {
3723
3723
  export interface StatSyncOptions extends StatOptions {
3724
3724
  throwIfNoEntry?: boolean | undefined;
3725
3725
  }
3726
- export interface CopyOptions {
3726
+ interface CopyOptionsBase {
3727
3727
  /**
3728
3728
  * Dereference symlinks
3729
3729
  * @default false
@@ -3735,11 +3735,6 @@ declare module 'fs' {
3735
3735
  * @default false
3736
3736
  */
3737
3737
  errorOnExist?: boolean;
3738
- /**
3739
- * Function to filter copied files/directories. Return
3740
- * `true` to copy the item, `false` to ignore it.
3741
- */
3742
- filter?(source: string, destination: string): boolean;
3743
3738
  /**
3744
3739
  * Overwrite existing file or directory. _The copy
3745
3740
  * operation will ignore errors if you set this to false and the destination
@@ -3759,6 +3754,20 @@ declare module 'fs' {
3759
3754
  */
3760
3755
  recursive?: boolean;
3761
3756
  }
3757
+ export interface CopyOptions extends CopyOptionsBase {
3758
+ /**
3759
+ * Function to filter copied files/directories. Return
3760
+ * `true` to copy the item, `false` to ignore it.
3761
+ */
3762
+ filter?(source: string, destination: string): boolean | Promise<boolean>;
3763
+ }
3764
+ export interface CopySyncOptions extends CopyOptionsBase {
3765
+ /**
3766
+ * Function to filter copied files/directories. Return
3767
+ * `true` to copy the item, `false` to ignore it.
3768
+ */
3769
+ filter?(source: string, destination: string): boolean;
3770
+ }
3762
3771
  /**
3763
3772
  * Asynchronously copies the entire directory structure from `src` to `dest`,
3764
3773
  * including subdirectories and files.
@@ -3783,7 +3792,7 @@ declare module 'fs' {
3783
3792
  * @param src source path to copy.
3784
3793
  * @param dest destination path to copy to.
3785
3794
  */
3786
- export function cpSync(source: string | URL, destination: string | URL, opts?: CopyOptions): void;
3795
+ export function cpSync(source: string | URL, destination: string | URL, opts?: CopySyncOptions): void;
3787
3796
  }
3788
3797
  declare module 'node:fs' {
3789
3798
  export * from 'fs';
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/node",
3
- "version": "16.11.44",
3
+ "version": "16.11.47",
4
4
  "description": "TypeScript definitions for Node.js",
5
5
  "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node",
6
6
  "license": "MIT",
@@ -220,6 +220,6 @@
220
220
  },
221
221
  "scripts": {},
222
222
  "dependencies": {},
223
- "typesPublisherContentHash": "956b726890ddfa9912775de02ebfc2897a6fdabc55afd5ea9a982ba88c2953b6",
223
+ "typesPublisherContentHash": "7f28db57ba4adbbd976a43438c24b15b083a387117417ecfdced467836e44637",
224
224
  "typeScriptVersion": "4.0"
225
225
  }
node v16.11/path.d.ts CHANGED
@@ -69,18 +69,19 @@ declare module 'path' {
69
69
  * Normalize a string path, reducing '..' and '.' parts.
70
70
  * When multiple slashes are found, they're replaced by a single one; when the path contains a trailing slash, it is preserved. On Windows backslashes are used.
71
71
  *
72
- * @param p string path to normalize.
72
+ * @param path string path to normalize.
73
+ * @throws {TypeError} if `path` is not a string.
73
74
  */
74
- normalize(p: string): string;
75
+ normalize(path: string): string;
75
76
  /**
76
77
  * Join all arguments together and normalize the resulting path.
77
- * Arguments must be strings. In v0.8, non-string arguments were silently ignored. In v0.10 and up, an exception is thrown.
78
78
  *
79
79
  * @param paths paths to join.
80
+ * @throws {TypeError} if any of the path segments is not a string.
80
81
  */
81
82
  join(...paths: string[]): string;
82
83
  /**
83
- * The right-most parameter is considered {to}. Other parameters are considered an array of {from}.
84
+ * The right-most parameter is considered {to}. Other parameters are considered an array of {from}.
84
85
  *
85
86
  * Starting from leftmost {from} parameter, resolves {to} to an absolute path.
86
87
  *
@@ -89,41 +90,50 @@ declare module 'path' {
89
90
  * the current working directory is used as well. The resulting path is normalized,
90
91
  * and trailing slashes are removed unless the path gets resolved to the root directory.
91
92
  *
92
- * @param pathSegments string paths to join. Non-string arguments are ignored.
93
+ * @param paths string paths to join.
94
+ * @throws {TypeError} if any of the arguments is not a string.
93
95
  */
94
- resolve(...pathSegments: string[]): string;
96
+ resolve(...paths: string[]): string;
95
97
  /**
96
98
  * Determines whether {path} is an absolute path. An absolute path will always resolve to the same location, regardless of the working directory.
97
99
  *
100
+ * If the given {path} is a zero-length string, `false` will be returned.
101
+ *
98
102
  * @param path path to test.
103
+ * @throws {TypeError} if `path` is not a string.
99
104
  */
100
- isAbsolute(p: string): boolean;
105
+ isAbsolute(path: string): boolean;
101
106
  /**
102
- * Solve the relative path from {from} to {to}.
107
+ * Solve the relative path from {from} to {to} based on the current working directory.
103
108
  * At times we have two absolute paths, and we need to derive the relative path from one to the other. This is actually the reverse transform of path.resolve.
109
+ *
110
+ * @throws {TypeError} if either `from` or `to` is not a string.
104
111
  */
105
112
  relative(from: string, to: string): string;
106
113
  /**
107
114
  * Return the directory name of a path. Similar to the Unix dirname command.
108
115
  *
109
- * @param p the path to evaluate.
116
+ * @param path the path to evaluate.
117
+ * @throws {TypeError} if `path` is not a string.
110
118
  */
111
- dirname(p: string): string;
119
+ dirname(path: string): string;
112
120
  /**
113
121
  * Return the last portion of a path. Similar to the Unix basename command.
114
122
  * Often used to extract the file name from a fully qualified path.
115
123
  *
116
- * @param p the path to evaluate.
124
+ * @param path the path to evaluate.
117
125
  * @param ext optionally, an extension to remove from the result.
126
+ * @throws {TypeError} if `path` is not a string or if `ext` is given and is not a string.
118
127
  */
119
- basename(p: string, ext?: string): string;
128
+ basename(path: string, ext?: string): string;
120
129
  /**
121
130
  * Return the extension of the path, from the last '.' to end of string in the last portion of the path.
122
- * If there is no '.' in the last portion of the path or the first character of it is '.', then it returns an empty string
131
+ * If there is no '.' in the last portion of the path or the first character of it is '.', then it returns an empty string.
123
132
  *
124
- * @param p the path to evaluate.
133
+ * @param path the path to evaluate.
134
+ * @throws {TypeError} if `path` is not a string.
125
135
  */
126
- extname(p: string): string;
136
+ extname(path: string): string;
127
137
  /**
128
138
  * The platform-specific file separator. '\\' or '/'.
129
139
  */
@@ -135,15 +145,16 @@ declare module 'path' {
135
145
  /**
136
146
  * Returns an object from a path string - the opposite of format().
137
147
  *
138
- * @param pathString path to evaluate.
148
+ * @param path path to evaluate.
149
+ * @throws {TypeError} if `path` is not a string.
139
150
  */
140
- parse(p: string): ParsedPath;
151
+ parse(path: string): ParsedPath;
141
152
  /**
142
153
  * Returns a path string from an object - the opposite of parse().
143
154
  *
144
- * @param pathString path to evaluate.
155
+ * @param pathObject path to evaluate.
145
156
  */
146
- format(pP: FormatInputPathObject): string;
157
+ format(pathObject: FormatInputPathObject): string;
147
158
  /**
148
159
  * On Windows systems only, returns an equivalent namespace-prefixed path for the given path.
149
160
  * If path is not a string, path will be returned without modifications.