@types/tar 6.1.3 → 6.1.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 (3) hide show
  1. tar/README.md +1 -1
  2. tar/index.d.ts +141 -12
  3. tar/package.json +4 -4
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: Mon, 26 Sep 2022 19:33:06 GMT
11
+ * Last updated: Tue, 09 May 2023 22:02:56 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
@@ -7,7 +7,6 @@
7
7
  /// <reference types="node" />
8
8
 
9
9
  import stream = require('stream');
10
- import events = require('events');
11
10
  import zlib = require('zlib');
12
11
  import MiniPass = require('minipass');
13
12
 
@@ -213,18 +212,146 @@ export interface Parse extends ParseStream {
213
212
  }
214
213
 
215
214
  export const Parse: {
216
- new(opt?: ParseOptions): Parse;
215
+ new (opt?: ParseOptions): Parse;
217
216
  };
218
217
  //#endregion
219
218
 
220
219
  //#region Global Methods
221
220
 
221
+ export interface PackOptions {
222
+ /**
223
+ * A function that will get called with (code, message, data) for any
224
+ * warnings encountered. (See "Warnings and Errors")
225
+ */
226
+ onwarn?(code: string, message: string, data: Buffer): void;
227
+ /**
228
+ * Treat warnings as crash-worthy errors.
229
+ *
230
+ * @default false
231
+ */
232
+ strict?: boolean;
233
+ /**
234
+ * The current working directory for creating the archive.
235
+ *
236
+ * @default process.cwd()
237
+ */
238
+ cwd?: string[];
239
+ /**
240
+ * A path portion to prefix onto the entries in the archive.
241
+ */
242
+ prefix?: string;
243
+ /**
244
+ * Set to any truthy value to create a gzipped archive, or an object with
245
+ * settings for zlib.Gzip()
246
+ */
247
+ gzip?: boolean | zlib.ZlibOptions;
248
+ /**
249
+ * A function that gets called with (path, stat) for each entry being added.
250
+ * Return true to add the entry to the archive, or false to omit it.
251
+ */
252
+ filter?(path: string, stat: FileStat): boolean;
253
+ /**
254
+ * Omit metadata that is system-specific: ctime, atime, uid, gid, uname,
255
+ * gname, dev, ino, and nlink. Note that mtime is still included, because
256
+ * this is necessary for other time-based operations. Additionally, mode is
257
+ * set to a "reasonable default" for most unix systems, based on a umask
258
+ * value of 0o22.
259
+ */
260
+ portable?: boolean;
261
+ /**
262
+ * Allow absolute paths. By default, / is stripped from absolute paths.
263
+ */
264
+ preservePaths?: boolean;
265
+ /**
266
+ * A Map object containing the device and inode value for any file whose
267
+ * nlink is > 1, to identify hard links.
268
+ */
269
+ linkCache?: Map<string, string>;
270
+ /**
271
+ * A Map object that caches calls lstat.
272
+ */
273
+ statCache?: Map<string, string>;
274
+ /**
275
+ * A Map object that caches calls to readdir.
276
+ */
277
+ readdirCache?: Map<string, string>;
278
+ /**
279
+ * A number specifying how many concurrent jobs to run.
280
+ *
281
+ * @default 4
282
+ */
283
+ jobs?: number;
284
+ /**
285
+ * The maximum buffer size for fs.read() operations.
286
+ *
287
+ * @default 16 MB
288
+ */
289
+ maxReadSize?: number;
290
+ /**
291
+ * Do not recursively archive the contents of directories.
292
+ */
293
+ noDirRecurse?: boolean;
294
+ /**
295
+ * Set to true to pack the targets of symbolic links. Without this option,
296
+ * symbolic links are archived as such.
297
+ */
298
+ follow?: boolean;
299
+ /**
300
+ * Suppress pax extended headers. Note that this means that long paths and
301
+ * linkpaths will be truncated, and large or negative numeric values may be
302
+ * interpreted incorrectly.
303
+ */
304
+ noPax?: boolean;
305
+ /**
306
+ * Set to true to omit writing mtime values for entries. Note that this
307
+ * prevents using other mtime-based features like tar.update or the
308
+ * keepNewer option with the resulting tar archive.
309
+ */
310
+ noMtime?: boolean;
311
+ /**
312
+ * Set to a Date object to force a specific mtime for everything added to
313
+ * the archive. Overridden by noMtime.
314
+ */
315
+ mtime?: number;
316
+ }
317
+
222
318
  /**
223
319
  * Returns a through stream. Use fstream to write files into the pack stream and you will receive tar archive data from the pack stream.
224
320
  * This only works with directories, it does not work with individual files.
225
321
  * The optional properties object are used to set properties in the tar 'Global Extended Header'.
226
322
  */
