xlsx: Add properties of IWorkSheet.

This commit is contained in:
Wolfgang Faust 2017-05-12 17:46:24 -04:00
parent d0a59ae283
commit 29ed597df6

147
index.d.ts vendored
View File

@ -1,6 +1,6 @@
// Type definitions for xlsx
// Project: https://github.com/SheetJS/js-xlsx
// Definitions by: themauveavenger <https://github.com/themauveavenger/>
// Definitions by: themauveavenger <https://github.com/themauveavenger/>, Wolfgang Faust <https://github.com/wolfgang42>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/** Attempts to read filename and parse */
@ -173,11 +173,154 @@ export interface IWorkBook {
Props: IProperties;
}
export interface IColInfo {
/**
* Excel's "Max Digit Width" unit, always integral
*/
MDW?: number;
/**
* width in Excel's "Max Digit Width", width*256 is integral
*/
width: number;
/**
* width in screen pixels
*/
wpx?: number;
/**
* intermediate character calculation
*/
wch?: number;
/**
* if true, the column is hidden
*/
hidden?: boolean;
}
export interface IRowInfo {
/**
* height in screen pixels
*/
hpx?: number;
/**
* height in points
*/
hpt?: number;
/**
* if true, the column is hidden
*/
hidden?: boolean;
}
/**
* Write sheet protection properties.
*/
export interface IProtectInfo {
/**
* The password for formats that support password-protected sheets
* (XLSX/XLSB/XLS). The writer uses the XOR obfuscation method.
*/
password?: string;
/**
* Select locked cells
* @default: true
*/
selectLockedCells?: boolean;
/**
* Select unlocked cells
* @default: true
*/
selectUnlockedCells?: boolean;
/**
* Format cells
* @default: false
*/
formatCells?: boolean;
/**
* Format columns
* @default: false
*/
formatColumns?: boolean;
/**
* Format rows
* @default: false
*/
formatRows?: boolean;
/**
* Insert columns
* @default: false
*/
insertColumns?: boolean;
/**
* Insert rows
* @default: false
*/
insertRows?: boolean;
/**
* Insert hyperlinks
* @default: false
*/
insertHyperlinks?: boolean;
/**
* Delete columns
* @default: false
*/
deleteColumns?: boolean;
/**
* Delete rows
* @default: false
*/
deleteRows?: boolean;
/**
* Sort
* @default: false
*/
sort?: boolean;
/**
* Filter
* @default: false
*/
autoFilter?: boolean;
/**
* Use PivotTable reports
* @default: false
*/
pivotTables?: boolean;
/**
* Edit objects
* @default: true
*/
objects?: boolean;
/**
* Edit scenarios
* @default: true
*/
scenarios?: boolean;
}
/**
* object representing any sheet (worksheet or chartsheet)
*/
export interface ISheet {
'!ref'?: string;
'!margins'?: {
left: number,
right: number,
top: number,
bottom: number,
header: number,
footer: number,
};
}
/**
* object representing the worksheet
*/
export interface IWorkSheet {
export interface IWorkSheet extends ISheet {
[cell: string]: IWorkSheetCell | any;
'!cols'?: IColInfo[];
'!rows'?: IRowInfo[];
'!merges'?: IRange[];
'!protect'?: IProtectInfo;
'!autofilter'?: {ref: string};
}
export interface IWorkSheetCell {