@types/tar 4.0.1 → 4.0.5

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 (4) hide show
  1. tar/LICENSE +21 -21
  2. tar/README.md +6 -6
  3. tar/index.d.ts +127 -71
  4. tar/package.json +6 -4
tar/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) Microsoft Corporation. All rights reserved.
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
@@ -2,15 +2,15 @@
2
2
  > `npm install --save @types/tar`
3
3
 
4
4
  # Summary
5
- This package contains type definitions for tar ( https://github.com/npm/node-tar ).
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: Mon, 17 Jun 2019 07:12:22 GMT
12
- * Dependencies: @types/node
10
+ ### Additional Details
11
+ * Last updated: Fri, 02 Jul 2021 21:32:11 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 <https://github.com/SomaticIT>, Connor Peet <https://github.com/connor4312>.
16
+ These definitions were written by [Maxime LUCE](https://github.com/SomaticIT), and [Connor Peet](https://github.com/connor4312).
tar/index.d.ts CHANGED
@@ -6,31 +6,33 @@
6
6
 
7
7
  /// <reference types="node" />
8
8
 
9
- import stream = require("stream");
10
- import events = require("events");
11
- import zlib = require("zlib");
9
+ import stream = require('stream');
10
+ import events = require('events');
11
+ import zlib = require('zlib');
12
+ import MiniPass = require('minipass');
12
13
 
13
14
  // #region Interfaces
14
15
 
15
16
  export interface HeaderProperties {
16
- path?: string;
17
- mode?: number;
18
- noProprietary?: boolean;
19
- uid?: number;
20
- gid?: number;
21
- size?: number;
22
- mtime?: number;
23
- uname?: string;
24
- gname?: string;
25
- devmaj?: number;
26
- devmin?: number;
17
+ path: string;
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;
27
29
  }
28
30
 
29
31
  export interface ExtractOptions {
30
- type?: string;
31
- Directory?: boolean;
32
- path?: string;
33
- strip?: number;
32
+ type?: string | undefined;
33
+ Directory?: boolean | undefined;
34
+ path?: string | undefined;
35
+ strip?: number | undefined;
34
36
  }
35
37
 
36
38
  export interface ParseStream extends NodeJS.ReadWriteStream {
@@ -234,6 +236,24 @@ export interface FileStat extends stream.Readable, Fields {
234
236
  size: number;
235
237
  }
236
238
 
239
+ export interface ReadEntry extends MiniPass, HeaderProperties {
240
+ /** The extended metadata object provided to the constructor. */
241
+ extended: any;
242
+ /** The global extended metadata object provided to the constructor. */
243
+ globalExtended: any;
244
+ /** The number of bytes remaining to be written into the stream. */
245
+ remain: number;
246
+ /** The number of 512-byte blocks remaining to be written into the stream. */
247
+ blockRemain: number;
248
+ /** Whether this entry should be ignored. */
249
+ ignore: boolean;
250
+ /**
251
+ * True if this represents metadata about the next entry, false if it
252
+ * represents a filesystem object.
253
+ */
254
+ meta: boolean;
255
+ }
256
+
237
257
  export interface CreateOptions {
238
258
  /**
239
259
  * A function that will get called with (message, data)
@@ -244,28 +264,28 @@ export interface CreateOptions {
244
264
  /**
245
265
  * Treat warnings as crash-worthy errors. Default false.
246
266
  */
247
- strict?: boolean;
267
+ strict?: boolean | undefined;
248
268
 
249
269
  /**
250
270
  * The current working directory for creating the archive. Defaults to process.cwd().
251
271
  */
252
- cwd?: string;
272
+ cwd?: string | undefined;
253
273
 
254
274
  /**
255
275
  * Alias for cwd.
256
276
  */
257
- C?: string;
277
+ C?: string | undefined;
258
278
 
259
279
  /**
260
280
  * Set to any truthy value to create a gzipped archive,
261
281
  * or an object with settings for zlib.Gzip()
262
282
  */
263
- gzip?: boolean | zlib.ZlibOptions;
283
+ gzip?: boolean | zlib.ZlibOptions | undefined;
264
284
 
265
285
  /**
266
286
  * Alias for gzip.
267
287
  */
268
- z?: boolean | zlib.ZlibOptions;
288
+ z?: boolean | zlib.ZlibOptions | undefined;
269
289
 
270
290
  /**
271
291
  * A function that gets called with (path, stat) for each entry being
@@ -278,55 +298,55 @@ export interface CreateOptions {
278
298
  * gname, dev, ino, and nlink. Note that mtime is still included,
279
299
  * because this is necessary other time-based operations.
280
300
  */
281
- portable?: boolean;
301
+ portable?: boolean | undefined;
282
302
 
283
303
  /**
284
304
  * Allow absolute paths. By default, / is stripped from absolute paths.
285
305
  */
286
- preservePaths?: boolean;
306
+ preservePaths?: boolean | undefined;
287
307
 
288
308
  /**
289
309
  * Alias for presevePaths.
290
310
  */
291
- P?: boolean;
311
+ P?: boolean | undefined;
292
312
 
293
313
  /**
294
314
  * The mode to set on the created file archive.
295
315
  */
296
- mode?: number;
316
+ mode?: number | undefined;
297
317
 
298
318
  /**
299
319
  * Do not recursively archive the contents of directories.
300
320
  */
301
- noDirRecurse?: boolean;
321
+ noDirRecurse?: boolean | undefined;
302
322
 
303
323
  /**
304
324
  * Set to true to pack the targets of symbolic links. Without this
305
325
  * option, symbolic links are archived as such.
306
326
  */
307
- follow?: boolean;
327
+ follow?: boolean | undefined;
308
328
 
309
329
  /**
310
330
  * Alias for follow.
311
331
  */
312
- L?: boolean;
332
+ L?: boolean | undefined;
313
333
 
314
334
  /**
315
335
  * Alias for follow.
316
336
  */
317
- h?: boolean;
337
+ h?: boolean | undefined;
318
338
 
319
339
  /**
320
340
  * Suppress pax extended headers. Note that this means that long paths and
321
341
  * linkpaths will be truncated, and large or negative numeric values
322
342
  * may be interpreted incorrectly.
323
343
  */
324
- noPax?: boolean;
344
+ noPax?: boolean | undefined;
325
345
 
326
346
  /**
327
347
  * A path portion to prefix onto the entries in the archive.
328
348
  */
329
- prefix?: string;
349
+ prefix?: string | undefined;
330
350
  }
331
351
 
332
352
  export interface ExtractOptions {
@@ -339,18 +359,18 @@ export interface ExtractOptions {
339
359
  /**
340
360
  * Treat warnings as crash-worthy errors. Default false.
341
361
  */
342
- strict?: boolean;
362
+ strict?: boolean | undefined;
343
363
 
344
364
  /**
345
365
  * Extract files relative to the specified directory. Defaults to
346
366
  * process.cwd(). If provided, this must exist and must be a directory.
347
367
  */
348
- cwd?: string;
368
+ cwd?: string | undefined;
349
369
 
350
370
  /**
351
371
  * Alias for cwd.
352
372
  */
353
- C?: string;
373
+ C?: string | undefined;
354
374
 
355
375
  /**
356
376
  * A function that gets called with (path, stat) for each entry being
@@ -362,33 +382,33 @@ export interface ExtractOptions {
362
382
  * Set to true to keep the existing file on disk if it's newer than
363
383
  * the file in the archive.
364
384
  */
365
- newer?: boolean;
385
+ newer?: boolean | undefined;
366
386
 
367
387
  /**
368
388
  * Alias for newer.
369
389
  */
370
- 'keep-newer'?: boolean;
390
+ 'keep-newer'?: boolean | undefined;
371
391
 
372
392
  /**
373
393
  * Alias for newer.
374
394
  */
375
- 'keep-newer-files'?: boolean;
395
+ 'keep-newer-files'?: boolean | undefined;
376
396
 
377
397
  /**
378
398
  * Do not overwrite existing files. In particular, if a file appears more
379
399
  * than once in an archive, later copies will not overwrite earlier copies
380
400
  */
381
- keep?: boolean;
401
+ keep?: boolean | undefined;
382
402
 
383
403
  /**
384
404
  * Alias for keep.
385
405
  */
386
- k?: boolean;
406
+ k?: boolean | undefined;
387
407
 
388
408
  /**
389
409
  * Alias for keep.
390
410
  */
391
- 'keep-existing'?: boolean;
411
+ 'keep-existing'?: boolean | undefined;
392
412
 
393
413
  /**
394
414
  * Unlink files before creating them. Without this option, tar overwrites
@@ -396,24 +416,24 @@ export interface ExtractOptions {
396
416
  * existing hardlinks will be broken, as will any symlink that would
397
417
  * affect the location of an extracted file.
398
418
  */
399
- unlink?: boolean;
419
+ unlink?: boolean | undefined;
400
420
 
401
421
  /**
402
422
  * Remove the specified number of leading path elements. Pathnames with
403
423
  * fewer elements will be silently skipped. Note that the pathname
404
424
  * is edited after applying the filter, but before security checks.
405
425
  */
406
- strip?: number;
426
+ strip?: number | undefined;
407
427
 
408
428
  /**
409
429
  * Alias for strip.
410
430
  */
411
- 'strip-components'?: number;
431
+ 'strip-components'?: number | undefined;
412
432
 
413
433
  /**
414
434
  * Alias for strip.
415
435
  */
416
- stripComponents?: number;
436
+ stripComponents?: number | undefined;
417
437
 
418
438
  /**
419
439
  * If true, tar will set the uid and gid of extracted entries to the uid
@@ -424,12 +444,12 @@ export interface ExtractOptions {
424
444
  * never unpacked in this implementation, and modes
425
445
  * are set by default already.
426
446
  */
427
- preserveOwner?: boolean;
447
+ preserveOwner?: boolean | undefined;
428
448
 
429
449
  /**
430
450
  * Alias for preserveOwner.
431
451
  */
432
- p?: boolean;
452
+ p?: boolean | undefined;
433
453
 
434
454
  /**
435
455
  * Set to a number to force ownership of all extracted files and folders,
@@ -437,7 +457,7 @@ export interface ExtractOptions {
437
457
  * user id, regardless of the uid field in the archive. Cannot be used
438
458
  * along with preserveOwner. Requires also setting a gid option.
439
459
  */
440
- uid?: number;
460
+ uid?: number | undefined;
441
461
 
442
462
  /**
443
463
  * Set to a number to force ownership of all extracted files and folders,
@@ -445,25 +465,61 @@ export interface ExtractOptions {
445
465
  * group id, regardless of the gid field in the archive. Cannot be used
446
466
  * along with preserveOwner. Requires also setting a uid option
447
467
  */
448
- gui?: number;
468
+ gid?: number | undefined;
469
+
470
+ /**
471
+ * Set to true to omit writing mtime value for extracted entries.
472
+ * [Alias: m, no-mtime]
473
+ */
474
+ noMtime?: boolean | undefined;
475
+ m?: boolean | undefined;
476
+ 'no-mtime'?: boolean | undefined;
477
+
478
+ /**
479
+ * Provide a function that takes an entry object, and returns a stream,
480
+ * or any falsey value. If a stream is provided, then that stream's data
481
+ * will be written instead of the contents of the archive entry. If a
482
+ * falsey value is provided, then the entry is written to disk as normal.
483
+ * (To exclude items from extraction, use the filter option described above.)
484
+ */
485
+ transform?(entry: ReadEntry): NodeJS.WritableStream | undefined | false | null;
486
+
487
+ /**
488
+ * A function that gets called with (entry) for each entry that passes the
489
+ * filter.
490
+ */
491
+ onentry?(entry: ReadEntry): void;
492
+
493
+ // The following options are mostly internal, but can be modified in some
494
+ // advanced use cases, such as re-using caches between runs.
495
+
496
+ /**
497
+ * The maximum buffer size for fs.read() operations (in bytes). Defaults to 16 MB.
498
+ */
499
+ maxReadSize?: number | undefined;
500
+
501
+ /**
502
+ * The maximum size of meta entries that is supported. Defaults to 1 MB.
503
+ */
504
+ maxMetaEntrySize?: number | undefined;
449
505
  }
450
506
 
451
507
  export interface ListOptions {
452
508
  /**
453
509
  * Treat warnings as crash-worthy errors. Default false.
454
510
  */
455
- strict?: boolean;
511
+ strict?: boolean | undefined;
456
512
 
457
513
  /**
458
514
  * Extract files relative to the specified directory. Defaults to
459
515
  * process.cwd(). If provided, this must exist and must be a directory.
460
516
  */
461
- cwd?: string;
517
+ cwd?: string | undefined;
462
518
 
463
519
  /**
464
520
  * Alias for cwd.
465
521
  */
466
- C?: string;
522
+ C?: string | undefined;
467
523
 
468
524
  /**
469
525
  * A function that gets called with (path, stat) for each entry being
@@ -481,7 +537,7 @@ export interface ListOptions {
481
537
  /**
482
538
  * The maximum buffer size for fs.read() operations. Defaults to 16 MB.
483
539
  */
484
- maxReadSize?: number;
540
+ maxReadSize?: number | undefined;
485
541
 
486
542
  /**
487
543
  * By default, entry streams are resumed immediately after the call to
@@ -489,7 +545,7 @@ export interface ListOptions {
489
545
  * opting into this, the stream will never complete until the entry
490
546
  * data is consumed.
491
547
  */
492
- noResume?: boolean;
548
+ noResume?: boolean | undefined;
493
549
  }
494
550
 
495
551
  export interface ReplaceOptions {
@@ -502,7 +558,7 @@ export interface ReplaceOptions {
502
558
  * Act synchronously. If this is set, then any provided file will be
503
559
  * fully written after the call to tar.c.
504
560
  */
505
- sync?: boolean;
561
+ sync?: boolean | undefined;
506
562
 
507
563
  /**
508
564
  * A function that will get called with (message, data)
@@ -513,29 +569,29 @@ export interface ReplaceOptions {
513
569
  /**
514
570
  * Treat warnings as crash-worthy errors. Default false.
515
571
  */
516
- strict?: boolean;
572
+ strict?: boolean | undefined;
517
573
 
518
574
  /**
519
575
  * Extract files relative to the specified directory. Defaults to
520
576
  * process.cwd(). If provided, this must exist and must be a directory.
521
577
  */
522
- cwd?: string;
578
+ cwd?: string | undefined;
523
579
 
524
580
  /**
525
581
  * Alias for cwd.
526
582
  */
527
- C?: string;
583
+ C?: string | undefined;
528
584
 
529
585
  /**
530
586
  * A path portion to prefix onto the entries in the archive.
531
587
  */
532
- prefix?: string;
588
+ prefix?: string | undefined;
533
589
 
534
590
  /**
535
591
  * Set to any truthy value to create a gzipped archive,
536
592
  * or an object with settings for zlib.Gzip()
537
593
  */
538
- gzip?: boolean | zlib.ZlibOptions;
594
+ gzip?: boolean | zlib.ZlibOptions | undefined;
539
595
 
540
596
  /**
541
597
  * A function that gets called with (path, stat) for each entry being
@@ -546,52 +602,52 @@ export interface ReplaceOptions {
546
602
  /**
547
603
  * Allow absolute paths. By default, / is stripped from absolute paths.
548
604
  */
549
- preservePaths?: boolean;
605
+ preservePaths?: boolean | undefined;
550
606
 
551
607
  /**
552
608
  * The maximum buffer size for fs.read() operations. Defaults to 16 MB.
553
609
  */
554
- maxReadSize?: number;
610
+ maxReadSize?: number | undefined;
555
611
 
556
612
  /**
557
613
  * Do not recursively archive the contents of directories.
558
614
  */
559
- noDirRecurse?: boolean;
615
+ noDirRecurse?: boolean | undefined;
560
616
 
561
617
  /**
562
618
  * Set to true to pack the targets of symbolic links. Without this
563
619
  * option, symbolic links are archived as such.
564
620
  */
565
- follow?: boolean;
621
+ follow?: boolean | undefined;
566
622
 
567
623
  /**
568
624
  * Alias for follow.
569
625
  */
570
- L?: boolean;
626
+ L?: boolean | undefined;
571
627
 
572
628
  /**
573
629
  * Alias for follow.
574
630
  */
575
- h?: boolean;
631
+ h?: boolean | undefined;
576
632
 
577
633
  /**
578
634
  * uppress pax extended headers. Note that this means that long paths and
579
635
  * linkpaths will be truncated, and large or negative numeric values
580
636
  * may be interpreted incorrectly.
581
637
  */
582
- noPax?: boolean;
638
+ noPax?: boolean | undefined;
583
639
  }
584
640
 
585
641
  export interface FileOptions {
586
642
  /**
587
643
  * Uses the given file as the input or output of this function.
588
644
  */
589
- file?: string;
645
+ file?: string | undefined;
590
646
 
591
647
  /**
592
648
  * Alias for file.
593
649
  */
594
- f?: string;
650
+ f?: string | undefined;
595
651
  }
596
652
 
597
653
  /**
@@ -660,7 +716,7 @@ export const x: typeof extract;
660
716
  *
661
717
  * Archive data should be written to the returned stream.
662
718
  */
663
- export function list(options?: ListOptions, fileList?: ReadonlyArray<string>, callback?: (err?: Error) => void): stream.Writable;
719
+ export function list(options?: ListOptions & FileOptions, fileList?: ReadonlyArray<string>, callback?: (err?: Error) => void): stream.Writable;
664
720
 
665
721
  /**
666
722
  * List the contents of a tarball archive. The fileList is an array of paths
tar/package.json CHANGED
@@ -1,7 +1,8 @@
1
1
  {
2
2
  "name": "@types/tar",
3
- "version": "4.0.1",
3
+ "version": "4.0.5",
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",
@@ -24,8 +25,9 @@
24
25
  },
25
26
  "scripts": {},
26
27
  "dependencies": {
28
+ "@types/minipass": "*",
27
29
  "@types/node": "*"
28
30
  },
29
- "typesPublisherContentHash": "fa48ef973d769fac749d202a47e36b1aafff9afd1b0a601f484b105713bd5b2e",
30
- "typeScriptVersion": "2.0"
31
+ "typesPublisherContentHash": "a6efdc2394562ab1a73de84074e183b53ab21d470ff13ecf93b28ba3993bd3d7",
32
+ "typeScriptVersion": "3.6"
31
33
  }