UNPKG

3.62 kBTypeScriptView Raw
1/// <reference types="node" />
2/// <reference types="node" />
3import { type Stats } from 'fs';
4import { WriteEntry, WriteEntrySync, WriteEntryTar } from './write-entry.js';
5export declare class PackJob {
6 path: string;
7 absolute: string;
8 entry?: WriteEntry | WriteEntryTar;
9 stat?: Stats;
10 readdir?: string[];
11 pending: boolean;
12 ignore: boolean;
13 piped: boolean;
14 constructor(path: string, absolute: string);
15}
16import { Minipass } from 'minipass';
17import * as zlib from 'minizlib';
18import { Yallist } from 'yallist';
19import { ReadEntry } from './read-entry.js';
20import { WarnEvent, type WarnData, type Warner } from './warn-method.js';
21declare const ONSTAT: unique symbol;
22declare const ENDED: unique symbol;
23declare const QUEUE: unique symbol;
24declare const CURRENT: unique symbol;
25declare const PROCESS: unique symbol;
26declare const PROCESSING: unique symbol;
27declare const PROCESSJOB: unique symbol;
28declare const JOBS: unique symbol;
29declare const JOBDONE: unique symbol;
30declare const ADDFSENTRY: unique symbol;
31declare const ADDTARENTRY: unique symbol;
32declare const STAT: unique symbol;
33declare const READDIR: unique symbol;
34declare const ONREADDIR: unique symbol;
35declare const PIPE: unique symbol;
36declare const ENTRY: unique symbol;
37declare const ENTRYOPT: unique symbol;
38declare const WRITEENTRYCLASS: unique symbol;
39declare const WRITE: unique symbol;
40declare const ONDRAIN: unique symbol;
41import { TarOptions } from './options.js';
42export declare class Pack extends Minipass<Buffer, ReadEntry | string, WarnEvent<Buffer>> implements Warner {
43 opt: TarOptions;
44 cwd: string;
45 maxReadSize?: number;
46 preservePaths: boolean;
47 strict: boolean;
48 noPax: boolean;
49 prefix: string;
50 linkCache: Exclude<TarOptions['linkCache'], undefined>;
51 statCache: Exclude<TarOptions['statCache'], undefined>;
52 file: string;
53 portable: boolean;
54 zip?: zlib.BrotliCompress | zlib.Gzip;
55 readdirCache: Exclude<TarOptions['readdirCache'], undefined>;
56 noDirRecurse: boolean;
57 follow: boolean;
58 noMtime: boolean;
59 mtime?: Date;
60 filter: Exclude<TarOptions['filter'], undefined>;
61 jobs: number;
62 [WRITEENTRYCLASS]: typeof WriteEntry | typeof WriteEntrySync;
63 onWriteEntry?: (entry: WriteEntry) => void;
64 [QUEUE]: Yallist<PackJob>;
65 [JOBS]: number;
66 [PROCESSING]: boolean;
67 [ENDED]: boolean;
68 constructor(opt?: TarOptions);
69 [WRITE](chunk: Buffer): boolean;
70 add(path: string | ReadEntry): this;
71 end(cb?: () => void): this;
72 end(path: string | ReadEntry, cb?: () => void): this;
73 end(path: string | ReadEntry, encoding?: Minipass.Encoding, cb?: () => void): this;
74 write(path: string | ReadEntry): boolean;
75 [ADDTARENTRY](p: ReadEntry): void;
76 [ADDFSENTRY](p: string): void;
77 [STAT](job: PackJob): void;
78 [ONSTAT](job: PackJob, stat: Stats): void;
79 [READDIR](job: PackJob): void;
80 [ONREADDIR](job: PackJob, entries: string[]): void;
81 [PROCESS](): void;
82 get [CURRENT](): PackJob | undefined;
83 [JOBDONE](_job: PackJob): void;
84 [PROCESSJOB](job: PackJob): void;
85 [ENTRYOPT](job: PackJob): TarOptions;
86 [ENTRY](job: PackJob): WriteEntry | undefined;
87 [ONDRAIN](): void;
88 [PIPE](job: PackJob): void;
89 pause(): void;
90 warn(code: string, message: string | Error, data?: WarnData): void;
91}
92export declare class PackSync extends Pack {
93 sync: true;
94 constructor(opt: TarOptions);
95 pause(): void;
96 resume(): void;
97 [STAT](job: PackJob): void;
98 [READDIR](job: PackJob): void;
99 [PIPE](job: PackJob): void;
100}
101export {};
102//# sourceMappingURL=pack.d.ts.map
\No newline at end of file