@types/tar 4.0.3 → 6.1.1
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.
- tar/LICENSE +21 -21
- tar/README.md +5 -5
- tar/index.d.ts +135 -86
- tar/package.json +5 -4
tar/LICENSE
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) Microsoft Corporation.
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) Microsoft Corporation.
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE
|
tar/README.md
CHANGED
|
@@ -5,12 +5,12 @@
|
|
|
5
5
|
This package contains type definitions for tar (https://github.com/npm/node-tar).
|
|
6
6
|
|
|
7
7
|
# Details
|
|
8
|
-
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/tar
|
|
8
|
+
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/tar.
|
|
9
9
|
|
|
10
|
-
Additional Details
|
|
11
|
-
* Last updated:
|
|
12
|
-
* Dependencies: @types/minipass, @types/node
|
|
10
|
+
### Additional Details
|
|
11
|
+
* Last updated: Sat, 20 Nov 2021 01:31:10 GMT
|
|
12
|
+
* Dependencies: [@types/minipass](https://npmjs.com/package/@types/minipass), [@types/node](https://npmjs.com/package/@types/node)
|
|
13
13
|
* Global values: none
|
|
14
14
|
|
|
15
15
|
# Credits
|
|
16
|
-
These definitions were written by Maxime LUCE
|
|
16
|
+
These definitions were written by [Maxime LUCE](https://github.com/SomaticIT), and [Connor Peet](https://github.com/connor4312).
|
tar/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Type definitions for tar
|
|
1
|
+
// Type definitions for tar 6.1
|
|
2
2
|
// Project: https://github.com/npm/node-tar
|
|
3
3
|
// Definitions by: Maxime LUCE <https://github.com/SomaticIT>, Connor Peet <https://github.com/connor4312>
|
|
4
4
|
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
|
@@ -15,24 +15,24 @@ import MiniPass = require('minipass');
|
|
|
15
15
|
|
|
16
16
|
export interface HeaderProperties {
|
|
17
17
|
path: string;
|
|
18
|
-
mode?: number;
|
|
19
|
-
noProprietary?: boolean;
|
|
20
|
-
uid?: number;
|
|
21
|
-
gid?: number;
|
|
22
|
-
size?: number;
|
|
23
|
-
mtime?: number;
|
|
24
|
-
type?: string;
|
|
25
|
-
uname?: string;
|
|
26
|
-
gname?: string;
|
|
27
|
-
devmaj?: number;
|
|
28
|
-
devmin?: number;
|
|
18
|
+
mode?: number | undefined;
|
|
19
|
+
noProprietary?: boolean | undefined;
|
|
20
|
+
uid?: number | undefined;
|
|
21
|
+
gid?: number | undefined;
|
|
22
|
+
size?: number | undefined;
|
|
23
|
+
mtime?: number | undefined;
|
|
24
|
+
type?: string | undefined;
|
|
25
|
+
uname?: string | undefined;
|
|
26
|
+
gname?: string | undefined;
|
|
27
|
+
devmaj?: number | undefined;
|
|
28
|
+
devmin?: number | undefined;
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
export interface ExtractOptions {
|
|
32
|
-
type?: string;
|
|
33
|
-
Directory?: boolean;
|
|
34
|
-
path?: string;
|
|
35
|
-
strip?: number;
|
|
32
|
+
type?: string | undefined;
|
|
33
|
+
Directory?: boolean | undefined;
|
|
34
|
+
path?: string | undefined;
|
|
35
|
+
strip?: number | undefined;
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
export interface ParseStream extends NodeJS.ReadWriteStream {
|
|
@@ -102,8 +102,8 @@ export const fieldEnds: number[];
|
|
|
102
102
|
*/
|
|
103
103
|
export const types: {
|
|
104
104
|
0: string;
|
|
105
|
-
|
|
106
|
-
|
|
105
|
+
'\0': string;
|
|
106
|
+
'': string;
|
|
107
107
|
1: string;
|
|
108
108
|
2: string;
|
|
109
109
|
3: string;
|
|
@@ -198,14 +198,27 @@ export const knownExtended: {
|
|
|
198
198
|
export const headerSize: number;
|
|
199
199
|
export const blockSize: number;
|
|
200
200
|
|
|
201
|
+
export interface ParseOptions {
|
|
202
|
+
strict?: boolean;
|
|
203
|
+
filter?: (path: string, entry: ReadEntry) => boolean;
|
|
204
|
+
onentry?: (entry: ReadEntry) => void;
|
|
205
|
+
onwarn?: (code: string, message: string, data: Buffer) => void;
|
|
206
|
+
}
|
|
207
|
+
/**
|
|
208
|
+
* A writable stream. Write tar data to it and it will emit entry events for each entry parsed from the tarball. This is used by tar.Extract.
|
|
209
|
+
*/
|
|
210
|
+
export interface Parse extends ParseStream {
|
|
211
|
+
on(event: 'end' | 'close', listener: () => void): this;
|
|
212
|
+
on(event: 'entry', listener: (entry: ReadEntry) => void): this;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
export const Parse: {
|
|
216
|
+
new(opt?: ParseOptions): Parse;
|
|
217
|
+
};
|
|
201
218
|
//#endregion
|
|
202
219
|
|
|
203
220
|
//#region Global Methods
|
|
204
221
|
|
|
205
|
-
/**
|
|
206
|
-
* Returns a writable stream. Write tar data to it and it will emit entry events for each entry parsed from the tarball. This is used by tar.Extract.
|
|
207
|
-
*/
|
|
208
|
-
export function Parse(): ParseStream;
|
|
209
222
|
/**
|
|
210
223
|
* Returns a through stream. Use fstream to write files into the pack stream and you will receive tar archive data from the pack stream.
|
|
211
224
|
* This only works with directories, it does not work with individual files.
|
|
@@ -264,28 +277,28 @@ export interface CreateOptions {
|
|
|
264
277
|
/**
|
|
265
278
|
* Treat warnings as crash-worthy errors. Default false.
|
|
266
279
|
*/
|
|
267
|
-
strict?: boolean;
|
|
280
|
+
strict?: boolean | undefined;
|
|
268
281
|
|
|
269
282
|
/**
|
|
270
283
|
* The current working directory for creating the archive. Defaults to process.cwd().
|
|
271
284
|
*/
|
|
272
|
-
cwd?: string;
|
|
285
|
+
cwd?: string | undefined;
|
|
273
286
|
|
|
274
287
|
/**
|
|
275
288
|
* Alias for cwd.
|
|
276
289
|
*/
|
|
277
|
-
C?: string;
|
|
290
|
+
C?: string | undefined;
|
|
278
291
|
|
|
279
292
|
/**
|
|
280
293
|
* Set to any truthy value to create a gzipped archive,
|
|
281
294
|
* or an object with settings for zlib.Gzip()
|
|
282
295
|
*/
|
|
283
|
-
gzip?: boolean | zlib.ZlibOptions;
|
|
296
|
+
gzip?: boolean | zlib.ZlibOptions | undefined;
|
|
284
297
|
|
|
285
298
|
/**
|
|
286
299
|
* Alias for gzip.
|
|
287
300
|
*/
|
|
288
|
-
z?: boolean | zlib.ZlibOptions;
|
|
301
|
+
z?: boolean | zlib.ZlibOptions | undefined;
|
|
289
302
|
|
|
290
303
|
/**
|
|
291
304
|
* A function that gets called with (path, stat) for each entry being
|
|
@@ -298,55 +311,55 @@ export interface CreateOptions {
|
|
|
298
311
|
* gname, dev, ino, and nlink. Note that mtime is still included,
|
|
299
312
|
* because this is necessary other time-based operations.
|
|
300
313
|
*/
|
|
301
|
-
portable?: boolean;
|
|
314
|
+
portable?: boolean | undefined;
|
|
302
315
|
|
|
303
316
|
/**
|
|
304
317
|
* Allow absolute paths. By default, / is stripped from absolute paths.
|
|
305
318
|
*/
|
|
306
|
-
preservePaths?: boolean;
|
|
319
|
+
preservePaths?: boolean | undefined;
|
|
307
320
|
|
|
308
321
|
/**
|
|
309
322
|
* Alias for presevePaths.
|
|
310
323
|
*/
|
|
311
|
-
P?: boolean;
|
|
324
|
+
P?: boolean | undefined;
|
|
312
325
|
|
|
313
326
|
/**
|
|
314
327
|
* The mode to set on the created file archive.
|
|
315
328
|
*/
|
|
316
|
-
mode?: number;
|
|
329
|
+
mode?: number | undefined;
|
|
317
330
|
|
|
318
331
|
/**
|
|
319
332
|
* Do not recursively archive the contents of directories.
|
|
320
333
|
*/
|
|
321
|
-
noDirRecurse?: boolean;
|
|
334
|
+
noDirRecurse?: boolean | undefined;
|
|
322
335
|
|
|
323
336
|
/**
|
|
324
337
|
* Set to true to pack the targets of symbolic links. Without this
|
|
325
338
|
* option, symbolic links are archived as such.
|
|
326
339
|
*/
|
|
327
|
-
follow?: boolean;
|
|
340
|
+
follow?: boolean | undefined;
|
|
328
341
|
|
|
329
342
|
/**
|
|
330
343
|
* Alias for follow.
|
|
331
344
|
*/
|
|
332
|
-
L?: boolean;
|
|
345
|
+
L?: boolean | undefined;
|
|
333
346
|
|
|
334
347
|
/**
|
|
335
348
|
* Alias for follow.
|
|
336
349
|
*/
|
|
337
|
-
h?: boolean;
|
|
350
|
+
h?: boolean | undefined;
|
|
338
351
|
|
|
339
352
|
/**
|
|
340
353
|
* Suppress pax extended headers. Note that this means that long paths and
|
|
341
354
|
* linkpaths will be truncated, and large or negative numeric values
|
|
342
355
|
* may be interpreted incorrectly.
|
|
343
356
|
*/
|
|
344
|
-
noPax?: boolean;
|
|
357
|
+
noPax?: boolean | undefined;
|
|
345
358
|
|
|
346
359
|
/**
|
|
347
360
|
* A path portion to prefix onto the entries in the archive.
|
|
348
361
|
*/
|
|
349
|
-
prefix?: string;
|
|
362
|
+
prefix?: string | undefined;
|
|
350
363
|
}
|
|
351
364
|
|
|
352
365
|
export interface ExtractOptions {
|
|
@@ -359,18 +372,18 @@ export interface ExtractOptions {
|
|
|
359
372
|
/**
|
|
360
373
|
* Treat warnings as crash-worthy errors. Default false.
|
|
361
374
|
*/
|
|
362
|
-
strict?: boolean;
|
|
375
|
+
strict?: boolean | undefined;
|
|
363
376
|
|
|
364
377
|
/**
|
|
365
378
|
* Extract files relative to the specified directory. Defaults to
|
|
366
379
|
* process.cwd(). If provided, this must exist and must be a directory.
|
|
367
380
|
*/
|
|
368
|
-
cwd?: string;
|
|
381
|
+
cwd?: string | undefined;
|
|
369
382
|
|
|
370
383
|
/**
|
|
371
384
|
* Alias for cwd.
|
|
372
385
|
*/
|
|
373
|
-
C?: string;
|
|
386
|
+
C?: string | undefined;
|
|
374
387
|
|
|
375
388
|
/**
|
|
376
389
|
* A function that gets called with (path, stat) for each entry being
|
|
@@ -382,33 +395,33 @@ export interface ExtractOptions {
|
|
|
382
395
|
* Set to true to keep the existing file on disk if it's newer than
|
|
383
396
|
* the file in the archive.
|
|
384
397
|
*/
|
|
385
|
-
newer?: boolean;
|
|
398
|
+
newer?: boolean | undefined;
|
|
386
399
|
|
|
387
400
|
/**
|
|
388
401
|
* Alias for newer.
|
|
389
402
|
*/
|
|
390
|
-
'keep-newer'?: boolean;
|
|
403
|
+
'keep-newer'?: boolean | undefined;
|
|
391
404
|
|
|
392
405
|
/**
|
|
393
406
|
* Alias for newer.
|
|
394
407
|
*/
|
|
395
|
-
'keep-newer-files'?: boolean;
|
|
408
|
+
'keep-newer-files'?: boolean | undefined;
|
|
396
409
|
|
|
397
410
|
/**
|
|
398
411
|
* Do not overwrite existing files. In particular, if a file appears more
|
|
399
412
|
* than once in an archive, later copies will not overwrite earlier copies
|
|
400
413
|
*/
|
|
401
|
-
keep?: boolean;
|
|
414
|
+
keep?: boolean | undefined;
|
|
402
415
|
|
|
403
416
|
/**
|
|
404
417
|
* Alias for keep.
|
|
405
418
|
*/
|
|
406
|
-
k?: boolean;
|
|
419
|
+
k?: boolean | undefined;
|
|
407
420
|
|
|
408
421
|
/**
|
|
409
422
|
* Alias for keep.
|
|
410
423
|
*/
|
|
411
|
-
'keep-existing'?: boolean;
|
|
424
|
+
'keep-existing'?: boolean | undefined;
|
|
412
425
|
|
|
413
426
|
/**
|
|
414
427
|
* Unlink files before creating them. Without this option, tar overwrites
|
|
@@ -416,24 +429,24 @@ export interface ExtractOptions {
|
|
|
416
429
|
* existing hardlinks will be broken, as will any symlink that would
|
|
417
430
|
* affect the location of an extracted file.
|
|
418
431
|
*/
|
|
419
|
-
unlink?: boolean;
|
|
432
|
+
unlink?: boolean | undefined;
|
|
420
433
|
|
|
421
434
|
/**
|
|
422
435
|
* Remove the specified number of leading path elements. Pathnames with
|
|
423
436
|
* fewer elements will be silently skipped. Note that the pathname
|
|
424
437
|
* is edited after applying the filter, but before security checks.
|
|
425
438
|
*/
|
|
426
|
-
strip?: number;
|
|
439
|
+
strip?: number | undefined;
|
|
427
440
|
|
|
428
441
|
/**
|
|
429
442
|
* Alias for strip.
|
|
430
443
|
*/
|
|
431
|
-
'strip-components'?: number;
|
|
444
|
+
'strip-components'?: number | undefined;
|
|
432
445
|
|
|
433
446
|
/**
|
|
434
447
|
* Alias for strip.
|
|
435
448
|
*/
|
|
436
|
-
stripComponents?: number;
|
|
449
|
+
stripComponents?: number | undefined;
|
|
437
450
|
|
|
438
451
|
/**
|
|
439
452
|
* If true, tar will set the uid and gid of extracted entries to the uid
|
|
@@ -444,12 +457,12 @@ export interface ExtractOptions {
|
|
|
444
457
|
* never unpacked in this implementation, and modes
|
|
445
458
|
* are set by default already.
|
|
446
459
|
*/
|
|
447
|
-
preserveOwner?: boolean;
|
|
460
|
+
preserveOwner?: boolean | undefined;
|
|
448
461
|
|
|
449
462
|
/**
|
|
450
463
|
* Alias for preserveOwner.
|
|
451
464
|
*/
|
|
452
|
-
p?: boolean;
|
|
465
|
+
p?: boolean | undefined;
|
|
453
466
|
|
|
454
467
|
/**
|
|
455
468
|
* Set to a number to force ownership of all extracted files and folders,
|
|
@@ -457,7 +470,7 @@ export interface ExtractOptions {
|
|
|
457
470
|
* user id, regardless of the uid field in the archive. Cannot be used
|
|
458
471
|
* along with preserveOwner. Requires also setting a gid option.
|
|
459
472
|
*/
|
|
460
|
-
uid?: number;
|
|
473
|
+
uid?: number | undefined;
|
|
461
474
|
|
|
462
475
|
/**
|
|
463
476
|
* Set to a number to force ownership of all extracted files and folders,
|
|
@@ -465,15 +478,15 @@ export interface ExtractOptions {
|
|
|
465
478
|
* group id, regardless of the gid field in the archive. Cannot be used
|
|
466
479
|
* along with preserveOwner. Requires also setting a uid option
|
|
467
480
|
*/
|
|
468
|
-
gid?: number;
|
|
481
|
+
gid?: number | undefined;
|
|
469
482
|
|
|
470
483
|
/**
|
|
471
484
|
* Set to true to omit writing mtime value for extracted entries.
|
|
472
485
|
* [Alias: m, no-mtime]
|
|
473
486
|
*/
|
|
474
|
-
noMtime?: boolean;
|
|
475
|
-
m?: boolean;
|
|
476
|
-
'no-mtime'?: boolean;
|
|
487
|
+
noMtime?: boolean | undefined;
|
|
488
|
+
m?: boolean | undefined;
|
|
489
|
+
'no-mtime'?: boolean | undefined;
|
|
477
490
|
|
|
478
491
|
/**
|
|
479
492
|
* Provide a function that takes an entry object, and returns a stream,
|
|
@@ -490,36 +503,44 @@ export interface ExtractOptions {
|
|
|
490
503
|
*/
|
|
491
504
|
onentry?(entry: ReadEntry): void;
|
|
492
505
|
|
|
506
|
+
/**
|
|
507
|
+
* Set to true to omit calling `fs.chmod()` to ensure that the extracted file
|
|
508
|
+
* matches the entry mode. This also suppresses the call to `process.umask()`
|
|
509
|
+
* to determine the default umask value, since tar will extract with whatever
|
|
510
|
+
* mode is provided, and let the process `umask` apply normally.
|
|
511
|
+
*/
|
|
512
|
+
noChmod?: boolean | undefined;
|
|
513
|
+
|
|
493
514
|
// The following options are mostly internal, but can be modified in some
|
|
494
515
|
// advanced use cases, such as re-using caches between runs.
|
|
495
516
|
|
|
496
517
|
/**
|
|
497
518
|
* The maximum buffer size for fs.read() operations (in bytes). Defaults to 16 MB.
|
|
498
519
|
*/
|
|
499
|
-
maxReadSize?: number;
|
|
520
|
+
maxReadSize?: number | undefined;
|
|
500
521
|
|
|
501
522
|
/**
|
|
502
523
|
* The maximum size of meta entries that is supported. Defaults to 1 MB.
|
|
503
524
|
*/
|
|
504
|
-
maxMetaEntrySize?: number;
|
|
525
|
+
maxMetaEntrySize?: number | undefined;
|
|
505
526
|
}
|
|
506
527
|
|
|
507
528
|
export interface ListOptions {
|
|
508
529
|
/**
|
|
509
530
|
* Treat warnings as crash-worthy errors. Default false.
|
|
510
531
|
*/
|
|
511
|
-
strict?: boolean;
|
|
532
|
+
strict?: boolean | undefined;
|
|
512
533
|
|
|
513
534
|
/**
|
|
514
535
|
* Extract files relative to the specified directory. Defaults to
|
|
515
536
|
* process.cwd(). If provided, this must exist and must be a directory.
|
|
516
537
|
*/
|
|
517
|
-
cwd?: string;
|
|
538
|
+
cwd?: string | undefined;
|
|
518
539
|
|
|
519
540
|
/**
|
|
520
541
|
* Alias for cwd.
|
|
521
542
|
*/
|
|
522
|
-
C?: string;
|
|
543
|
+
C?: string | undefined;
|
|
523
544
|
|
|
524
545
|
/**
|
|
525
546
|
* A function that gets called with (path, stat) for each entry being
|
|
@@ -537,7 +558,7 @@ export interface ListOptions {
|
|
|
537
558
|
/**
|
|
538
559
|
* The maximum buffer size for fs.read() operations. Defaults to 16 MB.
|
|
539
560
|
*/
|
|
540
|
-
maxReadSize?: number;
|
|
561
|
+
maxReadSize?: number | undefined;
|
|
541
562
|
|
|
542
563
|
/**
|
|
543
564
|
* By default, entry streams are resumed immediately after the call to
|
|
@@ -545,7 +566,7 @@ export interface ListOptions {
|
|
|
545
566
|
* opting into this, the stream will never complete until the entry
|
|
546
567
|
* data is consumed.
|
|
547
568
|
*/
|
|
548
|
-
noResume?: boolean;
|
|
569
|
+
noResume?: boolean | undefined;
|
|
549
570
|
}
|
|
550
571
|
|
|
551
572
|
export interface ReplaceOptions {
|
|
@@ -558,7 +579,7 @@ export interface ReplaceOptions {
|
|
|
558
579
|
* Act synchronously. If this is set, then any provided file will be
|
|
559
580
|
* fully written after the call to tar.c.
|
|
560
581
|
*/
|
|
561
|
-
sync?: boolean;
|
|
582
|
+
sync?: boolean | undefined;
|
|
562
583
|
|
|
563
584
|
/**
|
|
564
585
|
* A function that will get called with (message, data)
|
|
@@ -569,29 +590,29 @@ export interface ReplaceOptions {
|
|
|
569
590
|
/**
|
|
570
591
|
* Treat warnings as crash-worthy errors. Default false.
|
|
571
592
|
*/
|
|
572
|
-
strict?: boolean;
|
|
593
|
+
strict?: boolean | undefined;
|
|
573
594
|
|
|
574
595
|
/**
|
|
575
596
|
* Extract files relative to the specified directory. Defaults to
|
|
576
597
|
* process.cwd(). If provided, this must exist and must be a directory.
|
|
577
598
|
*/
|
|
578
|
-
cwd?: string;
|
|
599
|
+
cwd?: string | undefined;
|
|
579
600
|
|
|
580
601
|
/**
|
|
581
602
|
* Alias for cwd.
|
|
582
603
|
*/
|
|
583
|
-
C?: string;
|
|
604
|
+
C?: string | undefined;
|
|
584
605
|
|
|
585
606
|
/**
|
|
586
607
|
* A path portion to prefix onto the entries in the archive.
|
|
587
608
|
*/
|
|
588
|
-
prefix?: string;
|
|
609
|
+
prefix?: string | undefined;
|
|
589
610
|
|
|
590
611
|
/**
|
|
591
612
|
* Set to any truthy value to create a gzipped archive,
|
|
592
613
|
* or an object with settings for zlib.Gzip()
|
|
593
614
|
*/
|
|
594
|
-
gzip?: boolean | zlib.ZlibOptions;
|
|
615
|
+
gzip?: boolean | zlib.ZlibOptions | undefined;
|
|
595
616
|
|
|
596
617
|
/**
|
|
597
618
|
* A function that gets called with (path, stat) for each entry being
|
|
@@ -602,52 +623,52 @@ export interface ReplaceOptions {
|
|
|
602
623
|
/**
|
|
603
624
|
* Allow absolute paths. By default, / is stripped from absolute paths.
|
|
604
625
|
*/
|
|
605
|
-
preservePaths?: boolean;
|
|
626
|
+
preservePaths?: boolean | undefined;
|
|
606
627
|
|
|
607
628
|
/**
|
|
608
629
|
* The maximum buffer size for fs.read() operations. Defaults to 16 MB.
|
|
609
630
|
*/
|
|
610
|
-
maxReadSize?: number;
|
|
631
|
+
maxReadSize?: number | undefined;
|
|
611
632
|
|
|
612
633
|
/**
|
|
613
634
|
* Do not recursively archive the contents of directories.
|
|
614
635
|
*/
|
|
615
|
-
noDirRecurse?: boolean;
|
|
636
|
+
noDirRecurse?: boolean | undefined;
|
|
616
637
|
|
|
617
638
|
/**
|
|
618
639
|
* Set to true to pack the targets of symbolic links. Without this
|
|
619
640
|
* option, symbolic links are archived as such.
|
|
620
641
|
*/
|
|
621
|
-
follow?: boolean;
|
|
642
|
+
follow?: boolean | undefined;
|
|
622
643
|
|
|
623
644
|
/**
|
|
624
645
|
* Alias for follow.
|
|
625
646
|
*/
|
|
626
|
-
L?: boolean;
|
|
647
|
+
L?: boolean | undefined;
|
|
627
648
|
|
|
628
649
|
/**
|
|
629
650
|
* Alias for follow.
|
|
630
651
|
*/
|
|
631
|
-
h?: boolean;
|
|
652
|
+
h?: boolean | undefined;
|
|
632
653
|
|
|
633
654
|
/**
|
|
634
655
|
* uppress pax extended headers. Note that this means that long paths and
|
|
635
656
|
* linkpaths will be truncated, and large or negative numeric values
|
|
636
657
|
* may be interpreted incorrectly.
|
|
637
658
|
*/
|
|
638
|
-
noPax?: boolean;
|
|
659
|
+
noPax?: boolean | undefined;
|
|
639
660
|
}
|
|
640
661
|
|
|
641
662
|
export interface FileOptions {
|
|
642
663
|
/**
|
|
643
664
|
* Uses the given file as the input or output of this function.
|
|
644
665
|
*/
|
|
645
|
-
file?: string;
|
|
666
|
+
file?: string | undefined;
|
|
646
667
|
|
|
647
668
|
/**
|
|
648
669
|
* Alias for file.
|
|
649
670
|
*/
|
|
650
|
-
f?: string;
|
|
671
|
+
f?: string | undefined;
|
|
651
672
|
}
|
|
652
673
|
|
|
653
674
|
/**
|
|
@@ -658,7 +679,11 @@ export interface FileOptions {
|
|
|
658
679
|
*
|
|
659
680
|
* Archive data may be read from the returned stream.
|
|
660
681
|
*/
|
|
661
|
-
export function create(
|
|
682
|
+
export function create(
|
|
683
|
+
options: CreateOptions,
|
|
684
|
+
fileList: ReadonlyArray<string>,
|
|
685
|
+
callback?: (err?: Error) => void,
|
|
686
|
+
): stream.Readable;
|
|
662
687
|
|
|
663
688
|
/**
|
|
664
689
|
* Create a tarball archive. The fileList is an array of paths to add to the
|
|
@@ -668,7 +693,11 @@ export function create(options: CreateOptions, fileList: ReadonlyArray<string>,
|
|
|
668
693
|
*/
|
|
669
694
|
export function create(options: CreateOptions & FileOptions, fileList: ReadonlyArray<string>): Promise<void>;
|
|
670
695
|
export function create(options: CreateOptions & FileOptions & { sync: true }, fileList: ReadonlyArray<string>): void;
|
|
671
|
-
export function create(
|
|
696
|
+
export function create(
|
|
697
|
+
options: CreateOptions & FileOptions,
|
|
698
|
+
fileList: ReadonlyArray<string>,
|
|
699
|
+
callback: (err?: Error) => void,
|
|
700
|
+
): void;
|
|
672
701
|
|
|
673
702
|
/**
|
|
674
703
|
* Alias for create
|
|
@@ -687,7 +716,11 @@ export const c: typeof create;
|
|
|
687
716
|
*
|
|
688
717
|
* Archive data should be written to the returned stream.
|
|
689
718
|
*/
|
|
690
|
-
export function extract(
|
|
719
|
+
export function extract(
|
|
720
|
+
options: ExtractOptions,
|
|
721
|
+
fileList?: ReadonlyArray<string>,
|
|
722
|
+
callback?: (err?: Error) => void,
|
|
723
|
+
): stream.Writable;
|
|
691
724
|
|
|
692
725
|
/**
|
|
693
726
|
* Extract a tarball archive. The fileList is an array of paths to extract
|
|
@@ -701,7 +734,11 @@ export function extract(options: ExtractOptions, fileList?: ReadonlyArray<string
|
|
|
701
734
|
*/
|
|
702
735
|
export function extract(options: ExtractOptions & FileOptions, fileList?: ReadonlyArray<string>): Promise<void>;
|
|
703
736
|
export function extract(options: ExtractOptions & FileOptions & { sync: true }, fileList?: ReadonlyArray<string>): void;
|
|
704
|
-
export function extract(
|
|
737
|
+
export function extract(
|
|
738
|
+
options: ExtractOptions & FileOptions,
|
|
739
|
+
fileList: ReadonlyArray<string> | undefined,
|
|
740
|
+
callback: (err?: Error) => void,
|
|
741
|
+
): void;
|
|
705
742
|
|
|
706
743
|
/**
|
|
707
744
|
* Alias for extract
|
|
@@ -716,7 +753,11 @@ export const x: typeof extract;
|
|
|
716
753
|
*
|
|
717
754
|
* Archive data should be written to the returned stream.
|
|
718
755
|
*/
|
|
719
|
-
export function list(
|
|
756
|
+
export function list(
|
|
757
|
+
options?: ListOptions & FileOptions,
|
|
758
|
+
fileList?: ReadonlyArray<string>,
|
|
759
|
+
callback?: (err?: Error) => void,
|
|
760
|
+
): stream.Writable;
|
|
720
761
|
|
|
721
762
|
/**
|
|
722
763
|
* List the contents of a tarball archive. The fileList is an array of paths
|
|
@@ -741,7 +782,11 @@ export const t: typeof list;
|
|
|
741
782
|
* starts with @, prepend it with ./.
|
|
742
783
|
*/
|
|
743
784
|
export function replace(options: ReplaceOptions, fileList?: ReadonlyArray<string>): Promise<void>;
|
|
744
|
-
export function replace(
|
|
785
|
+
export function replace(
|
|
786
|
+
options: ReplaceOptions,
|
|
787
|
+
fileList: ReadonlyArray<string> | undefined,
|
|
788
|
+
callback: (err?: Error) => void,
|
|
789
|
+
): Promise<void>;
|
|
745
790
|
|
|
746
791
|
/**
|
|
747
792
|
* Alias for replace
|
|
@@ -756,7 +801,11 @@ export const r: typeof replace;
|
|
|
756
801
|
* To add a file that starts with @, prepend it with ./.
|
|
757
802
|
*/
|
|
758
803
|
export function update(options: ReplaceOptions, fileList?: ReadonlyArray<string>): Promise<void>;
|
|
759
|
-
export function update(
|
|
804
|
+
export function update(
|
|
805
|
+
options: ReplaceOptions,
|
|
806
|
+
fileList: ReadonlyArray<string> | undefined,
|
|
807
|
+
callback: (err?: Error) => void,
|
|
808
|
+
): Promise<void>;
|
|
760
809
|
|
|
761
810
|
/**
|
|
762
811
|
* Alias for update
|
tar/package.json
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@types/tar",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "6.1.1",
|
|
4
4
|
"description": "TypeScript definitions for tar",
|
|
5
|
+
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/tar",
|
|
5
6
|
"license": "MIT",
|
|
6
7
|
"contributors": [
|
|
7
8
|
{
|
|
@@ -16,7 +17,7 @@
|
|
|
16
17
|
}
|
|
17
18
|
],
|
|
18
19
|
"main": "",
|
|
19
|
-
"types": "index",
|
|
20
|
+
"types": "index.d.ts",
|
|
20
21
|
"repository": {
|
|
21
22
|
"type": "git",
|
|
22
23
|
"url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git",
|
|
@@ -27,6 +28,6 @@
|
|
|
27
28
|
"@types/minipass": "*",
|
|
28
29
|
"@types/node": "*"
|
|
29
30
|
},
|
|
30
|
-
"typesPublisherContentHash": "
|
|
31
|
-
"typeScriptVersion": "
|
|
31
|
+
"typesPublisherContentHash": "b6e3e62eb97754081bd85e908ecdd88b5f90caea3d29212e8624995f91f24321",
|
|
32
|
+
"typeScriptVersion": "3.8"
|
|
32
33
|
}
|