mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-07-01 15:50:13 +00:00
Use types from tar-stream as return types of tar-fs (#41282)
* Use types from tar-stream as return types of tar-fs * Re-export tar-stream types
This commit is contained in:
committed by
Armando Aguirre
parent
88dc14e78f
commit
4878ac3f21
10
types/tar-fs/index.d.ts
vendored
10
types/tar-fs/index.d.ts
vendored
@@ -9,11 +9,13 @@
|
||||
/// <reference types="node" />
|
||||
|
||||
import fs = require('fs');
|
||||
import stream = require('stream');
|
||||
import tarStream = require('tar-stream');
|
||||
|
||||
// Replace these return values with the value of tar-stream when it becomes available
|
||||
export function pack(cwd: string, opts?: PackOptions): stream.Readable;
|
||||
export function extract(cwd: string, opts?: ExtractOptions): stream.Writable;
|
||||
export function pack(cwd: string, opts?: PackOptions): tarStream.Pack;
|
||||
export function extract(cwd: string, opts?: ExtractOptions): tarStream.Extract;
|
||||
|
||||
export type Pack = tarStream.Pack;
|
||||
export type Extract = tarStream.Extract;
|
||||
|
||||
export interface Options {
|
||||
ignore?: (name: string) => boolean;
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import tar = require("tar-fs");
|
||||
import fs = require("fs");
|
||||
import path = require("path");
|
||||
import stream = require("stream");
|
||||
|
||||
/*
|
||||
* Default test
|
||||
@@ -96,3 +95,9 @@ tar.pack('./my-directory', {
|
||||
strict: false,
|
||||
dereference: true,
|
||||
});
|
||||
|
||||
/*
|
||||
* Return type of tar-stream
|
||||
*/
|
||||
tar.pack('./my-directory').entry({ name: 'generated-file.txt' }, '1234');
|
||||
tar.pack('./my-directory').finalize();
|
||||
|
||||
Reference in New Issue
Block a user