[BUG] Can't create columns in typescript
See original GitHub issue🐛 Bug Report
I have created worksheet and using that worksheet i cant seems to create columns header.
const workbook = new Workbook();
workbook.creator = workbookName;
const worksheet = workbook.addWorksheet(workSheetName);
worksheet.columns = [
{ header: 'Id', key: 'id', width: 10 },
{ header: 'Name', key: 'name', width: 32 },
{ header: 'D.O.B.', key: 'DOB', width: 10, outlineLevel: 1 },
];
Error give.
Type '{ header: string; key: string; width: number; }' is missing the following properties from type 'Column': outlineLevel, hidden, style, values, and 11 more.
It just seems like under Type Columns all is required.
Lib version: 4.2.0
Steps To Reproduce
const workbook = new Workbook();
workbook.creator = workbookName;
const worksheet = workbook.addWorksheet(workSheetName);
worksheet.columns = [
{ header: 'Id', key: 'id', width: 10 },
{ header: 'Name', key: 'name', width: 32 },
{ header: 'D.O.B.', key: 'DOB', width: 10, outlineLevel: 1 },
];
The expected behaviour:
Type '{ header: string; key: string; width: number; }' is missing the following properties from type 'Column': outlineLevel, hidden, style, values, and 11 more.
Possible solution (optional, but very helpful):
Make fields in Type Columns optional
Issue Analytics
- State:
- Created 3 years ago
- Reactions:22
- Comments:10
Top Results From Across the Web
TypeORM throws Error 'ER_CANT_CREATE_TABLE: Can\' ...
But somehow i keep getting that error. My entities are like below (Common entity is just an entity for basic Columns like id,...
Read more >JavaScript Data Grid: Column Sizing
All columns can be resized by dragging the top right portion of the column. Enable Sizing. Turn column resizing on for the grid...
Read more >The starting point for learning TypeScript
Find TypeScript starter projects: from Angular to React or Node.js and CLIs.
Read more >console.table() - Web APIs | MDN
It logs data as a table. Each element in the array (or enumerable property if data is an object) will be a row...
Read more >Typescript Error: Property 'registerRenderer' does not exist ...
In the demo link it does not throw this error, but in my refactored example I have also added 'checkbox' type in that...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@Artaud ExcelProper is just your default import of the library. You can name it differently.
You can cast if you are using 4.2 in the meantime: