@types/tar 6.1.2 → 6.1.4
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/README.md +1 -1
- tar/index.d.ts +150 -20
- 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:
|
|
11
|
+
* Last updated: Thu, 16 Feb 2023 06:02:34 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
|
|
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.
|
|
@@ -553,7 +680,7 @@ export interface ListOptions {
|
|
|
553
680
|
* filter. This is important for when both file and sync are set, because
|
|
554
681
|
* it will be called synchronously.
|
|
555
682
|
*/
|
|
556
|
-
onentry?(entry:
|
|
683
|
+
onentry?(entry: ReadEntry): void;
|
|
557
684
|
|
|
558
685
|
/**
|
|
559
686
|
* The maximum buffer size for fs.read() operations. Defaults to 16 MB.
|
|
@@ -671,6 +798,18 @@ export interface FileOptions {
|
|
|
671
798
|
f?: string | undefined;
|
|
672
799
|
}
|
|
673
800
|
|
|
801
|
+
export type RequiredFileOptions = {
|
|
802
|
+
/**
|
|
803
|
+
* Uses the given file as the input or output of this function.
|
|
804
|
+
*/
|
|
805
|
+
file: string;
|
|
806
|
+
} | {
|
|
807
|
+
/**
|
|
808
|
+
* Alias for file.
|
|
809
|
+
*/
|
|
810
|
+
f: string;
|
|
811
|
+
};
|
|
812
|
+
|
|
674
813
|
/**
|
|
675
814
|
* Create a tarball archive. The fileList is an array of paths to add to the
|
|
676
815
|
* tarball. Adding a directory also adds its children recursively. An entry in
|
|
@@ -745,28 +884,17 @@ export function extract(
|
|
|
745
884
|
*/
|
|
746
885
|
export const x: typeof extract;
|
|
747
886
|
|
|
748
|
-
/**
|
|
749
|
-
* List the contents of a tarball archive. The fileList is an array of paths
|
|
750
|
-
* to list from the tarball. If no paths are provided, then all the entries
|
|
751
|
-
* are listed. If the archive is gzipped, then tar will detect this and unzip
|
|
752
|
-
* it.
|
|
753
|
-
*
|
|
754
|
-
* Archive data should be written to the returned stream.
|
|
755
|
-
*/
|
|
756
|
-
export function list(
|
|
757
|
-
options?: ListOptions & FileOptions,
|
|
758
|
-
fileList?: ReadonlyArray<string>,
|
|
759
|
-
callback?: (err?: Error) => void,
|
|
760
|
-
): stream.Writable;
|
|
761
|
-
|
|
762
887
|
/**
|
|
763
888
|
* List the contents of a tarball archive. The fileList is an array of paths
|
|
764
889
|
* to list from the tarball. If no paths are provided, then all the entries
|
|
765
890
|
* are listed. If the archive is gzipped, then tar will detect this and unzip
|
|
766
891
|
* it.
|
|
767
892
|
*/
|
|
768
|
-
export function list(options: ListOptions &
|
|
769
|
-
export function list(options: ListOptions &
|
|
893
|
+
export function list(options: ListOptions & RequiredFileOptions, fileList?: ReadonlyArray<string>): Promise<void>;
|
|
894
|
+
export function list(options: ListOptions & RequiredFileOptions & { sync: true }, fileList?: ReadonlyArray<string>): void;
|
|
895
|
+
export function list(callback?: (err?: Error) => void): Parse;
|
|
896
|
+
export function list(optionsOrFileList: ListOptions | ReadonlyArray<string>, callback?: (err?: Error) => void): Parse;
|
|
897
|
+
export function list(options: ListOptions, fileList: ReadonlyArray<string>, callback?: (err?: Error) => void): Parse;
|
|
770
898
|
|
|
771
899
|
/**
|
|
772
900
|
* Alias for list
|
|
@@ -811,3 +939,5 @@ export function update(
|
|
|
811
939
|
* Alias for update
|
|
812
940
|
*/
|
|
813
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
|
+
"version": "6.1.4",
|
|
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": "^
|
|
29
|
+
"minipass": "^4.0.0"
|
|
30
30
|
},
|
|
31
|
-
"typesPublisherContentHash": "
|
|
32
|
-
"typeScriptVersion": "4.
|
|
31
|
+
"typesPublisherContentHash": "e903d71c2ec53ea8e04cbb1125f7386388c26c9152c68db383d78496fa362b97",
|
|
32
|
+
"typeScriptVersion": "4.2"
|
|
33
33
|
}
|