@types/node 18.6.1 → 18.6.4
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/README.md +1 -1
- node/fs.d.ts +22 -8
- node/package.json +2 -2
- node/path.d.ts +30 -19
node/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.
|
|
9
9
|
|
|
10
10
|
### Additional Details
|
|
11
|
-
* Last updated:
|
|
11
|
+
* Last updated: Thu, 04 Aug 2022 22:32:21 GMT
|
|
12
12
|
* Dependencies: none
|
|
13
13
|
* Global values: `AbortController`, `AbortSignal`, `__dirname`, `__filename`, `console`, `exports`, `gc`, `global`, `module`, `process`, `require`, `structuredClone`
|
|
14
14
|
|
node/fs.d.ts
CHANGED
|
@@ -1395,7 +1395,7 @@ declare module 'fs' {
|
|
|
1395
1395
|
* Use `fs.rm(path, { recursive: true, force: true })` instead.
|
|
1396
1396
|
*
|
|
1397
1397
|
* If `true`, perform a recursive directory removal. In
|
|
1398
|
-
* recursive mode
|
|
1398
|
+
* recursive mode, operations are retried on failure.
|
|
1399
1399
|
* @default false
|
|
1400
1400
|
*/
|
|
1401
1401
|
recursive?: boolean | undefined;
|
|
@@ -3791,7 +3791,7 @@ declare module 'fs' {
|
|
|
3791
3791
|
export interface StatSyncOptions extends StatOptions {
|
|
3792
3792
|
throwIfNoEntry?: boolean | undefined;
|
|
3793
3793
|
}
|
|
3794
|
-
|
|
3794
|
+
interface CopyOptionsBase {
|
|
3795
3795
|
/**
|
|
3796
3796
|
* Dereference symlinks
|
|
3797
3797
|
* @default false
|
|
@@ -3803,11 +3803,6 @@ declare module 'fs' {
|
|
|
3803
3803
|
* @default false
|
|
3804
3804
|
*/
|
|
3805
3805
|
errorOnExist?: boolean;
|
|
3806
|
-
/**
|
|
3807
|
-
* Function to filter copied files/directories. Return
|
|
3808
|
-
* `true` to copy the item, `false` to ignore it.
|
|
3809
|
-
*/
|
|
3810
|
-
filter?(source: string, destination: string): boolean;
|
|
3811
3806
|
/**
|
|
3812
3807
|
* Overwrite existing file or directory. _The copy
|
|
3813
3808
|
* operation will ignore errors if you set this to false and the destination
|
|
@@ -3826,6 +3821,25 @@ declare module 'fs' {
|
|
|
3826
3821
|
* @default false
|
|
3827
3822
|
*/
|
|
3828
3823
|
recursive?: boolean;
|
|
3824
|
+
/**
|
|
3825
|
+
* When true, path resolution for symlinks will be skipped
|
|
3826
|
+
* @default false
|
|
3827
|
+
*/
|
|
3828
|
+
verbatimSymlinks?: boolean;
|
|
3829
|
+
}
|
|
3830
|
+
export interface CopyOptions extends CopyOptionsBase {
|
|
3831
|
+
/**
|
|
3832
|
+
* Function to filter copied files/directories. Return
|
|
3833
|
+
* `true` to copy the item, `false` to ignore it.
|
|
3834
|
+
*/
|
|
3835
|
+
filter?(source: string, destination: string): boolean | Promise<boolean>;
|
|
3836
|
+
}
|
|
3837
|
+
export interface CopySyncOptions extends CopyOptionsBase {
|
|
3838
|
+
/**
|
|
3839
|
+
* Function to filter copied files/directories. Return
|
|
3840
|
+
* `true` to copy the item, `false` to ignore it.
|
|
3841
|
+
*/
|
|
3842
|
+
filter?(source: string, destination: string): boolean;
|
|
3829
3843
|
}
|
|
3830
3844
|
/**
|
|
3831
3845
|
* Asynchronously copies the entire directory structure from `src` to `dest`,
|
|
@@ -3851,7 +3865,7 @@ declare module 'fs' {
|
|
|
3851
3865
|
* @param src source path to copy.
|
|
3852
3866
|
* @param dest destination path to copy to.
|
|
3853
3867
|
*/
|
|
3854
|
-
export function cpSync(source: string | URL, destination: string | URL, opts?:
|
|
3868
|
+
export function cpSync(source: string | URL, destination: string | URL, opts?: CopySyncOptions): void;
|
|
3855
3869
|
}
|
|
3856
3870
|
declare module 'node:fs' {
|
|
3857
3871
|
export * from 'fs';
|
node/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@types/node",
|
|
3
|
-
"version": "18.6.
|
|
3
|
+
"version": "18.6.4",
|
|
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": "
|
|
223
|
+
"typesPublisherContentHash": "6c45c49b1633a0b9a44171aa51a4e6a8777838d5e52b362a2dd8ce57bae1f929",
|
|
224
224
|
"typeScriptVersion": "4.0"
|
|
225
225
|
}
|
node/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
|
|
72
|
+
* @param path string path to normalize.
|
|
73
|
+
* @throws {TypeError} if `path` is not a string.
|
|
73
74
|
*/
|
|
74
|
-
normalize(
|
|
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}.
|
|
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
|
|
93
|
+
* @param paths A sequence of paths or path segments.
|
|
94
|
+
* @throws {TypeError} if any of the arguments is not a string.
|
|
93
95
|
*/
|
|
94
|
-
resolve(...
|
|
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(
|
|
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
|
|
116
|
+
* @param path the path to evaluate.
|
|
117
|
+
* @throws {TypeError} if `path` is not a string.
|
|
110
118
|
*/
|
|
111
|
-
dirname(
|
|
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
|
|
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(
|
|
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
|
|
133
|
+
* @param path the path to evaluate.
|
|
134
|
+
* @throws {TypeError} if `path` is not a string.
|
|
125
135
|
*/
|
|
126
|
-
extname(
|
|
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
|
|
148
|
+
* @param path path to evaluate.
|
|
149
|
+
* @throws {TypeError} if `path` is not a string.
|
|
139
150
|
*/
|
|
140
|
-
parse(
|
|
151
|
+
parse(path: string): ParsedPath;
|
|
141
152
|
/**
|
|
142
153
|
* Returns a path string from an object - the opposite of parse().
|
|
143
154
|
*
|
|
144
|
-
* @param
|
|
155
|
+
* @param pathObject path to evaluate.
|
|
145
156
|
*/
|
|
146
|
-
format(
|
|
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.
|