@kition/kit-table-ui 0.0.0-stage → 0.5.8
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/package.json +29 -4
- package/table-ui/LICENSE +177 -0
- package/table-ui/NOTICE +223 -0
- package/table-ui/THIRD_PARTY_NOTICES.txt +11755 -0
- package/table-ui/agent/checks.json +56 -0
- package/table-ui/agent/guide.md +367 -0
- package/table-ui/assets/common-B-bp9Ip3.js +1 -0
- package/table-ui/assets/common-BMUmnQ1g.js +1 -0
- package/table-ui/assets/common-Bhm8gfvH.js +1 -0
- package/table-ui/assets/common-CeDowx6y.js +1 -0
- package/table-ui/assets/common-CrgxgxUu.js +1 -0
- package/table-ui/assets/common-DBFkHMZV.js +1 -0
- package/table-ui/assets/dev-DVvJVjyg.js +1 -0
- package/table-ui/assets/dist-BNgs-zwK.js +1 -0
- package/table-ui/assets/index-B4NhVTGq.css +1 -0
- package/table-ui/assets/index-D4MBkivB.js +167 -0
- package/table-ui/assets/kitEngine.worker-BfM9MCRl-BKaBiFnK.js +13103 -0
- package/table-ui/assets/table--j5_5jI6.js +1 -0
- package/table-ui/assets/table-B5yY2dYW.js +1 -0
- package/table-ui/assets/table-Bpba-GrO.js +1 -0
- package/table-ui/assets/table-CpZGkC_z.js +1 -0
- package/table-ui/assets/table-CqH5qF2L.js +1 -0
- package/table-ui/assets/table-DpGGBEXD.js +1 -0
- package/table-ui/engine/kition_table_kit.js +1418 -0
- package/table-ui/engine/kition_table_kit_bg.wasm +0 -0
- package/table-ui/fonts/droid-sans-fallback/DroidSansFallbackFull.ttf +0 -0
- package/table-ui/fonts/droid-sans-fallback/LICENSE +177 -0
- package/table-ui/fonts/droid-sans-fallback/NOTICE +190 -0
- package/table-ui/fonts/inter/Inter-Variable.ttf +0 -0
- package/table-ui/fonts/inter/OFL.txt +93 -0
- package/table-ui/fonts/nanum-gothic/NanumGothic-Regular.ttf +0 -0
- package/table-ui/fonts/nanum-gothic/OFL.txt +96 -0
- package/table-ui/fonts/noto-color-emoji/Noto-COLRv1.ttf +0 -0
- package/table-ui/fonts/noto-color-emoji/OFL.txt +92 -0
- package/table-ui/index.html +14 -0
- package/table-ui/kit-ui.json +1 -0
- package/table-ui/kit.json +224 -0
- package/table-ui/model/schema.json +108 -0
- package/table-ui/templates/batch-product-designer/manifest.json +368 -0
- package/table-ui/templates/batch-product-designer/records/record-01/design-01.webp +0 -0
- package/table-ui/templates/batch-product-designer/records/record-01/design-02.webp +0 -0
- package/table-ui/templates/batch-product-designer/records/record-01/feature-image-01.webp +0 -0
- package/table-ui/templates/batch-product-designer/records/record-01/lifestyle-shot-01.webp +0 -0
- package/table-ui/templates/batch-product-designer/records/record-01/orthographic-views-01.webp +0 -0
- package/table-ui/templates/batch-product-designer/records/record-01/style-board-01.webp +0 -0
- package/table-ui/templates/batch-product-designer/records/record-02/design-01.webp +0 -0
- package/table-ui/templates/batch-product-designer/records/record-02/design-02.webp +0 -0
- package/table-ui/templates/batch-product-designer/records/record-02/feature-image-01.webp +0 -0
- package/table-ui/templates/batch-product-designer/records/record-02/lifestyle-shot-01.webp +0 -0
- package/table-ui/templates/batch-product-designer/records/record-02/orthographic-views-01.webp +0 -0
- package/table-ui/templates/batch-product-designer/records/record-02/style-board-01.webp +0 -0
- package/table-ui/templates/batch-product-designer/records/record-03/design-01.webp +0 -0
- package/table-ui/templates/batch-product-designer/records/record-03/design-02.webp +0 -0
- package/table-ui/templates/batch-product-designer/records/record-03/feature-image-01.webp +0 -0
- package/table-ui/templates/batch-product-designer/records/record-03/lifestyle-shot-01.webp +0 -0
- package/table-ui/templates/batch-product-designer/records/record-03/orthographic-views-01.webp +0 -0
- package/table-ui/templates/batch-product-designer/records/record-03/style-board-01.webp +0 -0
- package/table-ui/templates/batch-product-designer/records/record-04/design-01.webp +0 -0
- package/table-ui/templates/batch-product-designer/records/record-04/design-02.webp +0 -0
- package/table-ui/templates/batch-product-designer/records/record-04/feature-image-01.webp +0 -0
- package/table-ui/templates/batch-product-designer/records/record-04/lifestyle-shot-01.webp +0 -0
- package/table-ui/templates/batch-product-designer/records/record-04/orthographic-views-01.webp +0 -0
- package/table-ui/templates/batch-product-designer/records/record-04/style-board-01.webp +0 -0
- package/table-ui/templates/batch-product-designer/records/record-05/design-01.webp +0 -0
- package/table-ui/templates/batch-product-designer/records/record-05/design-02.webp +0 -0
- package/table-ui/templates/batch-product-designer/records/record-05/feature-image-01.webp +0 -0
- package/table-ui/templates/batch-product-designer/records/record-05/lifestyle-shot-01.webp +0 -0
- package/table-ui/templates/batch-product-designer/records/record-05/orthographic-views-01.webp +0 -0
- package/table-ui/templates/batch-product-designer/records/record-05/style-board-01.webp +0 -0
- package/table-ui/templates/receipt-ocr-database/cover.webp +0 -0
- package/table-ui/templates/receipt-ocr-database/manifest.json +128 -0
- package/table-ui/templates/receipt-ocr-database/records/record-01/receipt.webp +0 -0
- package/table-ui/templates/receipt-ocr-database/records/record-02/receipt.webp +0 -0
- package/table-ui/templates/receipt-ocr-database/records/record-03/receipt.webp +0 -0
- package/table-ui/templates/receipt-ocr-database/records/record-04/receipt.webp +0 -0
- package/table-ui/templates/receipt-ocr-database/records/record-05/receipt.webp +0 -0
- package/table-ui/templates/receipt-ocr-database/records/record-06/receipt.webp +0 -0
- package/table-ui/templates/receipt-ocr-database/records/record-07/receipt.webp +0 -0
- package/table-ui/templates/receipt-ocr-database/records/record-08/receipt.webp +0 -0
- package/table-ui/templates/receipt-ocr-database/records/record-09/receipt.webp +0 -0
- package/table-ui/templates/receipt-ocr-database/records/record-10/receipt.webp +0 -0
- package/table-ui/templates/table-covers/batch-product-designer.webp +0 -0
- package/table-ui/templates/table-covers/business-analytics-dashboard.webp +0 -0
- package/table-ui/templates/table-covers/leads-landing-page.webp +0 -0
- package/table-ui/templates/table-covers/lumiere-restaurant.webp +0 -0
- package/table-ui/templates/table-covers/product-launch-website.webp +0 -0
- package/table-ui/templates/table-covers/project-gantt.webp +0 -0
- package/table-ui/templates/table-covers/receipt-ocr-database.webp +0 -0
- package/table-ui/templates/table-covers/sdr-cold-call-manager.webp +0 -0
- package/table-ui/templates/table-covers/simple-client-crm.webp +0 -0
- package/table-ui/templates/table-covers/task-tracker.webp +0 -0
- package/table-ui/templates/table-covers/thumbnail-generator.webp +0 -0
- package/table-ui/templates/youtube-tiktok-thumbnail-generator/manifest.json +308 -0
- package/table-ui/templates/youtube-tiktok-thumbnail-generator/records/record-01/face-photo-01.webp +0 -0
- package/table-ui/templates/youtube-tiktok-thumbnail-generator/records/record-01/thumbnail-16x9-01.webp +0 -0
- package/table-ui/templates/youtube-tiktok-thumbnail-generator/records/record-01/thumbnail-16x9-02.webp +0 -0
- package/table-ui/templates/youtube-tiktok-thumbnail-generator/records/record-01/thumbnail-9x16-01.webp +0 -0
- package/table-ui/templates/youtube-tiktok-thumbnail-generator/records/record-01/thumbnail-9x16-02.webp +0 -0
- package/table-ui/templates/youtube-tiktok-thumbnail-generator/records/record-02/face-photo-01.webp +0 -0
- package/table-ui/templates/youtube-tiktok-thumbnail-generator/records/record-02/thumbnail-16x9-01.webp +0 -0
- package/table-ui/templates/youtube-tiktok-thumbnail-generator/records/record-02/thumbnail-16x9-02.webp +0 -0
- package/table-ui/templates/youtube-tiktok-thumbnail-generator/records/record-02/thumbnail-9x16-01.webp +0 -0
- package/table-ui/templates/youtube-tiktok-thumbnail-generator/records/record-02/thumbnail-9x16-02.webp +0 -0
- package/table-ui/templates/youtube-tiktok-thumbnail-generator/records/record-03/face-photo-01.webp +0 -0
- package/table-ui/templates/youtube-tiktok-thumbnail-generator/records/record-03/thumbnail-16x9-01.webp +0 -0
- package/table-ui/templates/youtube-tiktok-thumbnail-generator/records/record-03/thumbnail-16x9-02.webp +0 -0
- package/table-ui/templates/youtube-tiktok-thumbnail-generator/records/record-03/thumbnail-9x16-01.webp +0 -0
- package/table-ui/templates/youtube-tiktok-thumbnail-generator/records/record-03/thumbnail-9x16-02.webp +0 -0
- package/table-ui/templates/youtube-tiktok-thumbnail-generator/records/record-04/face-photo-01.webp +0 -0
- package/table-ui/templates/youtube-tiktok-thumbnail-generator/records/record-04/thumbnail-16x9-01.webp +0 -0
- package/table-ui/templates/youtube-tiktok-thumbnail-generator/records/record-04/thumbnail-16x9-02.webp +0 -0
- package/table-ui/templates/youtube-tiktok-thumbnail-generator/records/record-04/thumbnail-9x16-01.webp +0 -0
- package/table-ui/templates/youtube-tiktok-thumbnail-generator/records/record-04/thumbnail-9x16-02.webp +0 -0
- package/table-ui/templates/youtube-tiktok-thumbnail-generator/records/record-05/face-photo-01.webp +0 -0
- package/table-ui/templates/youtube-tiktok-thumbnail-generator/records/record-05/thumbnail-16x9-01.webp +0 -0
- package/table-ui/templates/youtube-tiktok-thumbnail-generator/records/record-05/thumbnail-16x9-02.webp +0 -0
- package/table-ui/templates/youtube-tiktok-thumbnail-generator/records/record-05/thumbnail-9x16-01.webp +0 -0
- package/table-ui/templates/youtube-tiktok-thumbnail-generator/records/record-05/thumbnail-9x16-02.webp +0 -0
- package/README.md +0 -3
|
@@ -0,0 +1,1418 @@
|
|
|
1
|
+
export class TableDocument {
|
|
2
|
+
static __wrap(ptr) {
|
|
3
|
+
const obj = Object.create(TableDocument.prototype);
|
|
4
|
+
obj.__wbg_ptr = ptr;
|
|
5
|
+
TableDocumentFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
6
|
+
return obj;
|
|
7
|
+
}
|
|
8
|
+
__destroy_into_raw() {
|
|
9
|
+
const ptr = this.__wbg_ptr;
|
|
10
|
+
this.__wbg_ptr = 0;
|
|
11
|
+
TableDocumentFinalization.unregister(this);
|
|
12
|
+
return ptr;
|
|
13
|
+
}
|
|
14
|
+
free() {
|
|
15
|
+
const ptr = this.__destroy_into_raw();
|
|
16
|
+
wasm.__wbg_tabledocument_free(ptr, 0);
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Stores a peer's blobs (from their `blobs()` or `blobsSince`) before their changes import.
|
|
20
|
+
* @param {Uint8Array} bytes
|
|
21
|
+
*/
|
|
22
|
+
addBlobs(bytes) {
|
|
23
|
+
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
24
|
+
const len0 = WASM_VECTOR_LEN;
|
|
25
|
+
const ret = wasm.tabledocument_addBlobs(this.__wbg_ptr, ptr0, len0);
|
|
26
|
+
if (ret[1]) {
|
|
27
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* The blobs the changes since `since` name, encoded like `blobs()`: for live sync, so a
|
|
32
|
+
* change ships only the blobs it needs.
|
|
33
|
+
* @param {Uint8Array} since
|
|
34
|
+
* @returns {Uint8Array}
|
|
35
|
+
*/
|
|
36
|
+
blobsSince(since) {
|
|
37
|
+
const ptr0 = passArray8ToWasm0(since, wasm.__wbindgen_malloc);
|
|
38
|
+
const len0 = WASM_VECTOR_LEN;
|
|
39
|
+
const ret = wasm.tabledocument_blobsSince(this.__wbg_ptr, ptr0, len0);
|
|
40
|
+
if (ret[3]) {
|
|
41
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
42
|
+
}
|
|
43
|
+
var v2 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
44
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
45
|
+
return v2;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Every blob (an attachment held in the file) the document holds, for a peer's `addBlobs`.
|
|
49
|
+
* @returns {Uint8Array}
|
|
50
|
+
*/
|
|
51
|
+
blobs() {
|
|
52
|
+
const ret = wasm.tabledocument_blobs(this.__wbg_ptr);
|
|
53
|
+
if (ret[3]) {
|
|
54
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
55
|
+
}
|
|
56
|
+
var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
57
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
58
|
+
return v1;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* One `kition-table-api` request: `params` is JSON (an object, or empty for none); answers
|
|
62
|
+
* `{ "result", "change" }` as JSON.
|
|
63
|
+
* @param {string} method
|
|
64
|
+
* @param {string} params
|
|
65
|
+
* @returns {string}
|
|
66
|
+
*/
|
|
67
|
+
call(method, params) {
|
|
68
|
+
let deferred4_0;
|
|
69
|
+
let deferred4_1;
|
|
70
|
+
try {
|
|
71
|
+
const ptr0 = passStringToWasm0(method, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
72
|
+
const len0 = WASM_VECTOR_LEN;
|
|
73
|
+
const ptr1 = passStringToWasm0(params, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
74
|
+
const len1 = WASM_VECTOR_LEN;
|
|
75
|
+
const ret = wasm.tabledocument_call(this.__wbg_ptr, ptr0, len0, ptr1, len1);
|
|
76
|
+
var ptr3 = ret[0];
|
|
77
|
+
var len3 = ret[1];
|
|
78
|
+
if (ret[3]) {
|
|
79
|
+
ptr3 = 0; len3 = 0;
|
|
80
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
81
|
+
}
|
|
82
|
+
deferred4_0 = ptr3;
|
|
83
|
+
deferred4_1 = len3;
|
|
84
|
+
return getStringFromWasm0(ptr3, len3);
|
|
85
|
+
} finally {
|
|
86
|
+
wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* @returns {boolean}
|
|
91
|
+
*/
|
|
92
|
+
canRedo() {
|
|
93
|
+
const ret = wasm.tabledocument_canRedo(this.__wbg_ptr);
|
|
94
|
+
return ret !== 0;
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* @returns {boolean}
|
|
98
|
+
*/
|
|
99
|
+
canUndo() {
|
|
100
|
+
const ret = wasm.tabledocument_canUndo(this.__wbg_ptr);
|
|
101
|
+
return ret !== 0;
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* `{ "diagnostics": [...] }` as JSON (standard 2.0 A21).
|
|
105
|
+
* @returns {string}
|
|
106
|
+
*/
|
|
107
|
+
check() {
|
|
108
|
+
let deferred1_0;
|
|
109
|
+
let deferred1_1;
|
|
110
|
+
try {
|
|
111
|
+
const ret = wasm.tabledocument_check(this.__wbg_ptr);
|
|
112
|
+
deferred1_0 = ret[0];
|
|
113
|
+
deferred1_1 = ret[1];
|
|
114
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
115
|
+
} finally {
|
|
116
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* @returns {string}
|
|
121
|
+
*/
|
|
122
|
+
commands() {
|
|
123
|
+
let deferred1_0;
|
|
124
|
+
let deferred1_1;
|
|
125
|
+
try {
|
|
126
|
+
const ret = wasm.tabledocument_commands(this.__wbg_ptr);
|
|
127
|
+
deferred1_0 = ret[0];
|
|
128
|
+
deferred1_1 = ret[1];
|
|
129
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
130
|
+
} finally {
|
|
131
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* @returns {number}
|
|
136
|
+
*/
|
|
137
|
+
static contractVersion() {
|
|
138
|
+
const ret = wasm.tabledocument_contractVersion();
|
|
139
|
+
return ret >>> 0;
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* @param {string} name
|
|
143
|
+
* @param {number} width
|
|
144
|
+
* @param {number} height
|
|
145
|
+
* @returns {TableDocument}
|
|
146
|
+
*/
|
|
147
|
+
static create(name, width, height) {
|
|
148
|
+
const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
149
|
+
const len0 = WASM_VECTOR_LEN;
|
|
150
|
+
const ret = wasm.tabledocument_create(ptr0, len0, width, height);
|
|
151
|
+
if (ret[2]) {
|
|
152
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
153
|
+
}
|
|
154
|
+
return TableDocument.__wrap(ret[0]);
|
|
155
|
+
}
|
|
156
|
+
/**
|
|
157
|
+
* @returns {boolean}
|
|
158
|
+
*/
|
|
159
|
+
get dirty() {
|
|
160
|
+
const ret = wasm.tabledocument_dirty(this.__wbg_ptr);
|
|
161
|
+
return ret !== 0;
|
|
162
|
+
}
|
|
163
|
+
/**
|
|
164
|
+
* The ids of the commands that cannot run now, as a JSON array.
|
|
165
|
+
* @returns {string}
|
|
166
|
+
*/
|
|
167
|
+
disabledCommands() {
|
|
168
|
+
let deferred1_0;
|
|
169
|
+
let deferred1_1;
|
|
170
|
+
try {
|
|
171
|
+
const ret = wasm.tabledocument_disabledCommands(this.__wbg_ptr);
|
|
172
|
+
deferred1_0 = ret[0];
|
|
173
|
+
deferred1_1 = ret[1];
|
|
174
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
175
|
+
} finally {
|
|
176
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
/**
|
|
180
|
+
* @returns {string}
|
|
181
|
+
*/
|
|
182
|
+
get docId() {
|
|
183
|
+
let deferred1_0;
|
|
184
|
+
let deferred1_1;
|
|
185
|
+
try {
|
|
186
|
+
const ret = wasm.tabledocument_docId(this.__wbg_ptr);
|
|
187
|
+
deferred1_0 = ret[0];
|
|
188
|
+
deferred1_1 = ret[1];
|
|
189
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
190
|
+
} finally {
|
|
191
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
/**
|
|
195
|
+
* The editor state that is not the document, as JSON (`KitDocument::editor_state`):
|
|
196
|
+
* an editor puts the person's aside while an agent's step runs in the agent's own.
|
|
197
|
+
* @returns {string}
|
|
198
|
+
*/
|
|
199
|
+
editorState() {
|
|
200
|
+
let deferred1_0;
|
|
201
|
+
let deferred1_1;
|
|
202
|
+
try {
|
|
203
|
+
const ret = wasm.tabledocument_editorState(this.__wbg_ptr);
|
|
204
|
+
deferred1_0 = ret[0];
|
|
205
|
+
deferred1_1 = ret[1];
|
|
206
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
207
|
+
} finally {
|
|
208
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
/**
|
|
212
|
+
* Runs a command as `origin` (the KDM's commit form, the JSON array `[kind, principal,
|
|
213
|
+
* label]`): the editor's worker runs an agent's step this way, so the step is the agent's and
|
|
214
|
+
* the agent's undo (KitModel M12a) takes it back.
|
|
215
|
+
* @param {string} command
|
|
216
|
+
* @param {string} params
|
|
217
|
+
* @param {string} origin
|
|
218
|
+
* @returns {string}
|
|
219
|
+
*/
|
|
220
|
+
executeAs(command, params, origin) {
|
|
221
|
+
let deferred5_0;
|
|
222
|
+
let deferred5_1;
|
|
223
|
+
try {
|
|
224
|
+
const ptr0 = passStringToWasm0(command, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
225
|
+
const len0 = WASM_VECTOR_LEN;
|
|
226
|
+
const ptr1 = passStringToWasm0(params, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
227
|
+
const len1 = WASM_VECTOR_LEN;
|
|
228
|
+
const ptr2 = passStringToWasm0(origin, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
229
|
+
const len2 = WASM_VECTOR_LEN;
|
|
230
|
+
const ret = wasm.tabledocument_executeAs(this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2);
|
|
231
|
+
var ptr4 = ret[0];
|
|
232
|
+
var len4 = ret[1];
|
|
233
|
+
if (ret[3]) {
|
|
234
|
+
ptr4 = 0; len4 = 0;
|
|
235
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
236
|
+
}
|
|
237
|
+
deferred5_0 = ptr4;
|
|
238
|
+
deferred5_1 = len4;
|
|
239
|
+
return getStringFromWasm0(ptr4, len4);
|
|
240
|
+
} finally {
|
|
241
|
+
wasm.__wbindgen_free(deferred5_0, deferred5_1, 1);
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
/**
|
|
245
|
+
* @param {string} command
|
|
246
|
+
* @param {string} params
|
|
247
|
+
* @returns {string}
|
|
248
|
+
*/
|
|
249
|
+
execute(command, params) {
|
|
250
|
+
let deferred4_0;
|
|
251
|
+
let deferred4_1;
|
|
252
|
+
try {
|
|
253
|
+
const ptr0 = passStringToWasm0(command, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
254
|
+
const len0 = WASM_VECTOR_LEN;
|
|
255
|
+
const ptr1 = passStringToWasm0(params, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
256
|
+
const len1 = WASM_VECTOR_LEN;
|
|
257
|
+
const ret = wasm.tabledocument_execute(this.__wbg_ptr, ptr0, len0, ptr1, len1);
|
|
258
|
+
var ptr3 = ret[0];
|
|
259
|
+
var len3 = ret[1];
|
|
260
|
+
if (ret[3]) {
|
|
261
|
+
ptr3 = 0; len3 = 0;
|
|
262
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
263
|
+
}
|
|
264
|
+
deferred4_0 = ptr3;
|
|
265
|
+
deferred4_1 = len3;
|
|
266
|
+
return getStringFromWasm0(ptr3, len3);
|
|
267
|
+
} finally {
|
|
268
|
+
wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
/**
|
|
272
|
+
* @param {Uint8Array} since
|
|
273
|
+
* @returns {Uint8Array}
|
|
274
|
+
*/
|
|
275
|
+
exportChanges(since) {
|
|
276
|
+
const ptr0 = passArray8ToWasm0(since, wasm.__wbindgen_malloc);
|
|
277
|
+
const len0 = WASM_VECTOR_LEN;
|
|
278
|
+
const ret = wasm.tabledocument_exportChanges(this.__wbg_ptr, ptr0, len0);
|
|
279
|
+
if (ret[3]) {
|
|
280
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
281
|
+
}
|
|
282
|
+
var v2 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
283
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
284
|
+
return v2;
|
|
285
|
+
}
|
|
286
|
+
/**
|
|
287
|
+
* @returns {TableDocument}
|
|
288
|
+
*/
|
|
289
|
+
forkForPremises() {
|
|
290
|
+
const ret = wasm.tabledocument_forkForPremises(this.__wbg_ptr);
|
|
291
|
+
if (ret[2]) {
|
|
292
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
293
|
+
}
|
|
294
|
+
return TableDocument.__wrap(ret[0]);
|
|
295
|
+
}
|
|
296
|
+
/**
|
|
297
|
+
* Lays out the arrangement `axis` (what `gridOpen` or `gridSync` answered) for the view
|
|
298
|
+
* `params` (`{tableId, viewId?, theme?, brand?}`); answers the axes as JSON.
|
|
299
|
+
* @param {Uint8Array} axis
|
|
300
|
+
* @param {string} params
|
|
301
|
+
* @returns {string}
|
|
302
|
+
*/
|
|
303
|
+
gridAxes(axis, params) {
|
|
304
|
+
let deferred4_0;
|
|
305
|
+
let deferred4_1;
|
|
306
|
+
try {
|
|
307
|
+
const ptr0 = passArray8ToWasm0(axis, wasm.__wbindgen_malloc);
|
|
308
|
+
const len0 = WASM_VECTOR_LEN;
|
|
309
|
+
const ptr1 = passStringToWasm0(params, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
310
|
+
const len1 = WASM_VECTOR_LEN;
|
|
311
|
+
const ret = wasm.tabledocument_gridAxes(this.__wbg_ptr, ptr0, len0, ptr1, len1);
|
|
312
|
+
var ptr3 = ret[0];
|
|
313
|
+
var len3 = ret[1];
|
|
314
|
+
if (ret[3]) {
|
|
315
|
+
ptr3 = 0; len3 = 0;
|
|
316
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
317
|
+
}
|
|
318
|
+
deferred4_0 = ptr3;
|
|
319
|
+
deferred4_1 = len3;
|
|
320
|
+
return getStringFromWasm0(ptr3, len3);
|
|
321
|
+
} finally {
|
|
322
|
+
wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
/**
|
|
326
|
+
* The bands `keys` (layer, column band, row band triples) of arrangement `epoch` at
|
|
327
|
+
* `dpr` (drafts when `draft`), with the resources page session `session` does not hold
|
|
328
|
+
* yet, as one batch.
|
|
329
|
+
* @param {number} epoch
|
|
330
|
+
* @param {Uint32Array} keys
|
|
331
|
+
* @param {number} dpr
|
|
332
|
+
* @param {number} session
|
|
333
|
+
* @param {boolean} draft
|
|
334
|
+
* @returns {Uint8Array}
|
|
335
|
+
*/
|
|
336
|
+
gridBands(epoch, keys, dpr, session, draft) {
|
|
337
|
+
const ptr0 = passArray32ToWasm0(keys, wasm.__wbindgen_malloc);
|
|
338
|
+
const len0 = WASM_VECTOR_LEN;
|
|
339
|
+
const ret = wasm.tabledocument_gridBands(this.__wbg_ptr, epoch, ptr0, len0, dpr, session, draft);
|
|
340
|
+
if (ret[3]) {
|
|
341
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
342
|
+
}
|
|
343
|
+
var v2 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
344
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
345
|
+
return v2;
|
|
346
|
+
}
|
|
347
|
+
/**
|
|
348
|
+
* Clears records of a table (`{tableId, values}`, the records' ids as numbers) in one
|
|
349
|
+
* `transact`; answers JSON `{result, change}`.
|
|
350
|
+
* @param {string} params
|
|
351
|
+
* @param {Float64Array} ids
|
|
352
|
+
* @returns {string}
|
|
353
|
+
*/
|
|
354
|
+
gridClear(params, ids) {
|
|
355
|
+
let deferred4_0;
|
|
356
|
+
let deferred4_1;
|
|
357
|
+
try {
|
|
358
|
+
const ptr0 = passStringToWasm0(params, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
359
|
+
const len0 = WASM_VECTOR_LEN;
|
|
360
|
+
const ptr1 = passArrayF64ToWasm0(ids, wasm.__wbindgen_malloc);
|
|
361
|
+
const len1 = WASM_VECTOR_LEN;
|
|
362
|
+
const ret = wasm.tabledocument_gridClear(this.__wbg_ptr, ptr0, len0, ptr1, len1);
|
|
363
|
+
var ptr3 = ret[0];
|
|
364
|
+
var len3 = ret[1];
|
|
365
|
+
if (ret[3]) {
|
|
366
|
+
ptr3 = 0; len3 = 0;
|
|
367
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
368
|
+
}
|
|
369
|
+
deferred4_0 = ptr3;
|
|
370
|
+
deferred4_1 = len3;
|
|
371
|
+
return getStringFromWasm0(ptr3, len3);
|
|
372
|
+
} finally {
|
|
373
|
+
wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
|
+
/**
|
|
377
|
+
* Which cells of a run of the arrangement's rows hold the search: `params` is JSON `{epoch,
|
|
378
|
+
* from, count, fieldIds}`; answers the hits (`kition-table-arrange`, hits format v1) as bytes.
|
|
379
|
+
* @param {string} params
|
|
380
|
+
* @returns {Uint8Array}
|
|
381
|
+
*/
|
|
382
|
+
gridHits(params) {
|
|
383
|
+
const ptr0 = passStringToWasm0(params, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
384
|
+
const len0 = WASM_VECTOR_LEN;
|
|
385
|
+
const ret = wasm.tabledocument_gridHits(this.__wbg_ptr, ptr0, len0);
|
|
386
|
+
if (ret[3]) {
|
|
387
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
388
|
+
}
|
|
389
|
+
var v2 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
390
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
391
|
+
return v2;
|
|
392
|
+
}
|
|
393
|
+
/**
|
|
394
|
+
* How the grid splits `[{text, weight, size}]` into runs and measures them (JSON).
|
|
395
|
+
* @param {string} asks
|
|
396
|
+
* @returns {string}
|
|
397
|
+
*/
|
|
398
|
+
gridMeasure(asks) {
|
|
399
|
+
let deferred3_0;
|
|
400
|
+
let deferred3_1;
|
|
401
|
+
try {
|
|
402
|
+
const ptr0 = passStringToWasm0(asks, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
403
|
+
const len0 = WASM_VECTOR_LEN;
|
|
404
|
+
const ret = wasm.tabledocument_gridMeasure(this.__wbg_ptr, ptr0, len0);
|
|
405
|
+
var ptr2 = ret[0];
|
|
406
|
+
var len2 = ret[1];
|
|
407
|
+
if (ret[3]) {
|
|
408
|
+
ptr2 = 0; len2 = 0;
|
|
409
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
410
|
+
}
|
|
411
|
+
deferred3_0 = ptr2;
|
|
412
|
+
deferred3_1 = len2;
|
|
413
|
+
return getStringFromWasm0(ptr2, len2);
|
|
414
|
+
} finally {
|
|
415
|
+
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
416
|
+
}
|
|
417
|
+
}
|
|
418
|
+
/**
|
|
419
|
+
* Arranges a view for the editor: `params` is JSON `{tableId, viewId?, config?, query?,
|
|
420
|
+
* collapsed?}`; answers the axis (`kition-table-arrange`, format v2) as bytes.
|
|
421
|
+
* @param {string} params
|
|
422
|
+
* @returns {Uint8Array}
|
|
423
|
+
*/
|
|
424
|
+
gridOpen(params) {
|
|
425
|
+
const ptr0 = passStringToWasm0(params, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
426
|
+
const len0 = WASM_VECTOR_LEN;
|
|
427
|
+
const ret = wasm.tabledocument_gridOpen(this.__wbg_ptr, ptr0, len0);
|
|
428
|
+
if (ret[3]) {
|
|
429
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
430
|
+
}
|
|
431
|
+
var v2 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
432
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
433
|
+
return v2;
|
|
434
|
+
}
|
|
435
|
+
/**
|
|
436
|
+
* A picture the page's browser does not decode, decoded by the engine: width, height,
|
|
437
|
+
* straight RGBA8; no bytes when the engine does not read it either.
|
|
438
|
+
* @param {Uint8Array} bytes
|
|
439
|
+
* @param {number} max_side
|
|
440
|
+
* @returns {Uint8Array}
|
|
441
|
+
*/
|
|
442
|
+
gridPicture(bytes, max_side) {
|
|
443
|
+
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
444
|
+
const len0 = WASM_VECTOR_LEN;
|
|
445
|
+
const ret = wasm.tabledocument_gridPicture(this.__wbg_ptr, ptr0, len0, max_side);
|
|
446
|
+
var v2 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
447
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
448
|
+
return v2;
|
|
449
|
+
}
|
|
450
|
+
/**
|
|
451
|
+
* One band as the engine rasterizes it (for the parity test): width, height, RGBA8.
|
|
452
|
+
* @param {number} epoch
|
|
453
|
+
* @param {number} layer
|
|
454
|
+
* @param {number} col_band
|
|
455
|
+
* @param {number} row_band
|
|
456
|
+
* @param {number} dpr
|
|
457
|
+
* @returns {Uint8Array}
|
|
458
|
+
*/
|
|
459
|
+
gridRaster(epoch, layer, col_band, row_band, dpr) {
|
|
460
|
+
const ret = wasm.tabledocument_gridRaster(this.__wbg_ptr, epoch, layer, col_band, row_band, dpr);
|
|
461
|
+
if (ret[3]) {
|
|
462
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
463
|
+
}
|
|
464
|
+
var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
465
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
466
|
+
return v1;
|
|
467
|
+
}
|
|
468
|
+
/**
|
|
469
|
+
* The records of some ids (`{tableId, ids, fields?}`), as JSON `[{id, row_key, values}]`.
|
|
470
|
+
* @param {string} params
|
|
471
|
+
* @returns {string}
|
|
472
|
+
*/
|
|
473
|
+
gridRecords(params) {
|
|
474
|
+
let deferred3_0;
|
|
475
|
+
let deferred3_1;
|
|
476
|
+
try {
|
|
477
|
+
const ptr0 = passStringToWasm0(params, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
478
|
+
const len0 = WASM_VECTOR_LEN;
|
|
479
|
+
const ret = wasm.tabledocument_gridRecords(this.__wbg_ptr, ptr0, len0);
|
|
480
|
+
var ptr2 = ret[0];
|
|
481
|
+
var len2 = ret[1];
|
|
482
|
+
if (ret[3]) {
|
|
483
|
+
ptr2 = 0; len2 = 0;
|
|
484
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
485
|
+
}
|
|
486
|
+
deferred3_0 = ptr2;
|
|
487
|
+
deferred3_1 = len2;
|
|
488
|
+
return getStringFromWasm0(ptr2, len2);
|
|
489
|
+
} finally {
|
|
490
|
+
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
491
|
+
}
|
|
492
|
+
}
|
|
493
|
+
/**
|
|
494
|
+
* What each linear row of the laid-out grid is: a record, a group header or an add row.
|
|
495
|
+
* @returns {Uint8Array}
|
|
496
|
+
*/
|
|
497
|
+
gridRows() {
|
|
498
|
+
const ret = wasm.tabledocument_gridRows(this.__wbg_ptr);
|
|
499
|
+
if (ret[3]) {
|
|
500
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
501
|
+
}
|
|
502
|
+
var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
503
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
504
|
+
return v1;
|
|
505
|
+
}
|
|
506
|
+
/**
|
|
507
|
+
* How long arranging took, as JSON (for performance tests).
|
|
508
|
+
* @returns {string}
|
|
509
|
+
*/
|
|
510
|
+
gridStats() {
|
|
511
|
+
let deferred1_0;
|
|
512
|
+
let deferred1_1;
|
|
513
|
+
try {
|
|
514
|
+
const ret = wasm.tabledocument_gridStats(this.__wbg_ptr);
|
|
515
|
+
deferred1_0 = ret[0];
|
|
516
|
+
deferred1_1 = ret[1];
|
|
517
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
518
|
+
} finally {
|
|
519
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
520
|
+
}
|
|
521
|
+
}
|
|
522
|
+
/**
|
|
523
|
+
* The numbers of some fields over the editor's arrangement (`{fields}`), as JSON
|
|
524
|
+
* `[{field, count, sum}]`.
|
|
525
|
+
* @param {string} params
|
|
526
|
+
* @returns {string}
|
|
527
|
+
*/
|
|
528
|
+
gridSummary(params) {
|
|
529
|
+
let deferred3_0;
|
|
530
|
+
let deferred3_1;
|
|
531
|
+
try {
|
|
532
|
+
const ptr0 = passStringToWasm0(params, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
533
|
+
const len0 = WASM_VECTOR_LEN;
|
|
534
|
+
const ret = wasm.tabledocument_gridSummary(this.__wbg_ptr, ptr0, len0);
|
|
535
|
+
var ptr2 = ret[0];
|
|
536
|
+
var len2 = ret[1];
|
|
537
|
+
if (ret[3]) {
|
|
538
|
+
ptr2 = 0; len2 = 0;
|
|
539
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
540
|
+
}
|
|
541
|
+
deferred3_0 = ptr2;
|
|
542
|
+
deferred3_1 = len2;
|
|
543
|
+
return getStringFromWasm0(ptr2, len2);
|
|
544
|
+
} finally {
|
|
545
|
+
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
546
|
+
}
|
|
547
|
+
}
|
|
548
|
+
/**
|
|
549
|
+
* The editor's arrangement brought to the document's current state: the new axis, or no
|
|
550
|
+
* bytes when the axis is the same.
|
|
551
|
+
* @returns {Uint8Array}
|
|
552
|
+
*/
|
|
553
|
+
gridSync() {
|
|
554
|
+
const ret = wasm.tabledocument_gridSync(this.__wbg_ptr);
|
|
555
|
+
if (ret[3]) {
|
|
556
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
557
|
+
}
|
|
558
|
+
var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
559
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
560
|
+
return v1;
|
|
561
|
+
}
|
|
562
|
+
/**
|
|
563
|
+
* The file holds its replica: there always is one.
|
|
564
|
+
* @returns {boolean}
|
|
565
|
+
*/
|
|
566
|
+
get hasReplica() {
|
|
567
|
+
const ret = wasm.tabledocument_hasReplica(this.__wbg_ptr);
|
|
568
|
+
return ret !== 0;
|
|
569
|
+
}
|
|
570
|
+
/**
|
|
571
|
+
* @returns {number}
|
|
572
|
+
*/
|
|
573
|
+
get height() {
|
|
574
|
+
const ret = wasm.tabledocument_height(this.__wbg_ptr);
|
|
575
|
+
return ret >>> 0;
|
|
576
|
+
}
|
|
577
|
+
/**
|
|
578
|
+
* @param {Uint8Array} bytes
|
|
579
|
+
* @returns {string}
|
|
580
|
+
*/
|
|
581
|
+
importChanges(bytes) {
|
|
582
|
+
let deferred3_0;
|
|
583
|
+
let deferred3_1;
|
|
584
|
+
try {
|
|
585
|
+
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
586
|
+
const len0 = WASM_VECTOR_LEN;
|
|
587
|
+
const ret = wasm.tabledocument_importChanges(this.__wbg_ptr, ptr0, len0);
|
|
588
|
+
var ptr2 = ret[0];
|
|
589
|
+
var len2 = ret[1];
|
|
590
|
+
if (ret[3]) {
|
|
591
|
+
ptr2 = 0; len2 = 0;
|
|
592
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
593
|
+
}
|
|
594
|
+
deferred3_0 = ptr2;
|
|
595
|
+
deferred3_1 = len2;
|
|
596
|
+
return getStringFromWasm0(ptr2, len2);
|
|
597
|
+
} finally {
|
|
598
|
+
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
599
|
+
}
|
|
600
|
+
}
|
|
601
|
+
/**
|
|
602
|
+
* @returns {string}
|
|
603
|
+
*/
|
|
604
|
+
inspect() {
|
|
605
|
+
let deferred2_0;
|
|
606
|
+
let deferred2_1;
|
|
607
|
+
try {
|
|
608
|
+
const ret = wasm.tabledocument_inspect(this.__wbg_ptr);
|
|
609
|
+
var ptr1 = ret[0];
|
|
610
|
+
var len1 = ret[1];
|
|
611
|
+
if (ret[3]) {
|
|
612
|
+
ptr1 = 0; len1 = 0;
|
|
613
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
614
|
+
}
|
|
615
|
+
deferred2_0 = ptr1;
|
|
616
|
+
deferred2_1 = len1;
|
|
617
|
+
return getStringFromWasm0(ptr1, len1);
|
|
618
|
+
} finally {
|
|
619
|
+
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
620
|
+
}
|
|
621
|
+
}
|
|
622
|
+
markSaved() {
|
|
623
|
+
wasm.tabledocument_markSaved(this.__wbg_ptr);
|
|
624
|
+
}
|
|
625
|
+
/**
|
|
626
|
+
* Opens file bytes with the replica a host stored for them (engine contract 2): a snapshot of
|
|
627
|
+
* the file's own document (a co-editing room's) is merged into it, and empty `bytes` (no file
|
|
628
|
+
* yet) open the replica alone.
|
|
629
|
+
* @param {string} name
|
|
630
|
+
* @param {Uint8Array} bytes
|
|
631
|
+
* @param {Uint8Array} snapshot
|
|
632
|
+
* @param {Uint8Array} blobs
|
|
633
|
+
* @returns {TableDocument}
|
|
634
|
+
*/
|
|
635
|
+
static openWithReplica(name, bytes, snapshot, blobs) {
|
|
636
|
+
const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
637
|
+
const len0 = WASM_VECTOR_LEN;
|
|
638
|
+
const ptr1 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
639
|
+
const len1 = WASM_VECTOR_LEN;
|
|
640
|
+
const ptr2 = passArray8ToWasm0(snapshot, wasm.__wbindgen_malloc);
|
|
641
|
+
const len2 = WASM_VECTOR_LEN;
|
|
642
|
+
const ptr3 = passArray8ToWasm0(blobs, wasm.__wbindgen_malloc);
|
|
643
|
+
const len3 = WASM_VECTOR_LEN;
|
|
644
|
+
const ret = wasm.tabledocument_openWithReplica(ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3);
|
|
645
|
+
if (ret[2]) {
|
|
646
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
647
|
+
}
|
|
648
|
+
return TableDocument.__wrap(ret[0]);
|
|
649
|
+
}
|
|
650
|
+
/**
|
|
651
|
+
* @param {string} name
|
|
652
|
+
* @param {Uint8Array} bytes
|
|
653
|
+
* @returns {TableDocument}
|
|
654
|
+
*/
|
|
655
|
+
static open(name, bytes) {
|
|
656
|
+
const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
657
|
+
const len0 = WASM_VECTOR_LEN;
|
|
658
|
+
const ptr1 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
659
|
+
const len1 = WASM_VECTOR_LEN;
|
|
660
|
+
const ret = wasm.tabledocument_open(ptr0, len0, ptr1, len1);
|
|
661
|
+
if (ret[2]) {
|
|
662
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
663
|
+
}
|
|
664
|
+
return TableDocument.__wrap(ret[0]);
|
|
665
|
+
}
|
|
666
|
+
/**
|
|
667
|
+
* @returns {number}
|
|
668
|
+
*/
|
|
669
|
+
get pinnedLeft() {
|
|
670
|
+
const ret = wasm.tabledocument_pinnedLeft(this.__wbg_ptr);
|
|
671
|
+
return ret >>> 0;
|
|
672
|
+
}
|
|
673
|
+
/**
|
|
674
|
+
* @returns {number}
|
|
675
|
+
*/
|
|
676
|
+
get pinnedTop() {
|
|
677
|
+
const ret = wasm.tabledocument_pinnedTop(this.__wbg_ptr);
|
|
678
|
+
return ret >>> 0;
|
|
679
|
+
}
|
|
680
|
+
/**
|
|
681
|
+
* @param {string} method
|
|
682
|
+
* @param {string} params
|
|
683
|
+
* @returns {string}
|
|
684
|
+
*/
|
|
685
|
+
premiseRead(method, params) {
|
|
686
|
+
let deferred4_0;
|
|
687
|
+
let deferred4_1;
|
|
688
|
+
try {
|
|
689
|
+
const ptr0 = passStringToWasm0(method, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
690
|
+
const len0 = WASM_VECTOR_LEN;
|
|
691
|
+
const ptr1 = passStringToWasm0(params, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
692
|
+
const len1 = WASM_VECTOR_LEN;
|
|
693
|
+
const ret = wasm.tabledocument_premiseRead(this.__wbg_ptr, ptr0, len0, ptr1, len1);
|
|
694
|
+
var ptr3 = ret[0];
|
|
695
|
+
var len3 = ret[1];
|
|
696
|
+
if (ret[3]) {
|
|
697
|
+
ptr3 = 0; len3 = 0;
|
|
698
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
699
|
+
}
|
|
700
|
+
deferred4_0 = ptr3;
|
|
701
|
+
deferred4_1 = len3;
|
|
702
|
+
return getStringFromWasm0(ptr3, len3);
|
|
703
|
+
} finally {
|
|
704
|
+
wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
|
|
705
|
+
}
|
|
706
|
+
}
|
|
707
|
+
/**
|
|
708
|
+
* Redoes the person's last undone step; answers `{"done", "damage"}` as JSON.
|
|
709
|
+
* @returns {string}
|
|
710
|
+
*/
|
|
711
|
+
redo() {
|
|
712
|
+
let deferred2_0;
|
|
713
|
+
let deferred2_1;
|
|
714
|
+
try {
|
|
715
|
+
const ret = wasm.tabledocument_redo(this.__wbg_ptr);
|
|
716
|
+
var ptr1 = ret[0];
|
|
717
|
+
var len1 = ret[1];
|
|
718
|
+
if (ret[3]) {
|
|
719
|
+
ptr1 = 0; len1 = 0;
|
|
720
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
721
|
+
}
|
|
722
|
+
deferred2_0 = ptr1;
|
|
723
|
+
deferred2_1 = len1;
|
|
724
|
+
return getStringFromWasm0(ptr1, len1);
|
|
725
|
+
} finally {
|
|
726
|
+
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
727
|
+
}
|
|
728
|
+
}
|
|
729
|
+
/**
|
|
730
|
+
* @param {number} x0
|
|
731
|
+
* @param {number} y0
|
|
732
|
+
* @param {number} x1
|
|
733
|
+
* @param {number} y1
|
|
734
|
+
* @param {number} width
|
|
735
|
+
* @param {number} height
|
|
736
|
+
* @returns {Uint8Array}
|
|
737
|
+
*/
|
|
738
|
+
renderArea(x0, y0, x1, y1, width, height) {
|
|
739
|
+
const ret = wasm.tabledocument_renderArea(this.__wbg_ptr, x0, y0, x1, y1, width, height);
|
|
740
|
+
if (ret[3]) {
|
|
741
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
742
|
+
}
|
|
743
|
+
var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
744
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
745
|
+
return v1;
|
|
746
|
+
}
|
|
747
|
+
/**
|
|
748
|
+
* @param {number} x
|
|
749
|
+
* @param {number} y
|
|
750
|
+
* @param {number} scale
|
|
751
|
+
* @param {number} width
|
|
752
|
+
* @param {number} height
|
|
753
|
+
* @returns {Uint8Array}
|
|
754
|
+
*/
|
|
755
|
+
render(x, y, scale, width, height) {
|
|
756
|
+
const ret = wasm.tabledocument_render(this.__wbg_ptr, x, y, scale, width, height);
|
|
757
|
+
if (ret[3]) {
|
|
758
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
759
|
+
}
|
|
760
|
+
var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
761
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
762
|
+
return v1;
|
|
763
|
+
}
|
|
764
|
+
/**
|
|
765
|
+
* Puts back what `editorState()` answered (`KitDocument::restore_editor_state`).
|
|
766
|
+
* @param {string} state
|
|
767
|
+
*/
|
|
768
|
+
restoreEditorState(state) {
|
|
769
|
+
const ptr0 = passStringToWasm0(state, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
770
|
+
const len0 = WASM_VECTOR_LEN;
|
|
771
|
+
const ret = wasm.tabledocument_restoreEditorState(this.__wbg_ptr, ptr0, len0);
|
|
772
|
+
if (ret[1]) {
|
|
773
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
774
|
+
}
|
|
775
|
+
}
|
|
776
|
+
/**
|
|
777
|
+
* @returns {bigint}
|
|
778
|
+
*/
|
|
779
|
+
get revision() {
|
|
780
|
+
const ret = wasm.tabledocument_revision(this.__wbg_ptr);
|
|
781
|
+
return BigInt.asUintN(64, ret);
|
|
782
|
+
}
|
|
783
|
+
/**
|
|
784
|
+
* @param {string | null} [name]
|
|
785
|
+
* @returns {Uint8Array}
|
|
786
|
+
*/
|
|
787
|
+
save(name) {
|
|
788
|
+
var ptr0 = isLikeNone(name) ? 0 : passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
789
|
+
var len0 = WASM_VECTOR_LEN;
|
|
790
|
+
const ret = wasm.tabledocument_save(this.__wbg_ptr, ptr0, len0);
|
|
791
|
+
if (ret[3]) {
|
|
792
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
793
|
+
}
|
|
794
|
+
var v2 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
795
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
796
|
+
return v2;
|
|
797
|
+
}
|
|
798
|
+
/**
|
|
799
|
+
* Sets the editor state one command reads from a call context `{on?, part?, time?}` as
|
|
800
|
+
* JSON (`KitDocument::set_context`).
|
|
801
|
+
* @param {string} context
|
|
802
|
+
*/
|
|
803
|
+
setContext(context) {
|
|
804
|
+
const ptr0 = passStringToWasm0(context, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
805
|
+
const len0 = WASM_VECTOR_LEN;
|
|
806
|
+
const ret = wasm.tabledocument_setContext(this.__wbg_ptr, ptr0, len0);
|
|
807
|
+
if (ret[1]) {
|
|
808
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
809
|
+
}
|
|
810
|
+
}
|
|
811
|
+
/**
|
|
812
|
+
* The replica as a snapshot, for a peer's `openWithReplica` (engine contract 2).
|
|
813
|
+
* @returns {Uint8Array}
|
|
814
|
+
*/
|
|
815
|
+
snapshot() {
|
|
816
|
+
const ret = wasm.tabledocument_snapshot(this.__wbg_ptr);
|
|
817
|
+
if (ret[3]) {
|
|
818
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
819
|
+
}
|
|
820
|
+
var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
821
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
822
|
+
return v1;
|
|
823
|
+
}
|
|
824
|
+
/**
|
|
825
|
+
* The `TableChange`s of the replica changes imported since the last call, as a JSON array
|
|
826
|
+
* of `table/changed` params.
|
|
827
|
+
* @returns {string}
|
|
828
|
+
*/
|
|
829
|
+
takeImported() {
|
|
830
|
+
let deferred1_0;
|
|
831
|
+
let deferred1_1;
|
|
832
|
+
try {
|
|
833
|
+
const ret = wasm.tabledocument_takeImported(this.__wbg_ptr);
|
|
834
|
+
deferred1_0 = ret[0];
|
|
835
|
+
deferred1_1 = ret[1];
|
|
836
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
837
|
+
} finally {
|
|
838
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
839
|
+
}
|
|
840
|
+
}
|
|
841
|
+
/**
|
|
842
|
+
* The next chunk of output `id`, at most `max` bytes (engine contract E16).
|
|
843
|
+
* @param {string} id
|
|
844
|
+
* @param {number | null} [max]
|
|
845
|
+
* @returns {Uint8Array}
|
|
846
|
+
*/
|
|
847
|
+
takeOutput(id, max) {
|
|
848
|
+
const ptr0 = passStringToWasm0(id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
849
|
+
const len0 = WASM_VECTOR_LEN;
|
|
850
|
+
const ret = wasm.tabledocument_takeOutput(this.__wbg_ptr, ptr0, len0, isLikeNone(max) ? Number.MAX_SAFE_INTEGER : (max) >>> 0);
|
|
851
|
+
if (ret[3]) {
|
|
852
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
853
|
+
}
|
|
854
|
+
var v2 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
855
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
856
|
+
return v2;
|
|
857
|
+
}
|
|
858
|
+
/**
|
|
859
|
+
* Undoes the person's last step; answers `{"done", "damage"}` as JSON.
|
|
860
|
+
* @returns {string}
|
|
861
|
+
*/
|
|
862
|
+
undo() {
|
|
863
|
+
let deferred2_0;
|
|
864
|
+
let deferred2_1;
|
|
865
|
+
try {
|
|
866
|
+
const ret = wasm.tabledocument_undo(this.__wbg_ptr);
|
|
867
|
+
var ptr1 = ret[0];
|
|
868
|
+
var len1 = ret[1];
|
|
869
|
+
if (ret[3]) {
|
|
870
|
+
ptr1 = 0; len1 = 0;
|
|
871
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
872
|
+
}
|
|
873
|
+
deferred2_0 = ptr1;
|
|
874
|
+
deferred2_1 = len1;
|
|
875
|
+
return getStringFromWasm0(ptr1, len1);
|
|
876
|
+
} finally {
|
|
877
|
+
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
878
|
+
}
|
|
879
|
+
}
|
|
880
|
+
/**
|
|
881
|
+
* @returns {Uint8Array}
|
|
882
|
+
*/
|
|
883
|
+
version() {
|
|
884
|
+
const ret = wasm.tabledocument_version(this.__wbg_ptr);
|
|
885
|
+
var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
886
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
887
|
+
return v1;
|
|
888
|
+
}
|
|
889
|
+
/**
|
|
890
|
+
* @returns {number}
|
|
891
|
+
*/
|
|
892
|
+
get width() {
|
|
893
|
+
const ret = wasm.tabledocument_width(this.__wbg_ptr);
|
|
894
|
+
return ret >>> 0;
|
|
895
|
+
}
|
|
896
|
+
}
|
|
897
|
+
if (Symbol.dispose) TableDocument.prototype[Symbol.dispose] = TableDocument.prototype.free;
|
|
898
|
+
|
|
899
|
+
/**
|
|
900
|
+
* Registers a font file for the document's picture and grid (Kition platform E9; kit-editor
|
|
901
|
+
* calls it for Inter, its `fonts`, before a table opens, and for the others, its `lazyFonts`,
|
|
902
|
+
* once `wantsFonts` answers `true`); answers its family name. Without fonts the picture has no
|
|
903
|
+
* text. Text laid out after it is set in the new face.
|
|
904
|
+
* @param {Uint8Array} bytes
|
|
905
|
+
* @returns {string}
|
|
906
|
+
*/
|
|
907
|
+
export function addFont(bytes) {
|
|
908
|
+
let deferred3_0;
|
|
909
|
+
let deferred3_1;
|
|
910
|
+
try {
|
|
911
|
+
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
912
|
+
const len0 = WASM_VECTOR_LEN;
|
|
913
|
+
const ret = wasm.addFont(ptr0, len0);
|
|
914
|
+
var ptr2 = ret[0];
|
|
915
|
+
var len2 = ret[1];
|
|
916
|
+
if (ret[3]) {
|
|
917
|
+
ptr2 = 0; len2 = 0;
|
|
918
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
919
|
+
}
|
|
920
|
+
deferred3_0 = ptr2;
|
|
921
|
+
deferred3_1 = len2;
|
|
922
|
+
return getStringFromWasm0(ptr2, len2);
|
|
923
|
+
} finally {
|
|
924
|
+
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
925
|
+
}
|
|
926
|
+
}
|
|
927
|
+
|
|
928
|
+
/**
|
|
929
|
+
* Every method `call` answers, with the Kition runtime route it mirrors (relative to
|
|
930
|
+
* `/v1/data-documents/{documentId}`), as a JSON array of `[method, route]`: what a host needs to
|
|
931
|
+
* answer Kition's data-document HTTP API from the engine.
|
|
932
|
+
* @returns {string}
|
|
933
|
+
*/
|
|
934
|
+
export function tableMethods() {
|
|
935
|
+
let deferred1_0;
|
|
936
|
+
let deferred1_1;
|
|
937
|
+
try {
|
|
938
|
+
const ret = wasm.tableMethods();
|
|
939
|
+
deferred1_0 = ret[0];
|
|
940
|
+
deferred1_1 = ret[1];
|
|
941
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
942
|
+
} finally {
|
|
943
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
944
|
+
}
|
|
945
|
+
}
|
|
946
|
+
|
|
947
|
+
/**
|
|
948
|
+
* Whether text laid out since the last call had a character none of the registered faces covers
|
|
949
|
+
* (it drew as tofu), or an emoji without the emoji face (Kition platform E9a); the call clears it.
|
|
950
|
+
* @returns {boolean}
|
|
951
|
+
*/
|
|
952
|
+
export function wantsFonts() {
|
|
953
|
+
const ret = wasm.wantsFonts();
|
|
954
|
+
return ret !== 0;
|
|
955
|
+
}
|
|
956
|
+
function __wbg_get_imports() {
|
|
957
|
+
const import0 = {
|
|
958
|
+
__proto__: null,
|
|
959
|
+
__wbg_Error_30c8987f7c2ed4e2: function(arg0, arg1) {
|
|
960
|
+
const ret = Error(getStringFromWasm0(arg0, arg1));
|
|
961
|
+
return ret;
|
|
962
|
+
},
|
|
963
|
+
__wbg___wbindgen_is_function_1f9d30630b8b1d3d: function(arg0) {
|
|
964
|
+
const ret = typeof(arg0) === 'function';
|
|
965
|
+
return ret;
|
|
966
|
+
},
|
|
967
|
+
__wbg___wbindgen_is_object_3c45d4f2dde4e749: function(arg0) {
|
|
968
|
+
const val = arg0;
|
|
969
|
+
const ret = typeof(val) === 'object' && val !== null;
|
|
970
|
+
return ret;
|
|
971
|
+
},
|
|
972
|
+
__wbg___wbindgen_is_string_90b56bc79aad6f6c: function(arg0) {
|
|
973
|
+
const ret = typeof(arg0) === 'string';
|
|
974
|
+
return ret;
|
|
975
|
+
},
|
|
976
|
+
__wbg___wbindgen_is_undefined_8865fb403f8fe9d8: function(arg0) {
|
|
977
|
+
const ret = arg0 === undefined;
|
|
978
|
+
return ret;
|
|
979
|
+
},
|
|
980
|
+
__wbg___wbindgen_number_get_2e0e7dee9f701a71: function(arg0, arg1) {
|
|
981
|
+
const obj = arg1;
|
|
982
|
+
const ret = typeof(obj) === 'number' ? obj : undefined;
|
|
983
|
+
getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
|
|
984
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
|
|
985
|
+
},
|
|
986
|
+
__wbg___wbindgen_throw_41e9ee4f547fc59a: function(arg0, arg1) {
|
|
987
|
+
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
988
|
+
},
|
|
989
|
+
__wbg_call_187d372bd5fdd4aa: function() { return handleError(function (arg0, arg1, arg2) {
|
|
990
|
+
const ret = arg0.call(arg1, arg2);
|
|
991
|
+
return ret;
|
|
992
|
+
}, arguments); },
|
|
993
|
+
__wbg_call_6137034ef55c9d0f: function() { return handleError(function (arg0, arg1) {
|
|
994
|
+
const ret = arg0.call(arg1);
|
|
995
|
+
return ret;
|
|
996
|
+
}, arguments); },
|
|
997
|
+
__wbg_crypto_38df2bab126b63dc: function(arg0) {
|
|
998
|
+
const ret = arg0.crypto;
|
|
999
|
+
return ret;
|
|
1000
|
+
},
|
|
1001
|
+
__wbg_getDate_1181c785ea4fdd21: function(arg0) {
|
|
1002
|
+
const ret = arg0.getDate();
|
|
1003
|
+
return ret;
|
|
1004
|
+
},
|
|
1005
|
+
__wbg_getDay_a7e78a6fb31f7a75: function(arg0) {
|
|
1006
|
+
const ret = arg0.getDay();
|
|
1007
|
+
return ret;
|
|
1008
|
+
},
|
|
1009
|
+
__wbg_getFullYear_32050b2c56c56cd8: function(arg0) {
|
|
1010
|
+
const ret = arg0.getFullYear();
|
|
1011
|
+
return ret;
|
|
1012
|
+
},
|
|
1013
|
+
__wbg_getHours_f57dcda3efee150c: function(arg0) {
|
|
1014
|
+
const ret = arg0.getHours();
|
|
1015
|
+
return ret;
|
|
1016
|
+
},
|
|
1017
|
+
__wbg_getMinutes_951e7f98fc4fdb30: function(arg0) {
|
|
1018
|
+
const ret = arg0.getMinutes();
|
|
1019
|
+
return ret;
|
|
1020
|
+
},
|
|
1021
|
+
__wbg_getMonth_aae5f530fd173536: function(arg0) {
|
|
1022
|
+
const ret = arg0.getMonth();
|
|
1023
|
+
return ret;
|
|
1024
|
+
},
|
|
1025
|
+
__wbg_getRandomValues_896855b3a5f89999: function() { return handleError(function (arg0, arg1) {
|
|
1026
|
+
globalThis.crypto.getRandomValues(getArrayU8FromWasm0(arg0, arg1));
|
|
1027
|
+
}, arguments); },
|
|
1028
|
+
__wbg_getRandomValues_973dabfb0ad1769f: function() { return handleError(function (arg0, arg1) {
|
|
1029
|
+
globalThis.crypto.getRandomValues(getArrayU8FromWasm0(arg0, arg1));
|
|
1030
|
+
}, arguments); },
|
|
1031
|
+
__wbg_getRandomValues_c44a50d8cfdaebeb: function() { return handleError(function (arg0, arg1) {
|
|
1032
|
+
arg0.getRandomValues(arg1);
|
|
1033
|
+
}, arguments); },
|
|
1034
|
+
__wbg_getSeconds_8ffcca0e220547af: function(arg0) {
|
|
1035
|
+
const ret = arg0.getSeconds();
|
|
1036
|
+
return ret;
|
|
1037
|
+
},
|
|
1038
|
+
__wbg_getTime_f5a55efff2585d5d: function(arg0) {
|
|
1039
|
+
const ret = arg0.getTime();
|
|
1040
|
+
return ret;
|
|
1041
|
+
},
|
|
1042
|
+
__wbg_getTimezoneOffset_2e851fdaecc2dc92: function(arg0) {
|
|
1043
|
+
const ret = arg0.getTimezoneOffset();
|
|
1044
|
+
return ret;
|
|
1045
|
+
},
|
|
1046
|
+
__wbg_get_31af05bd4842a84f: function() { return handleError(function (arg0, arg1) {
|
|
1047
|
+
const ret = Reflect.get(arg0, arg1);
|
|
1048
|
+
return ret;
|
|
1049
|
+
}, arguments); },
|
|
1050
|
+
__wbg_length_7f3c00c40364105e: function(arg0) {
|
|
1051
|
+
const ret = arg0.length;
|
|
1052
|
+
return ret;
|
|
1053
|
+
},
|
|
1054
|
+
__wbg_msCrypto_bd5a034af96bcba6: function(arg0) {
|
|
1055
|
+
const ret = arg0.msCrypto;
|
|
1056
|
+
return ret;
|
|
1057
|
+
},
|
|
1058
|
+
__wbg_new_0_72d020f0c63443d4: function() {
|
|
1059
|
+
const ret = new Date();
|
|
1060
|
+
return ret;
|
|
1061
|
+
},
|
|
1062
|
+
__wbg_new_34e56228080aa9f8: function(arg0) {
|
|
1063
|
+
const ret = new Date(arg0);
|
|
1064
|
+
return ret;
|
|
1065
|
+
},
|
|
1066
|
+
__wbg_new_with_length_3da0ad195f6f63ba: function(arg0) {
|
|
1067
|
+
const ret = new Uint8Array(arg0 >>> 0);
|
|
1068
|
+
return ret;
|
|
1069
|
+
},
|
|
1070
|
+
__wbg_new_with_year_month_day_0d952a48f939d06b: function(arg0, arg1, arg2) {
|
|
1071
|
+
const ret = new Date(arg0 >>> 0, arg1, arg2);
|
|
1072
|
+
return ret;
|
|
1073
|
+
},
|
|
1074
|
+
__wbg_node_84ea875411254db1: function(arg0) {
|
|
1075
|
+
const ret = arg0.node;
|
|
1076
|
+
return ret;
|
|
1077
|
+
},
|
|
1078
|
+
__wbg_now_08b1211f5e7581ea: function() {
|
|
1079
|
+
const ret = Date.now();
|
|
1080
|
+
return ret;
|
|
1081
|
+
},
|
|
1082
|
+
__wbg_now_aa4ccb83129e9e55: function() {
|
|
1083
|
+
const ret = Date.now();
|
|
1084
|
+
return ret;
|
|
1085
|
+
},
|
|
1086
|
+
__wbg_now_e1044392fce0f3e7: function() { return handleError(function () {
|
|
1087
|
+
const ret = Date.now();
|
|
1088
|
+
return ret;
|
|
1089
|
+
}, arguments); },
|
|
1090
|
+
__wbg_process_44c7a14e11e9f69e: function(arg0) {
|
|
1091
|
+
const ret = arg0.process;
|
|
1092
|
+
return ret;
|
|
1093
|
+
},
|
|
1094
|
+
__wbg_prototypesetcall_bc27214492979395: function(arg0, arg1, arg2) {
|
|
1095
|
+
Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), arg2);
|
|
1096
|
+
},
|
|
1097
|
+
__wbg_randomFillSync_6c25eac9869eb53c: function() { return handleError(function (arg0, arg1) {
|
|
1098
|
+
arg0.randomFillSync(arg1);
|
|
1099
|
+
}, arguments); },
|
|
1100
|
+
__wbg_random_5a4cafd2f02395ff: function() {
|
|
1101
|
+
const ret = Math.random();
|
|
1102
|
+
return ret;
|
|
1103
|
+
},
|
|
1104
|
+
__wbg_require_b4edbdcf3e2a1ef0: function() { return handleError(function () {
|
|
1105
|
+
const ret = module.require;
|
|
1106
|
+
return ret;
|
|
1107
|
+
}, arguments); },
|
|
1108
|
+
__wbg_static_accessor_GLOBAL_266715b9d96ba635: function() {
|
|
1109
|
+
const ret = typeof global === 'undefined' ? null : global;
|
|
1110
|
+
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
1111
|
+
},
|
|
1112
|
+
__wbg_static_accessor_GLOBAL_THIS_10fb7dc1ae063179: function() {
|
|
1113
|
+
const ret = typeof globalThis === 'undefined' ? null : globalThis;
|
|
1114
|
+
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
1115
|
+
},
|
|
1116
|
+
__wbg_static_accessor_SELF_0b583911f537483a: function() {
|
|
1117
|
+
const ret = typeof self === 'undefined' ? null : self;
|
|
1118
|
+
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
1119
|
+
},
|
|
1120
|
+
__wbg_static_accessor_WINDOW_d7f903d1508cbdc4: function() {
|
|
1121
|
+
const ret = typeof window === 'undefined' ? null : window;
|
|
1122
|
+
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
1123
|
+
},
|
|
1124
|
+
__wbg_subarray_002b94d5e13d1411: function(arg0, arg1, arg2) {
|
|
1125
|
+
const ret = arg0.subarray(arg1 >>> 0, arg2 >>> 0);
|
|
1126
|
+
return ret;
|
|
1127
|
+
},
|
|
1128
|
+
__wbg_versions_276b2795b1c6a219: function(arg0) {
|
|
1129
|
+
const ret = arg0.versions;
|
|
1130
|
+
return ret;
|
|
1131
|
+
},
|
|
1132
|
+
__wbindgen_generic_0000000000000001: function(arg0) {
|
|
1133
|
+
// Cast intrinsic for `F64 -> Externref`.
|
|
1134
|
+
const ret = arg0;
|
|
1135
|
+
return ret;
|
|
1136
|
+
},
|
|
1137
|
+
__wbindgen_generic_0000000000000002: function(arg0, arg1) {
|
|
1138
|
+
// Cast intrinsic for `Ref(Slice(U8)) -> NamedExternref("Uint8Array")`.
|
|
1139
|
+
const ret = getArrayU8FromWasm0(arg0, arg1);
|
|
1140
|
+
return ret;
|
|
1141
|
+
},
|
|
1142
|
+
__wbindgen_generic_0000000000000003: function(arg0, arg1) {
|
|
1143
|
+
// Cast intrinsic for `Ref(String) -> Externref`.
|
|
1144
|
+
const ret = getStringFromWasm0(arg0, arg1);
|
|
1145
|
+
return ret;
|
|
1146
|
+
},
|
|
1147
|
+
__wbindgen_init_externref_table: function() {
|
|
1148
|
+
const table = wasm.__wbindgen_externrefs;
|
|
1149
|
+
const offset = table.grow(4);
|
|
1150
|
+
table.set(0, undefined);
|
|
1151
|
+
table.set(offset + 0, undefined);
|
|
1152
|
+
table.set(offset + 1, null);
|
|
1153
|
+
table.set(offset + 2, true);
|
|
1154
|
+
table.set(offset + 3, false);
|
|
1155
|
+
},
|
|
1156
|
+
};
|
|
1157
|
+
return {
|
|
1158
|
+
__proto__: null,
|
|
1159
|
+
"./kition_table_kit_bg.js": import0,
|
|
1160
|
+
};
|
|
1161
|
+
}
|
|
1162
|
+
|
|
1163
|
+
const TableDocumentFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1164
|
+
? { register: () => {}, unregister: () => {} }
|
|
1165
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_tabledocument_free(ptr, 1));
|
|
1166
|
+
|
|
1167
|
+
function addToExternrefTable0(obj) {
|
|
1168
|
+
const idx = wasm.__externref_table_alloc();
|
|
1169
|
+
wasm.__wbindgen_externrefs.set(idx, obj);
|
|
1170
|
+
return idx;
|
|
1171
|
+
}
|
|
1172
|
+
|
|
1173
|
+
function getArrayU8FromWasm0(ptr, len) {
|
|
1174
|
+
ptr = ptr >>> 0;
|
|
1175
|
+
return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
|
|
1176
|
+
}
|
|
1177
|
+
|
|
1178
|
+
let cachedDataViewMemory0 = null;
|
|
1179
|
+
function getDataViewMemory0() {
|
|
1180
|
+
if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
|
|
1181
|
+
cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
|
|
1182
|
+
}
|
|
1183
|
+
return cachedDataViewMemory0;
|
|
1184
|
+
}
|
|
1185
|
+
|
|
1186
|
+
let cachedFloat64ArrayMemory0 = null;
|
|
1187
|
+
function getFloat64ArrayMemory0() {
|
|
1188
|
+
if (cachedFloat64ArrayMemory0 === null || cachedFloat64ArrayMemory0.byteLength === 0) {
|
|
1189
|
+
cachedFloat64ArrayMemory0 = new Float64Array(wasm.memory.buffer);
|
|
1190
|
+
}
|
|
1191
|
+
return cachedFloat64ArrayMemory0;
|
|
1192
|
+
}
|
|
1193
|
+
|
|
1194
|
+
function getStringFromWasm0(ptr, len) {
|
|
1195
|
+
return decodeText(ptr >>> 0, len);
|
|
1196
|
+
}
|
|
1197
|
+
|
|
1198
|
+
let cachedUint32ArrayMemory0 = null;
|
|
1199
|
+
function getUint32ArrayMemory0() {
|
|
1200
|
+
if (cachedUint32ArrayMemory0 === null || cachedUint32ArrayMemory0.byteLength === 0) {
|
|
1201
|
+
cachedUint32ArrayMemory0 = new Uint32Array(wasm.memory.buffer);
|
|
1202
|
+
}
|
|
1203
|
+
return cachedUint32ArrayMemory0;
|
|
1204
|
+
}
|
|
1205
|
+
|
|
1206
|
+
let cachedUint8ArrayMemory0 = null;
|
|
1207
|
+
function getUint8ArrayMemory0() {
|
|
1208
|
+
if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
|
|
1209
|
+
cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
|
|
1210
|
+
}
|
|
1211
|
+
return cachedUint8ArrayMemory0;
|
|
1212
|
+
}
|
|
1213
|
+
|
|
1214
|
+
function handleError(f, args) {
|
|
1215
|
+
try {
|
|
1216
|
+
return f.apply(this, args);
|
|
1217
|
+
} catch (e) {
|
|
1218
|
+
const idx = addToExternrefTable0(e);
|
|
1219
|
+
wasm.__wbindgen_exn_store(idx);
|
|
1220
|
+
}
|
|
1221
|
+
}
|
|
1222
|
+
|
|
1223
|
+
function isLikeNone(x) {
|
|
1224
|
+
return x === undefined || x === null;
|
|
1225
|
+
}
|
|
1226
|
+
|
|
1227
|
+
function passArray32ToWasm0(arg, malloc) {
|
|
1228
|
+
const ptr = malloc(arg.length * 4, 4) >>> 0;
|
|
1229
|
+
getUint32ArrayMemory0().set(arg, ptr / 4);
|
|
1230
|
+
WASM_VECTOR_LEN = arg.length;
|
|
1231
|
+
return ptr;
|
|
1232
|
+
}
|
|
1233
|
+
|
|
1234
|
+
function passArray8ToWasm0(arg, malloc) {
|
|
1235
|
+
const ptr = malloc(arg.length * 1, 1) >>> 0;
|
|
1236
|
+
getUint8ArrayMemory0().set(arg, ptr / 1);
|
|
1237
|
+
WASM_VECTOR_LEN = arg.length;
|
|
1238
|
+
return ptr;
|
|
1239
|
+
}
|
|
1240
|
+
|
|
1241
|
+
function passArrayF64ToWasm0(arg, malloc) {
|
|
1242
|
+
const ptr = malloc(arg.length * 8, 8) >>> 0;
|
|
1243
|
+
getFloat64ArrayMemory0().set(arg, ptr / 8);
|
|
1244
|
+
WASM_VECTOR_LEN = arg.length;
|
|
1245
|
+
return ptr;
|
|
1246
|
+
}
|
|
1247
|
+
|
|
1248
|
+
function passStringToWasm0(arg, malloc, realloc) {
|
|
1249
|
+
if (realloc === undefined) {
|
|
1250
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
1251
|
+
const ptr = malloc(buf.length, 1) >>> 0;
|
|
1252
|
+
getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
|
|
1253
|
+
WASM_VECTOR_LEN = buf.length;
|
|
1254
|
+
return ptr;
|
|
1255
|
+
}
|
|
1256
|
+
|
|
1257
|
+
let len = arg.length;
|
|
1258
|
+
let ptr = malloc(len, 1) >>> 0;
|
|
1259
|
+
|
|
1260
|
+
const mem = getUint8ArrayMemory0();
|
|
1261
|
+
|
|
1262
|
+
let offset = 0;
|
|
1263
|
+
|
|
1264
|
+
for (; offset < len; offset++) {
|
|
1265
|
+
const code = arg.charCodeAt(offset);
|
|
1266
|
+
if (code > 0x7F) break;
|
|
1267
|
+
mem[ptr + offset] = code;
|
|
1268
|
+
}
|
|
1269
|
+
if (offset !== len) {
|
|
1270
|
+
if (offset !== 0) {
|
|
1271
|
+
arg = arg.slice(offset);
|
|
1272
|
+
}
|
|
1273
|
+
ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
|
|
1274
|
+
const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
|
|
1275
|
+
const ret = cachedTextEncoder.encodeInto(arg, view);
|
|
1276
|
+
|
|
1277
|
+
offset += ret.written;
|
|
1278
|
+
ptr = realloc(ptr, len, offset, 1) >>> 0;
|
|
1279
|
+
}
|
|
1280
|
+
|
|
1281
|
+
WASM_VECTOR_LEN = offset;
|
|
1282
|
+
return ptr;
|
|
1283
|
+
}
|
|
1284
|
+
|
|
1285
|
+
function takeFromExternrefTable0(idx) {
|
|
1286
|
+
const value = wasm.__wbindgen_externrefs.get(idx);
|
|
1287
|
+
wasm.__externref_table_dealloc(idx);
|
|
1288
|
+
return value;
|
|
1289
|
+
}
|
|
1290
|
+
|
|
1291
|
+
let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
1292
|
+
cachedTextDecoder.decode();
|
|
1293
|
+
const MAX_SAFARI_DECODE_BYTES = 2146435072;
|
|
1294
|
+
let numBytesDecoded = 0;
|
|
1295
|
+
function decodeText(ptr, len) {
|
|
1296
|
+
numBytesDecoded += len;
|
|
1297
|
+
if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
|
|
1298
|
+
cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
1299
|
+
cachedTextDecoder.decode();
|
|
1300
|
+
numBytesDecoded = len;
|
|
1301
|
+
}
|
|
1302
|
+
return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
|
|
1303
|
+
}
|
|
1304
|
+
|
|
1305
|
+
const cachedTextEncoder = new TextEncoder();
|
|
1306
|
+
|
|
1307
|
+
if (!('encodeInto' in cachedTextEncoder)) {
|
|
1308
|
+
cachedTextEncoder.encodeInto = function (arg, view) {
|
|
1309
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
1310
|
+
view.set(buf);
|
|
1311
|
+
return {
|
|
1312
|
+
read: arg.length,
|
|
1313
|
+
written: buf.length
|
|
1314
|
+
};
|
|
1315
|
+
};
|
|
1316
|
+
}
|
|
1317
|
+
|
|
1318
|
+
let WASM_VECTOR_LEN = 0;
|
|
1319
|
+
|
|
1320
|
+
let wasmModule, wasmInstance, wasm;
|
|
1321
|
+
function __wbg_finalize_init(instance, module) {
|
|
1322
|
+
wasmInstance = instance;
|
|
1323
|
+
wasm = instance.exports;
|
|
1324
|
+
wasmModule = module;
|
|
1325
|
+
cachedDataViewMemory0 = null;
|
|
1326
|
+
cachedFloat64ArrayMemory0 = null;
|
|
1327
|
+
cachedUint32ArrayMemory0 = null;
|
|
1328
|
+
cachedUint8ArrayMemory0 = null;
|
|
1329
|
+
wasm.__wbindgen_start();
|
|
1330
|
+
return wasm;
|
|
1331
|
+
}
|
|
1332
|
+
|
|
1333
|
+
async function __wbg_load(module, imports) {
|
|
1334
|
+
if (typeof Response === 'function' && module instanceof Response) {
|
|
1335
|
+
if (!module.ok) {
|
|
1336
|
+
throw new Error(`failed to fetch Wasm: ${module.status} ${module.statusText} fetching '${module.url}'`);
|
|
1337
|
+
}
|
|
1338
|
+
|
|
1339
|
+
if (typeof WebAssembly.instantiateStreaming === 'function') {
|
|
1340
|
+
try {
|
|
1341
|
+
return await WebAssembly.instantiateStreaming(module, imports);
|
|
1342
|
+
} catch (e) {
|
|
1343
|
+
const validResponse = expectedResponseType(module.type);
|
|
1344
|
+
|
|
1345
|
+
if (validResponse && module.headers.get('Content-Type') !== 'application/wasm') {
|
|
1346
|
+
console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n", e);
|
|
1347
|
+
|
|
1348
|
+
} else { throw e; }
|
|
1349
|
+
}
|
|
1350
|
+
}
|
|
1351
|
+
|
|
1352
|
+
const bytes = await module.arrayBuffer();
|
|
1353
|
+
return await WebAssembly.instantiate(bytes, imports);
|
|
1354
|
+
} else {
|
|
1355
|
+
const instance = await WebAssembly.instantiate(module, imports);
|
|
1356
|
+
|
|
1357
|
+
if (instance instanceof WebAssembly.Instance) {
|
|
1358
|
+
return { instance, module };
|
|
1359
|
+
} else {
|
|
1360
|
+
return instance;
|
|
1361
|
+
}
|
|
1362
|
+
}
|
|
1363
|
+
|
|
1364
|
+
function expectedResponseType(type) {
|
|
1365
|
+
switch (type) {
|
|
1366
|
+
case 'basic': case 'cors': case 'default': return true;
|
|
1367
|
+
}
|
|
1368
|
+
return false;
|
|
1369
|
+
}
|
|
1370
|
+
}
|
|
1371
|
+
|
|
1372
|
+
function initSync(module) {
|
|
1373
|
+
if (wasm !== undefined) return wasm;
|
|
1374
|
+
|
|
1375
|
+
|
|
1376
|
+
if (module !== undefined) {
|
|
1377
|
+
if (Object.getPrototypeOf(module) === Object.prototype) {
|
|
1378
|
+
({module} = module)
|
|
1379
|
+
} else {
|
|
1380
|
+
console.warn('using deprecated parameters for `initSync()`; pass a single object instead')
|
|
1381
|
+
}
|
|
1382
|
+
}
|
|
1383
|
+
|
|
1384
|
+
const imports = __wbg_get_imports();
|
|
1385
|
+
if (!(module instanceof WebAssembly.Module)) {
|
|
1386
|
+
module = new WebAssembly.Module(module);
|
|
1387
|
+
}
|
|
1388
|
+
const instance = new WebAssembly.Instance(module, imports);
|
|
1389
|
+
return __wbg_finalize_init(instance, module);
|
|
1390
|
+
}
|
|
1391
|
+
|
|
1392
|
+
async function __wbg_init(module_or_path) {
|
|
1393
|
+
if (wasm !== undefined) return wasm;
|
|
1394
|
+
|
|
1395
|
+
|
|
1396
|
+
if (module_or_path !== undefined) {
|
|
1397
|
+
if (Object.getPrototypeOf(module_or_path) === Object.prototype) {
|
|
1398
|
+
({module_or_path} = module_or_path)
|
|
1399
|
+
} else {
|
|
1400
|
+
console.warn('using deprecated parameters for the initialization function; pass a single object instead')
|
|
1401
|
+
}
|
|
1402
|
+
}
|
|
1403
|
+
|
|
1404
|
+
if (module_or_path === undefined) {
|
|
1405
|
+
module_or_path = new URL('kition_table_kit_bg.wasm', import.meta.url);
|
|
1406
|
+
}
|
|
1407
|
+
const imports = __wbg_get_imports();
|
|
1408
|
+
|
|
1409
|
+
if (typeof module_or_path === 'string' || (typeof Request === 'function' && module_or_path instanceof Request) || (typeof URL === 'function' && module_or_path instanceof URL)) {
|
|
1410
|
+
module_or_path = fetch(module_or_path);
|
|
1411
|
+
}
|
|
1412
|
+
|
|
1413
|
+
const { instance, module } = await __wbg_load(await module_or_path, imports);
|
|
1414
|
+
|
|
1415
|
+
return __wbg_finalize_init(instance, module);
|
|
1416
|
+
}
|
|
1417
|
+
|
|
1418
|
+
export { initSync, __wbg_init as default };
|