forked from sheetjs/sheetjs
xlsx: Fix whitespace lints.
This commit is contained in:
parent
bf73d62903
commit
0fb38af783
20
index.d.ts
vendored
20
index.d.ts
vendored
@ -324,9 +324,9 @@ export interface IWorkSheet extends ISheet {
|
||||
}
|
||||
|
||||
/**
|
||||
* The Excel data type for a cell.
|
||||
* b Boolean, n Number, e error, s String, d Date
|
||||
*/
|
||||
* The Excel data type for a cell.
|
||||
* b Boolean, n Number, e error, s String, d Date
|
||||
*/
|
||||
export type ExcelDataType = 'b' | 'n' | 'e' | 's' | 'd';
|
||||
|
||||
export interface IWorkSheetCell {
|
||||
@ -341,9 +341,9 @@ export interface IWorkSheetCell {
|
||||
w?: string;
|
||||
|
||||
/**
|
||||
* The Excel Data Type of the cell.
|
||||
* b Boolean, n Number, e error, s String, d Date
|
||||
*/
|
||||
* The Excel Data Type of the cell.
|
||||
* b Boolean, n Number, e error, s String, d Date
|
||||
*/
|
||||
t: ExcelDataType;
|
||||
|
||||
/**
|
||||
@ -403,18 +403,18 @@ export interface IRange {
|
||||
|
||||
export interface IUtils {
|
||||
/** converts an array of arrays of JS data to a worksheet. */
|
||||
aoa_to_sheet<T>(data: T[], opts?:any): IWorkSheet;
|
||||
aoa_to_sheet<T>(data: T[], opts?: any): IWorkSheet;
|
||||
|
||||
/** Converts a worksheet object to an array of JSON objects */
|
||||
sheet_to_json<T>(worksheet:IWorkSheet, opts?: {
|
||||
sheet_to_json<T>(worksheet: IWorkSheet, opts?: {
|
||||
raw?: boolean;
|
||||
range?: any;
|
||||
header?: "A"|number|string[];
|
||||
}):T[];
|
||||
}): T[];
|
||||
/** Generates delimiter-separated-values output */
|
||||
sheet_to_csv(worksheet: IWorkSheet, options?: { FS: string, RS: string }): string;
|
||||
/** Generates a list of the formulae (with value fallbacks) */
|
||||
sheet_to_formulae(worksheet: IWorkSheet):any;
|
||||
sheet_to_formulae(worksheet: IWorkSheet): any;
|
||||
|
||||
/** Converts 0-indexed cell address to A1 form */
|
||||
encode_cell(cell: ICell): string;
|
||||
|
1
tslint.json
Normal file
1
tslint.json
Normal file
@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
@ -1,8 +1,7 @@
|
||||
|
||||
import xlsx = require('xlsx');
|
||||
|
||||
var options:xlsx.IParsingOptions = {
|
||||
cellDates:true
|
||||
var options: xlsx.IParsingOptions = {
|
||||
cellDates: true
|
||||
};
|
||||
|
||||
var workbook = xlsx.readFile('test.xlsx', options);
|
||||
@ -10,17 +9,17 @@ var otherworkbook = xlsx.readFile('test.xlsx', {type: 'file'});
|
||||
|
||||
console.log(workbook.Props.Author);
|
||||
|
||||
var firstsheet:string = workbook.SheetNames[0];
|
||||
var firstsheet: string = workbook.SheetNames[0];
|
||||
|
||||
var firstworksheet = workbook.Sheets[firstsheet];
|
||||
|
||||
console.log(firstworksheet["A1"]);
|
||||
|
||||
interface tester {
|
||||
name:string;
|
||||
name: string;
|
||||
age: number;
|
||||
}
|
||||
|
||||
var jsonvalues:tester[] = xlsx.utils.sheet_to_json<tester>(firstworksheet);
|
||||
var jsonvalues: tester[] = xlsx.utils.sheet_to_json<tester>(firstworksheet);
|
||||
var csv = xlsx.utils.sheet_to_csv(firstworksheet);
|
||||
var formulae = xlsx.utils.sheet_to_formulae(firstworksheet);
|
||||
|
Loading…
Reference in New Issue
Block a user