From e40242d405e10e741f243d3fb60e6af05abbbf09 Mon Sep 17 00:00:00 2001 From: Lionel Date: Wed, 26 Feb 2020 05:51:00 +0800 Subject: [PATCH] [node-xlsx] Support node-xlsx 0.15.0 (#42260) --- types/node-xlsx/index.d.ts | 5 +++-- types/node-xlsx/node-xlsx-tests.ts | 7 ++++++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/types/node-xlsx/index.d.ts b/types/node-xlsx/index.d.ts index 4b9432da76..10540a6f80 100644 --- a/types/node-xlsx/index.d.ts +++ b/types/node-xlsx/index.d.ts @@ -1,6 +1,7 @@ -// Type definitions for node-xlsx 0.12 +// Type definitions for node-xlsx 0.15 // Project: https://github.com/mgcrea/node-xlsx#readme // Definitions by: chenc +// kinuxroot // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 3.0 @@ -25,7 +26,7 @@ export function parse( * @returns returns a buffer of worksheets */ export function build( - worksheets: Array<{ name: string; data: any[][] }>, + worksheets: Array<{ name: string; data: any[][]; options?: {} }>, options?: {} ): ArrayBuffer; declare const _default: { diff --git a/types/node-xlsx/node-xlsx-tests.ts b/types/node-xlsx/node-xlsx-tests.ts index f9dffcad47..660329f67d 100644 --- a/types/node-xlsx/node-xlsx-tests.ts +++ b/types/node-xlsx/node-xlsx-tests.ts @@ -5,4 +5,9 @@ const data = [ ['foo', 'bar', new Date('2014-02-19T14:30Z'), '0.3'], ['baz', null, 'qux'], ]; -const buffer = build([{ name: 'mySheetName', data }]); + +const options = { '!merges': [{ s: { c: 0, r: 0 }, e: { c: 11, r: 0 } }] }; + +const buffer1 = build([{ name: 'mySheetName1', data }]); +const buffer2 = build([{ name: 'mySheetName2', data }], options); +const buffer3 = build([{ name: 'mySheetName3', data, options}]);