1 |
|
2 |
|
3 | import { EventEmitter as EE } from 'events';
|
4 | import { BrotliDecompress, Unzip } from 'minizlib';
|
5 | import { Yallist } from 'yallist';
|
6 | import { TarOptions } from './options.js';
|
7 | import { Pax } from './pax.js';
|
8 | import { ReadEntry } from './read-entry.js';
|
9 | import { type WarnData, type Warner } from './warn-method.js';
|
10 | declare const STATE: unique symbol;
|
11 | declare const WRITEENTRY: unique symbol;
|
12 | declare const READENTRY: unique symbol;
|
13 | declare const NEXTENTRY: unique symbol;
|
14 | declare const PROCESSENTRY: unique symbol;
|
15 | declare const EX: unique symbol;
|
16 | declare const GEX: unique symbol;
|
17 | declare const META: unique symbol;
|
18 | declare const EMITMETA: unique symbol;
|
19 | declare const BUFFER: unique symbol;
|
20 | declare const QUEUE: unique symbol;
|
21 | declare const ENDED: unique symbol;
|
22 | declare const EMITTEDEND: unique symbol;
|
23 | declare const EMIT: unique symbol;
|
24 | declare const UNZIP: unique symbol;
|
25 | declare const CONSUMECHUNK: unique symbol;
|
26 | declare const CONSUMECHUNKSUB: unique symbol;
|
27 | declare const CONSUMEBODY: unique symbol;
|
28 | declare const CONSUMEMETA: unique symbol;
|
29 | declare const CONSUMEHEADER: unique symbol;
|
30 | declare const CONSUMING: unique symbol;
|
31 | declare const BUFFERCONCAT: unique symbol;
|
32 | declare const MAYBEEND: unique symbol;
|
33 | declare const WRITING: unique symbol;
|
34 | declare const ABORTED: unique symbol;
|
35 | declare const SAW_VALID_ENTRY: unique symbol;
|
36 | declare const SAW_NULL_BLOCK: unique symbol;
|
37 | declare const SAW_EOF: unique symbol;
|
38 | declare const CLOSESTREAM: unique symbol;
|
39 | export type State = 'begin' | 'header' | 'ignore' | 'meta' | 'body';
|
40 | export declare class Parser extends EE implements Warner {
|
41 | file: string;
|
42 | strict: boolean;
|
43 | maxMetaEntrySize: number;
|
44 | filter: Exclude<TarOptions['filter'], undefined>;
|
45 | brotli?: TarOptions['brotli'];
|
46 | writable: true;
|
47 | readable: false;
|
48 | [QUEUE]: Yallist<ReadEntry | [string | symbol, any, any]>;
|
49 | [BUFFER]?: Buffer;
|
50 | [READENTRY]?: ReadEntry;
|
51 | [WRITEENTRY]?: ReadEntry;
|
52 | [STATE]: State;
|
53 | [META]: string;
|
54 | [EX]?: Pax;
|
55 | [GEX]?: Pax;
|
56 | [ENDED]: boolean;
|
57 | [UNZIP]?: false | Unzip | BrotliDecompress;
|
58 | [ABORTED]: boolean;
|
59 | [SAW_VALID_ENTRY]?: boolean;
|
60 | [SAW_NULL_BLOCK]: boolean;
|
61 | [SAW_EOF]: boolean;
|
62 | [WRITING]: boolean;
|
63 | [CONSUMING]: boolean;
|
64 | [EMITTEDEND]: boolean;
|
65 | constructor(opt?: TarOptions);
|
66 | warn(code: string, message: string | Error, data?: WarnData): void;
|
67 | [CONSUMEHEADER](chunk: Buffer, position: number): void;
|
68 | [CLOSESTREAM](): void;
|
69 | [PROCESSENTRY](entry?: ReadEntry | [string | symbol, any, any]): boolean;
|
70 | [NEXTENTRY](): void;
|
71 | [CONSUMEBODY](chunk: Buffer, position: number): number;
|
72 | [CONSUMEMETA](chunk: Buffer, position: number): number;
|
73 | [EMIT](ev: string | symbol, data?: any, extra?: any): void;
|
74 | [EMITMETA](entry: ReadEntry): void;
|
75 | abort(error: Error): void;
|
76 | write(buffer: Uint8Array | string, cb?: (err?: Error | null) => void): boolean;
|
77 | write(str: string, encoding?: BufferEncoding, cb?: (err?: Error | null) => void): boolean;
|
78 | [BUFFERCONCAT](c: Buffer): void;
|
79 | [MAYBEEND](): void;
|
80 | [CONSUMECHUNK](chunk?: Buffer): void;
|
81 | [CONSUMECHUNKSUB](chunk: Buffer): void;
|
82 | end(cb?: () => void): this;
|
83 | end(data: string | Buffer, cb?: () => void): this;
|
84 | end(str: string, encoding?: BufferEncoding, cb?: () => void): this;
|
85 | }
|
86 | export {};
|
87 |
|
\ | No newline at end of file |