logisheets 1.10.0 → 1.11.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/workbook.d.ts +3 -0
- package/dist/src/api/workbook.js +5 -0
- package/dist/src/api/worksheet.d.ts +11 -1
- package/dist/src/api/worksheet.js +12 -0
- package/dist/src/bindings/cell_info.d.ts +2 -0
- package/dist/src/bindings/cf_data_bar.d.ts +6 -0
- package/dist/src/bindings/cf_data_bar.js +2 -0
- package/dist/src/bindings/cf_format_spec.d.ts +26 -0
- package/dist/src/bindings/cf_format_spec.js +34 -0
- package/dist/src/bindings/cf_icon.d.ts +6 -0
- package/dist/src/bindings/cf_icon.js +2 -0
- package/dist/src/bindings/cf_rule_info.d.ts +9 -0
- package/dist/src/bindings/cf_rule_info.js +2 -0
- package/dist/src/bindings/cf_rule_spec.d.ts +71 -0
- package/dist/src/bindings/cf_rule_spec.js +107 -0
- package/dist/src/bindings/conditional_format.d.ts +9 -0
- package/dist/src/bindings/conditional_format.js +2 -0
- package/dist/src/bindings/create_conditional_formatting_rule.d.ts +31 -0
- package/dist/src/bindings/create_conditional_formatting_rule.js +51 -0
- package/dist/src/bindings/delete_conditional_formatting_rule.d.ts +14 -0
- package/dist/src/bindings/delete_conditional_formatting_rule.js +23 -0
- package/dist/src/bindings/edit_payload.d.ts +16 -0
- package/dist/src/bindings/index.d.ts +11 -0
- package/dist/src/bindings/index.js +11 -0
- package/dist/src/bindings/move_conditional_formatting_rule.d.ts +30 -0
- package/dist/src/bindings/move_conditional_formatting_rule.js +51 -0
- package/dist/src/bindings/rpc_get_conditional_formatting_rules_params.d.ts +3 -0
- package/dist/src/bindings/rpc_get_conditional_formatting_rules_params.js +2 -0
- package/dist/src/bindings/rpc_workbook_methods.d.ts +4 -0
- package/dist/src/bindings/shadow_kind.d.ts +1 -1
- package/dist/src/bindings/update_conditional_formatting_rule.d.ts +19 -0
- package/dist/src/bindings/update_conditional_formatting_rule.js +30 -0
- package/dist/wasm/logisheets_wasm_server.d.ts +8 -8
- package/dist/wasm/logisheets_wasm_server.js +24 -24
- package/dist/wasm/logisheets_wasm_server_bg.wasm +0 -0
- package/dist/wasm/package.json +1 -1
- package/package.json +11 -3
- package/wasm/logisheets_wasm_server.d.ts +8 -8
- package/wasm/logisheets_wasm_server.js +24 -24
- package/wasm/logisheets_wasm_server_bg.wasm +0 -0
- package/wasm/package.json +1 -1
|
@@ -129,6 +129,9 @@ export declare class Workbook {
|
|
|
129
129
|
load(buf: Uint8Array, bookName: string): ReturnCode;
|
|
130
130
|
save(data: string): SaveFileResult;
|
|
131
131
|
getAppData(): readonly AppData[];
|
|
132
|
+
/** Monotonic counter bumped on every committed write — snapshot it to
|
|
133
|
+
* detect concurrent modification (optimistic concurrency). */
|
|
134
|
+
getVersion(): number;
|
|
132
135
|
release(): void;
|
|
133
136
|
getSheetCount(): number;
|
|
134
137
|
getWorksheet(idx: number): Worksheet;
|
package/dist/src/api/workbook.js
CHANGED
|
@@ -371,6 +371,11 @@ class Workbook {
|
|
|
371
371
|
getAppData() {
|
|
372
372
|
return rpc('getAppData', undefined, this._id);
|
|
373
373
|
}
|
|
374
|
+
/** Monotonic counter bumped on every committed write — snapshot it to
|
|
375
|
+
* detect concurrent modification (optimistic concurrency). */
|
|
376
|
+
getVersion() {
|
|
377
|
+
return rpc('getVersion', undefined, this._id);
|
|
378
|
+
}
|
|
374
379
|
release() {
|
|
375
380
|
rpc('release', undefined, this._id);
|
|
376
381
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BlockInfo, CellPosition, ColInfo, DisplayWindow, DisplayWindowWithStartPoint, RowInfo, Style, Value, CellInfo, SheetDimension, MergeCell, AppendixWithCell, ReproducibleCell, SheetCoordinate, CellInput, Comment, CellImageInfo, ChartInfo, DependentCell, CellRefRange, LinkInfo } from '../bindings';
|
|
1
|
+
import { BlockInfo, CellPosition, ColInfo, DisplayWindow, DisplayWindowWithStartPoint, RowInfo, Style, Value, CellInfo, SheetDimension, MergeCell, AppendixWithCell, ReproducibleCell, SheetCoordinate, CellInput, Comment, CellImageInfo, ChartInfo, CfRuleInfo, DependentCell, CellRefRange, LinkInfo } from '../bindings';
|
|
2
2
|
import { Cell } from './cell';
|
|
3
3
|
import { Result } from './utils';
|
|
4
4
|
export declare class Worksheet {
|
|
@@ -91,6 +91,16 @@ export declare class Worksheet {
|
|
|
91
91
|
* anchor and re-reads live values from the source ranges.
|
|
92
92
|
*/
|
|
93
93
|
getCharts(): Result<ChartInfo[]>;
|
|
94
|
+
/**
|
|
95
|
+
* Every conditional-formatting rule on this sheet, in `priority` order —
|
|
96
|
+
* the order they are applied, and the order a rule manager lists them in.
|
|
97
|
+
*
|
|
98
|
+
* Each rule's `spec` is the same shape the create/update payloads accept, so
|
|
99
|
+
* a UI can load one into an editor and send it straight back. `ruleId` is
|
|
100
|
+
* session-scoped: it is re-minted when the file is reloaded, so it must not
|
|
101
|
+
* be persisted.
|
|
102
|
+
*/
|
|
103
|
+
getConditionalFormattingRules(): Result<CfRuleInfo[]>;
|
|
94
104
|
getFullyCoveredBlocks(rowIdx: number, colIdx: number, rowCnt: number, colCnt: number): Result<BlockInfo[]>;
|
|
95
105
|
private _id;
|
|
96
106
|
private _sheetId;
|
|
@@ -260,6 +260,18 @@ class Worksheet {
|
|
|
260
260
|
getCharts() {
|
|
261
261
|
return rpc('getCharts', { sheetIdx: this._sheetIdx }, this._id);
|
|
262
262
|
}
|
|
263
|
+
/**
|
|
264
|
+
* Every conditional-formatting rule on this sheet, in `priority` order —
|
|
265
|
+
* the order they are applied, and the order a rule manager lists them in.
|
|
266
|
+
*
|
|
267
|
+
* Each rule's `spec` is the same shape the create/update payloads accept, so
|
|
268
|
+
* a UI can load one into an editor and send it straight back. `ruleId` is
|
|
269
|
+
* session-scoped: it is re-minted when the file is reloaded, so it must not
|
|
270
|
+
* be persisted.
|
|
271
|
+
*/
|
|
272
|
+
getConditionalFormattingRules() {
|
|
273
|
+
return rpc('getConditionalFormattingRules', { sheetIdx: this._sheetIdx }, this._id);
|
|
274
|
+
}
|
|
263
275
|
getFullyCoveredBlocks(rowIdx, colIdx, rowCnt, colCnt) {
|
|
264
276
|
return rpc('getFullyCoveredBlocks', {
|
|
265
277
|
sheetId: this._sheetId,
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ConditionalFormat } from './conditional_format';
|
|
1
2
|
import { Style } from './style';
|
|
2
3
|
import { Value } from './value';
|
|
3
4
|
export interface CellInfo {
|
|
@@ -7,4 +8,5 @@ export interface CellInfo {
|
|
|
7
8
|
blockId?: number;
|
|
8
9
|
diyCellId?: number;
|
|
9
10
|
validationShadow?: Value;
|
|
11
|
+
conditionalFormat?: ConditionalFormat;
|
|
10
12
|
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export interface CfFormatSpec {
|
|
2
|
+
fillColor?: string;
|
|
3
|
+
fontColor?: string;
|
|
4
|
+
bold?: boolean;
|
|
5
|
+
italic?: boolean;
|
|
6
|
+
strike?: boolean;
|
|
7
|
+
}
|
|
8
|
+
export declare class CfFormatSpecBuilder {
|
|
9
|
+
private _fillColor?;
|
|
10
|
+
private _fontColor?;
|
|
11
|
+
private _bold?;
|
|
12
|
+
private _italic?;
|
|
13
|
+
private _strike?;
|
|
14
|
+
fillColor(value: string): this;
|
|
15
|
+
fontColor(value: string): this;
|
|
16
|
+
bold(value: boolean): this;
|
|
17
|
+
italic(value: boolean): this;
|
|
18
|
+
strike(value: boolean): this;
|
|
19
|
+
build(): {
|
|
20
|
+
fillColor: string | undefined;
|
|
21
|
+
fontColor: string | undefined;
|
|
22
|
+
bold: boolean | undefined;
|
|
23
|
+
italic: boolean | undefined;
|
|
24
|
+
strike: boolean | undefined;
|
|
25
|
+
};
|
|
26
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CfFormatSpecBuilder = void 0;
|
|
4
|
+
class CfFormatSpecBuilder {
|
|
5
|
+
_fillColor;
|
|
6
|
+
_fontColor;
|
|
7
|
+
_bold;
|
|
8
|
+
_italic;
|
|
9
|
+
_strike;
|
|
10
|
+
fillColor(value) {
|
|
11
|
+
this._fillColor = value;
|
|
12
|
+
return this;
|
|
13
|
+
}
|
|
14
|
+
fontColor(value) {
|
|
15
|
+
this._fontColor = value;
|
|
16
|
+
return this;
|
|
17
|
+
}
|
|
18
|
+
bold(value) {
|
|
19
|
+
this._bold = value;
|
|
20
|
+
return this;
|
|
21
|
+
}
|
|
22
|
+
italic(value) {
|
|
23
|
+
this._italic = value;
|
|
24
|
+
return this;
|
|
25
|
+
}
|
|
26
|
+
strike(value) {
|
|
27
|
+
this._strike = value;
|
|
28
|
+
return this;
|
|
29
|
+
}
|
|
30
|
+
build() {
|
|
31
|
+
return { fillColor: this._fillColor, fontColor: this._fontColor, bold: this._bold, italic: this._italic, strike: this._strike };
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
exports.CfFormatSpecBuilder = CfFormatSpecBuilder;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { CfFormatSpec } from './cf_format_spec';
|
|
2
|
+
export interface CfRuleSpec {
|
|
3
|
+
ty: string;
|
|
4
|
+
operator?: string;
|
|
5
|
+
operands: readonly string[];
|
|
6
|
+
text?: string;
|
|
7
|
+
timePeriod?: string;
|
|
8
|
+
rank?: number;
|
|
9
|
+
percent: boolean;
|
|
10
|
+
bottom: boolean;
|
|
11
|
+
aboveAverage: boolean;
|
|
12
|
+
equalAverage: boolean;
|
|
13
|
+
stdDev?: number;
|
|
14
|
+
colors: readonly string[];
|
|
15
|
+
iconSet?: string;
|
|
16
|
+
reverse: boolean;
|
|
17
|
+
stopIfTrue: boolean;
|
|
18
|
+
format?: CfFormatSpec;
|
|
19
|
+
}
|
|
20
|
+
export declare class CfRuleSpecBuilder {
|
|
21
|
+
private _ty;
|
|
22
|
+
private _operator?;
|
|
23
|
+
private _operands;
|
|
24
|
+
private _text?;
|
|
25
|
+
private _timePeriod?;
|
|
26
|
+
private _rank?;
|
|
27
|
+
private _percent;
|
|
28
|
+
private _bottom;
|
|
29
|
+
private _aboveAverage;
|
|
30
|
+
private _equalAverage;
|
|
31
|
+
private _stdDev?;
|
|
32
|
+
private _colors;
|
|
33
|
+
private _iconSet?;
|
|
34
|
+
private _reverse;
|
|
35
|
+
private _stopIfTrue;
|
|
36
|
+
private _format?;
|
|
37
|
+
ty(value: string): this;
|
|
38
|
+
operator(value: string): this;
|
|
39
|
+
operands(value: readonly string[]): this;
|
|
40
|
+
text(value: string): this;
|
|
41
|
+
timePeriod(value: string): this;
|
|
42
|
+
rank(value: number): this;
|
|
43
|
+
percent(value: boolean): this;
|
|
44
|
+
bottom(value: boolean): this;
|
|
45
|
+
aboveAverage(value: boolean): this;
|
|
46
|
+
equalAverage(value: boolean): this;
|
|
47
|
+
stdDev(value: number): this;
|
|
48
|
+
colors(value: readonly string[]): this;
|
|
49
|
+
iconSet(value: string): this;
|
|
50
|
+
reverse(value: boolean): this;
|
|
51
|
+
stopIfTrue(value: boolean): this;
|
|
52
|
+
format(value: CfFormatSpec): this;
|
|
53
|
+
build(): {
|
|
54
|
+
ty: string;
|
|
55
|
+
operator: string | undefined;
|
|
56
|
+
operands: readonly string[];
|
|
57
|
+
text: string | undefined;
|
|
58
|
+
timePeriod: string | undefined;
|
|
59
|
+
rank: number | undefined;
|
|
60
|
+
percent: boolean;
|
|
61
|
+
bottom: boolean;
|
|
62
|
+
aboveAverage: boolean;
|
|
63
|
+
equalAverage: boolean;
|
|
64
|
+
stdDev: number | undefined;
|
|
65
|
+
colors: readonly string[];
|
|
66
|
+
iconSet: string | undefined;
|
|
67
|
+
reverse: boolean;
|
|
68
|
+
stopIfTrue: boolean;
|
|
69
|
+
format: CfFormatSpec | undefined;
|
|
70
|
+
};
|
|
71
|
+
}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CfRuleSpecBuilder = void 0;
|
|
4
|
+
class CfRuleSpecBuilder {
|
|
5
|
+
_ty;
|
|
6
|
+
_operator;
|
|
7
|
+
_operands;
|
|
8
|
+
_text;
|
|
9
|
+
_timePeriod;
|
|
10
|
+
_rank;
|
|
11
|
+
_percent;
|
|
12
|
+
_bottom;
|
|
13
|
+
_aboveAverage;
|
|
14
|
+
_equalAverage;
|
|
15
|
+
_stdDev;
|
|
16
|
+
_colors;
|
|
17
|
+
_iconSet;
|
|
18
|
+
_reverse;
|
|
19
|
+
_stopIfTrue;
|
|
20
|
+
_format;
|
|
21
|
+
ty(value) {
|
|
22
|
+
this._ty = value;
|
|
23
|
+
return this;
|
|
24
|
+
}
|
|
25
|
+
operator(value) {
|
|
26
|
+
this._operator = value;
|
|
27
|
+
return this;
|
|
28
|
+
}
|
|
29
|
+
operands(value) {
|
|
30
|
+
this._operands = value;
|
|
31
|
+
return this;
|
|
32
|
+
}
|
|
33
|
+
text(value) {
|
|
34
|
+
this._text = value;
|
|
35
|
+
return this;
|
|
36
|
+
}
|
|
37
|
+
timePeriod(value) {
|
|
38
|
+
this._timePeriod = value;
|
|
39
|
+
return this;
|
|
40
|
+
}
|
|
41
|
+
rank(value) {
|
|
42
|
+
this._rank = value;
|
|
43
|
+
return this;
|
|
44
|
+
}
|
|
45
|
+
percent(value) {
|
|
46
|
+
this._percent = value;
|
|
47
|
+
return this;
|
|
48
|
+
}
|
|
49
|
+
bottom(value) {
|
|
50
|
+
this._bottom = value;
|
|
51
|
+
return this;
|
|
52
|
+
}
|
|
53
|
+
aboveAverage(value) {
|
|
54
|
+
this._aboveAverage = value;
|
|
55
|
+
return this;
|
|
56
|
+
}
|
|
57
|
+
equalAverage(value) {
|
|
58
|
+
this._equalAverage = value;
|
|
59
|
+
return this;
|
|
60
|
+
}
|
|
61
|
+
stdDev(value) {
|
|
62
|
+
this._stdDev = value;
|
|
63
|
+
return this;
|
|
64
|
+
}
|
|
65
|
+
colors(value) {
|
|
66
|
+
this._colors = value;
|
|
67
|
+
return this;
|
|
68
|
+
}
|
|
69
|
+
iconSet(value) {
|
|
70
|
+
this._iconSet = value;
|
|
71
|
+
return this;
|
|
72
|
+
}
|
|
73
|
+
reverse(value) {
|
|
74
|
+
this._reverse = value;
|
|
75
|
+
return this;
|
|
76
|
+
}
|
|
77
|
+
stopIfTrue(value) {
|
|
78
|
+
this._stopIfTrue = value;
|
|
79
|
+
return this;
|
|
80
|
+
}
|
|
81
|
+
format(value) {
|
|
82
|
+
this._format = value;
|
|
83
|
+
return this;
|
|
84
|
+
}
|
|
85
|
+
build() {
|
|
86
|
+
if (this._ty === undefined)
|
|
87
|
+
throw new Error('missing ty');
|
|
88
|
+
if (this._operands === undefined)
|
|
89
|
+
throw new Error('missing operands');
|
|
90
|
+
if (this._percent === undefined)
|
|
91
|
+
throw new Error('missing percent');
|
|
92
|
+
if (this._bottom === undefined)
|
|
93
|
+
throw new Error('missing bottom');
|
|
94
|
+
if (this._aboveAverage === undefined)
|
|
95
|
+
throw new Error('missing aboveAverage');
|
|
96
|
+
if (this._equalAverage === undefined)
|
|
97
|
+
throw new Error('missing equalAverage');
|
|
98
|
+
if (this._colors === undefined)
|
|
99
|
+
throw new Error('missing colors');
|
|
100
|
+
if (this._reverse === undefined)
|
|
101
|
+
throw new Error('missing reverse');
|
|
102
|
+
if (this._stopIfTrue === undefined)
|
|
103
|
+
throw new Error('missing stopIfTrue');
|
|
104
|
+
return { ty: this._ty, operator: this._operator, operands: this._operands, text: this._text, timePeriod: this._timePeriod, rank: this._rank, percent: this._percent, bottom: this._bottom, aboveAverage: this._aboveAverage, equalAverage: this._equalAverage, stdDev: this._stdDev, colors: this._colors, iconSet: this._iconSet, reverse: this._reverse, stopIfTrue: this._stopIfTrue, format: this._format };
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
exports.CfRuleSpecBuilder = CfRuleSpecBuilder;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { CfRuleSpec } from './cf_rule_spec';
|
|
2
|
+
export interface CreateConditionalFormattingRule {
|
|
3
|
+
sheetIdx: number;
|
|
4
|
+
startRow: number;
|
|
5
|
+
startCol: number;
|
|
6
|
+
endRow: number;
|
|
7
|
+
endCol: number;
|
|
8
|
+
rule: CfRuleSpec;
|
|
9
|
+
}
|
|
10
|
+
export declare class CreateConditionalFormattingRuleBuilder {
|
|
11
|
+
private _sheetIdx;
|
|
12
|
+
private _startRow;
|
|
13
|
+
private _startCol;
|
|
14
|
+
private _endRow;
|
|
15
|
+
private _endCol;
|
|
16
|
+
private _rule;
|
|
17
|
+
sheetIdx(value: number): this;
|
|
18
|
+
startRow(value: number): this;
|
|
19
|
+
startCol(value: number): this;
|
|
20
|
+
endRow(value: number): this;
|
|
21
|
+
endCol(value: number): this;
|
|
22
|
+
rule(value: CfRuleSpec): this;
|
|
23
|
+
build(): {
|
|
24
|
+
sheetIdx: number;
|
|
25
|
+
startRow: number;
|
|
26
|
+
startCol: number;
|
|
27
|
+
endRow: number;
|
|
28
|
+
endCol: number;
|
|
29
|
+
rule: CfRuleSpec;
|
|
30
|
+
};
|
|
31
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CreateConditionalFormattingRuleBuilder = void 0;
|
|
4
|
+
class CreateConditionalFormattingRuleBuilder {
|
|
5
|
+
_sheetIdx;
|
|
6
|
+
_startRow;
|
|
7
|
+
_startCol;
|
|
8
|
+
_endRow;
|
|
9
|
+
_endCol;
|
|
10
|
+
_rule;
|
|
11
|
+
sheetIdx(value) {
|
|
12
|
+
this._sheetIdx = value;
|
|
13
|
+
return this;
|
|
14
|
+
}
|
|
15
|
+
startRow(value) {
|
|
16
|
+
this._startRow = value;
|
|
17
|
+
return this;
|
|
18
|
+
}
|
|
19
|
+
startCol(value) {
|
|
20
|
+
this._startCol = value;
|
|
21
|
+
return this;
|
|
22
|
+
}
|
|
23
|
+
endRow(value) {
|
|
24
|
+
this._endRow = value;
|
|
25
|
+
return this;
|
|
26
|
+
}
|
|
27
|
+
endCol(value) {
|
|
28
|
+
this._endCol = value;
|
|
29
|
+
return this;
|
|
30
|
+
}
|
|
31
|
+
rule(value) {
|
|
32
|
+
this._rule = value;
|
|
33
|
+
return this;
|
|
34
|
+
}
|
|
35
|
+
build() {
|
|
36
|
+
if (this._sheetIdx === undefined)
|
|
37
|
+
throw new Error('missing sheetIdx');
|
|
38
|
+
if (this._startRow === undefined)
|
|
39
|
+
throw new Error('missing startRow');
|
|
40
|
+
if (this._startCol === undefined)
|
|
41
|
+
throw new Error('missing startCol');
|
|
42
|
+
if (this._endRow === undefined)
|
|
43
|
+
throw new Error('missing endRow');
|
|
44
|
+
if (this._endCol === undefined)
|
|
45
|
+
throw new Error('missing endCol');
|
|
46
|
+
if (this._rule === undefined)
|
|
47
|
+
throw new Error('missing rule');
|
|
48
|
+
return { sheetIdx: this._sheetIdx, startRow: this._startRow, startCol: this._startCol, endRow: this._endRow, endCol: this._endCol, rule: this._rule };
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
exports.CreateConditionalFormattingRuleBuilder = CreateConditionalFormattingRuleBuilder;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export interface DeleteConditionalFormattingRule {
|
|
2
|
+
sheetIdx: number;
|
|
3
|
+
ruleId: number;
|
|
4
|
+
}
|
|
5
|
+
export declare class DeleteConditionalFormattingRuleBuilder {
|
|
6
|
+
private _sheetIdx;
|
|
7
|
+
private _ruleId;
|
|
8
|
+
sheetIdx(value: number): this;
|
|
9
|
+
ruleId(value: number): this;
|
|
10
|
+
build(): {
|
|
11
|
+
sheetIdx: number;
|
|
12
|
+
ruleId: number;
|
|
13
|
+
};
|
|
14
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DeleteConditionalFormattingRuleBuilder = void 0;
|
|
4
|
+
class DeleteConditionalFormattingRuleBuilder {
|
|
5
|
+
_sheetIdx;
|
|
6
|
+
_ruleId;
|
|
7
|
+
sheetIdx(value) {
|
|
8
|
+
this._sheetIdx = value;
|
|
9
|
+
return this;
|
|
10
|
+
}
|
|
11
|
+
ruleId(value) {
|
|
12
|
+
this._ruleId = value;
|
|
13
|
+
return this;
|
|
14
|
+
}
|
|
15
|
+
build() {
|
|
16
|
+
if (this._sheetIdx === undefined)
|
|
17
|
+
throw new Error('missing sheetIdx');
|
|
18
|
+
if (this._ruleId === undefined)
|
|
19
|
+
throw new Error('missing ruleId');
|
|
20
|
+
return { sheetIdx: this._sheetIdx, ruleId: this._ruleId };
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
exports.DeleteConditionalFormattingRuleBuilder = DeleteConditionalFormattingRuleBuilder;
|
|
@@ -13,6 +13,7 @@ import { ConvertBlock } from './convert_block';
|
|
|
13
13
|
import { CreateAppendix } from './create_appendix';
|
|
14
14
|
import { CreateBlock } from './create_block';
|
|
15
15
|
import { CreateChart } from './create_chart';
|
|
16
|
+
import { CreateConditionalFormattingRule } from './create_conditional_formatting_rule';
|
|
16
17
|
import { CreateDiyCell } from './create_diy_cell';
|
|
17
18
|
import { CreateDiyCellById } from './create_diy_cell_by_id';
|
|
18
19
|
import { CreateLink } from './create_link';
|
|
@@ -22,6 +23,7 @@ import { DeleteChart } from './delete_chart';
|
|
|
22
23
|
import { DeleteCols } from './delete_cols';
|
|
23
24
|
import { DeleteColsInBlock } from './delete_cols_in_block';
|
|
24
25
|
import { DeleteComment } from './delete_comment';
|
|
26
|
+
import { DeleteConditionalFormattingRule } from './delete_conditional_formatting_rule';
|
|
25
27
|
import { DeleteRows } from './delete_rows';
|
|
26
28
|
import { DeleteRowsInBlock } from './delete_rows_in_block';
|
|
27
29
|
import { DeleteSheet } from './delete_sheet';
|
|
@@ -39,6 +41,7 @@ import { MergeCells } from './merge_cells';
|
|
|
39
41
|
import { MoveBlock } from './move_block';
|
|
40
42
|
import { MoveBlockLine } from './move_block_line';
|
|
41
43
|
import { MoveChart } from './move_chart';
|
|
44
|
+
import { MoveConditionalFormattingRule } from './move_conditional_formatting_rule';
|
|
42
45
|
import { RemoveAppendix } from './remove_appendix';
|
|
43
46
|
import { RemoveBlock } from './remove_block';
|
|
44
47
|
import { RemoveDiyCell } from './remove_diy_cell';
|
|
@@ -57,6 +60,7 @@ import { SetVisible } from './set_visible';
|
|
|
57
60
|
import { SheetRename } from './sheet_rename';
|
|
58
61
|
import { SplitMergedCells } from './split_merged_cells';
|
|
59
62
|
import { UpdateChart } from './update_chart';
|
|
63
|
+
import { UpdateConditionalFormattingRule } from './update_conditional_formatting_rule';
|
|
60
64
|
import { UpsertFieldFormulas } from './upsert_field_formulas';
|
|
61
65
|
import { UpsertFieldRenderInfo } from './upsert_field_render_info';
|
|
62
66
|
import { UpsertPerson } from './upsert_person';
|
|
@@ -162,6 +166,18 @@ export type EditPayload = {
|
|
|
162
166
|
} | {
|
|
163
167
|
type: 'moveChart';
|
|
164
168
|
value: MoveChart;
|
|
169
|
+
} | {
|
|
170
|
+
type: 'createConditionalFormattingRule';
|
|
171
|
+
value: CreateConditionalFormattingRule;
|
|
172
|
+
} | {
|
|
173
|
+
type: 'updateConditionalFormattingRule';
|
|
174
|
+
value: UpdateConditionalFormattingRule;
|
|
175
|
+
} | {
|
|
176
|
+
type: 'moveConditionalFormattingRule';
|
|
177
|
+
value: MoveConditionalFormattingRule;
|
|
178
|
+
} | {
|
|
179
|
+
type: 'deleteConditionalFormattingRule';
|
|
180
|
+
value: DeleteConditionalFormattingRule;
|
|
165
181
|
} | {
|
|
166
182
|
type: 'deleteChart';
|
|
167
183
|
value: DeleteChart;
|
|
@@ -40,6 +40,11 @@ export * from './cell_protection';
|
|
|
40
40
|
export * from './cell_ref';
|
|
41
41
|
export * from './cell_ref_range';
|
|
42
42
|
export * from './cell_style_update';
|
|
43
|
+
export * from './cf_data_bar';
|
|
44
|
+
export * from './cf_format_spec';
|
|
45
|
+
export * from './cf_icon';
|
|
46
|
+
export * from './cf_rule_info';
|
|
47
|
+
export * from './cf_rule_spec';
|
|
43
48
|
export * from './chart_info';
|
|
44
49
|
export * from './chart_series_info';
|
|
45
50
|
export * from './checkpoint_meta';
|
|
@@ -50,11 +55,13 @@ export * from './comment_mention';
|
|
|
50
55
|
export * from './comment_mention_info';
|
|
51
56
|
export * from './comment_note';
|
|
52
57
|
export * from './comment_person';
|
|
58
|
+
export * from './conditional_format';
|
|
53
59
|
export * from './convert_block';
|
|
54
60
|
export * from './create_appendix';
|
|
55
61
|
export * from './create_block';
|
|
56
62
|
export * from './create_chart';
|
|
57
63
|
export * from './create_chart_series';
|
|
64
|
+
export * from './create_conditional_formatting_rule';
|
|
58
65
|
export * from './create_diy_cell';
|
|
59
66
|
export * from './create_diy_cell_by_id';
|
|
60
67
|
export * from './create_link';
|
|
@@ -72,6 +79,7 @@ export * from './delete_chart';
|
|
|
72
79
|
export * from './delete_cols';
|
|
73
80
|
export * from './delete_cols_in_block';
|
|
74
81
|
export * from './delete_comment';
|
|
82
|
+
export * from './delete_conditional_formatting_rule';
|
|
75
83
|
export * from './delete_rows';
|
|
76
84
|
export * from './delete_rows_in_block';
|
|
77
85
|
export * from './delete_sheet';
|
|
@@ -111,6 +119,7 @@ export * from './modify_policy';
|
|
|
111
119
|
export * from './move_block';
|
|
112
120
|
export * from './move_block_line';
|
|
113
121
|
export * from './move_chart';
|
|
122
|
+
export * from './move_conditional_formatting_rule';
|
|
114
123
|
export * from './msg_edit';
|
|
115
124
|
export * from './msg_join';
|
|
116
125
|
export * from './msg_sequencer_action_invalid_message';
|
|
@@ -161,6 +170,7 @@ export * from './rpc_get_cells_params';
|
|
|
161
170
|
export * from './rpc_get_charts_params';
|
|
162
171
|
export * from './rpc_get_col_width_params';
|
|
163
172
|
export * from './rpc_get_comments_params';
|
|
173
|
+
export * from './rpc_get_conditional_formatting_rules_params';
|
|
164
174
|
export * from './rpc_get_data_boundary_params';
|
|
165
175
|
export * from './rpc_get_dependents_params';
|
|
166
176
|
export * from './rpc_get_display_units_of_formula_params';
|
|
@@ -227,6 +237,7 @@ export * from './token_type';
|
|
|
227
237
|
export * from './token_unit';
|
|
228
238
|
export * from './underline_property';
|
|
229
239
|
export * from './update_chart';
|
|
240
|
+
export * from './update_conditional_formatting_rule';
|
|
230
241
|
export * from './upsert_field_formulas';
|
|
231
242
|
export * from './upsert_field_render_info';
|
|
232
243
|
export * from './upsert_person';
|
|
@@ -57,6 +57,11 @@ __exportStar(require("./cell_protection"), exports);
|
|
|
57
57
|
__exportStar(require("./cell_ref"), exports);
|
|
58
58
|
__exportStar(require("./cell_ref_range"), exports);
|
|
59
59
|
__exportStar(require("./cell_style_update"), exports);
|
|
60
|
+
__exportStar(require("./cf_data_bar"), exports);
|
|
61
|
+
__exportStar(require("./cf_format_spec"), exports);
|
|
62
|
+
__exportStar(require("./cf_icon"), exports);
|
|
63
|
+
__exportStar(require("./cf_rule_info"), exports);
|
|
64
|
+
__exportStar(require("./cf_rule_spec"), exports);
|
|
60
65
|
__exportStar(require("./chart_info"), exports);
|
|
61
66
|
__exportStar(require("./chart_series_info"), exports);
|
|
62
67
|
__exportStar(require("./checkpoint_meta"), exports);
|
|
@@ -67,11 +72,13 @@ __exportStar(require("./comment_mention"), exports);
|
|
|
67
72
|
__exportStar(require("./comment_mention_info"), exports);
|
|
68
73
|
__exportStar(require("./comment_note"), exports);
|
|
69
74
|
__exportStar(require("./comment_person"), exports);
|
|
75
|
+
__exportStar(require("./conditional_format"), exports);
|
|
70
76
|
__exportStar(require("./convert_block"), exports);
|
|
71
77
|
__exportStar(require("./create_appendix"), exports);
|
|
72
78
|
__exportStar(require("./create_block"), exports);
|
|
73
79
|
__exportStar(require("./create_chart"), exports);
|
|
74
80
|
__exportStar(require("./create_chart_series"), exports);
|
|
81
|
+
__exportStar(require("./create_conditional_formatting_rule"), exports);
|
|
75
82
|
__exportStar(require("./create_diy_cell"), exports);
|
|
76
83
|
__exportStar(require("./create_diy_cell_by_id"), exports);
|
|
77
84
|
__exportStar(require("./create_link"), exports);
|
|
@@ -89,6 +96,7 @@ __exportStar(require("./delete_chart"), exports);
|
|
|
89
96
|
__exportStar(require("./delete_cols"), exports);
|
|
90
97
|
__exportStar(require("./delete_cols_in_block"), exports);
|
|
91
98
|
__exportStar(require("./delete_comment"), exports);
|
|
99
|
+
__exportStar(require("./delete_conditional_formatting_rule"), exports);
|
|
92
100
|
__exportStar(require("./delete_rows"), exports);
|
|
93
101
|
__exportStar(require("./delete_rows_in_block"), exports);
|
|
94
102
|
__exportStar(require("./delete_sheet"), exports);
|
|
@@ -128,6 +136,7 @@ __exportStar(require("./modify_policy"), exports);
|
|
|
128
136
|
__exportStar(require("./move_block"), exports);
|
|
129
137
|
__exportStar(require("./move_block_line"), exports);
|
|
130
138
|
__exportStar(require("./move_chart"), exports);
|
|
139
|
+
__exportStar(require("./move_conditional_formatting_rule"), exports);
|
|
131
140
|
__exportStar(require("./msg_edit"), exports);
|
|
132
141
|
__exportStar(require("./msg_join"), exports);
|
|
133
142
|
__exportStar(require("./msg_sequencer_action_invalid_message"), exports);
|
|
@@ -178,6 +187,7 @@ __exportStar(require("./rpc_get_cells_params"), exports);
|
|
|
178
187
|
__exportStar(require("./rpc_get_charts_params"), exports);
|
|
179
188
|
__exportStar(require("./rpc_get_col_width_params"), exports);
|
|
180
189
|
__exportStar(require("./rpc_get_comments_params"), exports);
|
|
190
|
+
__exportStar(require("./rpc_get_conditional_formatting_rules_params"), exports);
|
|
181
191
|
__exportStar(require("./rpc_get_data_boundary_params"), exports);
|
|
182
192
|
__exportStar(require("./rpc_get_dependents_params"), exports);
|
|
183
193
|
__exportStar(require("./rpc_get_display_units_of_formula_params"), exports);
|
|
@@ -244,6 +254,7 @@ __exportStar(require("./token_type"), exports);
|
|
|
244
254
|
__exportStar(require("./token_unit"), exports);
|
|
245
255
|
__exportStar(require("./underline_property"), exports);
|
|
246
256
|
__exportStar(require("./update_chart"), exports);
|
|
257
|
+
__exportStar(require("./update_conditional_formatting_rule"), exports);
|
|
247
258
|
__exportStar(require("./upsert_field_formulas"), exports);
|
|
248
259
|
__exportStar(require("./upsert_field_render_info"), exports);
|
|
249
260
|
__exportStar(require("./upsert_person"), exports);
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export interface MoveConditionalFormattingRule {
|
|
2
|
+
sheetIdx: number;
|
|
3
|
+
ruleId: number;
|
|
4
|
+
startRow: number;
|
|
5
|
+
startCol: number;
|
|
6
|
+
endRow: number;
|
|
7
|
+
endCol: number;
|
|
8
|
+
}
|
|
9
|
+
export declare class MoveConditionalFormattingRuleBuilder {
|
|
10
|
+
private _sheetIdx;
|
|
11
|
+
private _ruleId;
|
|
12
|
+
private _startRow;
|
|
13
|
+
private _startCol;
|
|
14
|
+
private _endRow;
|
|
15
|
+
private _endCol;
|
|
16
|
+
sheetIdx(value: number): this;
|
|
17
|
+
ruleId(value: number): this;
|
|
18
|
+
startRow(value: number): this;
|
|
19
|
+
startCol(value: number): this;
|
|
20
|
+
endRow(value: number): this;
|
|
21
|
+
endCol(value: number): this;
|
|
22
|
+
build(): {
|
|
23
|
+
sheetIdx: number;
|
|
24
|
+
ruleId: number;
|
|
25
|
+
startRow: number;
|
|
26
|
+
startCol: number;
|
|
27
|
+
endRow: number;
|
|
28
|
+
endCol: number;
|
|
29
|
+
};
|
|
30
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MoveConditionalFormattingRuleBuilder = void 0;
|
|
4
|
+
class MoveConditionalFormattingRuleBuilder {
|
|
5
|
+
_sheetIdx;
|
|
6
|
+
_ruleId;
|
|
7
|
+
_startRow;
|
|
8
|
+
_startCol;
|
|
9
|
+
_endRow;
|
|
10
|
+
_endCol;
|
|
11
|
+
sheetIdx(value) {
|
|
12
|
+
this._sheetIdx = value;
|
|
13
|
+
return this;
|
|
14
|
+
}
|
|
15
|
+
ruleId(value) {
|
|
16
|
+
this._ruleId = value;
|
|
17
|
+
return this;
|
|
18
|
+
}
|
|
19
|
+
startRow(value) {
|
|
20
|
+
this._startRow = value;
|
|
21
|
+
return this;
|
|
22
|
+
}
|
|
23
|
+
startCol(value) {
|
|
24
|
+
this._startCol = value;
|
|
25
|
+
return this;
|
|
26
|
+
}
|
|
27
|
+
endRow(value) {
|
|
28
|
+
this._endRow = value;
|
|
29
|
+
return this;
|
|
30
|
+
}
|
|
31
|
+
endCol(value) {
|
|
32
|
+
this._endCol = value;
|
|
33
|
+
return this;
|
|
34
|
+
}
|
|
35
|
+
build() {
|
|
36
|
+
if (this._sheetIdx === undefined)
|
|
37
|
+
throw new Error('missing sheetIdx');
|
|
38
|
+
if (this._ruleId === undefined)
|
|
39
|
+
throw new Error('missing ruleId');
|
|
40
|
+
if (this._startRow === undefined)
|
|
41
|
+
throw new Error('missing startRow');
|
|
42
|
+
if (this._startCol === undefined)
|
|
43
|
+
throw new Error('missing startCol');
|
|
44
|
+
if (this._endRow === undefined)
|
|
45
|
+
throw new Error('missing endRow');
|
|
46
|
+
if (this._endCol === undefined)
|
|
47
|
+
throw new Error('missing endCol');
|
|
48
|
+
return { sheetIdx: this._sheetIdx, ruleId: this._ruleId, startRow: this._startRow, startCol: this._startCol, endRow: this._endRow, endCol: this._endCol };
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
exports.MoveConditionalFormattingRuleBuilder = MoveConditionalFormattingRuleBuilder;
|
|
@@ -14,6 +14,7 @@ import { CellInfo } from './cell_info';
|
|
|
14
14
|
import { CellInput } from './cell_input';
|
|
15
15
|
import { CellPosition } from './cell_position';
|
|
16
16
|
import { CellRefRange } from './cell_ref_range';
|
|
17
|
+
import { CfRuleInfo } from './cf_rule_info';
|
|
17
18
|
import { ChartInfo } from './chart_info';
|
|
18
19
|
import { CheckFormulaParams } from './rpc_check_formula_params';
|
|
19
20
|
import { CheckpointMetaDto } from './checkpoint_meta';
|
|
@@ -44,6 +45,7 @@ import { GetCellsParams } from './rpc_get_cells_params';
|
|
|
44
45
|
import { GetChartsParams } from './rpc_get_charts_params';
|
|
45
46
|
import { GetColWidthParams } from './rpc_get_col_width_params';
|
|
46
47
|
import { GetCommentsParams } from './rpc_get_comments_params';
|
|
48
|
+
import { GetConditionalFormattingRulesParams } from './rpc_get_conditional_formatting_rules_params';
|
|
47
49
|
import { GetDataBoundaryParams } from './rpc_get_data_boundary_params';
|
|
48
50
|
import { GetDependentsParams } from './rpc_get_dependents_params';
|
|
49
51
|
import { GetDisplayUnitsOfFormulaParams } from './rpc_get_display_units_of_formula_params';
|
|
@@ -134,6 +136,7 @@ export interface WorkbookMethods {
|
|
|
134
136
|
getComments(params: GetCommentsParams, bookId?: number): Promise<readonly Comment[] | ErrorMessage>;
|
|
135
137
|
getCellImages(params: GetCellImagesParams, bookId?: number): Promise<readonly CellImageInfo[] | ErrorMessage>;
|
|
136
138
|
getCharts(params: GetChartsParams, bookId?: number): Promise<readonly ChartInfo[] | ErrorMessage>;
|
|
139
|
+
getConditionalFormattingRules(params: GetConditionalFormattingRulesParams, bookId?: number): Promise<readonly CfRuleInfo[] | ErrorMessage>;
|
|
137
140
|
getShadowCellId(params: GetShadowCellIdParams, bookId?: number): Promise<SheetCellId | ErrorMessage>;
|
|
138
141
|
getShadowCellIds(params: GetShadowCellIdsParams, bookId?: number): Promise<readonly SheetCellId[] | ErrorMessage>;
|
|
139
142
|
getShadowInfoById(params: GetShadowInfoByIdParams, bookId?: number): Promise<ShadowCellInfo | ErrorMessage>;
|
|
@@ -146,6 +149,7 @@ export interface WorkbookMethods {
|
|
|
146
149
|
loadWorkbook(params: LoadWorkbookParams, bookId?: number): Promise<void | ErrorMessage>;
|
|
147
150
|
save(params: SaveParams, bookId?: number): Promise<SaveFileResult | ErrorMessage>;
|
|
148
151
|
getAppData(bookId?: number): Promise<readonly AppData[] | ErrorMessage>;
|
|
152
|
+
getVersion(bookId?: number): Promise<number | ErrorMessage>;
|
|
149
153
|
getDisplayUnitsOfFormula(params: GetDisplayUnitsOfFormulaParams, bookId?: number): Promise<FormulaDisplayInfo | ErrorMessage>;
|
|
150
154
|
calcCondition(params: CalcConditionParams, bookId?: number): Promise<boolean | ErrorMessage>;
|
|
151
155
|
getCellIdByBlockRef(params: GetCellIdByBlockRefParams, bookId?: number): Promise<SheetCellId | ErrorMessage>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export type ShadowKind = 'validation' | 'userEditable';
|
|
1
|
+
export type ShadowKind = 'validation' | 'userEditable' | 'conditionalFormat' | 'conditionalFormatScale';
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { CfRuleSpec } from './cf_rule_spec';
|
|
2
|
+
export interface UpdateConditionalFormattingRule {
|
|
3
|
+
sheetIdx: number;
|
|
4
|
+
ruleId: number;
|
|
5
|
+
rule: CfRuleSpec;
|
|
6
|
+
}
|
|
7
|
+
export declare class UpdateConditionalFormattingRuleBuilder {
|
|
8
|
+
private _sheetIdx;
|
|
9
|
+
private _ruleId;
|
|
10
|
+
private _rule;
|
|
11
|
+
sheetIdx(value: number): this;
|
|
12
|
+
ruleId(value: number): this;
|
|
13
|
+
rule(value: CfRuleSpec): this;
|
|
14
|
+
build(): {
|
|
15
|
+
sheetIdx: number;
|
|
16
|
+
ruleId: number;
|
|
17
|
+
rule: CfRuleSpec;
|
|
18
|
+
};
|
|
19
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UpdateConditionalFormattingRuleBuilder = void 0;
|
|
4
|
+
class UpdateConditionalFormattingRuleBuilder {
|
|
5
|
+
_sheetIdx;
|
|
6
|
+
_ruleId;
|
|
7
|
+
_rule;
|
|
8
|
+
sheetIdx(value) {
|
|
9
|
+
this._sheetIdx = value;
|
|
10
|
+
return this;
|
|
11
|
+
}
|
|
12
|
+
ruleId(value) {
|
|
13
|
+
this._ruleId = value;
|
|
14
|
+
return this;
|
|
15
|
+
}
|
|
16
|
+
rule(value) {
|
|
17
|
+
this._rule = value;
|
|
18
|
+
return this;
|
|
19
|
+
}
|
|
20
|
+
build() {
|
|
21
|
+
if (this._sheetIdx === undefined)
|
|
22
|
+
throw new Error('missing sheetIdx');
|
|
23
|
+
if (this._ruleId === undefined)
|
|
24
|
+
throw new Error('missing ruleId');
|
|
25
|
+
if (this._rule === undefined)
|
|
26
|
+
throw new Error('missing rule');
|
|
27
|
+
return { sheetIdx: this._sheetIdx, ruleId: this._ruleId, rule: this._rule };
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
exports.UpdateConditionalFormattingRuleBuilder = UpdateConditionalFormattingRuleBuilder;
|
|
@@ -2,19 +2,19 @@
|
|
|
2
2
|
/* eslint-disable */
|
|
3
3
|
export function handle(msg: any, book_id?: number | null): any;
|
|
4
4
|
/**
|
|
5
|
-
* Render a
|
|
6
|
-
*
|
|
5
|
+
* Render a number with an Excel number-format code, natively via `ssf-rs`
|
|
6
|
+
* (the Rust port of SheetJS `ssf`). Replaces the browser's old dependency on
|
|
7
|
+
* the `ssf` npm package. On an unsupported/invalid format it falls back to the
|
|
8
|
+
* JavaScript `String(value)` representation, matching the previous behavior.
|
|
7
9
|
*/
|
|
8
|
-
export function
|
|
10
|
+
export function format_number(fmt: string, value: number): string;
|
|
9
11
|
/**
|
|
10
12
|
* Input: AsyncFuncResult
|
|
11
13
|
* Output: ActionAffect
|
|
12
14
|
*/
|
|
13
15
|
export function input_async_result(id: number, result: any): any;
|
|
14
16
|
/**
|
|
15
|
-
* Render a
|
|
16
|
-
*
|
|
17
|
-
* the `ssf` npm package. On an unsupported/invalid format it falls back to the
|
|
18
|
-
* JavaScript `String(value)` representation, matching the previous behavior.
|
|
17
|
+
* Render a text value with an Excel number-format code (for the `@` text
|
|
18
|
+
* section). Falls back to the text itself on an unsupported format.
|
|
19
19
|
*/
|
|
20
|
-
export function
|
|
20
|
+
export function format_text(fmt: string, text: string): string;
|
|
@@ -181,26 +181,26 @@ module.exports.handle = function(msg, book_id) {
|
|
|
181
181
|
};
|
|
182
182
|
|
|
183
183
|
/**
|
|
184
|
-
* Render a
|
|
185
|
-
*
|
|
184
|
+
* Render a number with an Excel number-format code, natively via `ssf-rs`
|
|
185
|
+
* (the Rust port of SheetJS `ssf`). Replaces the browser's old dependency on
|
|
186
|
+
* the `ssf` npm package. On an unsupported/invalid format it falls back to the
|
|
187
|
+
* JavaScript `String(value)` representation, matching the previous behavior.
|
|
186
188
|
* @param {string} fmt
|
|
187
|
-
* @param {
|
|
189
|
+
* @param {number} value
|
|
188
190
|
* @returns {string}
|
|
189
191
|
*/
|
|
190
|
-
module.exports.
|
|
191
|
-
let
|
|
192
|
-
let
|
|
192
|
+
module.exports.format_number = function(fmt, value) {
|
|
193
|
+
let deferred2_0;
|
|
194
|
+
let deferred2_1;
|
|
193
195
|
try {
|
|
194
196
|
const ptr0 = passStringToWasm0(fmt, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
195
197
|
const len0 = WASM_VECTOR_LEN;
|
|
196
|
-
const
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
deferred3_0 = ret[0];
|
|
200
|
-
deferred3_1 = ret[1];
|
|
198
|
+
const ret = wasm.format_number(ptr0, len0, value);
|
|
199
|
+
deferred2_0 = ret[0];
|
|
200
|
+
deferred2_1 = ret[1];
|
|
201
201
|
return getStringFromWasm0(ret[0], ret[1]);
|
|
202
202
|
} finally {
|
|
203
|
-
wasm.__wbindgen_free(
|
|
203
|
+
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
204
204
|
}
|
|
205
205
|
};
|
|
206
206
|
|
|
@@ -217,26 +217,26 @@ module.exports.input_async_result = function(id, result) {
|
|
|
217
217
|
};
|
|
218
218
|
|
|
219
219
|
/**
|
|
220
|
-
* Render a
|
|
221
|
-
*
|
|
222
|
-
* the `ssf` npm package. On an unsupported/invalid format it falls back to the
|
|
223
|
-
* JavaScript `String(value)` representation, matching the previous behavior.
|
|
220
|
+
* Render a text value with an Excel number-format code (for the `@` text
|
|
221
|
+
* section). Falls back to the text itself on an unsupported format.
|
|
224
222
|
* @param {string} fmt
|
|
225
|
-
* @param {
|
|
223
|
+
* @param {string} text
|
|
226
224
|
* @returns {string}
|
|
227
225
|
*/
|
|
228
|
-
module.exports.
|
|
229
|
-
let
|
|
230
|
-
let
|
|
226
|
+
module.exports.format_text = function(fmt, text) {
|
|
227
|
+
let deferred3_0;
|
|
228
|
+
let deferred3_1;
|
|
231
229
|
try {
|
|
232
230
|
const ptr0 = passStringToWasm0(fmt, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
233
231
|
const len0 = WASM_VECTOR_LEN;
|
|
234
|
-
const
|
|
235
|
-
|
|
236
|
-
|
|
232
|
+
const ptr1 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
233
|
+
const len1 = WASM_VECTOR_LEN;
|
|
234
|
+
const ret = wasm.format_text(ptr0, len0, ptr1, len1);
|
|
235
|
+
deferred3_0 = ret[0];
|
|
236
|
+
deferred3_1 = ret[1];
|
|
237
237
|
return getStringFromWasm0(ret[0], ret[1]);
|
|
238
238
|
} finally {
|
|
239
|
-
wasm.__wbindgen_free(
|
|
239
|
+
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
240
240
|
}
|
|
241
241
|
};
|
|
242
242
|
|
|
Binary file
|
package/dist/wasm/package.json
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "logisheets",
|
|
3
|
-
"version": "1.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "1.11.0",
|
|
4
|
+
"description": "Node.js bindings for LogiSheets — a Rust + WebAssembly spreadsheet engine that reads, edits, and writes real .xlsx (Excel) files (formulas, styles, and structure preserved) with no browser required.",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
7
7
|
"scripts": {
|
|
@@ -18,7 +18,15 @@
|
|
|
18
18
|
},
|
|
19
19
|
"keywords": [
|
|
20
20
|
"xlsx",
|
|
21
|
-
"
|
|
21
|
+
"excel",
|
|
22
|
+
"spreadsheet",
|
|
23
|
+
"spreadsheet-engine",
|
|
24
|
+
"wasm",
|
|
25
|
+
"webassembly",
|
|
26
|
+
"rust",
|
|
27
|
+
"nodejs",
|
|
28
|
+
"formula",
|
|
29
|
+
"ooxml"
|
|
22
30
|
],
|
|
23
31
|
"author": "Jeremy He<yiliang.he@qq.com>",
|
|
24
32
|
"license": "MIT",
|
|
@@ -2,19 +2,19 @@
|
|
|
2
2
|
/* eslint-disable */
|
|
3
3
|
export function handle(msg: any, book_id?: number | null): any;
|
|
4
4
|
/**
|
|
5
|
-
* Render a
|
|
6
|
-
*
|
|
5
|
+
* Render a number with an Excel number-format code, natively via `ssf-rs`
|
|
6
|
+
* (the Rust port of SheetJS `ssf`). Replaces the browser's old dependency on
|
|
7
|
+
* the `ssf` npm package. On an unsupported/invalid format it falls back to the
|
|
8
|
+
* JavaScript `String(value)` representation, matching the previous behavior.
|
|
7
9
|
*/
|
|
8
|
-
export function
|
|
10
|
+
export function format_number(fmt: string, value: number): string;
|
|
9
11
|
/**
|
|
10
12
|
* Input: AsyncFuncResult
|
|
11
13
|
* Output: ActionAffect
|
|
12
14
|
*/
|
|
13
15
|
export function input_async_result(id: number, result: any): any;
|
|
14
16
|
/**
|
|
15
|
-
* Render a
|
|
16
|
-
*
|
|
17
|
-
* the `ssf` npm package. On an unsupported/invalid format it falls back to the
|
|
18
|
-
* JavaScript `String(value)` representation, matching the previous behavior.
|
|
17
|
+
* Render a text value with an Excel number-format code (for the `@` text
|
|
18
|
+
* section). Falls back to the text itself on an unsupported format.
|
|
19
19
|
*/
|
|
20
|
-
export function
|
|
20
|
+
export function format_text(fmt: string, text: string): string;
|
|
@@ -181,26 +181,26 @@ module.exports.handle = function(msg, book_id) {
|
|
|
181
181
|
};
|
|
182
182
|
|
|
183
183
|
/**
|
|
184
|
-
* Render a
|
|
185
|
-
*
|
|
184
|
+
* Render a number with an Excel number-format code, natively via `ssf-rs`
|
|
185
|
+
* (the Rust port of SheetJS `ssf`). Replaces the browser's old dependency on
|
|
186
|
+
* the `ssf` npm package. On an unsupported/invalid format it falls back to the
|
|
187
|
+
* JavaScript `String(value)` representation, matching the previous behavior.
|
|
186
188
|
* @param {string} fmt
|
|
187
|
-
* @param {
|
|
189
|
+
* @param {number} value
|
|
188
190
|
* @returns {string}
|
|
189
191
|
*/
|
|
190
|
-
module.exports.
|
|
191
|
-
let
|
|
192
|
-
let
|
|
192
|
+
module.exports.format_number = function(fmt, value) {
|
|
193
|
+
let deferred2_0;
|
|
194
|
+
let deferred2_1;
|
|
193
195
|
try {
|
|
194
196
|
const ptr0 = passStringToWasm0(fmt, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
195
197
|
const len0 = WASM_VECTOR_LEN;
|
|
196
|
-
const
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
deferred3_0 = ret[0];
|
|
200
|
-
deferred3_1 = ret[1];
|
|
198
|
+
const ret = wasm.format_number(ptr0, len0, value);
|
|
199
|
+
deferred2_0 = ret[0];
|
|
200
|
+
deferred2_1 = ret[1];
|
|
201
201
|
return getStringFromWasm0(ret[0], ret[1]);
|
|
202
202
|
} finally {
|
|
203
|
-
wasm.__wbindgen_free(
|
|
203
|
+
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
204
204
|
}
|
|
205
205
|
};
|
|
206
206
|
|
|
@@ -217,26 +217,26 @@ module.exports.input_async_result = function(id, result) {
|
|
|
217
217
|
};
|
|
218
218
|
|
|
219
219
|
/**
|
|
220
|
-
* Render a
|
|
221
|
-
*
|
|
222
|
-
* the `ssf` npm package. On an unsupported/invalid format it falls back to the
|
|
223
|
-
* JavaScript `String(value)` representation, matching the previous behavior.
|
|
220
|
+
* Render a text value with an Excel number-format code (for the `@` text
|
|
221
|
+
* section). Falls back to the text itself on an unsupported format.
|
|
224
222
|
* @param {string} fmt
|
|
225
|
-
* @param {
|
|
223
|
+
* @param {string} text
|
|
226
224
|
* @returns {string}
|
|
227
225
|
*/
|
|
228
|
-
module.exports.
|
|
229
|
-
let
|
|
230
|
-
let
|
|
226
|
+
module.exports.format_text = function(fmt, text) {
|
|
227
|
+
let deferred3_0;
|
|
228
|
+
let deferred3_1;
|
|
231
229
|
try {
|
|
232
230
|
const ptr0 = passStringToWasm0(fmt, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
233
231
|
const len0 = WASM_VECTOR_LEN;
|
|
234
|
-
const
|
|
235
|
-
|
|
236
|
-
|
|
232
|
+
const ptr1 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
233
|
+
const len1 = WASM_VECTOR_LEN;
|
|
234
|
+
const ret = wasm.format_text(ptr0, len0, ptr1, len1);
|
|
235
|
+
deferred3_0 = ret[0];
|
|
236
|
+
deferred3_1 = ret[1];
|
|
237
237
|
return getStringFromWasm0(ret[0], ret[1]);
|
|
238
238
|
} finally {
|
|
239
|
-
wasm.__wbindgen_free(
|
|
239
|
+
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
240
240
|
}
|
|
241
241
|
};
|
|
242
242
|
|
|
Binary file
|