mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-12 04:50:18 +00:00
[jszip] add string output type (#41183)
This commit is contained in:
committed by
Eloy Durán
parent
e3e0ab9417
commit
f1f2a7e50a
Vendored
+5
-2
@@ -1,6 +1,8 @@
|
||||
// Type definitions for JSZip 3.1
|
||||
// Project: http://stuk.github.com/jszip/, https://github.com/stuk/jszip
|
||||
// Definitions by: mzeiher <https://github.com/mzeiher>, forabi <https://github.com/forabi>
|
||||
// Definitions by: mzeiher <https://github.com/mzeiher>
|
||||
// forabi <https://github.com/forabi>
|
||||
// Florian Keller <https://github.com/ffflorian>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
@@ -15,7 +17,7 @@ interface JSZipSupport {
|
||||
|
||||
type Compression = 'STORE' | 'DEFLATE';
|
||||
|
||||
interface Metadata {
|
||||
interface Metadata {
|
||||
percent: number;
|
||||
currentFile: string;
|
||||
}
|
||||
@@ -37,6 +39,7 @@ interface InputByType {
|
||||
interface OutputByType {
|
||||
base64: string;
|
||||
text: string;
|
||||
string: string;
|
||||
binarystring: string;
|
||||
array: number[];
|
||||
uint8array: Uint8Array;
|
||||
|
||||
@@ -69,6 +69,10 @@ function testJSZip() {
|
||||
}).catch((e: any) => log(SEVERITY.ERROR, e));
|
||||
|
||||
const folder = newJszip.folder("test");
|
||||
|
||||
folder.file("test.txt").async('string'); // $ExpectType Promise<string>
|
||||
folder.file("test.txt").async('text'); // $ExpectType Promise<string>
|
||||
|
||||
folder.file("test.txt").async('text').then((text: string) => {
|
||||
if (text === "test string") {
|
||||
log(SEVERITY.INFO, "all ok");
|
||||
|
||||
Reference in New Issue
Block a user