227
- export function Pack(props?: HeaderProperties): PackStream;
323
+ export class Pack extends MiniPass {
324
+ linkCache: PackOptions['linkCache'];
325
+ readdirCache: PackOptions['readdirCache'];
326
+ statCache: PackOptions['statCache'];
327
+
328
+ static Sync: typeof PackSync;
329
+
330
+ constructor(opt?: PackOptions);
331
+
332
+ add(path: string): this;
333
+ }
334
+
335
+ declare class PackSync extends Pack {
336
+ constructor(opt: PackOptions);
337
+
338
+ // pause/resume are no-ops in sync streams.
339
+ pause(): void;
340
+ resume(): void;
341
+ }
342
+
343
+ declare class PackJob {
344
+ path: string;
345
+ absolute: string;
346
+ entry: unknown | null;
347
+ stat: unknown | null;
348
+ readdir: unknown | null;
349
+ pending: boolean;
350
+ ignore: boolean;
351
+ piped: boolean;
352
+
353
+ constructor(path?: string, absolute?: string);
354
+ }
228
355
 
229
356
  /**
230
357
  * Returns a through stream. Write tar data to the stream and the files in the tarball will be extracted onto the filesystem.
@@ -269,10 +396,10 @@ export interface ReadEntry extends MiniPass, HeaderProperties {
269
396
 
270
397
  export interface CreateOptions {
271
398
  /**
272
- * A function that will get called with (message, data)
273
- * for any warnings encountered.
399
+ * A function that will get called with (code, message, data) for any
400
+ * warnings encountered. (See "Warnings and Errors")
274
401
  */
275
- onwarn?(message: string, data: Buffer): void;
402
+ onwarn?(code: string, message: string, data: Buffer): void;
276
403
 
277
404
  /**
278
405
  * Treat warnings as crash-worthy errors. Default false.
@@ -364,10 +491,10 @@ export interface CreateOptions {
364
491
 
365
492
  export interface ExtractOptions {
366
493
  /**
367
- * A function that will get called with (message, data)
368
- * for any warnings encountered.
494
+ * A function that will get called with (code, message, data) for any
495
+ * warnings encountered. (See "Warnings and Errors")
369
496
  */
370
- onwarn?(message: string, data: Buffer): void;
497
+ onwarn?(code: string, message: string, data: Buffer): void;
371
498
 
372
499
  /**
373
500
  * Treat warnings as crash-worthy errors. Default false.
@@ -582,10 +709,10 @@ export interface ReplaceOptions {
582
709
  sync?: boolean | undefined;
583
710
 
584
711
  /**
585
- * A function that will get called with (message, data)
586
- * for any warnings encountered.
712
+ * A function that will get called with (code, message, data) for any
713
+ * warnings encountered. (See "Warnings and Errors")
587
714
  */
588
- onwarn?(message: string, data: Buffer): void;
715
+ onwarn?(code: string, message: string, data: Buffer): void;
589
716
 
590
717
  /**
591
718
  * Treat warnings as crash-worthy errors. Default false.
@@ -812,3 +939,5 @@ export function update(
812
939
  * Alias for update
813
940
  */
814
941
  export const u: typeof update;
942
+
943
+ export {};
tar/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/tar",
3
- "version": "6.1.3",
3
+ "version": "6.1.5",
4
4
  "description": "TypeScript definitions for tar",
5
5
  "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/tar",
6
6
  "license": "MIT",
@@ -26,8 +26,8 @@
26
26
  "scripts": {},
27
27
  "dependencies": {
28
28
  "@types/node": "*",
29
- "minipass": "^3.3.5"
29
+ "minipass": "^4.0.0"
30
30
  },
31
- "typesPublisherContentHash": "73d2759e05ef82c75abf82485bcfc9688944e454f3ab49a061586d8a42e1fec8",
32
- "typeScriptVersion": "4.1"
31
+ "typesPublisherContentHash": "e0e9c306b0a501a7d753543d5a95ddc55bef6a6be7f2423a03ba6f5de5adaf26",
32
+ "typeScriptVersion": "4.3"
33
33
  }