From 5e2768ac846ccdd750f59b3bc88acaa3920b9ce6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C4=81rlis=20Ga=C5=86=C4=A3is?= Date: Thu, 11 Aug 2016 14:10:56 +0300 Subject: [PATCH 1/2] Added `opts` parameter to sheet_to_json method. --- xlsx.d.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/xlsx.d.ts b/xlsx.d.ts index b761387..766be99 100644 --- a/xlsx.d.ts +++ b/xlsx.d.ts @@ -128,7 +128,11 @@ declare module 'xlsx' { } export interface IUtils { - sheet_to_json(worksheet:IWorkSheet):T[]; + sheet_to_json(worksheet:IWorkSheet, opts?: { + raw?: boolean; + range?: any; + header?: "A"|number|string[]; + }):T[]; sheet_to_csv(worksheet:IWorkSheet):any; sheet_to_formulae(worksheet:IWorkSheet):any; } From 09c3f9db84422bc9919d9656ee49fd72c330b54c Mon Sep 17 00:00:00 2001 From: Hagai Cohen Date: Thu, 11 Aug 2016 19:20:48 +0300 Subject: [PATCH 2/2] Fixed XLSX typings --- xlsx.d.ts | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/xlsx.d.ts b/xlsx.d.ts index 766be99..68f89b5 100644 --- a/xlsx.d.ts +++ b/xlsx.d.ts @@ -7,6 +7,7 @@ declare module 'xlsx' { export function readFile(filename:string, opts?:IParsingOptions):IWorkBook; export function read(data:any, opts?:IParsingOptions):IWorkBook; + export function write(data:any, opts?:IParsingOptions): any; export var utils:IUtils; export interface IProperties { @@ -41,6 +42,7 @@ declare module 'xlsx' { bookSheets?:boolean; bookVBA?:boolean; password?:string; + bookType?:string; /** * Possible options: 'binary', 'base64', 'buffer', 'file' @@ -127,14 +129,21 @@ declare module 'xlsx' { s?: string; } + export interface ICell { + c: number; + r: number; + } + export interface IUtils { sheet_to_json(worksheet:IWorkSheet, opts?: { raw?: boolean; range?: any; header?: "A"|number|string[]; }):T[]; - sheet_to_csv(worksheet:IWorkSheet):any; - sheet_to_formulae(worksheet:IWorkSheet):any; + sheet_to_csv(worksheet: IWorkSheet):any; + sheet_to_formulae(worksheet: IWorkSheet):any; + encode_cell(cell: ICell): any; + encode_range(s: ICell, e: ICell): any; } }