UNPKG

920 BTypeScriptView Raw
1import Base from './base';
2import Row from './row';
3import { OneDArray, TCell, TwoDArray } from './types';
4declare class Tabular extends Base {
5 private _rows;
6 private _length;
7 constructor(rows?: Row[] | Row);
8 get rows(): Row[];
9 set rows(rows: Row[]);
10 get length(): number;
11 set length(len: number);
12 toArray(): TCell[][];
13 /**
14 * Creates a new Tabular from an array of Row(s)
15 * This method generates a new ID for the Tabular and all nested elements
16 *
17 * @param rows
18 * @returns Tabular
19 */
20 static fromRows(rows: Row[]): Tabular;
21 /**
22 * Creates a new Tabular from a 2D array
23 * This method generates a new ID for the Tabular and all nested elements
24 *
25 * @param data
26 * @returns Tabular
27 */
28 static fromArray<T extends TCell>(data: OneDArray<T> | TwoDArray<T>): Tabular;
29}
30export default Tabular;