1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 | import stream = require("stream");
|
11 |
|
12 |
|
13 |
|
14 | export interface HeaderProperties {
|
15 | path?: string;
|
16 | mode?: number;
|
17 | uid?: number;
|
18 | gid?: number;
|
19 | size?: number;
|
20 | mtime?: number;
|
21 | uname?: string;
|
22 | gname?: string;
|
23 | devmaj?: number;
|
24 | devmin?: number;
|
25 | }
|
26 |
|
27 | export interface ExtractOptions {
|
28 | type?: string;
|
29 | Directory?: boolean;
|
30 | path?: string;
|
31 | strip?: number;
|
32 | }
|
33 |
|
34 | export interface ParseStream extends NodeJS.ReadWriteStream {
|
35 | position: number;
|
36 |
|
37 | _stream: stream.Stream;
|
38 | _ended: boolean;
|
39 |
|
40 | _streamEnd(): void;
|
41 | _process(c: Buffer): void;
|
42 | _startEntry(c: Buffer): void;
|
43 | }
|
44 |
|
45 | export interface PackStream extends NodeJS.ReadWriteStream {
|
46 | writable: boolean;
|
47 | readable: boolean;
|
48 |
|
49 | _noProprietary: boolean;
|
50 | _global: HeaderProperties;
|
51 | _buffer: stream.Stream[];
|
52 | _currentEntry: any;
|
53 | _processing: boolean;
|
54 | _pipeRoot: stream.Stream;
|
55 | _needDrain: boolean;
|
56 | _paused: boolean;
|
57 |
|
58 | addGlobal(props: HeaderProperties): void;
|
59 | add(stream: stream.Stream): boolean;
|
60 | destroy(): void;
|
61 |
|
62 | _process(): void;
|
63 | }
|
64 |
|
65 | export interface ExtractStream extends ParseStream {
|
66 | }
|
67 |
|
68 |
|
69 |
|
70 |
|
71 |
|
72 | export declare var fields: {
|
73 | path: number;
|
74 | mode: number;
|
75 | uid: number;
|
76 | gid: number;
|
77 | size: number;
|
78 | mtime: number;
|
79 | cksum: number;
|
80 | type: number;
|
81 | linkpath: number;
|
82 | ustar: number;
|
83 | ustarvar: number;
|
84 | uname: number;
|
85 | gname: number;
|
86 | devmaj: number;
|
87 | devmin: number;
|
88 | prefix: number;
|
89 | fill: number;
|
90 | };
|
91 |
|
92 | export declare var fieldSize: number[];
|
93 | export declare var fieldOffs: number[];
|
94 | export declare var fieldEnds: number[];
|
95 |
|
96 |
|
97 |
|
98 |
|
99 |
|
100 | export declare var types: {
|
101 | 0: string;
|
102 | "\0": string;
|
103 | "": string;
|
104 | 1: string;
|
105 | 2: string;
|
106 | 3: string;
|
107 | 4: string;
|
108 | 5: string;
|
109 | 6: string;
|
110 | 7: string;
|
111 | g: string;
|
112 | x: string;
|
113 | A: string;
|
114 | D: string;
|
115 | I: string;
|
116 | K: string;
|
117 | L: string;
|
118 | M: string;
|
119 | N: string;
|
120 | S: string;
|
121 | V: string;
|
122 | X: string;
|
123 | File: string;
|
124 | OldFile: string;
|
125 | Link: string;
|
126 | SymbolicLick: string;
|
127 | CharacterDevice: string;
|
128 | BlockDevice: string;
|
129 | Directory: string;
|
130 | FIFO: string;
|
131 | ContiguousFile: string;
|
132 | GlobalExtendedHeader: string;
|
133 | ExtendedHeader: string;
|
134 | SolarisACL: string;
|
135 | GNUDumpDir: string;
|
136 | INode: string;
|
137 | NextFileHasLonLinkPath: string;
|
138 | NextFileHasLongPath: string;
|
139 | ContinuationFile: string;
|
140 | TapeVolumeHeader: string;
|
141 | OldExtendedHeader: string;
|
142 | };
|
143 |
|
144 |
|
145 |
|
146 |
|
147 | export declare var modes: {
|
148 | suid: number;
|
149 | sgid: number;
|
150 | svtx: number;
|
151 | uread: number;
|
152 | uwrite: number;
|
153 | uexec: number;
|
154 | gread: number;
|
155 | gwrite: number;
|
156 | gexec: number;
|
157 | oread: number;
|
158 | owrite: number;
|
159 | oexec: number;
|
160 | };
|
161 |
|
162 | export declare var numeric: {
|
163 | mode: boolean;
|
164 | uid: boolean;
|
165 | gid: boolean;
|
166 | size: boolean;
|
167 | mtime: boolean;
|
168 | devmaj: boolean;
|
169 | devmin: boolean;
|
170 | cksum: boolean;
|
171 | atime: boolean;
|
172 | ctime: boolean;
|
173 | dev: boolean;
|
174 | ino: boolean;
|
175 | nlink: boolean;
|
176 | };
|
177 |
|
178 | export declare var knownExtended: {
|
179 | atime: boolean;
|
180 | charset: boolean;
|
181 | comment: boolean;
|
182 | ctime: boolean;
|
183 | gid: boolean;
|
184 | gname: boolean;
|
185 | linkpat: boolean;
|
186 | mtime: boolean;
|
187 | path: boolean;
|
188 | realtime: boolean;
|
189 | security: boolean;
|
190 | size: boolean;
|
191 | uid: boolean;
|
192 | uname: boolean;
|
193 | };
|
194 |
|
195 | export declare var headerSize: number;
|
196 | export declare var blockSize: number;
|
197 |
|
198 |
|
199 |
|
200 |
|
201 |
|
202 |
|
203 |
|
204 |
|
205 | export declare function Parse(): ParseStream;
|
206 |
|
207 |
|
208 |
|
209 |
|
210 |
|
211 | export declare function Pack(props?: HeaderProperties): PackStream;
|
212 |
|
213 |
|
214 |
|
215 | export declare function Extract(path: string): ExtractStream;
|
216 |
|
217 |
|
218 |
|
219 |
|
220 |
|
221 |
|
222 |
|
223 |
|
224 |
|
225 |
|
226 |
|
227 | export declare function Extract(opts: ExtractOptions): ExtractStream;
|