@cj-tech-master/excelts 1.4.5 → 1.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser/excelts.iife.js +454 -159
- package/dist/browser/excelts.iife.js.map +1 -1
- package/dist/browser/excelts.iife.min.js +28 -28
- package/dist/cjs/doc/anchor.js +25 -11
- package/dist/cjs/doc/cell.js +75 -43
- package/dist/cjs/doc/column.js +74 -22
- package/dist/cjs/doc/defined-names.js +53 -7
- package/dist/cjs/doc/image.js +11 -8
- package/dist/cjs/doc/range.js +64 -28
- package/dist/cjs/doc/row.js +72 -31
- package/dist/cjs/doc/table.js +3 -5
- package/dist/cjs/doc/workbook.js +30 -6
- package/dist/cjs/doc/worksheet.js +165 -41
- package/dist/cjs/utils/sheet-utils.js +3 -1
- package/dist/cjs/utils/unzip/extract.js +30 -82
- package/dist/cjs/utils/unzip/index.js +18 -2
- package/dist/cjs/utils/unzip/zip-parser.js +458 -0
- package/dist/esm/doc/anchor.js +25 -11
- package/dist/esm/doc/cell.js +75 -43
- package/dist/esm/doc/column.js +74 -22
- package/dist/esm/doc/defined-names.js +53 -7
- package/dist/esm/doc/image.js +11 -8
- package/dist/esm/doc/range.js +64 -28
- package/dist/esm/doc/row.js +72 -31
- package/dist/esm/doc/table.js +3 -5
- package/dist/esm/doc/workbook.js +30 -6
- package/dist/esm/doc/worksheet.js +165 -41
- package/dist/esm/utils/sheet-utils.js +3 -1
- package/dist/esm/utils/unzip/extract.js +28 -82
- package/dist/esm/utils/unzip/index.js +17 -2
- package/dist/esm/utils/unzip/zip-parser.js +451 -0
- package/dist/types/doc/anchor.d.ts +14 -7
- package/dist/types/doc/cell.d.ts +78 -37
- package/dist/types/doc/column.d.ts +72 -36
- package/dist/types/doc/defined-names.d.ts +11 -8
- package/dist/types/doc/image.d.ts +29 -12
- package/dist/types/doc/pivot-table.d.ts +1 -1
- package/dist/types/doc/range.d.ts +15 -4
- package/dist/types/doc/row.d.ts +78 -40
- package/dist/types/doc/table.d.ts +21 -36
- package/dist/types/doc/workbook.d.ts +54 -34
- package/dist/types/doc/worksheet.d.ts +255 -83
- package/dist/types/stream/xlsx/worksheet-reader.d.ts +3 -5
- package/dist/types/types.d.ts +86 -26
- package/dist/types/utils/col-cache.d.ts +11 -8
- package/dist/types/utils/unzip/extract.d.ts +16 -14
- package/dist/types/utils/unzip/index.d.ts +15 -1
- package/dist/types/utils/unzip/zip-parser.d.ts +92 -0
- package/package.json +1 -1
|
@@ -1,72 +1,108 @@
|
|
|
1
|
-
import type { Cell } from "./cell.js";
|
|
1
|
+
import type { Cell, CellValueType } from "./cell.js";
|
|
2
2
|
import type { Worksheet } from "./worksheet.js";
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
import type { Style, NumFmt, Font, Alignment, Protection, Borders, Fill } from "../types.js";
|
|
4
|
+
export interface ColumnDefn {
|
|
5
|
+
header?: string | string[];
|
|
5
6
|
key?: string;
|
|
6
7
|
width?: number;
|
|
7
8
|
outlineLevel?: number;
|
|
8
9
|
hidden?: boolean;
|
|
9
|
-
style?:
|
|
10
|
+
style?: Partial<Style>;
|
|
10
11
|
}
|
|
11
|
-
interface ColumnModel {
|
|
12
|
+
export interface ColumnModel {
|
|
12
13
|
min: number;
|
|
13
14
|
max: number;
|
|
14
15
|
width?: number;
|
|
15
|
-
style?:
|
|
16
|
+
style?: Partial<Style>;
|
|
16
17
|
isCustomWidth?: boolean;
|
|
17
18
|
hidden?: boolean;
|
|
18
19
|
outlineLevel?: number;
|
|
19
20
|
collapsed?: boolean;
|
|
20
21
|
}
|
|
22
|
+
/**
|
|
23
|
+
* Column defines the column properties for 1 column.
|
|
24
|
+
* This includes header rows, widths, key, (style), etc.
|
|
25
|
+
* Worksheet will condense the columns as appropriate during serialization
|
|
26
|
+
*/
|
|
21
27
|
declare class Column {
|
|
22
|
-
_worksheet
|
|
23
|
-
_number
|
|
24
|
-
_header
|
|
25
|
-
_key
|
|
28
|
+
private _worksheet;
|
|
29
|
+
private _number;
|
|
30
|
+
private _header;
|
|
31
|
+
private _key;
|
|
32
|
+
/** The width of the column */
|
|
26
33
|
width?: number;
|
|
27
|
-
_hidden
|
|
28
|
-
_outlineLevel
|
|
29
|
-
|
|
30
|
-
|
|
34
|
+
private _hidden;
|
|
35
|
+
private _outlineLevel;
|
|
36
|
+
/** Styles applied to the column */
|
|
37
|
+
style: Partial<Style>;
|
|
38
|
+
constructor(worksheet: Worksheet, number: number, defn?: ColumnDefn | false);
|
|
31
39
|
get number(): number;
|
|
32
|
-
get worksheet():
|
|
40
|
+
get worksheet(): Worksheet;
|
|
41
|
+
/**
|
|
42
|
+
* Column letter key
|
|
43
|
+
*/
|
|
33
44
|
get letter(): string;
|
|
34
45
|
get isCustomWidth(): boolean;
|
|
35
46
|
get defn(): ColumnDefn;
|
|
36
47
|
set defn(value: ColumnDefn | undefined);
|
|
37
|
-
get headers():
|
|
38
|
-
|
|
39
|
-
|
|
48
|
+
get headers(): string[];
|
|
49
|
+
/**
|
|
50
|
+
* Can be a string to set one row high header or an array to set multi-row high header
|
|
51
|
+
*/
|
|
52
|
+
get header(): string | string[] | undefined;
|
|
53
|
+
set header(value: string | string[] | undefined);
|
|
54
|
+
/**
|
|
55
|
+
* The name of the properties associated with this column in each row
|
|
56
|
+
*/
|
|
40
57
|
get key(): string | undefined;
|
|
41
58
|
set key(value: string | undefined);
|
|
59
|
+
/**
|
|
60
|
+
* Hides the column
|
|
61
|
+
*/
|
|
42
62
|
get hidden(): boolean;
|
|
43
63
|
set hidden(value: boolean);
|
|
64
|
+
/**
|
|
65
|
+
* Set an outline level for columns
|
|
66
|
+
*/
|
|
44
67
|
get outlineLevel(): number;
|
|
45
68
|
set outlineLevel(value: number | undefined);
|
|
69
|
+
/**
|
|
70
|
+
* Indicate the collapsed state based on outlineLevel
|
|
71
|
+
*/
|
|
46
72
|
get collapsed(): boolean;
|
|
47
73
|
toString(): string;
|
|
48
74
|
equivalentTo(other: Column): boolean;
|
|
75
|
+
equivalentToModel(model: ColumnModel): boolean;
|
|
49
76
|
get isDefault(): boolean;
|
|
50
77
|
get headerCount(): number;
|
|
51
|
-
|
|
78
|
+
/**
|
|
79
|
+
* Iterate over all current cells in this column
|
|
80
|
+
*/
|
|
81
|
+
eachCell(callback: (cell: Cell, rowNumber: number) => void): void;
|
|
82
|
+
/**
|
|
83
|
+
* Iterate over all current cells in this column including empty cells
|
|
84
|
+
*/
|
|
85
|
+
eachCell(opt: {
|
|
52
86
|
includeEmpty?: boolean;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
get
|
|
58
|
-
set
|
|
59
|
-
get
|
|
60
|
-
set
|
|
61
|
-
get
|
|
62
|
-
set
|
|
63
|
-
get
|
|
64
|
-
set
|
|
65
|
-
get
|
|
66
|
-
set
|
|
67
|
-
get
|
|
68
|
-
set
|
|
87
|
+
}, callback: (cell: Cell, rowNumber: number) => void): void;
|
|
88
|
+
/**
|
|
89
|
+
* The cell values in the column
|
|
90
|
+
*/
|
|
91
|
+
get values(): CellValueType[];
|
|
92
|
+
set values(v: CellValueType[]);
|
|
93
|
+
get numFmt(): string | NumFmt | undefined;
|
|
94
|
+
set numFmt(value: string | undefined);
|
|
95
|
+
get font(): Partial<Font> | undefined;
|
|
96
|
+
set font(value: Partial<Font> | undefined);
|
|
97
|
+
get alignment(): Partial<Alignment> | undefined;
|
|
98
|
+
set alignment(value: Partial<Alignment> | undefined);
|
|
99
|
+
get protection(): Partial<Protection> | undefined;
|
|
100
|
+
set protection(value: Partial<Protection> | undefined);
|
|
101
|
+
get border(): Partial<Borders> | undefined;
|
|
102
|
+
set border(value: Partial<Borders> | undefined);
|
|
103
|
+
get fill(): Fill | undefined;
|
|
104
|
+
set fill(value: Fill | undefined);
|
|
69
105
|
static toModel(columns: Column[]): ColumnModel[] | undefined;
|
|
70
|
-
static fromModel(worksheet:
|
|
106
|
+
static fromModel(worksheet: Worksheet, cols: ColumnModel[]): Column[] | null;
|
|
71
107
|
}
|
|
72
108
|
export { Column };
|
|
@@ -1,12 +1,15 @@
|
|
|
1
|
+
import { type DecodedRange } from "../utils/col-cache.js";
|
|
1
2
|
import { CellMatrix } from "../utils/cell-matrix.js";
|
|
2
3
|
import { Range } from "./range.js";
|
|
3
|
-
|
|
4
|
+
import type { Address } from "../types.js";
|
|
5
|
+
interface DefinedNameCell {
|
|
4
6
|
sheetName?: string;
|
|
5
7
|
address: string;
|
|
6
8
|
row: number;
|
|
7
9
|
col: number;
|
|
8
10
|
mark?: boolean;
|
|
9
11
|
}
|
|
12
|
+
type CellLocation = Address | DecodedRange;
|
|
10
13
|
interface DefinedNameModel {
|
|
11
14
|
name: string;
|
|
12
15
|
ranges: string[];
|
|
@@ -16,14 +19,14 @@ declare class DefinedNames {
|
|
|
16
19
|
constructor();
|
|
17
20
|
getMatrix(name: string): CellMatrix;
|
|
18
21
|
add(locStr: string, name: string): void;
|
|
19
|
-
addEx(location:
|
|
22
|
+
addEx(location: CellLocation, name: string): void;
|
|
20
23
|
remove(locStr: string, name: string): void;
|
|
21
|
-
removeEx(location:
|
|
22
|
-
removeAllNames(location:
|
|
23
|
-
forEach(callback: (name: string, cell:
|
|
24
|
+
removeEx(location: CellLocation, name: string): void;
|
|
25
|
+
removeAllNames(location: CellLocation): void;
|
|
26
|
+
forEach(callback: (name: string, cell: DefinedNameCell) => void): void;
|
|
24
27
|
getNames(addressStr: string): string[];
|
|
25
|
-
getNamesEx(address:
|
|
26
|
-
_explore(matrix: CellMatrix, cell:
|
|
28
|
+
getNamesEx(address: Address): string[];
|
|
29
|
+
_explore(matrix: CellMatrix, cell: DefinedNameCell): Range;
|
|
27
30
|
getRanges(name: string, matrix?: CellMatrix): DefinedNameModel;
|
|
28
31
|
normaliseMatrix(matrix: CellMatrix, sheetName: string): void;
|
|
29
32
|
spliceRows(sheetName: string, start: number, numDelete: number, numInsert: number): void;
|
|
@@ -31,4 +34,4 @@ declare class DefinedNames {
|
|
|
31
34
|
get model(): DefinedNameModel[];
|
|
32
35
|
set model(value: DefinedNameModel[]);
|
|
33
36
|
}
|
|
34
|
-
export { DefinedNames };
|
|
37
|
+
export { DefinedNames, type DefinedNameModel };
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import { Anchor } from "./anchor.js";
|
|
1
|
+
import { Anchor, type AnchorModel } from "./anchor.js";
|
|
2
|
+
import type { Worksheet } from "./worksheet.js";
|
|
2
3
|
interface ImageHyperlinks {
|
|
3
|
-
|
|
4
|
+
hyperlink?: string;
|
|
5
|
+
tooltip?: string;
|
|
4
6
|
}
|
|
5
7
|
interface ImageExt {
|
|
6
8
|
width?: number;
|
|
@@ -17,31 +19,46 @@ interface BackgroundModel {
|
|
|
17
19
|
type: "background";
|
|
18
20
|
imageId: string;
|
|
19
21
|
}
|
|
22
|
+
interface ImageRangeModel {
|
|
23
|
+
tl: AnchorModel;
|
|
24
|
+
br?: AnchorModel;
|
|
25
|
+
ext?: ImageExt;
|
|
26
|
+
editAs?: string;
|
|
27
|
+
}
|
|
20
28
|
interface ImageModel {
|
|
21
29
|
type: "image";
|
|
22
30
|
imageId: string;
|
|
23
31
|
hyperlinks?: ImageHyperlinks;
|
|
24
|
-
range:
|
|
25
|
-
tl: any;
|
|
26
|
-
br?: any;
|
|
27
|
-
ext?: ImageExt;
|
|
28
|
-
editAs?: string;
|
|
29
|
-
};
|
|
32
|
+
range: ImageRangeModel;
|
|
30
33
|
}
|
|
31
34
|
type Model = BackgroundModel | ImageModel;
|
|
35
|
+
type ImageModelInput = ModelInput;
|
|
36
|
+
interface RangeInput {
|
|
37
|
+
tl?: AnchorModel | {
|
|
38
|
+
col: number;
|
|
39
|
+
row: number;
|
|
40
|
+
} | string;
|
|
41
|
+
br?: AnchorModel | {
|
|
42
|
+
col: number;
|
|
43
|
+
row: number;
|
|
44
|
+
} | string;
|
|
45
|
+
ext?: ImageExt;
|
|
46
|
+
editAs?: string;
|
|
47
|
+
hyperlinks?: ImageHyperlinks;
|
|
48
|
+
}
|
|
32
49
|
interface ModelInput {
|
|
33
50
|
type: string;
|
|
34
51
|
imageId: string;
|
|
35
|
-
range?: string |
|
|
52
|
+
range?: string | RangeInput | ImageRangeModel;
|
|
36
53
|
hyperlinks?: ImageHyperlinks;
|
|
37
54
|
}
|
|
38
55
|
declare class Image {
|
|
39
|
-
worksheet:
|
|
56
|
+
worksheet: Worksheet;
|
|
40
57
|
type?: string;
|
|
41
58
|
imageId?: string;
|
|
42
59
|
range?: ImageRange;
|
|
43
|
-
constructor(worksheet:
|
|
60
|
+
constructor(worksheet: Worksheet, model?: ModelInput);
|
|
44
61
|
get model(): Model;
|
|
45
62
|
set model({ type, imageId, range, hyperlinks }: ModelInput);
|
|
46
63
|
}
|
|
47
|
-
export { Image };
|
|
64
|
+
export { Image, type Model as ImageModel, type ImageModelInput };
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { Address } from "../types.js";
|
|
1
2
|
interface RangeModel {
|
|
2
3
|
top: number;
|
|
3
4
|
left: number;
|
|
@@ -13,11 +14,21 @@ interface RowWithDimensions {
|
|
|
13
14
|
number: number;
|
|
14
15
|
dimensions?: RowDimensions;
|
|
15
16
|
}
|
|
17
|
+
export type RangeInput = Range | RangeModel | string | number | RangeInput[];
|
|
16
18
|
declare class Range {
|
|
17
19
|
model: RangeModel;
|
|
18
|
-
constructor(
|
|
19
|
-
|
|
20
|
-
|
|
20
|
+
constructor();
|
|
21
|
+
constructor(range: Range);
|
|
22
|
+
constructor(model: RangeModel);
|
|
23
|
+
constructor(rangeString: string);
|
|
24
|
+
constructor(args: RangeInput[]);
|
|
25
|
+
constructor(tl: string, br: string);
|
|
26
|
+
constructor(tl: string, br: string, sheetName: string);
|
|
27
|
+
constructor(top: number, left: number, bottom: number, right: number);
|
|
28
|
+
constructor(top: number, left: number, bottom: number, right: number, sheetName: string);
|
|
29
|
+
setTLBR(tl: string, br: string, sheetName?: string): void;
|
|
30
|
+
setTLBR(top: number, left: number, bottom: number, right: number, sheetName?: string): void;
|
|
31
|
+
private decode;
|
|
21
32
|
get top(): number;
|
|
22
33
|
set top(value: number);
|
|
23
34
|
get left(): number;
|
|
@@ -44,7 +55,7 @@ declare class Range {
|
|
|
44
55
|
toString(): string;
|
|
45
56
|
intersects(other: Range): boolean;
|
|
46
57
|
contains(addressStr: string): boolean;
|
|
47
|
-
containsEx(address:
|
|
58
|
+
containsEx(address: Address): boolean;
|
|
48
59
|
forEachAddress(cb: (address: string, row: number, col: number) => void): void;
|
|
49
60
|
}
|
|
50
61
|
export { Range };
|
package/dist/types/doc/row.d.ts
CHANGED
|
@@ -1,70 +1,108 @@
|
|
|
1
|
-
import { Cell } from "./cell.js";
|
|
1
|
+
import { Cell, type CellModel, type CellAddress } from "./cell.js";
|
|
2
2
|
import type { Worksheet } from "./worksheet.js";
|
|
3
|
-
|
|
4
|
-
address: string;
|
|
5
|
-
row: number;
|
|
6
|
-
col: number;
|
|
7
|
-
$col$row?: string;
|
|
8
|
-
}
|
|
3
|
+
import type { Style, NumFmt, Font, Alignment, Protection, Borders, Fill, CellValue, RowValues } from "../types.js";
|
|
9
4
|
interface RowDimensions {
|
|
10
5
|
min: number;
|
|
11
6
|
max: number;
|
|
12
7
|
}
|
|
13
|
-
interface RowModel {
|
|
14
|
-
cells:
|
|
8
|
+
export interface RowModel {
|
|
9
|
+
cells: CellModel[];
|
|
15
10
|
number: number;
|
|
16
11
|
min: number;
|
|
17
12
|
max: number;
|
|
18
13
|
height?: number;
|
|
19
|
-
style:
|
|
14
|
+
style: Partial<Style>;
|
|
20
15
|
hidden: boolean;
|
|
21
16
|
outlineLevel: number;
|
|
22
17
|
collapsed: boolean;
|
|
23
18
|
}
|
|
24
|
-
interface EachCellOptions {
|
|
25
|
-
includeEmpty?: boolean;
|
|
26
|
-
}
|
|
27
19
|
declare class Row {
|
|
28
|
-
_worksheet
|
|
29
|
-
_number
|
|
30
|
-
_cells
|
|
31
|
-
style:
|
|
32
|
-
_hidden
|
|
33
|
-
_outlineLevel
|
|
20
|
+
private _worksheet;
|
|
21
|
+
private _number;
|
|
22
|
+
private _cells;
|
|
23
|
+
style: Partial<Style>;
|
|
24
|
+
private _hidden?;
|
|
25
|
+
private _outlineLevel?;
|
|
34
26
|
height?: number;
|
|
35
|
-
constructor(worksheet:
|
|
27
|
+
constructor(worksheet: Worksheet, number: number);
|
|
28
|
+
/**
|
|
29
|
+
* The row number
|
|
30
|
+
*/
|
|
36
31
|
get number(): number;
|
|
32
|
+
/**
|
|
33
|
+
* The worksheet that contains this row
|
|
34
|
+
*/
|
|
37
35
|
get worksheet(): Worksheet;
|
|
36
|
+
/**
|
|
37
|
+
* Commit a completed row to stream.
|
|
38
|
+
* Inform Streaming Writer that this row (and all rows before it) are complete
|
|
39
|
+
* and ready to write. Has no effect on Worksheet document.
|
|
40
|
+
*/
|
|
38
41
|
commit(): void;
|
|
42
|
+
/**
|
|
43
|
+
* Helps GC by breaking cyclic references
|
|
44
|
+
*/
|
|
39
45
|
destroy(): void;
|
|
40
46
|
findCell(colNumber: number): Cell | undefined;
|
|
41
47
|
getCellEx(address: CellAddress): Cell;
|
|
48
|
+
/**
|
|
49
|
+
* Get cell by number, column letter or column key
|
|
50
|
+
*/
|
|
42
51
|
getCell(col: string | number): Cell;
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
52
|
+
/**
|
|
53
|
+
* Cut one or more cells (cells to the right are shifted left)
|
|
54
|
+
*
|
|
55
|
+
* Note: this operation will not affect other rows
|
|
56
|
+
*/
|
|
57
|
+
splice(start: number, count: number, ...inserts: CellValue[]): void;
|
|
58
|
+
/**
|
|
59
|
+
* Iterate over all non-null cells in a row
|
|
60
|
+
*/
|
|
61
|
+
eachCell(callback: (cell: Cell, colNumber: number) => void): void;
|
|
62
|
+
/**
|
|
63
|
+
* Iterate over all cells in a row (including empty cells)
|
|
64
|
+
*/
|
|
65
|
+
eachCell(opt: {
|
|
66
|
+
includeEmpty?: boolean;
|
|
67
|
+
}, callback: (cell: Cell, colNumber: number) => void): void;
|
|
46
68
|
addPageBreak(lft?: number, rght?: number): void;
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
69
|
+
/**
|
|
70
|
+
* Get a row as a sparse array
|
|
71
|
+
*/
|
|
72
|
+
get values(): CellValue[];
|
|
73
|
+
/**
|
|
74
|
+
* Set the values by contiguous or sparse array, or by key'd object literal
|
|
75
|
+
*/
|
|
76
|
+
set values(value: RowValues);
|
|
77
|
+
/**
|
|
78
|
+
* Returns true if the row includes at least one cell with a value
|
|
79
|
+
*/
|
|
51
80
|
get hasValues(): boolean;
|
|
81
|
+
/**
|
|
82
|
+
* Number of cells including empty ones
|
|
83
|
+
*/
|
|
52
84
|
get cellCount(): number;
|
|
85
|
+
/**
|
|
86
|
+
* Number of non-empty cells
|
|
87
|
+
*/
|
|
53
88
|
get actualCellCount(): number;
|
|
89
|
+
/**
|
|
90
|
+
* Get the min and max column number for the non-null cells in this row or null
|
|
91
|
+
*/
|
|
54
92
|
get dimensions(): RowDimensions | null;
|
|
55
|
-
_applyStyle
|
|
56
|
-
get numFmt():
|
|
57
|
-
set numFmt(value:
|
|
58
|
-
get font():
|
|
59
|
-
set font(value:
|
|
60
|
-
get alignment():
|
|
61
|
-
set alignment(value:
|
|
62
|
-
get protection():
|
|
63
|
-
set protection(value:
|
|
64
|
-
get border():
|
|
65
|
-
set border(value:
|
|
66
|
-
get fill():
|
|
67
|
-
set fill(value:
|
|
93
|
+
private _applyStyle;
|
|
94
|
+
get numFmt(): string | NumFmt | undefined;
|
|
95
|
+
set numFmt(value: string | undefined);
|
|
96
|
+
get font(): Partial<Font> | undefined;
|
|
97
|
+
set font(value: Partial<Font> | undefined);
|
|
98
|
+
get alignment(): Partial<Alignment> | undefined;
|
|
99
|
+
set alignment(value: Partial<Alignment> | undefined);
|
|
100
|
+
get protection(): Partial<Protection> | undefined;
|
|
101
|
+
set protection(value: Partial<Protection> | undefined);
|
|
102
|
+
get border(): Partial<Borders> | undefined;
|
|
103
|
+
set border(value: Partial<Borders> | undefined);
|
|
104
|
+
get fill(): Fill | undefined;
|
|
105
|
+
set fill(value: Fill | undefined);
|
|
68
106
|
get hidden(): boolean;
|
|
69
107
|
set hidden(value: boolean);
|
|
70
108
|
get outlineLevel(): number;
|
|
@@ -1,75 +1,60 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
filterButton?: boolean;
|
|
4
|
-
style?: any;
|
|
5
|
-
totalsRowLabel?: string;
|
|
6
|
-
totalsRowFunction?: string;
|
|
7
|
-
totalsRowResult?: any;
|
|
8
|
-
totalsRowFormula?: string;
|
|
9
|
-
}
|
|
10
|
-
interface TableStyle {
|
|
11
|
-
theme?: string;
|
|
12
|
-
name?: string;
|
|
13
|
-
showFirstColumn?: boolean;
|
|
14
|
-
showLastColumn?: boolean;
|
|
15
|
-
showRowStripes?: boolean;
|
|
16
|
-
showColumnStripes?: boolean;
|
|
17
|
-
}
|
|
1
|
+
import type { Address, CellFormulaValue, CellValue, Style, TableColumnProperties, TableStyleProperties } from "../types.js";
|
|
2
|
+
import type { Worksheet } from "./worksheet.js";
|
|
18
3
|
interface TableModel {
|
|
19
4
|
ref: string;
|
|
20
5
|
name: string;
|
|
21
6
|
displayName?: string;
|
|
22
|
-
columns:
|
|
23
|
-
rows:
|
|
7
|
+
columns: TableColumnProperties[];
|
|
8
|
+
rows: CellValue[][];
|
|
24
9
|
headerRow?: boolean;
|
|
25
10
|
totalsRow?: boolean;
|
|
26
|
-
style
|
|
27
|
-
tl?:
|
|
11
|
+
style?: TableStyleProperties;
|
|
12
|
+
tl?: Address;
|
|
28
13
|
autoFilterRef?: string;
|
|
29
14
|
tableRef?: string;
|
|
30
15
|
}
|
|
31
16
|
declare class Column {
|
|
32
17
|
table: Table;
|
|
33
|
-
column:
|
|
18
|
+
column: TableColumnProperties;
|
|
34
19
|
index: number;
|
|
35
|
-
constructor(table: Table, column:
|
|
20
|
+
constructor(table: Table, column: TableColumnProperties, index: number);
|
|
36
21
|
private _set;
|
|
37
22
|
get name(): string;
|
|
38
23
|
set name(value: string);
|
|
39
24
|
get filterButton(): boolean | undefined;
|
|
40
25
|
set filterButton(value: boolean | undefined);
|
|
41
|
-
get style():
|
|
42
|
-
set style(value:
|
|
26
|
+
get style(): Partial<Style> | undefined;
|
|
27
|
+
set style(value: Partial<Style> | undefined);
|
|
43
28
|
get totalsRowLabel(): string | undefined;
|
|
44
29
|
set totalsRowLabel(value: string | undefined);
|
|
45
|
-
get totalsRowFunction():
|
|
46
|
-
set totalsRowFunction(value:
|
|
47
|
-
get totalsRowResult():
|
|
48
|
-
set totalsRowResult(value:
|
|
30
|
+
get totalsRowFunction(): TableColumnProperties["totalsRowFunction"];
|
|
31
|
+
set totalsRowFunction(value: TableColumnProperties["totalsRowFunction"]);
|
|
32
|
+
get totalsRowResult(): CellValue;
|
|
33
|
+
set totalsRowResult(value: CellFormulaValue["result"]);
|
|
49
34
|
get totalsRowFormula(): string | undefined;
|
|
50
35
|
set totalsRowFormula(value: string | undefined);
|
|
51
36
|
}
|
|
52
37
|
declare class Table {
|
|
53
|
-
worksheet:
|
|
38
|
+
worksheet: Worksheet;
|
|
54
39
|
table: TableModel;
|
|
55
40
|
private _cache?;
|
|
56
|
-
constructor(worksheet:
|
|
57
|
-
getFormula(column:
|
|
41
|
+
constructor(worksheet: Worksheet, table?: TableModel);
|
|
42
|
+
getFormula(column: TableColumnProperties): string | null;
|
|
58
43
|
get width(): number;
|
|
59
44
|
get height(): number;
|
|
60
45
|
get filterHeight(): number;
|
|
61
46
|
get tableHeight(): number;
|
|
62
47
|
validate(): void;
|
|
63
48
|
store(): void;
|
|
64
|
-
load(worksheet:
|
|
49
|
+
load(worksheet: Worksheet): void;
|
|
65
50
|
get model(): TableModel;
|
|
66
51
|
set model(value: TableModel);
|
|
67
52
|
cacheState(): void;
|
|
68
53
|
commit(): void;
|
|
69
|
-
addRow(values:
|
|
54
|
+
addRow(values: CellValue[], rowNumber?: number): void;
|
|
70
55
|
removeRows(rowIndex: number, count?: number): void;
|
|
71
56
|
getColumn(colIndex: number): Column;
|
|
72
|
-
addColumn(column:
|
|
57
|
+
addColumn(column: TableColumnProperties, values: CellValue[], colIndex?: number): void;
|
|
73
58
|
removeColumns(colIndex: number, count?: number): void;
|
|
74
59
|
private _assign;
|
|
75
60
|
get ref(): string;
|
|
@@ -93,4 +78,4 @@ declare class Table {
|
|
|
93
78
|
get showColumnStripes(): boolean | undefined;
|
|
94
79
|
set showColumnStripes(value: boolean | undefined);
|
|
95
80
|
}
|
|
96
|
-
export { Table };
|
|
81
|
+
export { Table, type TableModel };
|