Skip to content

Commit

Permalink
Updated types list in TS definition [ci skip]
Browse files Browse the repository at this point in the history
fixes #1026
  • Loading branch information
andrisarkameru committed Mar 7, 2018
1 parent 7149728 commit be4e21c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
4 changes: 2 additions & 2 deletions types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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
Expand Down
7 changes: 7 additions & 0 deletions types/xlsx-tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit be4e21c

Please sign in to comment.