#83421 Remove yazl and yauzl typings
This commit is contained in:
parent
e5719685cc
commit
c2e8b28a9a
5 changed files with 17 additions and 65 deletions
|
@ -70,6 +70,8 @@
|
|||
"@types/node": "^10.12.12",
|
||||
"@types/semver": "^5.5.0",
|
||||
"@types/sinon": "^1.16.36",
|
||||
"@types/yauzl": "^2.9.1",
|
||||
"@types/yazl": "^2.4.2",
|
||||
"@types/webpack": "^4.4.10",
|
||||
"@types/winreg": "^1.2.30",
|
||||
"ansi-colors": "^3.2.3",
|
||||
|
|
49
src/typings/yauzl.d.ts
vendored
49
src/typings/yauzl.d.ts
vendored
|
@ -1,49 +0,0 @@
|
|||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
declare module 'yauzl' {
|
||||
|
||||
import { EventEmitter } from 'events';
|
||||
import { Readable } from 'stream';
|
||||
|
||||
export class Entry {
|
||||
fileName: string;
|
||||
extraFields: { id: number; data: Buffer; }[];
|
||||
comment: string;
|
||||
versionMadeBy: number;
|
||||
versionNeededToExtract: number;
|
||||
generalPurposeBitFlag: number;
|
||||
compressionMethod: number;
|
||||
lastModFileTime: number;
|
||||
lastModFileDate: number;
|
||||
crc32: number;
|
||||
compressedSize: number;
|
||||
uncompressedSize: number;
|
||||
fileNameLength: number;
|
||||
extraFieldLength: number;
|
||||
fileCommentLength: number;
|
||||
internalFileAttributes: number;
|
||||
externalFileAttributes: number;
|
||||
relativeOffsetOfLocalHeader: number;
|
||||
getLastModDate(): Date;
|
||||
}
|
||||
|
||||
export class ZipFile extends EventEmitter {
|
||||
readEntry(): void;
|
||||
openReadStream(entry: Entry, callback: (err?: Error, stream?: Readable) => void): void;
|
||||
close(): void;
|
||||
isOpen: boolean;
|
||||
entryCount: number;
|
||||
comment: string;
|
||||
}
|
||||
|
||||
export interface IOptions {
|
||||
autoClose?: boolean;
|
||||
lazyEntries?: boolean;
|
||||
}
|
||||
|
||||
export function open(path: string, callback: (err?: Error, zipfile?: ZipFile) => void): void;
|
||||
export function open(path: string, options: IOptions | undefined, callback: (err?: Error, zipfile?: ZipFile) => void): void;
|
||||
}
|
15
src/typings/yazl.d.ts
vendored
15
src/typings/yazl.d.ts
vendored
|
@ -1,15 +0,0 @@
|
|||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
declare module 'yazl' {
|
||||
import * as stream from 'stream';
|
||||
|
||||
class ZipFile {
|
||||
outputStream: stream.Stream;
|
||||
addBuffer(buffer: Buffer, path: string): void;
|
||||
addFile(localPath: string, path: string): void;
|
||||
end(): void;
|
||||
}
|
||||
}
|
|
@ -163,7 +163,7 @@ function extractZip(zipfile: ZipFile, targetPath: string, options: IOptions, tok
|
|||
|
||||
function openZip(zipFile: string, lazy: boolean = false): Promise<ZipFile> {
|
||||
return new Promise((resolve, reject) => {
|
||||
_openZip(zipFile, lazy ? { lazyEntries: true } : undefined, (error?: Error, zipfile?: ZipFile) => {
|
||||
_openZip(zipFile, lazy ? { lazyEntries: true } : undefined!, (error?: Error, zipfile?: ZipFile) => {
|
||||
if (error) {
|
||||
reject(toExtractError(error));
|
||||
} else {
|
||||
|
|
14
yarn.lock
14
yarn.lock
|
@ -195,6 +195,20 @@
|
|||
resolved "https://registry.yarnpkg.com/@types/winreg/-/winreg-1.2.30.tgz#91d6710e536d345b9c9b017c574cf6a8da64c518"
|
||||
integrity sha1-kdZxDlNtNFucmwF8V0z2qNpkxRg=
|
||||
|
||||
"@types/yauzl@^2.9.1":
|
||||
version "2.9.1"
|
||||
resolved "https://registry.yarnpkg.com/@types/yauzl/-/yauzl-2.9.1.tgz#d10f69f9f522eef3cf98e30afb684a1e1ec923af"
|
||||
integrity sha512-A1b8SU4D10uoPjwb0lnHmmu8wZhR9d+9o2PKBQT2jU5YPTKsxac6M2qGAdY7VcL+dHHhARVUDmeg0rOrcd9EjA==
|
||||
dependencies:
|
||||
"@types/node" "*"
|
||||
|
||||
"@types/yazl@^2.4.2":
|
||||
version "2.4.2"
|
||||
resolved "https://registry.yarnpkg.com/@types/yazl/-/yazl-2.4.2.tgz#d5f8a4752261badbf1a36e8b49e042dc18ec84bc"
|
||||
integrity sha512-T+9JH8O2guEjXNxqmybzQ92mJUh2oCwDDMSSimZSe1P+pceZiFROZLYmcbqkzV5EUwz6VwcKXCO2S2yUpra6XQ==
|
||||
dependencies:
|
||||
"@types/node" "*"
|
||||
|
||||
"@webassemblyjs/ast@1.5.13":
|
||||
version "1.5.13"
|
||||
resolved "https://registry.yarnpkg.com/@webassemblyjs/ast/-/ast-1.5.13.tgz#81155a570bd5803a30ec31436bc2c9c0ede38f25"
|
||||
|
|
Loading…
Reference in a new issue