1 |
|
2 |
|
3 |
|
4 |
|
5 | import { ReadStream } from "fs";
|
6 | import * as tarStream from "tar-stream";
|
7 |
|
8 | export function pack(cwd: string, opts?: PackOptions): tarStream.Pack;
|
9 | export function extract(cwd: string, opts?: ExtractOptions): tarStream.Extract;
|
10 |
|
11 | export type Pack = tarStream.Pack;
|
12 | export type Extract = tarStream.Extract;
|
13 |
|
14 | export interface Options {
|
15 | ignore?: ((name: string) => boolean) | undefined;
|
16 | filter?: ((name: string) => boolean) | undefined;
|
17 | map?: ((header: Headers) => Headers) | undefined;
|
18 | mapStream?: ((fileStream: ReadStream, header: Headers) => ReadStream) | undefined;
|
19 | dmode?: number | undefined;
|
20 | fmode?: number | undefined;
|
21 | readable?: boolean | undefined;
|
22 | writable?: boolean | undefined;
|
23 | strict?: boolean | undefined;
|
24 | }
|
25 |
|
26 | export interface PackOptions extends Options {
|
27 | entries?: string[] | undefined;
|
28 | dereference?: boolean | undefined;
|
29 | finalize?: boolean | undefined;
|
30 | finish?: ((pack: tarStream.Pack) => void) | undefined;
|
31 | pack?: tarStream.Pack | undefined;
|
32 | }
|
33 |
|
34 | export interface ExtractOptions extends Options {
|
35 | ignore?: ((name: string, header?: Headers) => boolean) | undefined;
|
36 | filter?: ((name: string, header?: Headers) => boolean) | undefined;
|
37 | strip?: number | undefined;
|
38 | }
|
39 |
|
40 | export interface Headers {
|
41 | name: string;
|
42 | mode: number;
|
43 | mtime: Date;
|
44 | size: number;
|
45 | type: "file" | "directory" | "link" | "symlink";
|
46 | uid: number;
|
47 | gid: number;
|
48 | }
|
49 |
|
\ | No newline at end of file |