-
Notifications
You must be signed in to change notification settings - Fork 17
Expand file tree
/
Copy pathtar.d.ts
More file actions
80 lines (60 loc) · 2.22 KB
/
tar.d.ts
File metadata and controls
80 lines (60 loc) · 2.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See LICENSE.md in the project root for license information.
*--------------------------------------------------------------------------------------------*/
/**
* Originally from the Docker extension: https://github.com/microsoft/vscode-docker/blob/main/src/definitions/tar.d.ts
*
* The `@types/tar` package is riddled with inaccuracies, so it's easier
* to just declare typings for it here
*/
declare module "tar" {
//#region Parse
export interface ParseOptions {
filter?: (path: string, entry: ReadEntryClass) => boolean;
onentry?: (entry: ReadEntryClass) => void;
}
export interface ParseClass extends NodeJS.ReadWriteStream {
// eslint-disable-next-line @typescript-eslint/no-misused-new
new(options?: ParseOptions): ParseClass;
}
export const Parse: ParseClass;
//#endregion Parse
//#region Pack
export interface PackOptions {
portable?: boolean;
}
export interface PackClass extends NodeJS.ReadWriteStream {
// eslint-disable-next-line @typescript-eslint/no-misused-new
new(options?: PackOptions): PackClass;
add(readEntry: ReadEntryClass): void;
}
export const Pack: PackClass;
//#endregion Pack
//#region ReadEntry
export interface ReadEntryOptions {
path: string;
type: 'File' | 'Directory';
size: number;
atime: Date;
mtime: Date;
ctime: Date;
mode?: number;
gid?: number;
uid?: number;
}
export interface ReadEntryClass extends NodeJS.EventEmitter, NodeJS.ReadWriteStream {
// eslint-disable-next-line @typescript-eslint/no-misused-new
new(options: ReadEntryOptions): ReadEntryClass;
path: string;
}
export const ReadEntry: ReadEntryClass;
//#endregion ReadEntry
//#region Create
export interface CreateOptions {
cwd?: string;
}
export function create(options: CreateOptions, fileList: string[]): NodeJS.ReadableStream;
export const c: typeof create;
//#endregion
}