UNPKG

1.54 kBTypeScriptView Raw
1// Imported from: https://github.com/soywiz/typescript-node-definitions/d.ts
2
3/// <reference types="node" />
4
5import { ReadStream } from "fs";
6import * as tarStream from "tar-stream";
7
8export function pack(cwd: string, opts?: PackOptions): tarStream.Pack;
9export function extract(cwd: string, opts?: ExtractOptions): tarStream.Extract;
10
11export type Pack = tarStream.Pack;
12export type Extract = tarStream.Extract;
13
14export 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
26export 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
34export 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
40export 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