xlsx-extractor
Version:
Extract the colums/rows from XLSX file.
38 lines (37 loc) • 1.21 kB
TypeScript
/** Sheet values. */
export declare type Sheet = {
/** Number of the extract sheets. */
id: number;
/** Name of the sheet. */
name: string;
/** Cells of the sheet. Empty cell is stored is `""`. */
cells: string[][];
};
/**
* Extract and get an index of sheets.
* @param filePath Path of XMLS file.
* @returns Index of sheets (1 - Sheet count).
* @throws Failed to expand the XLSX file.
*/
export declare const getSheetCount: (filePath: string) => number;
/**
* Extract a sheet.
* @param filePath Path of XMLS file.
* @param index Index of sheet. Range of from 1 to XlsxExtractor.count.
* @return Sheet.
*/
export declare const extract: (filePath: string, index: number) => Promise<Sheet>;
/**
* Extract and get a specified range of sheets.
* @param filePath Path of XMLS file.
* @param begin Begin index (1 - Sheet count).
* @param end End index (1 - Sheet count).
* @returns Sheets.
*/
export declare const extractRange: (filePath: string, begin: number, end: number) => Promise<Sheet[]>;
/**
* Extract and get specified all of sheets.
* @param filePath Path of XMLS file.
* @returns Sheets.
*/
export declare const extractAll: (filePath: string) => Promise<Sheet[]>;