@types/tar 4.0.5 → 6.1.2

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 (3) hide show
  1. tar/README.md +1 -1
  2. tar/index.d.ts +63 -14
  3. tar/package.json +5 -5
tar/README.md CHANGED
@@ -8,7 +8,7 @@ This package contains type definitions for tar (https://github.com/npm/node-tar)
8
8
  Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/tar.
9
9
 
10
10
  ### Additional Details
11
- * Last updated: Fri, 02 Jul 2021 21:32:11 GMT
11
+ * Last updated: Mon, 01 Aug 2022 22:02:17 GMT
12
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
 
tar/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- // Type definitions for tar 4.0
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
@@ -102,8 +102,8 @@ export const fieldEnds: number[];
102
102
  */
103
103
  export const types: {
104
104
  0: string;
105
- "\0": string;
106
- "": string;
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.
@@ -490,6 +503,14 @@ 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
 
@@ -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(options: CreateOptions, fileList: ReadonlyArray<string>, callback?: (err?: Error) => void): stream.Readable;
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(options: CreateOptions & FileOptions, fileList: ReadonlyArray<string>, callback: (err?: Error) => void): void;
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(options: ExtractOptions, fileList?: ReadonlyArray<string>, callback?: (err?: Error) => void): stream.Writable;
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(options: ExtractOptions & FileOptions, fileList: ReadonlyArray<string> | undefined, callback: (err?: Error) => void): void;
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(options?: ListOptions & FileOptions, fileList?: ReadonlyArray<string>, callback?: (err?: Error) => void): stream.Writable;
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(options: ReplaceOptions, fileList: ReadonlyArray<string> | undefined, callback: (err?: Error) => void): Promise<void>;
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(options: ReplaceOptions, fileList: ReadonlyArray<string> | undefined, callback: (err?: Error) => void): Promise<void>;
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,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/tar",
3
- "version": "4.0.5",
3
+ "version": "6.1.2",
4
4
  "description": "TypeScript definitions for tar",
5
5
  "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/tar",
6
6
  "license": "MIT",
@@ -25,9 +25,9 @@
25
25
  },
26
26
  "scripts": {},
27
27
  "dependencies": {
28
- "@types/minipass": "*",
29
- "@types/node": "*"
28
+ "@types/node": "*",
29
+ "minipass": "^3.3.5"
30
30
  },
31
- "typesPublisherContentHash": "a6efdc2394562ab1a73de84074e183b53ab21d470ff13ecf93b28ba3993bd3d7",
32
- "typeScriptVersion": "3.6"
31
+ "typesPublisherContentHash": "1ed2a9537078e1f4506663bfa209058cfdcad5f1d6770ed205517e663ec67a8b",
32
+ "typeScriptVersion": "4.0"
33
33
  }