I am currently utilizing the excelJS library within an Angular 4 project. When attempting to modify the borders of a specific row using the following code snippet:
sheet.getRow(5).eachCell(cell => cell.border = {
top: { style: 'thin' },
left: { style: 'thin' },
bottom: { style: 'thin' },
right: { style: 'thin' }
});
An error is thrown by the Angular compiler stating:
Type '{ top: { style: string; }; left: { style: string; }; bottom: { style: string; }; right: { style: ...' is not assignable to type 'Partial<Borders>'.
Edit: I encountered a similar issue to that described in this question and the provided solution did not resolve it. It was suggested to simply run
npm install --save-dev @types/exceljs
, but this also did not work for me. Instead, I found a workaround through this method. I added the following configuration to my tsconfig.json
:
"compilerOptions": {
"paths": {
"exceljs": [
"../node_modules/exceljs/dist/es5/exceljs.browser"
]
},