@kikiutils/shared 18.0.1 → 18.1.0
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.
- package/dist/buffer.d.ts +19 -21
- package/dist/buffer.d.ts.map +1 -1
- package/dist/buffer.js +18 -19
- package/dist/buffer.js.map +1 -1
- package/dist/classes/enhanced-date.d.ts +425 -0
- package/dist/classes/enhanced-date.d.ts.map +1 -0
- package/dist/classes/enhanced-date.js +591 -0
- package/dist/classes/enhanced-date.js.map +1 -0
- package/dist/classes/path.d.ts +211 -48
- package/dist/classes/path.d.ts.map +1 -1
- package/dist/classes/path.js +181 -52
- package/dist/classes/path.js.map +1 -1
- package/dist/classes/precision-number.d.ts +44 -39
- package/dist/classes/precision-number.d.ts.map +1 -1
- package/dist/classes/precision-number.js +51 -45
- package/dist/classes/precision-number.js.map +1 -1
- package/dist/classes/ssh-client.d.ts +3 -4
- package/dist/classes/ssh-client.d.ts.map +1 -1
- package/dist/classes/ssh-client.js +2 -2
- package/dist/classes/ssh-client.js.map +1 -1
- package/dist/clipboard.d.ts +25 -26
- package/dist/clipboard.d.ts.map +1 -1
- package/dist/clipboard.js +23 -23
- package/dist/clipboard.js.map +1 -1
- package/dist/consola.d.ts +12 -15
- package/dist/consola.d.ts.map +1 -1
- package/dist/consola.js +10 -12
- package/dist/consola.js.map +1 -1
- package/dist/crypto-hash.d.ts +65 -56
- package/dist/crypto-hash.d.ts.map +1 -1
- package/dist/crypto-hash.js +55 -45
- package/dist/crypto-hash.js.map +1 -1
- package/dist/datetime.d.ts +41 -53
- package/dist/datetime.d.ts.map +1 -1
- package/dist/datetime.js +53 -66
- package/dist/datetime.js.map +1 -1
- package/dist/element-plus.d.ts +13 -14
- package/dist/element-plus.d.ts.map +1 -1
- package/dist/element-plus.js +11 -11
- package/dist/element-plus.js.map +1 -1
- package/dist/enum.d.ts +39 -36
- package/dist/enum.d.ts.map +1 -1
- package/dist/enum.js +36 -32
- package/dist/enum.js.map +1 -1
- package/dist/env.d.ts +22 -15
- package/dist/env.d.ts.map +1 -1
- package/dist/env.js +20 -12
- package/dist/env.js.map +1 -1
- package/dist/event-awaiter.d.ts +47 -52
- package/dist/event-awaiter.d.ts.map +1 -1
- package/dist/event-awaiter.js +46 -50
- package/dist/event-awaiter.js.map +1 -1
- package/dist/general.d.ts +22 -17
- package/dist/general.d.ts.map +1 -1
- package/dist/general.js.map +1 -1
- package/dist/hash.d.ts +24 -21
- package/dist/hash.d.ts.map +1 -1
- package/dist/hash.js +20 -16
- package/dist/hash.js.map +1 -1
- package/dist/math.d.ts +20 -19
- package/dist/math.d.ts.map +1 -1
- package/dist/math.js +14 -12
- package/dist/math.js.map +1 -1
- package/dist/number.d.ts +10 -9
- package/dist/number.d.ts.map +1 -1
- package/dist/number.js +9 -7
- package/dist/number.js.map +1 -1
- package/dist/object.d.ts +22 -10
- package/dist/object.d.ts.map +1 -1
- package/dist/object.js +21 -8
- package/dist/object.js.map +1 -1
- package/dist/pino.d.ts +12 -15
- package/dist/pino.d.ts.map +1 -1
- package/dist/pino.js +10 -15
- package/dist/pino.js.map +1 -1
- package/dist/random.d.ts +17 -15
- package/dist/random.d.ts.map +1 -1
- package/dist/random.js +16 -13
- package/dist/random.js.map +1 -1
- package/dist/redis/script-runner.d.ts +57 -0
- package/dist/redis/script-runner.d.ts.map +1 -0
- package/dist/redis/script-runner.js +46 -0
- package/dist/redis/script-runner.js.map +1 -0
- package/dist/storages/lru/keyed-store.d.ts +18 -14
- package/dist/storages/lru/keyed-store.d.ts.map +1 -1
- package/dist/storages/lru/keyed-store.js +17 -12
- package/dist/storages/lru/keyed-store.js.map +1 -1
- package/dist/storages/redis/keyed-store.d.ts +11 -21
- package/dist/storages/redis/keyed-store.d.ts.map +1 -1
- package/dist/storages/redis/keyed-store.js +10 -19
- package/dist/storages/redis/keyed-store.js.map +1 -1
- package/dist/storages/redis/msgpack.d.ts +33 -13
- package/dist/storages/redis/msgpack.d.ts.map +1 -1
- package/dist/storages/redis/msgpack.js +32 -11
- package/dist/storages/redis/msgpack.js.map +1 -1
- package/dist/storages/redis/types.d.ts +34 -17
- package/dist/storages/redis/types.d.ts.map +1 -1
- package/dist/string.d.ts +12 -11
- package/dist/string.d.ts.map +1 -1
- package/dist/string.js +20 -15
- package/dist/string.js.map +1 -1
- package/dist/time.d.ts +26 -21
- package/dist/time.d.ts.map +1 -1
- package/dist/time.js +24 -18
- package/dist/time.js.map +1 -1
- package/dist/types/filtered-key-path.d.ts +4 -15
- package/dist/types/filtered-key-path.d.ts.map +1 -1
- package/dist/types/index.d.ts +10 -10
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/vue.d.ts +7 -7
- package/dist/types/vue.d.ts.map +1 -1
- package/dist/url.d.ts +15 -14
- package/dist/url.d.ts.map +1 -1
- package/dist/url.js +12 -10
- package/dist/url.js.map +1 -1
- package/dist/vue.d.ts +19 -21
- package/dist/vue.d.ts.map +1 -1
- package/dist/vue.js +15 -16
- package/dist/vue.js.map +1 -1
- package/dist/web.d.ts +14 -11
- package/dist/web.d.ts.map +1 -1
- package/dist/web.js +12 -8
- package/dist/web.js.map +1 -1
- package/package.json +20 -20
- package/src/buffer.ts +18 -19
- package/src/classes/enhanced-date.ts +665 -0
- package/src/classes/path.ts +232 -91
- package/src/classes/precision-number.ts +61 -53
- package/src/classes/ssh-client.ts +8 -5
- package/src/clipboard.ts +23 -23
- package/src/consola.ts +10 -12
- package/src/crypto-hash.ts +55 -45
- package/src/datetime.ts +65 -85
- package/src/element-plus.ts +11 -11
- package/src/enum.ts +36 -32
- package/src/env.ts +20 -12
- package/src/event-awaiter.ts +49 -50
- package/src/general.ts +20 -14
- package/src/hash.ts +20 -16
- package/src/math.ts +18 -16
- package/src/number.ts +9 -7
- package/src/object.ts +21 -8
- package/src/pino.ts +11 -15
- package/src/random.ts +16 -13
- package/src/redis/script-runner.ts +107 -0
- package/src/storages/lru/keyed-store.ts +17 -12
- package/src/storages/redis/keyed-store.ts +10 -19
- package/src/storages/redis/msgpack.ts +32 -11
- package/src/storages/redis/types.ts +32 -14
- package/src/string.ts +10 -8
- package/src/time.ts +24 -18
- package/src/types/filtered-key-path.ts +9 -14
- package/src/types/vue.ts +6 -5
- package/src/url.ts +12 -10
- package/src/vue.ts +15 -16
- package/src/web.ts +12 -8
package/dist/classes/path.d.ts
CHANGED
|
@@ -8,146 +8,259 @@ type DropFirstParameters<T extends (...args: any) => any> = Parameters<T> extend
|
|
|
8
8
|
/**
|
|
9
9
|
* Values accepted by the `Path` constructor and path-composition methods.
|
|
10
10
|
*/
|
|
11
|
-
type PathLike = fs.PathLike | Path;
|
|
11
|
+
export type PathLike = fs.PathLike | Path;
|
|
12
12
|
/**
|
|
13
|
-
*
|
|
13
|
+
* An immutable file system path with Node.js path and file operations.
|
|
14
14
|
*
|
|
15
|
-
*
|
|
16
|
-
* and
|
|
15
|
+
* @remarks
|
|
16
|
+
* Path-composition methods return new instances and leave this instance unchanged.
|
|
17
|
+
* File operations act on the stored path and forward Node.js defaults and promise rejections.
|
|
18
|
+
* They do not update the stored path, including after a successful rename.
|
|
19
|
+
* The constructor joins stringified inputs using the platform-specific Node.js path rules.
|
|
17
20
|
*/
|
|
18
|
-
declare class Path {
|
|
21
|
+
export declare class Path {
|
|
19
22
|
#private;
|
|
20
23
|
/**
|
|
21
24
|
* Creates a normalized path value by joining the provided path segments.
|
|
22
25
|
*
|
|
23
|
-
* @param
|
|
26
|
+
* @param paths - Path segments accepted by Node.js `path.join` or another `Path` instance.
|
|
24
27
|
*/
|
|
25
28
|
constructor(...paths: PathLike[]);
|
|
26
|
-
[Symbol.toPrimitive](hint: string): string;
|
|
27
29
|
/**
|
|
28
|
-
*
|
|
30
|
+
* The parent directory as a new `Path`; this instance is unchanged.
|
|
31
|
+
*
|
|
32
|
+
* @see {@link Path.dirname}
|
|
29
33
|
*/
|
|
30
34
|
get parent(): Path;
|
|
31
35
|
/**
|
|
32
|
-
*
|
|
36
|
+
* The normalized path string stored by this instance.
|
|
33
37
|
*/
|
|
34
38
|
get value(): string;
|
|
35
39
|
/**
|
|
36
|
-
*
|
|
40
|
+
* Creates a new path from a Node.js path object.
|
|
41
|
+
*
|
|
42
|
+
* @param pathObject - The path components to format.
|
|
43
|
+
*
|
|
44
|
+
* @returns A new normalized `Path`.
|
|
45
|
+
*
|
|
46
|
+
* @see {@link https://nodejs.org/api/path.html | Node.js path.format}
|
|
37
47
|
*/
|
|
38
48
|
static format(pathObject: nodePath.FormatInputPathObject): Path;
|
|
39
49
|
/**
|
|
40
|
-
*
|
|
50
|
+
* Resolves joined path segments to an absolute path.
|
|
51
|
+
*
|
|
52
|
+
* @remarks
|
|
53
|
+
* Inputs are joined before resolution; unlike Node.js `path.resolve`,
|
|
54
|
+
* later absolute segments do not reset the path.
|
|
55
|
+
*
|
|
56
|
+
* @param paths - The stringified path segments to join.
|
|
57
|
+
*
|
|
58
|
+
* @returns A new absolute `Path`.
|
|
59
|
+
*
|
|
60
|
+
* @see {@link https://nodejs.org/api/path.html | Node.js path.resolve}
|
|
41
61
|
*/
|
|
42
62
|
static resolve(...paths: PathLike[]): Path;
|
|
63
|
+
[Symbol.toPrimitive](hint: string): string;
|
|
43
64
|
/**
|
|
44
|
-
*
|
|
65
|
+
* Returns the final component of this path.
|
|
66
|
+
*
|
|
67
|
+
* @param suffix - An optional exact suffix to remove.
|
|
68
|
+
*
|
|
69
|
+
* @see {@link https://nodejs.org/api/path.html | Node.js path.basename}
|
|
45
70
|
*/
|
|
46
71
|
basename(suffix?: string): string;
|
|
47
72
|
/**
|
|
48
|
-
*
|
|
73
|
+
* Returns the parent directory of this path.
|
|
74
|
+
*
|
|
75
|
+
* @returns A new `Path`; this instance is unchanged.
|
|
76
|
+
*
|
|
77
|
+
* @see {@link https://nodejs.org/api/path.html | Node.js path.dirname}
|
|
49
78
|
*/
|
|
50
79
|
dirname(): Path;
|
|
51
80
|
/**
|
|
52
|
-
*
|
|
81
|
+
* Returns the extension of the final path component.
|
|
82
|
+
*
|
|
83
|
+
* @returns The extension including its leading dot, or an empty string when absent.
|
|
84
|
+
*
|
|
85
|
+
* @see {@link https://nodejs.org/api/path.html | Node.js path.extname}
|
|
53
86
|
*/
|
|
54
87
|
extname(): string;
|
|
55
88
|
/**
|
|
56
|
-
*
|
|
89
|
+
* Checks whether this path is absolute on the current platform.
|
|
90
|
+
*
|
|
91
|
+
* @returns Whether this path is absolute.
|
|
92
|
+
*
|
|
93
|
+
* @see {@link https://nodejs.org/api/path.html | Node.js path.isAbsolute}
|
|
57
94
|
*/
|
|
58
95
|
isAbsolute(): boolean;
|
|
59
96
|
/**
|
|
60
|
-
*
|
|
97
|
+
* Normalizes separators and relative segments in this path.
|
|
98
|
+
*
|
|
99
|
+
* @returns A new `Path`; this instance is unchanged.
|
|
100
|
+
*
|
|
101
|
+
* @see {@link https://nodejs.org/api/path.html | Node.js path.normalize}
|
|
61
102
|
*/
|
|
62
103
|
normalize(): Path;
|
|
63
104
|
/**
|
|
64
|
-
*
|
|
105
|
+
* Joins additional segments onto this path.
|
|
106
|
+
*
|
|
107
|
+
* @param paths - The stringified path segments to append.
|
|
108
|
+
*
|
|
109
|
+
* @returns A new normalized `Path`; this instance is unchanged.
|
|
110
|
+
*
|
|
111
|
+
* @see {@link https://nodejs.org/api/path.html | Node.js path.join}
|
|
65
112
|
*/
|
|
66
113
|
join(...paths: PathLike[]): Path;
|
|
67
114
|
/**
|
|
68
|
-
*
|
|
115
|
+
* Parses this path into its root, directory, basename, extension, and name.
|
|
116
|
+
*
|
|
117
|
+
* @returns A new object containing the path components.
|
|
118
|
+
*
|
|
119
|
+
* @see {@link https://nodejs.org/api/path.html | Node.js path.parse}
|
|
69
120
|
*/
|
|
70
121
|
parse(): nodePath.ParsedPath;
|
|
71
122
|
/**
|
|
72
|
-
*
|
|
123
|
+
* Computes a relative path from this path to the destination.
|
|
124
|
+
*
|
|
125
|
+
* @param to - The destination path.
|
|
126
|
+
*
|
|
127
|
+
* @returns A new `Path`; this instance is unchanged.
|
|
128
|
+
*
|
|
129
|
+
* @see {@link https://nodejs.org/api/path.html | Node.js path.relative}
|
|
73
130
|
*/
|
|
74
131
|
relative(to: PathLike): Path;
|
|
75
132
|
/**
|
|
76
|
-
*
|
|
133
|
+
* Resolves this path to an absolute path using the current working directory.
|
|
134
|
+
*
|
|
135
|
+
* @remarks
|
|
136
|
+
* Relative paths use the current working directory. This instance is unchanged.
|
|
137
|
+
*
|
|
138
|
+
* @returns A new absolute `Path`.
|
|
139
|
+
*
|
|
140
|
+
* @see {@link https://nodejs.org/api/path.html | Node.js path.resolve}
|
|
77
141
|
*/
|
|
78
142
|
resolve(): Path;
|
|
79
143
|
toJSON(): string;
|
|
80
144
|
/**
|
|
81
|
-
*
|
|
145
|
+
* Converts this path to the Windows namespace form when applicable.
|
|
146
|
+
*
|
|
147
|
+
* @returns The namespace-converted path string; this instance is unchanged.
|
|
148
|
+
* On non-Windows platforms, the path text is unchanged.
|
|
149
|
+
*
|
|
150
|
+
* @see {@link https://nodejs.org/api/path.html | Node.js path.toNamespacedPath}
|
|
82
151
|
*/
|
|
83
152
|
toNamespacedPath(): string;
|
|
84
153
|
/**
|
|
85
|
-
*
|
|
86
|
-
* This method returns the internal path string value,
|
|
87
|
-
* making it useful for implicit and explicit string conversions.
|
|
154
|
+
* Returns the stored path as a string.
|
|
88
155
|
*/
|
|
89
156
|
toString(): string;
|
|
90
157
|
/**
|
|
91
|
-
*
|
|
158
|
+
* Checks access permissions for the stored path.
|
|
159
|
+
*
|
|
160
|
+
* @remarks
|
|
161
|
+
* The promise resolves when the access check succeeds and rejects if access is denied or the path is missing.
|
|
162
|
+
*
|
|
163
|
+
* @see {@link https://nodejs.org/api/fs.html | Node.js fsPromises.access}
|
|
92
164
|
*/
|
|
93
165
|
access(...args: DropFirstParameters<typeof fsp.access>): Promise<void>;
|
|
94
166
|
/**
|
|
95
|
-
*
|
|
167
|
+
* Appends data to the file at the stored path.
|
|
168
|
+
*
|
|
169
|
+
* @remarks
|
|
170
|
+
* The promise resolves when appending completes; a missing file is created according to the supplied options.
|
|
171
|
+
*
|
|
172
|
+
* @see {@link https://nodejs.org/api/fs.html | Node.js fsPromises.appendFile}
|
|
96
173
|
*/
|
|
97
174
|
appendFile(...args: DropFirstParameters<typeof fsp.appendFile>): Promise<void>;
|
|
98
175
|
/**
|
|
99
|
-
*
|
|
176
|
+
* Changes the permissions of the stored path.
|
|
177
|
+
*
|
|
178
|
+
* @remarks
|
|
179
|
+
* The promise resolves when the permissions are changed.
|
|
180
|
+
*
|
|
181
|
+
* @see {@link https://nodejs.org/api/fs.html | Node.js fsPromises.chmod}
|
|
100
182
|
*/
|
|
101
183
|
chmod(...args: DropFirstParameters<typeof fsp.chmod>): Promise<void>;
|
|
102
184
|
/**
|
|
103
|
-
*
|
|
185
|
+
* Changes the owner and group of the stored path.
|
|
186
|
+
*
|
|
187
|
+
* @remarks
|
|
188
|
+
* The promise resolves when the ownership is changed.
|
|
189
|
+
*
|
|
190
|
+
* @see {@link https://nodejs.org/api/fs.html | Node.js fsPromises.chown}
|
|
104
191
|
*/
|
|
105
192
|
chown(...args: DropFirstParameters<typeof fsp.chown>): Promise<void>;
|
|
106
193
|
/**
|
|
107
|
-
*
|
|
194
|
+
* Copies the file at the stored path to a destination.
|
|
195
|
+
*
|
|
196
|
+
* @remarks
|
|
197
|
+
* The promise resolves when copying completes. The stored path remains the source path.
|
|
198
|
+
*
|
|
199
|
+
* @see {@link https://nodejs.org/api/fs.html | Node.js fsPromises.copyFile}
|
|
108
200
|
*/
|
|
109
201
|
copyFile(...args: DropFirstParameters<typeof fsp.copyFile>): Promise<void>;
|
|
110
202
|
/**
|
|
111
|
-
*
|
|
203
|
+
* Creates a directory at the stored path.
|
|
204
|
+
*
|
|
205
|
+
* @remarks
|
|
206
|
+
* The promise resolves after creation. Recursive mode resolves to the first created directory path, or
|
|
207
|
+
* `undefined` if no directory is created; nonrecursive mode resolves without a value.
|
|
208
|
+
*
|
|
209
|
+
* @see {@link https://nodejs.org/api/fs.html | Node.js fsPromises.mkdir}
|
|
112
210
|
*/
|
|
113
211
|
mkdir(options: fs.MakeDirectoryOptions & {
|
|
114
212
|
recursive: true;
|
|
115
|
-
}): Promise<string>;
|
|
213
|
+
}): Promise<string | undefined>;
|
|
116
214
|
mkdir(options?: (fs.MakeDirectoryOptions & {
|
|
117
215
|
recursive?: false;
|
|
118
216
|
}) | fs.Mode | null): Promise<void>;
|
|
119
217
|
mkdir(options?: fs.MakeDirectoryOptions | fs.Mode | null): Promise<string | undefined>;
|
|
120
218
|
/**
|
|
121
|
-
*
|
|
219
|
+
* Opens the file at the stored path.
|
|
220
|
+
*
|
|
221
|
+
* @remarks
|
|
222
|
+
* The promise resolves to a new file handle. The caller must close the handle when it is no longer needed.
|
|
223
|
+
*
|
|
224
|
+
* @see {@link https://nodejs.org/api/fs.html | Node.js fsPromises.open}
|
|
122
225
|
*/
|
|
123
226
|
open(...args: DropFirstParameters<typeof fsp.open>): Promise<fs.promises.FileHandle>;
|
|
124
227
|
/**
|
|
125
|
-
*
|
|
228
|
+
* Reads the entries of the directory at the stored path.
|
|
229
|
+
*
|
|
230
|
+
* @remarks
|
|
231
|
+
* The promise resolves to names, buffers, or directory entries according to the options.
|
|
232
|
+
*
|
|
233
|
+
* @see {@link https://nodejs.org/api/fs.html | Node.js fsPromises.readdir}
|
|
126
234
|
*/
|
|
127
|
-
readdir(
|
|
235
|
+
readdir(options?: BufferEncoding | (fs.ObjectEncodingOptions & {
|
|
128
236
|
recursive?: boolean;
|
|
129
237
|
withFileTypes?: false;
|
|
130
238
|
}) | null): Promise<string[]>;
|
|
131
|
-
readdir(
|
|
239
|
+
readdir(options: 'buffer' | {
|
|
132
240
|
encoding: 'buffer';
|
|
133
241
|
recursive?: boolean;
|
|
134
242
|
withFileTypes?: false;
|
|
135
243
|
}): Promise<Buffer[]>;
|
|
136
|
-
readdir(
|
|
244
|
+
readdir(options?: BufferEncoding | (fs.ObjectEncodingOptions & {
|
|
137
245
|
recursive?: boolean;
|
|
138
246
|
withFileTypes?: false;
|
|
139
247
|
}) | null): Promise<Buffer[] | string[]>;
|
|
140
|
-
readdir(
|
|
248
|
+
readdir(options: fs.ObjectEncodingOptions & {
|
|
141
249
|
recursive?: boolean;
|
|
142
250
|
withFileTypes: true;
|
|
143
251
|
}): Promise<fs.Dirent[]>;
|
|
144
|
-
readdir(
|
|
252
|
+
readdir(options: {
|
|
145
253
|
encoding: 'buffer';
|
|
146
254
|
recursive?: boolean;
|
|
147
255
|
withFileTypes: true;
|
|
148
256
|
}): Promise<fs.Dirent<Buffer>[]>;
|
|
149
257
|
/**
|
|
150
|
-
*
|
|
258
|
+
* Reads the entire file at the stored path.
|
|
259
|
+
*
|
|
260
|
+
* @remarks
|
|
261
|
+
* The promise resolves to a string when a text encoding is supplied, or a `Buffer` otherwise.
|
|
262
|
+
*
|
|
263
|
+
* @see {@link https://nodejs.org/api/fs.html | Node.js fsPromises.readFile}
|
|
151
264
|
*/
|
|
152
265
|
readFile(options?: (Abortable & {
|
|
153
266
|
encoding?: null;
|
|
@@ -161,40 +274,90 @@ declare class Path {
|
|
|
161
274
|
flag?: fs.OpenMode;
|
|
162
275
|
}) | BufferEncoding | null): Promise<Buffer | string>;
|
|
163
276
|
/**
|
|
164
|
-
*
|
|
277
|
+
* Renames or moves the file or directory at the stored path.
|
|
278
|
+
*
|
|
279
|
+
* @remarks
|
|
280
|
+
* The promise resolves when the rename completes. This instance retains its original stored path.
|
|
281
|
+
*
|
|
282
|
+
* @param newPath - The destination path; this instance retains its original value.
|
|
283
|
+
*
|
|
284
|
+
* @see {@link https://nodejs.org/api/fs.html | Node.js fsPromises.rename}
|
|
165
285
|
*/
|
|
166
286
|
rename(newPath: PathLike): Promise<void>;
|
|
167
287
|
/**
|
|
168
|
-
*
|
|
288
|
+
* Removes the file or directory at the stored path.
|
|
289
|
+
*
|
|
290
|
+
* @remarks
|
|
291
|
+
* The promise resolves after removal according to the supplied options.
|
|
292
|
+
*
|
|
293
|
+
* @see {@link https://nodejs.org/api/fs.html | Node.js fsPromises.rm}
|
|
169
294
|
*/
|
|
170
295
|
rm(...args: DropFirstParameters<typeof fsp.rm>): Promise<void>;
|
|
171
296
|
/**
|
|
172
|
-
*
|
|
297
|
+
* Removes the directory at the stored path.
|
|
298
|
+
*
|
|
299
|
+
* @remarks
|
|
300
|
+
* The promise resolves after directory removal.
|
|
301
|
+
*
|
|
302
|
+
* @see {@link https://nodejs.org/api/fs.html | Node.js fsPromises.rmdir}
|
|
173
303
|
*/
|
|
174
304
|
rmdir(...args: DropFirstParameters<typeof fsp.rmdir>): Promise<void>;
|
|
175
305
|
/**
|
|
176
|
-
*
|
|
306
|
+
* Reads file system metadata for the stored path.
|
|
307
|
+
*
|
|
308
|
+
* @remarks
|
|
309
|
+
* The promise resolves to `Stats`, or `BigIntStats` when `bigint` is enabled.
|
|
310
|
+
* If `throwIfNoEntry` is `false`, a missing path resolves to `undefined` instead of rejecting.
|
|
311
|
+
*
|
|
312
|
+
* @see {@link https://nodejs.org/api/fs.html | Node.js fsPromises.stat}
|
|
177
313
|
*/
|
|
178
314
|
stat(opts?: fs.StatOptions & {
|
|
179
315
|
bigint?: false;
|
|
316
|
+
throwIfNoEntry?: true;
|
|
180
317
|
}): Promise<fs.Stats>;
|
|
181
318
|
stat(opts: fs.StatOptions & {
|
|
182
319
|
bigint: true;
|
|
320
|
+
throwIfNoEntry?: true;
|
|
183
321
|
}): Promise<fs.BigIntStats>;
|
|
184
|
-
stat(opts
|
|
322
|
+
stat(opts: fs.StatOptions & {
|
|
323
|
+
bigint?: false;
|
|
324
|
+
throwIfNoEntry: false;
|
|
325
|
+
}): Promise<fs.Stats | undefined>;
|
|
326
|
+
stat(opts: fs.StatOptions & {
|
|
327
|
+
bigint: true;
|
|
328
|
+
throwIfNoEntry: false;
|
|
329
|
+
}): Promise<fs.BigIntStats | undefined>;
|
|
330
|
+
stat(opts: fs.StatOptions & {
|
|
331
|
+
throwIfNoEntry?: true;
|
|
332
|
+
}): Promise<fs.BigIntStats | fs.Stats>;
|
|
333
|
+
stat(opts?: fs.StatOptions): Promise<fs.BigIntStats | fs.Stats | undefined>;
|
|
185
334
|
/**
|
|
186
|
-
*
|
|
335
|
+
* Truncates or extends the file at the stored path.
|
|
336
|
+
*
|
|
337
|
+
* @remarks
|
|
338
|
+
* The promise resolves when the file reaches the requested length in bytes; the default length is `0`.
|
|
339
|
+
*
|
|
340
|
+
* @see {@link https://nodejs.org/api/fs.html | Node.js fsPromises.truncate}
|
|
187
341
|
*/
|
|
188
342
|
truncate(...args: DropFirstParameters<typeof fsp.truncate>): Promise<void>;
|
|
189
343
|
/**
|
|
190
|
-
*
|
|
344
|
+
* Deletes the file or symbolic link at the stored path.
|
|
345
|
+
*
|
|
346
|
+
* @remarks
|
|
347
|
+
* The promise resolves after deletion; directories are not removed.
|
|
348
|
+
*
|
|
349
|
+
* @see {@link https://nodejs.org/api/fs.html | Node.js fsPromises.unlink}
|
|
191
350
|
*/
|
|
192
351
|
unlink(): Promise<void>;
|
|
193
352
|
/**
|
|
194
|
-
*
|
|
353
|
+
* Writes data to the file at the stored path.
|
|
354
|
+
*
|
|
355
|
+
* @remarks
|
|
356
|
+
* The promise resolves when writing completes; the default flag replaces existing file contents.
|
|
357
|
+
*
|
|
358
|
+
* @see {@link https://nodejs.org/api/fs.html | Node.js fsPromises.writeFile}
|
|
195
359
|
*/
|
|
196
360
|
writeFile(...args: DropFirstParameters<typeof fsp.writeFile>): Promise<void>;
|
|
197
361
|
}
|
|
198
362
|
//#endregion
|
|
199
|
-
export { Path, PathLike };
|
|
200
363
|
//# sourceMappingURL=path.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"path.d.ts","names":[],"sources":["../../src/classes/path.ts"],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"path.d.ts","names":[],"sources":["../../src/classes/path.ts"],"mappings":";;;;;;KAMK,oBAAoB,cAAc,qBAAqB,WAAW,0BAA0B,KAAK;;;;YAK1F,WAAW,GAA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