@@ -26,20 +26,6 @@ class VirtualTar {
26
26
| Partial < Record < MetadataKeywords , string > >
27
27
| undefined ;
28
28
29
- protected addEntry (
30
- filePath : string ,
31
- type : 'file' | 'directory' ,
32
- stat ?: FileStat ,
33
- data ?: Uint8Array | string ,
34
- ) : void ;
35
-
36
- protected addEntry (
37
- filePath : string ,
38
- type : 'file' | 'directory' ,
39
- stat ?: FileStat ,
40
- callback ?: ( write : ( chunk : string | Uint8Array ) => void ) => void ,
41
- ) : void ;
42
-
43
29
protected addEntry (
44
30
filePath : string ,
45
31
type : 'file' | 'directory' ,
@@ -130,6 +116,24 @@ class VirtualTar {
130
116
filePath : string ,
131
117
stat : FileStat ,
132
118
data ?: Uint8Array | string ,
119
+ ) : void ;
120
+
121
+ public addFile (
122
+ filePath : string ,
123
+ stat : FileStat ,
124
+ data ?:
125
+ | Uint8Array
126
+ | string
127
+ | ( ( writer : ( chunk : string | Uint8Array ) => void ) => void ) ,
128
+ ) : void ;
129
+
130
+ public addFile (
131
+ filePath : string ,
132
+ stat : FileStat ,
133
+ data ?:
134
+ | Uint8Array
135
+ | string
136
+ | ( ( writer : ( chunk : string | Uint8Array ) => void ) => void ) ,
133
137
) : void {
134
138
if ( this . state !== VirtualTarState . GENERATOR ) {
135
139
throw new errors . ErrorVirtualTarInvalidState (
@@ -267,18 +271,14 @@ class VirtualTar {
267
271
return { type : 'empty' , awaitingData : false } ;
268
272
}
269
273
270
- public parseAvailable ( ) : Array <
271
- ParsedFile | ParsedDirectory | ParsedMetadata | ParsedEmpty
272
- > {
274
+ public parseAvailable ( ) : Array < ParsedFile | ParsedDirectory > {
273
275
if ( this . state !== VirtualTarState . PARSER ) {
274
276
throw new errors . ErrorVirtualTarInvalidState (
275
277
'VirtualTar is not in parser mode' ,
276
278
) ;
277
279
}
278
280
279
- const parsedTokens : Array <
280
- ParsedFile | ParsedDirectory | ParsedMetadata | ParsedEmpty
281
- > = [ ] ;
281
+ const parsedTokens : Array < ParsedFile | ParsedDirectory > = [ ] ;
282
282
let token ;
283
283
while ( token . type !== 'empty' && ! token . awaitingData ) {
284
284
token = this . next ( ) ;
0 commit comments