Skip to content

[BUG] Documents instructs us to set Table theme to null, if we dont want one. But TS file doesnt allow it. #2960

@vbanuelos

Description

@vbanuelos

🐛 Bug Report

Documents instructs us to set Table theme to null, if we dont want one. But TS file doesnt allow it.

From docs:
Image

Lib version: 4.4.0

Steps To Reproduce

Example from Docs, with style.theme set to null
// add a table to a sheet

ws.addTable({
  name: 'MyTable',
  ref: 'A1',
  headerRow: true,
  totalsRow: true,
  style: {
    theme: null,
    showRowStripes: true,
  },
  columns: [
    {name: 'Date', totalsRowLabel: 'Totals:', filterButton: true},
    {name: 'Amount', totalsRowFunction: 'sum', filterButton: false},
  ],
  rows: [
    [new Date('2019-07-20'), 70.10],
    [new Date('2019-07-21'), 70.60],
    [new Date('2019-07-22'), 70.10],
  ],
});

The expected behaviour:

yarn build runs.

but I get a failed build, stating that null is not accepted.
these are the types:
https://github.com/exceljs/exceljs/blob/master/index.d.ts#L1788

Possible solution (optional, but very helpful):

I think the best solution, is to add null to the linked type. Since it runs fine, just doesnt build.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions