Updated types list in TS definition [ci skip]

fixes #1026
This commit is contained in:
andrisarkameru 2018-03-07 15:49:25 +02:00
parent 7149728c7c
commit be4e21c6f1
2 changed files with 9 additions and 2 deletions

4
types/index.d.ts vendored
View File

@ -110,7 +110,7 @@ export interface DateNFOption {
/** Options for read and readFile */
export interface ParsingOptions extends CommonOptions {
/** Input data encoding */
type?: 'base64' | 'binary' | 'buffer' | 'file' | 'array';
type?: 'base64' | 'binary' | 'buffer' | 'file' | 'array' | 'string';
/** Default codepage */
codepage?: number;
@ -193,7 +193,7 @@ export interface ParsingOptions extends CommonOptions {
/** Options for write and writeFile */
export interface WritingOptions extends CommonOptions {
/** Output data encoding */
type?: 'base64' | 'binary' | 'buffer' | 'file' | 'array';
type?: 'base64' | 'binary' | 'buffer' | 'file' | 'array' | 'string';
/**
* Generate Shared String Table

View File

@ -50,6 +50,13 @@ XLSX.utils.book_append_sheet(newwb, aoa2, "AOA");
XLSX.utils.book_append_sheet(newwb, js2ws, "JSON");
const bstrxlsx: string = XLSX.write(newwb, {type: "binary", bookType: "xlsx" });
const wb_1: XLSX.WorkBook = XLSX.read(XLSX.write(newwb, {type: "base64", bookType: "xlsx" }), {type: "base64"});
const wb_2: XLSX.WorkBook = XLSX.read(XLSX.write(newwb, {type: "binary", bookType: "xlsx" }), {type: "binary"});
const wb_3: XLSX.WorkBook = XLSX.read(XLSX.write(newwb, {type: "buffer", bookType: "xlsx" }), {type: "buffer"});
const wb_4: XLSX.WorkBook = XLSX.read(XLSX.write(newwb, {type: "file", bookType: "xlsx" }), {type: "file"});
const wb_5: XLSX.WorkBook = XLSX.read(XLSX.write(newwb, {type: "array", bookType: "xlsx" }), {type: "array"});
const wb_6: XLSX.WorkBook = XLSX.read(XLSX.write(newwb, {type: "string", bookType: "xlsx" }), {type: "string"});
const CFB = XLSX.CFB;
const vbawb = XLSX.readFile("test.xlsm", {bookVBA:true});
if(vbawb.vbaraw) {