logisheets 0.7.0 → 0.8.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/src/api/block_manager.d.ts +21 -0
- package/dist/src/api/block_manager.js +35 -0
- package/dist/src/api/calculator.d.ts +19 -0
- package/dist/src/api/calculator.js +46 -0
- package/dist/src/api/cell.d.ts +28 -0
- package/dist/src/api/cell.js +52 -0
- package/dist/src/api/index.d.ts +5 -0
- package/dist/src/api/index.js +3 -0
- package/dist/src/api/utils.d.ts +3 -1
- package/dist/src/api/utils.js +5 -0
- package/dist/src/api/workbook.d.ts +30 -8
- package/dist/src/api/workbook.js +161 -21
- package/dist/src/api/worksheet.d.ts +20 -12
- package/dist/src/api/worksheet.js +58 -20
- package/dist/src/bindings/alignment.d.ts +6 -0
- package/dist/src/bindings/alignment.js +1 -0
- package/dist/src/bindings/block_cell_id.d.ts +1 -1
- package/dist/src/bindings/cell_clear.d.ts +5 -0
- package/dist/src/bindings/cell_clear.js +2 -0
- package/dist/src/bindings/cell_format_brush.d.ts +10 -0
- package/dist/src/bindings/cell_format_brush.js +2 -0
- package/dist/src/bindings/cell_id.d.ts +5 -3
- package/dist/src/bindings/cell_info.d.ts +1 -0
- package/dist/src/bindings/cell_position.d.ts +4 -0
- package/dist/src/bindings/cell_position.js +2 -0
- package/dist/src/bindings/cell_style_update.d.ts +7 -0
- package/dist/src/bindings/cell_style_update.js +1 -0
- package/dist/src/bindings/display_window.d.ts +14 -0
- package/dist/src/bindings/display_window.js +1 -0
- package/dist/src/bindings/display_window_request.d.ts +7 -0
- package/dist/src/bindings/display_window_request.js +2 -0
- package/dist/src/bindings/display_window_with_start_point.d.ts +6 -0
- package/dist/src/bindings/display_window_with_start_point.js +1 -0
- package/dist/src/bindings/edit_action.d.ts +1 -1
- package/dist/src/bindings/edit_payload.d.ts +27 -3
- package/dist/src/bindings/ephemeral_cell_input.d.ts +5 -0
- package/dist/src/bindings/ephemeral_cell_input.js +2 -0
- package/dist/src/bindings/ephemeral_cell_style_update.d.ts +6 -0
- package/dist/src/bindings/ephemeral_cell_style_update.js +1 -0
- package/dist/src/bindings/fill.d.ts +1 -1
- package/dist/src/bindings/horizontal_alignment.d.ts +1 -0
- package/dist/src/bindings/horizontal_alignment.js +2 -0
- package/dist/src/bindings/index.d.ts +19 -17
- package/dist/src/bindings/index.js +19 -17
- package/dist/src/bindings/line_format_brush.d.ts +9 -0
- package/dist/src/bindings/line_format_brush.js +2 -0
- package/dist/src/bindings/line_style_update.d.ts +8 -0
- package/dist/src/bindings/line_style_update.js +1 -0
- package/dist/src/bindings/merge_cell.d.ts +4 -4
- package/dist/src/bindings/merge_cells.d.ts +7 -0
- package/dist/src/bindings/merge_cells.js +2 -0
- package/dist/src/bindings/msg_sequencer_message.d.ts +1 -1
- package/dist/src/bindings/msg_user_message.d.ts +1 -1
- package/dist/src/bindings/payloads_action.d.ts +1 -0
- package/dist/src/bindings/sheet_dimension.d.ts +6 -0
- package/dist/src/bindings/sheet_dimension.js +2 -0
- package/dist/src/bindings/sheet_info.d.ts +6 -0
- package/dist/src/bindings/sheet_info.js +2 -0
- package/dist/src/bindings/split_merged_cells.d.ts +5 -0
- package/dist/src/bindings/split_merged_cells.js +2 -0
- package/dist/src/bindings/st_border_style.d.ts +1 -1
- package/dist/src/bindings/st_font_scheme.d.ts +1 -1
- package/dist/src/bindings/st_gradient_type.d.ts +1 -1
- package/dist/src/bindings/st_pattern_type.d.ts +1 -1
- package/dist/src/bindings/st_underline_values.d.ts +1 -1
- package/dist/src/bindings/st_vertical_align_run.d.ts +1 -1
- package/dist/src/bindings/status_code.d.ts +3 -2
- package/dist/src/bindings/status_code.js +0 -1
- package/dist/src/bindings/style.d.ts +2 -2
- package/dist/src/bindings/style_update_type.d.ts +2 -0
- package/dist/src/bindings/value.d.ts +1 -1
- package/dist/src/bindings/vertical_alignment.d.ts +1 -0
- package/dist/src/bindings/vertical_alignment.js +2 -0
- package/dist/src/bindings/workbook_update_type.d.ts +1 -0
- package/dist/src/bindings/workbook_update_type.js +2 -0
- package/dist/src/client.d.ts +82 -0
- package/dist/src/client.js +1 -0
- package/dist/src/index.d.ts +2 -1
- package/dist/src/index.js +1 -0
- package/dist/src/payloads/cell_clear.d.ts +15 -0
- package/dist/src/payloads/cell_clear.js +31 -0
- package/dist/src/payloads/cell_format_brush.d.ts +30 -0
- package/dist/src/payloads/cell_format_brush.js +71 -0
- package/dist/src/payloads/index.d.ts +28 -6
- package/dist/src/payloads/index.js +14 -3
- package/dist/src/payloads/line_format_brush.d.ts +27 -0
- package/dist/src/payloads/line_format_brush.js +63 -0
- package/dist/src/payloads/merge_cells.d.ts +21 -0
- package/dist/src/payloads/merge_cells.js +47 -0
- package/dist/src/payloads/set_cell_alignment.d.ts +19 -0
- package/dist/src/payloads/set_cell_alignment.js +39 -0
- package/dist/src/payloads/set_cell_border.d.ts +49 -0
- package/dist/src/payloads/set_cell_border.js +97 -0
- package/dist/src/payloads/set_cell_font.d.ts +46 -0
- package/dist/src/payloads/set_cell_font.js +91 -0
- package/dist/src/payloads/set_cell_pattern_fill.d.ts +25 -0
- package/dist/src/payloads/set_cell_pattern_fill.js +49 -0
- package/dist/src/payloads/set_line_alignment.d.ts +22 -0
- package/dist/src/payloads/set_line_alignment.js +47 -0
- package/dist/src/payloads/set_line_border.d.ts +49 -0
- package/dist/src/payloads/set_line_border.js +97 -0
- package/dist/src/payloads/set_line_font.d.ts +49 -0
- package/dist/src/payloads/set_line_font.js +99 -0
- package/dist/src/payloads/set_line_pattern_fill.d.ts +28 -0
- package/dist/src/payloads/set_line_pattern_fill.js +57 -0
- package/dist/src/payloads/split_merged_cells.d.ts +15 -0
- package/dist/src/payloads/split_merged_cells.js +31 -0
- package/dist/src/transactions.d.ts +9 -3
- package/dist/src/transactions.js +15 -4
- package/package.json +2 -2
- package/wasm/.gitignore +0 -1
- package/wasm/logisheets_wasm_server.d.ts +0 -255
- package/wasm/logisheets_wasm_server.js +0 -946
- package/wasm/logisheets_wasm_server_bg.wasm +0 -0
- package/wasm/logisheets_wasm_server_bg.wasm.d.ts +0 -40
- package/wasm/package.json +0 -14
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import type { SheetDimension, SheetInfo, DisplayWindowWithStartPoint, CellPosition, BlockInfo, MergeCell, ErrorMessage } from './bindings';
|
|
2
|
+
import type { Cell, CustomFunc } from './api';
|
|
3
|
+
import type { Transaction } from './transactions';
|
|
4
|
+
export type Resp<T> = Promise<T | ErrorMessage>;
|
|
5
|
+
/**
|
|
6
|
+
* The client is the interface for the workbook. This is used when the workbook
|
|
7
|
+
* is wrapped by a server.
|
|
8
|
+
*/
|
|
9
|
+
export interface Client {
|
|
10
|
+
isReady(): Promise<void>;
|
|
11
|
+
getSheetDimension(sheetIdx: number): Resp<SheetDimension>;
|
|
12
|
+
getAllSheetInfo(params: GetAllSheetInfoParams): Resp<readonly SheetInfo[]>;
|
|
13
|
+
getDisplayWindow(params: GetDisplayWindowParams): Resp<DisplayWindowWithStartPoint>;
|
|
14
|
+
getCell(params: GetCellParams): Resp<Cell>;
|
|
15
|
+
getCellPosition(params: GetCellParams): Resp<CellPosition>;
|
|
16
|
+
getFullyCoveredBlocks(params: GetFullyCoveredBlocksParams): Resp<readonly BlockInfo[]>;
|
|
17
|
+
undo(): Resp<void>;
|
|
18
|
+
redo(): Resp<void>;
|
|
19
|
+
handleTransaction(params: HandleTransactionParams): Resp<void>;
|
|
20
|
+
loadWorkbook(params: LoadWorkbookParams): Resp<void>;
|
|
21
|
+
registryCustomFunc(f: CustomFunc): void;
|
|
22
|
+
registryCellUpdatedCallback(f: () => void): void;
|
|
23
|
+
registrySheetUpdatedCallback(f: () => void): void;
|
|
24
|
+
getMergedCells(params: GetMergedCellsParams): Resp<readonly MergeCell[]>;
|
|
25
|
+
calcCondition(params: CalcConditionParams): Resp<boolean>;
|
|
26
|
+
}
|
|
27
|
+
export interface GetAllSheetInfoParams {
|
|
28
|
+
}
|
|
29
|
+
export interface CalcConditionParams {
|
|
30
|
+
sheetIdx: number;
|
|
31
|
+
condition: string;
|
|
32
|
+
}
|
|
33
|
+
export interface GetDisplayWindowParams {
|
|
34
|
+
sheetIdx: number;
|
|
35
|
+
startX: number;
|
|
36
|
+
startY: number;
|
|
37
|
+
height: number;
|
|
38
|
+
width: number;
|
|
39
|
+
}
|
|
40
|
+
export interface GetDisplayWindowWithPositionParams {
|
|
41
|
+
sheetIdx: number;
|
|
42
|
+
row: number;
|
|
43
|
+
col: number;
|
|
44
|
+
height: number;
|
|
45
|
+
width: number;
|
|
46
|
+
}
|
|
47
|
+
export interface GetCellParams {
|
|
48
|
+
sheetIdx: number;
|
|
49
|
+
row: number;
|
|
50
|
+
col: number;
|
|
51
|
+
}
|
|
52
|
+
export interface HandleTransactionParams {
|
|
53
|
+
transaction: Transaction;
|
|
54
|
+
}
|
|
55
|
+
export interface LoadWorkbookParams {
|
|
56
|
+
content: Uint8Array;
|
|
57
|
+
name: string;
|
|
58
|
+
}
|
|
59
|
+
export interface MessageResp<T> {
|
|
60
|
+
result: T;
|
|
61
|
+
id: number;
|
|
62
|
+
}
|
|
63
|
+
export interface GetFullyCoveredBlocksParams {
|
|
64
|
+
sheetIdx: number;
|
|
65
|
+
row: number;
|
|
66
|
+
col: number;
|
|
67
|
+
height: number;
|
|
68
|
+
width: number;
|
|
69
|
+
}
|
|
70
|
+
export declare const enum WorkerUpdate {
|
|
71
|
+
Cell = 0,
|
|
72
|
+
Sheet = 1,
|
|
73
|
+
CellAndSheet = 2,
|
|
74
|
+
Ready = 3
|
|
75
|
+
}
|
|
76
|
+
export interface GetMergedCellsParams {
|
|
77
|
+
sheetIdx: number;
|
|
78
|
+
startRow: number;
|
|
79
|
+
startCol: number;
|
|
80
|
+
endRow: number;
|
|
81
|
+
endCol: number;
|
|
82
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/src/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export * from './api';
|
|
2
2
|
export * from './payloads';
|
|
3
3
|
export * from './transactions';
|
|
4
|
-
export
|
|
4
|
+
export * from './client';
|
|
5
|
+
export type { ActionEffect, Alignment, AsyncFuncResult, BlockInfo, Border, BorderPr, CellInfo, CellPosition, ColInfo, Color, Comment, CtCellProtection, CtFontFamily, CtFontName, CtFontScheme, CtUnderlineProperty, DisplayWindow, DisplayWindowWithStartPoint, EditAction, ErrorMessage, Fill, Font, HorizontalAlignment, MergeCell, PatternFill, RowInfo, SheetDimension, SheetInfo, StPatternType, Style, Task, Value, VerticalAlignment, StBorderStyle, } from './bindings';
|
package/dist/src/index.js
CHANGED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export interface CellClear {
|
|
2
|
+
readonly type: 'cellClear';
|
|
3
|
+
readonly sheetIdx: number;
|
|
4
|
+
readonly row: number;
|
|
5
|
+
readonly col: number;
|
|
6
|
+
}
|
|
7
|
+
export declare class CellClearBuilder {
|
|
8
|
+
private _sheetIdx?;
|
|
9
|
+
private _row?;
|
|
10
|
+
private _col?;
|
|
11
|
+
sheetIdx(sheetIdx: number): this;
|
|
12
|
+
row(row: number): this;
|
|
13
|
+
col(col: number): this;
|
|
14
|
+
build(): CellClear;
|
|
15
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export class CellClearBuilder {
|
|
2
|
+
_sheetIdx;
|
|
3
|
+
_row;
|
|
4
|
+
_col;
|
|
5
|
+
sheetIdx(sheetIdx) {
|
|
6
|
+
this._sheetIdx = sheetIdx;
|
|
7
|
+
return this;
|
|
8
|
+
}
|
|
9
|
+
row(row) {
|
|
10
|
+
this._row = row;
|
|
11
|
+
return this;
|
|
12
|
+
}
|
|
13
|
+
col(col) {
|
|
14
|
+
this._col = col;
|
|
15
|
+
return this;
|
|
16
|
+
}
|
|
17
|
+
build() {
|
|
18
|
+
if (this._sheetIdx === undefined)
|
|
19
|
+
throw Error('sheetIdx is undefined!');
|
|
20
|
+
if (this._row === undefined)
|
|
21
|
+
throw Error('row is undefined!');
|
|
22
|
+
if (this._col === undefined)
|
|
23
|
+
throw Error('col is undefined!');
|
|
24
|
+
return {
|
|
25
|
+
type: 'cellClear',
|
|
26
|
+
sheetIdx: this._sheetIdx,
|
|
27
|
+
row: this._row,
|
|
28
|
+
col: this._col,
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export interface CellFormatBrush {
|
|
2
|
+
readonly type: 'cellFormatBrush';
|
|
3
|
+
readonly srcSheetIdx: number;
|
|
4
|
+
readonly srcRow: number;
|
|
5
|
+
readonly srcCol: number;
|
|
6
|
+
readonly dstSheetIdx: number;
|
|
7
|
+
readonly dstRowStart: number;
|
|
8
|
+
readonly dstColStart: number;
|
|
9
|
+
readonly dstRowEnd: number;
|
|
10
|
+
readonly dstColEnd: number;
|
|
11
|
+
}
|
|
12
|
+
export declare class CellFormatBrushBuilder {
|
|
13
|
+
private _srcSheetIdx?;
|
|
14
|
+
private _srcRow?;
|
|
15
|
+
private _srcCol?;
|
|
16
|
+
private _dstSheetIdx?;
|
|
17
|
+
private _dstRowStart?;
|
|
18
|
+
private _dstColStart?;
|
|
19
|
+
private _dstRowEnd?;
|
|
20
|
+
private _dstColEnd?;
|
|
21
|
+
srcSheetIdx(srcSheetIdx: number): this;
|
|
22
|
+
dstSheetIdx(dstSheetIdx: number): this;
|
|
23
|
+
srcRow(srcRow: number): this;
|
|
24
|
+
srcCol(srcCol: number): this;
|
|
25
|
+
dstRowStart(dstRowStart: number): this;
|
|
26
|
+
dstColStart(dstColStart: number): this;
|
|
27
|
+
dstRowEnd(dstRowEnd: number): this;
|
|
28
|
+
dstColEnd(dstColEnd: number): this;
|
|
29
|
+
build(): CellFormatBrush;
|
|
30
|
+
}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
export class CellFormatBrushBuilder {
|
|
2
|
+
_srcSheetIdx;
|
|
3
|
+
_srcRow;
|
|
4
|
+
_srcCol;
|
|
5
|
+
_dstSheetIdx;
|
|
6
|
+
_dstRowStart;
|
|
7
|
+
_dstColStart;
|
|
8
|
+
_dstRowEnd;
|
|
9
|
+
_dstColEnd;
|
|
10
|
+
srcSheetIdx(srcSheetIdx) {
|
|
11
|
+
this._srcSheetIdx = srcSheetIdx;
|
|
12
|
+
return this;
|
|
13
|
+
}
|
|
14
|
+
dstSheetIdx(dstSheetIdx) {
|
|
15
|
+
this._dstSheetIdx = dstSheetIdx;
|
|
16
|
+
return this;
|
|
17
|
+
}
|
|
18
|
+
srcRow(srcRow) {
|
|
19
|
+
this._srcRow = srcRow;
|
|
20
|
+
return this;
|
|
21
|
+
}
|
|
22
|
+
srcCol(srcCol) {
|
|
23
|
+
this._srcCol = srcCol;
|
|
24
|
+
return this;
|
|
25
|
+
}
|
|
26
|
+
dstRowStart(dstRowStart) {
|
|
27
|
+
this._dstRowStart = dstRowStart;
|
|
28
|
+
return this;
|
|
29
|
+
}
|
|
30
|
+
dstColStart(dstColStart) {
|
|
31
|
+
this._dstColStart = dstColStart;
|
|
32
|
+
return this;
|
|
33
|
+
}
|
|
34
|
+
dstRowEnd(dstRowEnd) {
|
|
35
|
+
this._dstRowEnd = dstRowEnd;
|
|
36
|
+
return this;
|
|
37
|
+
}
|
|
38
|
+
dstColEnd(dstColEnd) {
|
|
39
|
+
this._dstColEnd = dstColEnd;
|
|
40
|
+
return this;
|
|
41
|
+
}
|
|
42
|
+
build() {
|
|
43
|
+
if (this._srcSheetIdx === undefined)
|
|
44
|
+
throw Error('srcSheetIdx is undefined!');
|
|
45
|
+
if (this._srcRow === undefined)
|
|
46
|
+
throw Error('srcRow is undefined!');
|
|
47
|
+
if (this._srcCol === undefined)
|
|
48
|
+
throw Error('srcCol is undefined!');
|
|
49
|
+
if (this._dstSheetIdx === undefined)
|
|
50
|
+
throw Error('dstSheetIdx is undefined!');
|
|
51
|
+
if (this._dstRowStart === undefined)
|
|
52
|
+
throw Error('dstRowStart is undefined!');
|
|
53
|
+
if (this._dstColStart === undefined)
|
|
54
|
+
throw Error('dstColStart is undefined!');
|
|
55
|
+
if (this._dstRowEnd === undefined)
|
|
56
|
+
throw Error('dstRowEnd is undefined!');
|
|
57
|
+
if (this._dstColEnd === undefined)
|
|
58
|
+
throw Error('dstColEnd is undefined!');
|
|
59
|
+
return {
|
|
60
|
+
type: 'cellFormatBrush',
|
|
61
|
+
srcSheetIdx: this._srcSheetIdx,
|
|
62
|
+
srcRow: this._srcRow,
|
|
63
|
+
srcCol: this._srcCol,
|
|
64
|
+
dstSheetIdx: this._dstSheetIdx,
|
|
65
|
+
dstRowStart: this._dstRowStart,
|
|
66
|
+
dstColStart: this._dstColStart,
|
|
67
|
+
dstRowEnd: this._dstRowEnd,
|
|
68
|
+
dstColEnd: this._dstColEnd,
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { BlockInput } from './block_input';
|
|
2
|
+
import { CellClear } from './cell_clear';
|
|
2
3
|
import { CellInput } from './cell_input';
|
|
3
4
|
import { CreateBlock } from './create_block';
|
|
4
5
|
import { DeleteBlockCols } from './delete_block_cols';
|
|
@@ -6,19 +7,31 @@ import { DeleteBlockRows } from './delete_block_rows';
|
|
|
6
7
|
import { DeleteCols } from './delete_cols';
|
|
7
8
|
import { DeleteRows } from './delete_rows';
|
|
8
9
|
import { DeleteSheet } from './delete_sheet';
|
|
10
|
+
import { CellFormatBrush } from './cell_format_brush';
|
|
11
|
+
import { LineFormatBrush } from './line_format_brush';
|
|
9
12
|
import { InsertBlockCols } from './insert_block_cols';
|
|
10
13
|
import { InsertBlockRows } from './insert_block_rows';
|
|
11
14
|
import { InsertCols } from './insert_cols';
|
|
12
15
|
import { InsertRows } from './insert_rows';
|
|
13
16
|
import { InsertSheet } from './insert_sheet';
|
|
17
|
+
import { MergeCells } from './merge_cells';
|
|
14
18
|
import { MoveBlock } from './move_block';
|
|
15
|
-
import {
|
|
19
|
+
import { SetCellAlignment } from './set_cell_alignment';
|
|
20
|
+
import { SetCellBorder } from './set_cell_border';
|
|
21
|
+
import { SetCellFont } from './set_cell_font';
|
|
22
|
+
import { SetCellPatternFill } from './set_cell_pattern_fill';
|
|
16
23
|
import { SetColVisible } from './set_col_visible';
|
|
17
24
|
import { SetColWidth } from './set_col_width';
|
|
18
|
-
import {
|
|
25
|
+
import { SetLineAlignment } from './set_line_alignment';
|
|
26
|
+
import { SetLineBorder } from './set_line_border';
|
|
27
|
+
import { SetLineFont } from './set_line_font';
|
|
28
|
+
import { SetLinePatternFill } from './set_line_pattern_fill';
|
|
19
29
|
import { SetRowHeight } from './set_row_height';
|
|
20
30
|
import { SetRowVisible } from './set_row_visible';
|
|
21
31
|
import { SheetRename } from './sheet_rename';
|
|
32
|
+
import { SplitMergedCells } from './split_merged_cells';
|
|
33
|
+
export * from './block_input';
|
|
34
|
+
export * from './cell_clear';
|
|
22
35
|
export * from './cell_input';
|
|
23
36
|
export * from './create_block';
|
|
24
37
|
export * from './delete_block_cols';
|
|
@@ -26,18 +39,27 @@ export * from './delete_block_rows';
|
|
|
26
39
|
export * from './delete_cols';
|
|
27
40
|
export * from './delete_rows';
|
|
28
41
|
export * from './delete_sheet';
|
|
42
|
+
export * from './cell_format_brush';
|
|
43
|
+
export * from './line_format_brush';
|
|
29
44
|
export * from './insert_block_cols';
|
|
30
45
|
export * from './insert_block_rows';
|
|
31
46
|
export * from './insert_cols';
|
|
32
47
|
export * from './insert_rows';
|
|
33
48
|
export * from './insert_sheet';
|
|
49
|
+
export * from './merge_cells';
|
|
34
50
|
export * from './move_block';
|
|
35
|
-
export * from './
|
|
51
|
+
export * from './set_cell_alignment';
|
|
52
|
+
export * from './set_cell_border';
|
|
53
|
+
export * from './set_cell_font';
|
|
54
|
+
export * from './set_cell_pattern_fill';
|
|
36
55
|
export * from './set_col_visible';
|
|
37
56
|
export * from './set_col_width';
|
|
38
|
-
export * from './
|
|
57
|
+
export * from './set_line_alignment';
|
|
58
|
+
export * from './set_line_border';
|
|
59
|
+
export * from './set_line_font';
|
|
60
|
+
export * from './set_line_pattern_fill';
|
|
39
61
|
export * from './set_row_height';
|
|
40
62
|
export * from './set_row_visible';
|
|
41
63
|
export * from './sheet_rename';
|
|
42
|
-
export * from './
|
|
43
|
-
export
|
|
64
|
+
export * from './split_merged_cells';
|
|
65
|
+
export type Payload = BlockInput | CellClear | CellInput | CreateBlock | DeleteBlockCols | DeleteBlockRows | DeleteCols | DeleteRows | DeleteSheet | CellFormatBrush | InsertBlockCols | InsertBlockRows | InsertCols | InsertRows | InsertSheet | MergeCells | MoveBlock | SetCellAlignment | SetCellBorder | SetCellFont | SetCellPatternFill | SetColVisible | SetColWidth | SetLineAlignment | SetLineBorder | SetLineFont | SetLinePatternFill | SetRowHeight | SetRowVisible | SheetRename | SplitMergedCells | LineFormatBrush;
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
export * from './block_input';
|
|
2
|
+
export * from './cell_clear';
|
|
1
3
|
export * from './cell_input';
|
|
2
4
|
export * from './create_block';
|
|
3
5
|
export * from './delete_block_cols';
|
|
@@ -5,17 +7,26 @@ export * from './delete_block_rows';
|
|
|
5
7
|
export * from './delete_cols';
|
|
6
8
|
export * from './delete_rows';
|
|
7
9
|
export * from './delete_sheet';
|
|
10
|
+
export * from './cell_format_brush';
|
|
11
|
+
export * from './line_format_brush';
|
|
8
12
|
export * from './insert_block_cols';
|
|
9
13
|
export * from './insert_block_rows';
|
|
10
14
|
export * from './insert_cols';
|
|
11
15
|
export * from './insert_rows';
|
|
12
16
|
export * from './insert_sheet';
|
|
17
|
+
export * from './merge_cells';
|
|
13
18
|
export * from './move_block';
|
|
14
|
-
export * from './
|
|
19
|
+
export * from './set_cell_alignment';
|
|
20
|
+
export * from './set_cell_border';
|
|
21
|
+
export * from './set_cell_font';
|
|
22
|
+
export * from './set_cell_pattern_fill';
|
|
15
23
|
export * from './set_col_visible';
|
|
16
24
|
export * from './set_col_width';
|
|
17
|
-
export * from './
|
|
25
|
+
export * from './set_line_alignment';
|
|
26
|
+
export * from './set_line_border';
|
|
27
|
+
export * from './set_line_font';
|
|
28
|
+
export * from './set_line_pattern_fill';
|
|
18
29
|
export * from './set_row_height';
|
|
19
30
|
export * from './set_row_visible';
|
|
20
31
|
export * from './sheet_rename';
|
|
21
|
-
export * from './
|
|
32
|
+
export * from './split_merged_cells';
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export interface LineFormatBrush {
|
|
2
|
+
readonly type: 'lineFormatBrush';
|
|
3
|
+
readonly srcSheetIdx: number;
|
|
4
|
+
readonly srcRow: number;
|
|
5
|
+
readonly srcCol: number;
|
|
6
|
+
readonly dstSheetIdx: number;
|
|
7
|
+
readonly row: boolean;
|
|
8
|
+
readonly from: number;
|
|
9
|
+
readonly to: number;
|
|
10
|
+
}
|
|
11
|
+
export declare class LineFormatBrushBuilder {
|
|
12
|
+
private _srcSheetIdx?;
|
|
13
|
+
private _srcRow?;
|
|
14
|
+
private _srcCol?;
|
|
15
|
+
private _dstSheetIdx?;
|
|
16
|
+
private _row?;
|
|
17
|
+
private _from?;
|
|
18
|
+
private _to?;
|
|
19
|
+
srcSheetIdx(srcSheetIdx: number): this;
|
|
20
|
+
dstSheetIdx(dstSheetIdx: number): this;
|
|
21
|
+
srcRow(srcRow: number): this;
|
|
22
|
+
srcCol(srcCol: number): this;
|
|
23
|
+
row(row: boolean): this;
|
|
24
|
+
from(from: number): this;
|
|
25
|
+
to(to: number): this;
|
|
26
|
+
build(): LineFormatBrush;
|
|
27
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
export class LineFormatBrushBuilder {
|
|
2
|
+
_srcSheetIdx;
|
|
3
|
+
_srcRow;
|
|
4
|
+
_srcCol;
|
|
5
|
+
_dstSheetIdx;
|
|
6
|
+
_row;
|
|
7
|
+
_from;
|
|
8
|
+
_to;
|
|
9
|
+
srcSheetIdx(srcSheetIdx) {
|
|
10
|
+
this._srcSheetIdx = srcSheetIdx;
|
|
11
|
+
return this;
|
|
12
|
+
}
|
|
13
|
+
dstSheetIdx(dstSheetIdx) {
|
|
14
|
+
this._dstSheetIdx = dstSheetIdx;
|
|
15
|
+
return this;
|
|
16
|
+
}
|
|
17
|
+
srcRow(srcRow) {
|
|
18
|
+
this._srcRow = srcRow;
|
|
19
|
+
return this;
|
|
20
|
+
}
|
|
21
|
+
srcCol(srcCol) {
|
|
22
|
+
this._srcCol = srcCol;
|
|
23
|
+
return this;
|
|
24
|
+
}
|
|
25
|
+
row(row) {
|
|
26
|
+
this._row = row;
|
|
27
|
+
return this;
|
|
28
|
+
}
|
|
29
|
+
from(from) {
|
|
30
|
+
this._from = from;
|
|
31
|
+
return this;
|
|
32
|
+
}
|
|
33
|
+
to(to) {
|
|
34
|
+
this._to = to;
|
|
35
|
+
return this;
|
|
36
|
+
}
|
|
37
|
+
build() {
|
|
38
|
+
if (this._srcSheetIdx === undefined)
|
|
39
|
+
throw Error('srcSheetIdx is undefined!');
|
|
40
|
+
if (this._srcRow === undefined)
|
|
41
|
+
throw Error('srcRow is undefined!');
|
|
42
|
+
if (this._srcCol === undefined)
|
|
43
|
+
throw Error('srcCol is undefined!');
|
|
44
|
+
if (this._dstSheetIdx === undefined)
|
|
45
|
+
throw Error('dstSheetIdx is undefined!');
|
|
46
|
+
if (this._row === undefined)
|
|
47
|
+
throw Error('row is undefined!');
|
|
48
|
+
if (this._from === undefined)
|
|
49
|
+
throw Error('from is undefined!');
|
|
50
|
+
if (this._to === undefined)
|
|
51
|
+
throw Error('to is undefined!');
|
|
52
|
+
return {
|
|
53
|
+
type: 'lineFormatBrush',
|
|
54
|
+
srcSheetIdx: this._srcSheetIdx,
|
|
55
|
+
srcRow: this._srcRow,
|
|
56
|
+
srcCol: this._srcCol,
|
|
57
|
+
dstSheetIdx: this._dstSheetIdx,
|
|
58
|
+
row: this._row,
|
|
59
|
+
from: this._from,
|
|
60
|
+
to: this._to,
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export interface MergeCells {
|
|
2
|
+
readonly type: 'mergeCells';
|
|
3
|
+
readonly sheetIdx: number;
|
|
4
|
+
readonly startRow: number;
|
|
5
|
+
readonly startCol: number;
|
|
6
|
+
readonly endRow: number;
|
|
7
|
+
readonly endCol: number;
|
|
8
|
+
}
|
|
9
|
+
export declare class MergeCellsBuilder {
|
|
10
|
+
private _sheetIdx?;
|
|
11
|
+
private _startRow?;
|
|
12
|
+
private _startCol?;
|
|
13
|
+
private _endRow?;
|
|
14
|
+
private _endCol?;
|
|
15
|
+
sheetIdx(v: number): this;
|
|
16
|
+
startRow(v: number): this;
|
|
17
|
+
startCol(v: number): this;
|
|
18
|
+
endRow(v: number): this;
|
|
19
|
+
endCol(v: number): this;
|
|
20
|
+
build(): MergeCells;
|
|
21
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
export class MergeCellsBuilder {
|
|
2
|
+
_sheetIdx;
|
|
3
|
+
_startRow;
|
|
4
|
+
_startCol;
|
|
5
|
+
_endRow;
|
|
6
|
+
_endCol;
|
|
7
|
+
sheetIdx(v) {
|
|
8
|
+
this._sheetIdx = v;
|
|
9
|
+
return this;
|
|
10
|
+
}
|
|
11
|
+
startRow(v) {
|
|
12
|
+
this._startRow = v;
|
|
13
|
+
return this;
|
|
14
|
+
}
|
|
15
|
+
startCol(v) {
|
|
16
|
+
this._startCol = v;
|
|
17
|
+
return this;
|
|
18
|
+
}
|
|
19
|
+
endRow(v) {
|
|
20
|
+
this._endRow = v;
|
|
21
|
+
return this;
|
|
22
|
+
}
|
|
23
|
+
endCol(v) {
|
|
24
|
+
this._endCol = v;
|
|
25
|
+
return this;
|
|
26
|
+
}
|
|
27
|
+
build() {
|
|
28
|
+
if (this._sheetIdx === undefined)
|
|
29
|
+
throw Error('sheetIdx is undefined!');
|
|
30
|
+
if (this._startRow === undefined)
|
|
31
|
+
throw Error('startRow is undefined');
|
|
32
|
+
if (this._startCol === undefined)
|
|
33
|
+
throw Error('startCol is undefined');
|
|
34
|
+
if (this._endRow === undefined)
|
|
35
|
+
throw Error('endRow is undefined');
|
|
36
|
+
if (this._endCol === undefined)
|
|
37
|
+
throw Error('endCol is undefined');
|
|
38
|
+
return {
|
|
39
|
+
type: 'mergeCells',
|
|
40
|
+
sheetIdx: this._sheetIdx,
|
|
41
|
+
startRow: this._startRow,
|
|
42
|
+
startCol: this._startCol,
|
|
43
|
+
endRow: this._endRow,
|
|
44
|
+
endCol: this._endCol,
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Alignment } from '../bindings';
|
|
2
|
+
export interface SetCellAlignment {
|
|
3
|
+
readonly type: 'setCellAlignment';
|
|
4
|
+
readonly sheetIdx: number;
|
|
5
|
+
readonly row: number;
|
|
6
|
+
readonly col: number;
|
|
7
|
+
readonly alignment: Alignment;
|
|
8
|
+
}
|
|
9
|
+
export declare class SetCellAlignmentBuilder {
|
|
10
|
+
private _sheetIdx?;
|
|
11
|
+
private _row?;
|
|
12
|
+
private _col?;
|
|
13
|
+
private _alignment?;
|
|
14
|
+
sheetIdx(sheetIdx: number): this;
|
|
15
|
+
row(row: number): this;
|
|
16
|
+
col(col: number): this;
|
|
17
|
+
alignment(value: Alignment): this;
|
|
18
|
+
build(): SetCellAlignment;
|
|
19
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
export class SetCellAlignmentBuilder {
|
|
2
|
+
_sheetIdx;
|
|
3
|
+
_row;
|
|
4
|
+
_col;
|
|
5
|
+
_alignment;
|
|
6
|
+
sheetIdx(sheetIdx) {
|
|
7
|
+
this._sheetIdx = sheetIdx;
|
|
8
|
+
return this;
|
|
9
|
+
}
|
|
10
|
+
row(row) {
|
|
11
|
+
this._row = row;
|
|
12
|
+
return this;
|
|
13
|
+
}
|
|
14
|
+
col(col) {
|
|
15
|
+
this._col = col;
|
|
16
|
+
return this;
|
|
17
|
+
}
|
|
18
|
+
alignment(value) {
|
|
19
|
+
this._alignment = value;
|
|
20
|
+
return this;
|
|
21
|
+
}
|
|
22
|
+
build() {
|
|
23
|
+
if (this._sheetIdx === undefined)
|
|
24
|
+
throw Error('sheetIdx is undefined!');
|
|
25
|
+
if (this._row === undefined)
|
|
26
|
+
throw Error('row is undefined!');
|
|
27
|
+
if (this._col === undefined)
|
|
28
|
+
throw Error('col is undefined!');
|
|
29
|
+
if (this._alignment === undefined)
|
|
30
|
+
throw Error('alignment is undefined!');
|
|
31
|
+
return {
|
|
32
|
+
type: 'setCellAlignment',
|
|
33
|
+
sheetIdx: this._sheetIdx,
|
|
34
|
+
row: this._row,
|
|
35
|
+
col: this._col,
|
|
36
|
+
alignment: this._alignment,
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { StBorderStyle } from '../bindings';
|
|
2
|
+
export interface SetCellBorder {
|
|
3
|
+
readonly type: 'setCellBorder';
|
|
4
|
+
readonly sheetIdx: number;
|
|
5
|
+
readonly row: number;
|
|
6
|
+
readonly col: number;
|
|
7
|
+
readonly leftColor?: string;
|
|
8
|
+
readonly rightColor?: string;
|
|
9
|
+
readonly topColor?: string;
|
|
10
|
+
readonly bottomColor?: string;
|
|
11
|
+
readonly leftBorderType?: StBorderStyle;
|
|
12
|
+
readonly rightBorderType?: StBorderStyle;
|
|
13
|
+
readonly topBorderType?: StBorderStyle;
|
|
14
|
+
readonly bottomBorderType?: StBorderStyle;
|
|
15
|
+
readonly outline?: boolean;
|
|
16
|
+
readonly diagonalUp?: boolean;
|
|
17
|
+
readonly diagonalDown?: boolean;
|
|
18
|
+
}
|
|
19
|
+
export declare class SetCellBorderBuilder {
|
|
20
|
+
private _sheetIdx?;
|
|
21
|
+
private _row?;
|
|
22
|
+
private _col?;
|
|
23
|
+
private _leftColor?;
|
|
24
|
+
private _rightColor?;
|
|
25
|
+
private _topColor?;
|
|
26
|
+
private _bottomColor?;
|
|
27
|
+
private _leftBorderType?;
|
|
28
|
+
private _rightBorderType?;
|
|
29
|
+
private _topBorderType?;
|
|
30
|
+
private _bottomBorderType?;
|
|
31
|
+
private _outline?;
|
|
32
|
+
private _diagonalUp?;
|
|
33
|
+
private _diagonalDown?;
|
|
34
|
+
sheetIdx(sheetIdx: number): this;
|
|
35
|
+
row(row: number): this;
|
|
36
|
+
col(col: number): this;
|
|
37
|
+
leftColor(leftColor: string): this;
|
|
38
|
+
rightColor(rightColor: string): this;
|
|
39
|
+
topColor(topColor: string): this;
|
|
40
|
+
bottomColor(bottomColor: string): this;
|
|
41
|
+
leftBorderType(leftBorderType: StBorderStyle): this;
|
|
42
|
+
rightBorderType(rightBorderType: StBorderStyle): this;
|
|
43
|
+
topBorderType(topBorderType: StBorderStyle): this;
|
|
44
|
+
bottomBorderType(bottomBorderType: StBorderStyle): this;
|
|
45
|
+
outline(outline: boolean): this;
|
|
46
|
+
diagonalUp(diagonalUp: boolean): this;
|
|
47
|
+
diagonalDown(diagonalDown: boolean): this;
|
|
48
|
+
build(): SetCellBorder;
|
|
49
|
+
}
|