Exceljs equivalentTo(other: Column) and eachCell(callback: (cell: Cell, rowNumber: number) => void): void

49
November 26, 2020, at 07:00 AM

I am new at React and Nodejs and currently, I am using Exceljs to export a json array to a XLSX file. I used import Excel = require('exceljs'); and it worked like a charm but due to principle of order, my company asked me to use import { Cell, Workbook } from 'exceljs'; instead of the require but when I use that import, the library makes me use all of these parameters:

export interface Column {
header?: string | string[];
key?: string;

width?: number;

outlineLevel: number;
hidden: boolean;
/**
 * Styles applied to the column
 */
style: Partial<Style>;
values: ReadonlyArray<CellValue>;
readonly letter: string;
readonly number: number;
readonly worksheet: Worksheet;
readonly isCustomWidth: boolean;
readonly headers: string[];
readonly isDefault: boolean;
readonly headerCount: number;
/**
 * Below properties read from style
 */
border?: Partial<Borders>;
fill?: Fill;
numFmt?: string;
font?: Partial<Font>;
alignment?: Partial<Alignment>;
protection?: Partial<Protection>;
toString(): string
equivalentTo(other: Column): boolean
readonly collapsed: boolean;
/**
 * Iterate over all current cells in this column
 */
eachCell(callback: (cell: Cell, rowNumber: number) => void): void;
/**
 * Iterate over all current cells in this column including empty cells
 */
eachCell(opt: { includeEmpty: boolean }, callback: (cell: Cell, rowNumber: number) => void): void;
defn: any; //todo
}

And I am not sure of how implement the functions equivalentTo and eachCell(callback) but they're required in order to work. Any ideas? I've read all the documentation and I have not found any example or explanation or issue in the original github site. Thanks in advance.

READ ALSO
How to capture matching count value in an array?

How to capture matching count value in an array?

I have an array x which can have following values:

33
Js: Refresh and Acess Token logic [closed]

Js: Refresh and Acess Token logic [closed]

Want to improve this question? Update the question so it focuses on one problem only by editing this post

43
How to format data to correctly decrypt hex strings in CryptoJS

How to format data to correctly decrypt hex strings in CryptoJS

I have a TCP server that is receiving information via direct IPI am receiving this information encrypted in AES-128-CBC

50
How cancel Timeout inside object

How cancel Timeout inside object

I have the following code:

32