-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Closed
Description
🐛 Bug Report
v4.1.0
of the library broke the [TypeScript] types of addRow
and addRows
by requiring a second argument (styleOption
). This is however an optional argument.
Lib version: 4.1.0
Steps To Reproduce
const wb = new ExcelJS.Workbook();
const ws = wb.addWorksheet('blort');
ws.addRow([1]); // type error
The expected behaviour:
There should be no compilationn error, since the second argument is optional.
Possible solution (optional, but very helpful):
--- a/node_modules/exceljs/index.d.ts
+++ b/node_modules/exceljs/index.d.ts
@@ -1193,12 +1193,12 @@ export interface Worksheet {
* Add a couple of Rows by key-value, after the last current row, using the column keys,
* or add a row by contiguous Array (assign to columns A, B & C)
*/
- addRow(data: any[] | any, styleOption: string): Row;
+ addRow(data: any[] | any, styleOption?: string): Row;
/**
* Add multiple rows by providing an array of arrays or key-value pairs
*/
- addRows(rows: any[], styleOption: string): void;
+ addRows(rows: any[], styleOption?: string): void;
foxylion, keatkeat87 and KingDarBoja
Metadata
Metadata
Assignees
Labels
No labels