mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-07-06 02:00:07 +00:00
[unzipper] Fix CentralDirectory.extract type (#40240)
This commit is contained in:
committed by
Pranav Senthilnathan
parent
acda7e1cdb
commit
27cff735cb
2
types/unzipper/index.d.ts
vendored
2
types/unzipper/index.d.ts
vendored
@@ -81,7 +81,7 @@ export interface CentralDirectory {
|
||||
offsetToStartOfCentralDirectory: number;
|
||||
commentLength: number;
|
||||
files: File[];
|
||||
extract: (opts: ParseOptions) => ParseStream;
|
||||
extract: (opts: ParseOptions) => Promise<void>;
|
||||
}
|
||||
|
||||
export interface File {
|
||||
|
||||
@@ -48,3 +48,10 @@ const dir1: Promise<CentralDirectory> = Open.file("Z:\\path\\to\\archive.zip");
|
||||
const dir2: Promise<CentralDirectory> = Open.url(get("url/to/archive.zip"), {});
|
||||
const dir3: Promise<CentralDirectory> = Open.s3("any", "any");
|
||||
const dir4: Promise<CentralDirectory> = Open.buffer(Buffer.from('ZIPDATA'));
|
||||
|
||||
(async () => {
|
||||
const cd = await dir1;
|
||||
await cd.extract({
|
||||
path: "path/to/extraction/root"
|
||||
});
|
||||
})();
|
||||
|
||||
Reference in New Issue
Block a user