@senlinz/import-export-wasm 0.0.1-beta.4 → 0.1.0-beta.10
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/LICENSE +33 -0
- package/README.md +13 -1
- package/package.json +4 -3
- package/pkg/imexport_wasm.d.ts +91 -79
- package/pkg/imexport_wasm.js +360 -147
- package/pkg/imexport_wasm_bg.wasm +0 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024, senlinz
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
This project includes third-party software licensed under the MIT License and the Apache License 2.0:
|
|
26
|
+
|
|
27
|
+
## rust_xlsxwriter
|
|
28
|
+
|
|
29
|
+
MIT License (MIT) or Apache License, Version 2.0
|
|
30
|
+
|
|
31
|
+
## calamine
|
|
32
|
+
|
|
33
|
+
MIT License
|
package/README.md
CHANGED
|
@@ -1 +1,13 @@
|
|
|
1
|
-
# @senlinz/import-export-wasm
|
|
1
|
+
# @senlinz/import-export-wasm
|
|
2
|
+
**@senlinz/import-export-wasm** is the Rust WebAssembly core library for the **@senlinz/import-export** library. It provides the core logic for handling Excel data in browser environments.
|
|
3
|
+
|
|
4
|
+
> **Note:** This library is currently in beta. Features and APIs may change.
|
|
5
|
+
|
|
6
|
+
## Features
|
|
7
|
+
- Rust WebAssembly core for efficient Excel data handling.
|
|
8
|
+
- Read using [calamine](https://docs.rs/calamine/).
|
|
9
|
+
- Write using [rust_xlsxwriter](https://docs.rs/rust_xlsxwriter/).
|
|
10
|
+
|
|
11
|
+
## Usage
|
|
12
|
+
Directly use WebAssembly in browser environments.
|
|
13
|
+
[Example](./tests/index.html)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@senlinz/import-export-wasm",
|
|
3
|
-
"version": "0.0
|
|
3
|
+
"version": "0.1.0-beta.10",
|
|
4
4
|
"description": "Rust WebAssembly for import/export excel files",
|
|
5
5
|
"main": "pkg/imexport_wasm.js",
|
|
6
6
|
"types": "pkg/imexport_wasm.d.ts",
|
|
@@ -32,8 +32,9 @@
|
|
|
32
32
|
],
|
|
33
33
|
"scripts": {
|
|
34
34
|
"build": "wasm-pack build --release --target web",
|
|
35
|
-
"test": "wasm-pack test --headless --firefox",
|
|
36
35
|
"publish-dry-run": "pnpm publish --dry-run --no-git-checks",
|
|
37
|
-
"cargo-test": "cargo test"
|
|
36
|
+
"cargo-test": "cargo test --lib",
|
|
37
|
+
"e2e-serve": "wasm-pack build --release --target web -d tests/dist && serve -l 8080 ./tests",
|
|
38
|
+
"e2e-test": "playwright test"
|
|
38
39
|
}
|
|
39
40
|
}
|
package/pkg/imexport_wasm.d.ts
CHANGED
|
@@ -1,96 +1,93 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
3
|
/**
|
|
4
|
-
* @param {ExcelInfo} info
|
|
5
|
-
* @returns {Uint8Array}
|
|
6
|
-
*/
|
|
4
|
+
* @param {ExcelInfo} info
|
|
5
|
+
* @returns {Uint8Array}
|
|
6
|
+
*/
|
|
7
7
|
export function createTemplate(info: ExcelInfo): Uint8Array;
|
|
8
8
|
/**
|
|
9
|
-
* @param {ExcelInfo} info
|
|
10
|
-
* @param {Uint8Array} excel_bytes
|
|
11
|
-
* @returns {ExcelData}
|
|
12
|
-
*/
|
|
9
|
+
* @param {ExcelInfo} info
|
|
10
|
+
* @param {Uint8Array} excel_bytes
|
|
11
|
+
* @returns {ExcelData}
|
|
12
|
+
*/
|
|
13
13
|
export function importData(info: ExcelInfo, excel_bytes: Uint8Array): ExcelData;
|
|
14
14
|
/**
|
|
15
|
-
* @param {ExcelInfo} info
|
|
16
|
-
* @param {ExcelData} data
|
|
17
|
-
* @returns {Uint8Array}
|
|
18
|
-
*/
|
|
15
|
+
* @param {ExcelInfo} info
|
|
16
|
+
* @param {ExcelData} data
|
|
17
|
+
* @returns {Uint8Array}
|
|
18
|
+
*/
|
|
19
19
|
export function exportData(info: ExcelInfo, data: ExcelData): Uint8Array;
|
|
20
|
-
|
|
21
|
-
|
|
20
|
+
export enum ExcelDataType {
|
|
21
|
+
Text = 0,
|
|
22
|
+
Number = 1,
|
|
23
|
+
}
|
|
22
24
|
export class ExcelColumnData {
|
|
23
25
|
free(): void;
|
|
24
|
-
/**
|
|
25
|
-
* @param {string} key
|
|
26
|
-
* @param {string} value
|
|
27
|
-
*/
|
|
26
|
+
/**
|
|
27
|
+
* @param {string} key
|
|
28
|
+
* @param {string} value
|
|
29
|
+
*/
|
|
28
30
|
constructor(key: string, value: string);
|
|
29
|
-
/**
|
|
30
|
-
*/
|
|
31
31
|
key: string;
|
|
32
|
-
/**
|
|
33
|
-
*/
|
|
34
32
|
value: string;
|
|
35
33
|
}
|
|
36
|
-
/**
|
|
37
|
-
*/
|
|
38
34
|
export class ExcelColumnInfo {
|
|
39
35
|
free(): void;
|
|
40
|
-
/**
|
|
41
|
-
* @param {string} key
|
|
42
|
-
* @param {string} name
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
36
|
+
/**
|
|
37
|
+
* @param {string} key
|
|
38
|
+
* @param {string} name
|
|
39
|
+
* @param {number | undefined} [width]
|
|
40
|
+
*/
|
|
41
|
+
constructor(key: string, name: string, width?: number);
|
|
42
|
+
/**
|
|
43
|
+
* @param {string} note
|
|
44
|
+
*/
|
|
45
|
+
setNote(note: string): void;
|
|
46
|
+
/**
|
|
47
|
+
* @param {ExcelDataType} data_type
|
|
48
|
+
*/
|
|
49
|
+
setDataType(data_type: ExcelDataType): void;
|
|
50
|
+
/**
|
|
51
|
+
* @param {(string)[]} allowed_values
|
|
52
|
+
*/
|
|
53
|
+
setAllowedValues(allowed_values: (string)[]): void;
|
|
54
|
+
allowed_values?: (string)[];
|
|
55
|
+
data_type: ExcelDataType;
|
|
47
56
|
key: string;
|
|
48
|
-
/**
|
|
49
|
-
*/
|
|
50
57
|
name: string;
|
|
58
|
+
note?: string;
|
|
59
|
+
width?: number;
|
|
51
60
|
}
|
|
52
|
-
/**
|
|
53
|
-
*/
|
|
54
61
|
export class ExcelData {
|
|
55
62
|
free(): void;
|
|
56
|
-
/**
|
|
57
|
-
* @param {(ExcelRowData)[]} rows
|
|
58
|
-
*/
|
|
63
|
+
/**
|
|
64
|
+
* @param {(ExcelRowData)[]} rows
|
|
65
|
+
*/
|
|
59
66
|
constructor(rows: (ExcelRowData)[]);
|
|
60
|
-
/**
|
|
61
|
-
*/
|
|
62
67
|
rows: (ExcelRowData)[];
|
|
63
68
|
}
|
|
64
|
-
/**
|
|
65
|
-
*/
|
|
66
69
|
export class ExcelInfo {
|
|
67
70
|
free(): void;
|
|
68
|
-
/**
|
|
69
|
-
* @param {string} name
|
|
70
|
-
* @param {string} sheet_name
|
|
71
|
-
* @param {(ExcelColumnInfo)[]} columns
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
71
|
+
/**
|
|
72
|
+
* @param {string} name
|
|
73
|
+
* @param {string} sheet_name
|
|
74
|
+
* @param {(ExcelColumnInfo)[]} columns
|
|
75
|
+
* @param {string} author
|
|
76
|
+
* @param {string} create_time
|
|
77
|
+
*/
|
|
78
|
+
constructor(name: string, sheet_name: string, columns: (ExcelColumnInfo)[], author: string, create_time: string);
|
|
79
|
+
author: string;
|
|
76
80
|
columns: (ExcelColumnInfo)[];
|
|
77
|
-
|
|
78
|
-
*/
|
|
81
|
+
create_time: string;
|
|
79
82
|
name: string;
|
|
80
|
-
/**
|
|
81
|
-
*/
|
|
82
83
|
sheet_name: string;
|
|
83
84
|
}
|
|
84
|
-
/**
|
|
85
|
-
*/
|
|
86
85
|
export class ExcelRowData {
|
|
87
86
|
free(): void;
|
|
88
|
-
/**
|
|
89
|
-
* @param {(ExcelColumnData)[]} columns
|
|
90
|
-
*/
|
|
87
|
+
/**
|
|
88
|
+
* @param {(ExcelColumnData)[]} columns
|
|
89
|
+
*/
|
|
91
90
|
constructor(columns: (ExcelColumnData)[]);
|
|
92
|
-
/**
|
|
93
|
-
*/
|
|
94
91
|
columns: (ExcelColumnData)[];
|
|
95
92
|
}
|
|
96
93
|
|
|
@@ -98,41 +95,56 @@ export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembl
|
|
|
98
95
|
|
|
99
96
|
export interface InitOutput {
|
|
100
97
|
readonly memory: WebAssembly.Memory;
|
|
101
|
-
readonly __wbg_exceldata_free: (a: number, b: number) => void;
|
|
102
|
-
readonly __wbg_get_exceldata_rows: (a: number, b: number) => void;
|
|
103
|
-
readonly __wbg_set_exceldata_rows: (a: number, b: number, c: number) => void;
|
|
104
|
-
readonly exceldata_new: (a: number, b: number) => number;
|
|
105
|
-
readonly __wbg_excelrowdata_free: (a: number, b: number) => void;
|
|
106
|
-
readonly __wbg_get_excelrowdata_columns: (a: number, b: number) => void;
|
|
107
|
-
readonly __wbg_set_excelrowdata_columns: (a: number, b: number, c: number) => void;
|
|
108
|
-
readonly excelrowdata_new: (a: number, b: number) => number;
|
|
109
98
|
readonly __wbg_excelcolumndata_free: (a: number, b: number) => void;
|
|
110
99
|
readonly __wbg_get_excelcolumndata_key: (a: number, b: number) => void;
|
|
111
100
|
readonly __wbg_set_excelcolumndata_key: (a: number, b: number, c: number) => void;
|
|
112
101
|
readonly __wbg_get_excelcolumndata_value: (a: number, b: number) => void;
|
|
113
102
|
readonly __wbg_set_excelcolumndata_value: (a: number, b: number, c: number) => void;
|
|
114
103
|
readonly excelcolumndata_new: (a: number, b: number, c: number, d: number) => number;
|
|
115
|
-
readonly
|
|
116
|
-
readonly
|
|
117
|
-
readonly
|
|
104
|
+
readonly __wbg_excelrowdata_free: (a: number, b: number) => void;
|
|
105
|
+
readonly __wbg_get_excelrowdata_columns: (a: number, b: number) => void;
|
|
106
|
+
readonly __wbg_set_excelrowdata_columns: (a: number, b: number, c: number) => void;
|
|
107
|
+
readonly excelrowdata_new: (a: number, b: number) => number;
|
|
108
|
+
readonly __wbg_exceldata_free: (a: number, b: number) => void;
|
|
109
|
+
readonly __wbg_get_exceldata_rows: (a: number, b: number) => void;
|
|
110
|
+
readonly __wbg_set_exceldata_rows: (a: number, b: number, c: number) => void;
|
|
111
|
+
readonly exceldata_new: (a: number, b: number) => number;
|
|
118
112
|
readonly __wbg_excelinfo_free: (a: number, b: number) => void;
|
|
113
|
+
readonly __wbg_get_excelinfo_name: (a: number, b: number) => void;
|
|
114
|
+
readonly __wbg_set_excelinfo_name: (a: number, b: number, c: number) => void;
|
|
115
|
+
readonly __wbg_get_excelinfo_sheet_name: (a: number, b: number) => void;
|
|
116
|
+
readonly __wbg_set_excelinfo_sheet_name: (a: number, b: number, c: number) => void;
|
|
119
117
|
readonly __wbg_get_excelinfo_columns: (a: number, b: number) => void;
|
|
120
118
|
readonly __wbg_set_excelinfo_columns: (a: number, b: number, c: number) => void;
|
|
121
|
-
readonly
|
|
119
|
+
readonly __wbg_get_excelinfo_author: (a: number, b: number) => void;
|
|
120
|
+
readonly __wbg_set_excelinfo_author: (a: number, b: number, c: number) => void;
|
|
121
|
+
readonly __wbg_get_excelinfo_create_time: (a: number, b: number) => void;
|
|
122
|
+
readonly __wbg_set_excelinfo_create_time: (a: number, b: number, c: number) => void;
|
|
123
|
+
readonly excelinfo_new: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number) => number;
|
|
122
124
|
readonly __wbg_excelcolumninfo_free: (a: number, b: number) => void;
|
|
123
125
|
readonly __wbg_get_excelcolumninfo_key: (a: number, b: number) => void;
|
|
124
126
|
readonly __wbg_set_excelcolumninfo_key: (a: number, b: number, c: number) => void;
|
|
125
127
|
readonly __wbg_get_excelcolumninfo_name: (a: number, b: number) => void;
|
|
126
128
|
readonly __wbg_set_excelcolumninfo_name: (a: number, b: number, c: number) => void;
|
|
127
|
-
readonly
|
|
128
|
-
readonly
|
|
129
|
-
readonly
|
|
130
|
-
readonly
|
|
131
|
-
readonly
|
|
132
|
-
readonly
|
|
133
|
-
readonly
|
|
129
|
+
readonly __wbg_get_excelcolumninfo_width: (a: number, b: number) => void;
|
|
130
|
+
readonly __wbg_set_excelcolumninfo_width: (a: number, b: number, c: number) => void;
|
|
131
|
+
readonly __wbg_get_excelcolumninfo_note: (a: number, b: number) => void;
|
|
132
|
+
readonly __wbg_set_excelcolumninfo_note: (a: number, b: number, c: number) => void;
|
|
133
|
+
readonly __wbg_get_excelcolumninfo_data_type: (a: number) => number;
|
|
134
|
+
readonly __wbg_set_excelcolumninfo_data_type: (a: number, b: number) => void;
|
|
135
|
+
readonly __wbg_get_excelcolumninfo_allowed_values: (a: number, b: number) => void;
|
|
136
|
+
readonly __wbg_set_excelcolumninfo_allowed_values: (a: number, b: number, c: number) => void;
|
|
137
|
+
readonly excelcolumninfo_new: (a: number, b: number, c: number, d: number, e: number, f: number) => number;
|
|
138
|
+
readonly excelcolumninfo_setNote: (a: number, b: number, c: number) => void;
|
|
139
|
+
readonly excelcolumninfo_setDataType: (a: number, b: number) => void;
|
|
140
|
+
readonly excelcolumninfo_setAllowedValues: (a: number, b: number, c: number) => void;
|
|
141
|
+
readonly createTemplate: (a: number, b: number) => void;
|
|
142
|
+
readonly importData: (a: number, b: number, c: number, d: number) => void;
|
|
143
|
+
readonly exportData: (a: number, b: number, c: number) => void;
|
|
134
144
|
readonly __wbindgen_malloc: (a: number, b: number) => number;
|
|
135
145
|
readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
|
|
146
|
+
readonly __wbindgen_add_to_stack_pointer: (a: number) => number;
|
|
147
|
+
readonly __wbindgen_free: (a: number, b: number, c: number) => void;
|
|
136
148
|
}
|
|
137
149
|
|
|
138
150
|
export type SyncInitInput = BufferSource | WebAssembly.Module;
|
package/pkg/imexport_wasm.js
CHANGED
|
@@ -1,32 +1,5 @@
|
|
|
1
1
|
let wasm;
|
|
2
2
|
|
|
3
|
-
const cachedTextDecoder = (typeof TextDecoder !== 'undefined' ? new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }) : { decode: () => { throw Error('TextDecoder not available') } } );
|
|
4
|
-
|
|
5
|
-
if (typeof TextDecoder !== 'undefined') { cachedTextDecoder.decode(); };
|
|
6
|
-
|
|
7
|
-
let cachedUint8ArrayMemory0 = null;
|
|
8
|
-
|
|
9
|
-
function getUint8ArrayMemory0() {
|
|
10
|
-
if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
|
|
11
|
-
cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
|
|
12
|
-
}
|
|
13
|
-
return cachedUint8ArrayMemory0;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
function getStringFromWasm0(ptr, len) {
|
|
17
|
-
ptr = ptr >>> 0;
|
|
18
|
-
return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
let cachedDataViewMemory0 = null;
|
|
22
|
-
|
|
23
|
-
function getDataViewMemory0() {
|
|
24
|
-
if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
|
|
25
|
-
cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
|
|
26
|
-
}
|
|
27
|
-
return cachedDataViewMemory0;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
3
|
const heap = new Array(128).fill(undefined);
|
|
31
4
|
|
|
32
5
|
heap.push(undefined, null, true, false);
|
|
@@ -47,17 +20,23 @@ function takeObject(idx) {
|
|
|
47
20
|
return ret;
|
|
48
21
|
}
|
|
49
22
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
23
|
+
const cachedTextDecoder = (typeof TextDecoder !== 'undefined' ? new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }) : { decode: () => { throw Error('TextDecoder not available') } } );
|
|
24
|
+
|
|
25
|
+
if (typeof TextDecoder !== 'undefined') { cachedTextDecoder.decode(); };
|
|
26
|
+
|
|
27
|
+
let cachedUint8ArrayMemory0 = null;
|
|
28
|
+
|
|
29
|
+
function getUint8ArrayMemory0() {
|
|
30
|
+
if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
|
|
31
|
+
cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
|
|
56
32
|
}
|
|
57
|
-
return
|
|
33
|
+
return cachedUint8ArrayMemory0;
|
|
58
34
|
}
|
|
59
35
|
|
|
60
|
-
|
|
36
|
+
function getStringFromWasm0(ptr, len) {
|
|
37
|
+
ptr = ptr >>> 0;
|
|
38
|
+
return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
|
|
39
|
+
}
|
|
61
40
|
|
|
62
41
|
function addHeapObject(obj) {
|
|
63
42
|
if (heap_next === heap.length) heap.push(heap.length + 1);
|
|
@@ -68,15 +47,7 @@ function addHeapObject(obj) {
|
|
|
68
47
|
return idx;
|
|
69
48
|
}
|
|
70
49
|
|
|
71
|
-
|
|
72
|
-
const ptr = malloc(array.length * 4, 4) >>> 0;
|
|
73
|
-
const mem = getDataViewMemory0();
|
|
74
|
-
for (let i = 0; i < array.length; i++) {
|
|
75
|
-
mem.setUint32(ptr + 4 * i, addHeapObject(array[i]), true);
|
|
76
|
-
}
|
|
77
|
-
WASM_VECTOR_LEN = array.length;
|
|
78
|
-
return ptr;
|
|
79
|
-
}
|
|
50
|
+
let WASM_VECTOR_LEN = 0;
|
|
80
51
|
|
|
81
52
|
const cachedTextEncoder = (typeof TextEncoder !== 'undefined' ? new TextEncoder('utf-8') : { encode: () => { throw Error('TextEncoder not available') } } );
|
|
82
53
|
|
|
@@ -132,6 +103,39 @@ function passStringToWasm0(arg, malloc, realloc) {
|
|
|
132
103
|
return ptr;
|
|
133
104
|
}
|
|
134
105
|
|
|
106
|
+
function isLikeNone(x) {
|
|
107
|
+
return x === undefined || x === null;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
let cachedDataViewMemory0 = null;
|
|
111
|
+
|
|
112
|
+
function getDataViewMemory0() {
|
|
113
|
+
if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
|
|
114
|
+
cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
|
|
115
|
+
}
|
|
116
|
+
return cachedDataViewMemory0;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
function getArrayJsValueFromWasm0(ptr, len) {
|
|
120
|
+
ptr = ptr >>> 0;
|
|
121
|
+
const mem = getDataViewMemory0();
|
|
122
|
+
const result = [];
|
|
123
|
+
for (let i = ptr; i < ptr + 4 * len; i += 4) {
|
|
124
|
+
result.push(takeObject(mem.getUint32(i, true)));
|
|
125
|
+
}
|
|
126
|
+
return result;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
function passArrayJsValueToWasm0(array, malloc) {
|
|
130
|
+
const ptr = malloc(array.length * 4, 4) >>> 0;
|
|
131
|
+
const mem = getDataViewMemory0();
|
|
132
|
+
for (let i = 0; i < array.length; i++) {
|
|
133
|
+
mem.setUint32(ptr + 4 * i, addHeapObject(array[i]), true);
|
|
134
|
+
}
|
|
135
|
+
WASM_VECTOR_LEN = array.length;
|
|
136
|
+
return ptr;
|
|
137
|
+
}
|
|
138
|
+
|
|
135
139
|
function _assertClass(instance, klass) {
|
|
136
140
|
if (!(instance instanceof klass)) {
|
|
137
141
|
throw new Error(`expected instance of ${klass.name}`);
|
|
@@ -144,9 +148,9 @@ function getArrayU8FromWasm0(ptr, len) {
|
|
|
144
148
|
return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
|
|
145
149
|
}
|
|
146
150
|
/**
|
|
147
|
-
* @param {ExcelInfo} info
|
|
148
|
-
* @returns {Uint8Array}
|
|
149
|
-
*/
|
|
151
|
+
* @param {ExcelInfo} info
|
|
152
|
+
* @returns {Uint8Array}
|
|
153
|
+
*/
|
|
150
154
|
export function createTemplate(info) {
|
|
151
155
|
try {
|
|
152
156
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
@@ -155,6 +159,11 @@ export function createTemplate(info) {
|
|
|
155
159
|
wasm.createTemplate(retptr, ptr0);
|
|
156
160
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
157
161
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
162
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
163
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
164
|
+
if (r3) {
|
|
165
|
+
throw takeObject(r2);
|
|
166
|
+
}
|
|
158
167
|
var v2 = getArrayU8FromWasm0(r0, r1).slice();
|
|
159
168
|
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
160
169
|
return v2;
|
|
@@ -170,24 +179,35 @@ function passArray8ToWasm0(arg, malloc) {
|
|
|
170
179
|
return ptr;
|
|
171
180
|
}
|
|
172
181
|
/**
|
|
173
|
-
* @param {ExcelInfo} info
|
|
174
|
-
* @param {Uint8Array} excel_bytes
|
|
175
|
-
* @returns {ExcelData}
|
|
176
|
-
*/
|
|
182
|
+
* @param {ExcelInfo} info
|
|
183
|
+
* @param {Uint8Array} excel_bytes
|
|
184
|
+
* @returns {ExcelData}
|
|
185
|
+
*/
|
|
177
186
|
export function importData(info, excel_bytes) {
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
187
|
+
try {
|
|
188
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
189
|
+
_assertClass(info, ExcelInfo);
|
|
190
|
+
var ptr0 = info.__destroy_into_raw();
|
|
191
|
+
const ptr1 = passArray8ToWasm0(excel_bytes, wasm.__wbindgen_malloc);
|
|
192
|
+
const len1 = WASM_VECTOR_LEN;
|
|
193
|
+
wasm.importData(retptr, ptr0, ptr1, len1);
|
|
194
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
195
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
196
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
197
|
+
if (r2) {
|
|
198
|
+
throw takeObject(r1);
|
|
199
|
+
}
|
|
200
|
+
return ExcelData.__wrap(r0);
|
|
201
|
+
} finally {
|
|
202
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
203
|
+
}
|
|
184
204
|
}
|
|
185
205
|
|
|
186
206
|
/**
|
|
187
|
-
* @param {ExcelInfo} info
|
|
188
|
-
* @param {ExcelData} data
|
|
189
|
-
* @returns {Uint8Array}
|
|
190
|
-
*/
|
|
207
|
+
* @param {ExcelInfo} info
|
|
208
|
+
* @param {ExcelData} data
|
|
209
|
+
* @returns {Uint8Array}
|
|
210
|
+
*/
|
|
191
211
|
export function exportData(info, data) {
|
|
192
212
|
try {
|
|
193
213
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
@@ -198,6 +218,11 @@ export function exportData(info, data) {
|
|
|
198
218
|
wasm.exportData(retptr, ptr0, ptr1);
|
|
199
219
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
200
220
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
221
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
222
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
223
|
+
if (r3) {
|
|
224
|
+
throw takeObject(r2);
|
|
225
|
+
}
|
|
201
226
|
var v3 = getArrayU8FromWasm0(r0, r1).slice();
|
|
202
227
|
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
203
228
|
return v3;
|
|
@@ -206,11 +231,12 @@ export function exportData(info, data) {
|
|
|
206
231
|
}
|
|
207
232
|
}
|
|
208
233
|
|
|
234
|
+
export const ExcelDataType = Object.freeze({ Text:0,"0":"Text",Number:1,"1":"Number", });
|
|
235
|
+
|
|
209
236
|
const ExcelColumnDataFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
210
237
|
? { register: () => {}, unregister: () => {} }
|
|
211
238
|
: new FinalizationRegistry(ptr => wasm.__wbg_excelcolumndata_free(ptr >>> 0, 1));
|
|
212
|
-
|
|
213
|
-
*/
|
|
239
|
+
|
|
214
240
|
export class ExcelColumnData {
|
|
215
241
|
|
|
216
242
|
static __wrap(ptr) {
|
|
@@ -240,8 +266,8 @@ export class ExcelColumnData {
|
|
|
240
266
|
wasm.__wbg_excelcolumndata_free(ptr, 0);
|
|
241
267
|
}
|
|
242
268
|
/**
|
|
243
|
-
|
|
244
|
-
|
|
269
|
+
* @returns {string}
|
|
270
|
+
*/
|
|
245
271
|
get key() {
|
|
246
272
|
let deferred1_0;
|
|
247
273
|
let deferred1_1;
|
|
@@ -259,16 +285,16 @@ export class ExcelColumnData {
|
|
|
259
285
|
}
|
|
260
286
|
}
|
|
261
287
|
/**
|
|
262
|
-
|
|
263
|
-
|
|
288
|
+
* @param {string} arg0
|
|
289
|
+
*/
|
|
264
290
|
set key(arg0) {
|
|
265
291
|
const ptr0 = passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
266
292
|
const len0 = WASM_VECTOR_LEN;
|
|
267
293
|
wasm.__wbg_set_excelcolumndata_key(this.__wbg_ptr, ptr0, len0);
|
|
268
294
|
}
|
|
269
295
|
/**
|
|
270
|
-
|
|
271
|
-
|
|
296
|
+
* @returns {string}
|
|
297
|
+
*/
|
|
272
298
|
get value() {
|
|
273
299
|
let deferred1_0;
|
|
274
300
|
let deferred1_1;
|
|
@@ -286,17 +312,17 @@ export class ExcelColumnData {
|
|
|
286
312
|
}
|
|
287
313
|
}
|
|
288
314
|
/**
|
|
289
|
-
|
|
290
|
-
|
|
315
|
+
* @param {string} arg0
|
|
316
|
+
*/
|
|
291
317
|
set value(arg0) {
|
|
292
318
|
const ptr0 = passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
293
319
|
const len0 = WASM_VECTOR_LEN;
|
|
294
320
|
wasm.__wbg_set_excelcolumndata_value(this.__wbg_ptr, ptr0, len0);
|
|
295
321
|
}
|
|
296
322
|
/**
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
323
|
+
* @param {string} key
|
|
324
|
+
* @param {string} value
|
|
325
|
+
*/
|
|
300
326
|
constructor(key, value) {
|
|
301
327
|
const ptr0 = passStringToWasm0(key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
302
328
|
const len0 = WASM_VECTOR_LEN;
|
|
@@ -312,8 +338,7 @@ export class ExcelColumnData {
|
|
|
312
338
|
const ExcelColumnInfoFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
313
339
|
? { register: () => {}, unregister: () => {} }
|
|
314
340
|
: new FinalizationRegistry(ptr => wasm.__wbg_excelcolumninfo_free(ptr >>> 0, 1));
|
|
315
|
-
|
|
316
|
-
*/
|
|
341
|
+
|
|
317
342
|
export class ExcelColumnInfo {
|
|
318
343
|
|
|
319
344
|
static __wrap(ptr) {
|
|
@@ -343,8 +368,8 @@ export class ExcelColumnInfo {
|
|
|
343
368
|
wasm.__wbg_excelcolumninfo_free(ptr, 0);
|
|
344
369
|
}
|
|
345
370
|
/**
|
|
346
|
-
|
|
347
|
-
|
|
371
|
+
* @returns {string}
|
|
372
|
+
*/
|
|
348
373
|
get key() {
|
|
349
374
|
let deferred1_0;
|
|
350
375
|
let deferred1_1;
|
|
@@ -362,16 +387,16 @@ export class ExcelColumnInfo {
|
|
|
362
387
|
}
|
|
363
388
|
}
|
|
364
389
|
/**
|
|
365
|
-
|
|
366
|
-
|
|
390
|
+
* @param {string} arg0
|
|
391
|
+
*/
|
|
367
392
|
set key(arg0) {
|
|
368
393
|
const ptr0 = passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
369
394
|
const len0 = WASM_VECTOR_LEN;
|
|
370
395
|
wasm.__wbg_set_excelcolumninfo_key(this.__wbg_ptr, ptr0, len0);
|
|
371
396
|
}
|
|
372
397
|
/**
|
|
373
|
-
|
|
374
|
-
|
|
398
|
+
* @returns {string}
|
|
399
|
+
*/
|
|
375
400
|
get name() {
|
|
376
401
|
let deferred1_0;
|
|
377
402
|
let deferred1_1;
|
|
@@ -389,34 +414,143 @@ export class ExcelColumnInfo {
|
|
|
389
414
|
}
|
|
390
415
|
}
|
|
391
416
|
/**
|
|
392
|
-
|
|
393
|
-
|
|
417
|
+
* @param {string} arg0
|
|
418
|
+
*/
|
|
394
419
|
set name(arg0) {
|
|
395
420
|
const ptr0 = passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
396
421
|
const len0 = WASM_VECTOR_LEN;
|
|
397
422
|
wasm.__wbg_set_excelcolumninfo_name(this.__wbg_ptr, ptr0, len0);
|
|
398
423
|
}
|
|
399
424
|
/**
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
425
|
+
* @returns {number | undefined}
|
|
426
|
+
*/
|
|
427
|
+
get width() {
|
|
428
|
+
try {
|
|
429
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
430
|
+
wasm.__wbg_get_excelcolumninfo_width(retptr, this.__wbg_ptr);
|
|
431
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
432
|
+
var r2 = getDataViewMemory0().getFloat64(retptr + 8 * 1, true);
|
|
433
|
+
return r0 === 0 ? undefined : r2;
|
|
434
|
+
} finally {
|
|
435
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
436
|
+
}
|
|
437
|
+
}
|
|
438
|
+
/**
|
|
439
|
+
* @param {number | undefined} [arg0]
|
|
440
|
+
*/
|
|
441
|
+
set width(arg0) {
|
|
442
|
+
wasm.__wbg_set_excelcolumninfo_width(this.__wbg_ptr, !isLikeNone(arg0), isLikeNone(arg0) ? 0 : arg0);
|
|
443
|
+
}
|
|
444
|
+
/**
|
|
445
|
+
* @returns {string | undefined}
|
|
446
|
+
*/
|
|
447
|
+
get note() {
|
|
448
|
+
try {
|
|
449
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
450
|
+
wasm.__wbg_get_excelcolumninfo_note(retptr, this.__wbg_ptr);
|
|
451
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
452
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
453
|
+
let v1;
|
|
454
|
+
if (r0 !== 0) {
|
|
455
|
+
v1 = getStringFromWasm0(r0, r1).slice();
|
|
456
|
+
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
457
|
+
}
|
|
458
|
+
return v1;
|
|
459
|
+
} finally {
|
|
460
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
461
|
+
}
|
|
462
|
+
}
|
|
463
|
+
/**
|
|
464
|
+
* @param {string | undefined} [arg0]
|
|
465
|
+
*/
|
|
466
|
+
set note(arg0) {
|
|
467
|
+
var ptr0 = isLikeNone(arg0) ? 0 : passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
468
|
+
var len0 = WASM_VECTOR_LEN;
|
|
469
|
+
wasm.__wbg_set_excelcolumninfo_note(this.__wbg_ptr, ptr0, len0);
|
|
470
|
+
}
|
|
471
|
+
/**
|
|
472
|
+
* @returns {ExcelDataType}
|
|
473
|
+
*/
|
|
474
|
+
get data_type() {
|
|
475
|
+
const ret = wasm.__wbg_get_excelcolumninfo_data_type(this.__wbg_ptr);
|
|
476
|
+
return ret;
|
|
477
|
+
}
|
|
478
|
+
/**
|
|
479
|
+
* @param {ExcelDataType} arg0
|
|
480
|
+
*/
|
|
481
|
+
set data_type(arg0) {
|
|
482
|
+
wasm.__wbg_set_excelcolumninfo_data_type(this.__wbg_ptr, arg0);
|
|
483
|
+
}
|
|
484
|
+
/**
|
|
485
|
+
* @returns {(string)[] | undefined}
|
|
486
|
+
*/
|
|
487
|
+
get allowed_values() {
|
|
488
|
+
try {
|
|
489
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
490
|
+
wasm.__wbg_get_excelcolumninfo_allowed_values(retptr, this.__wbg_ptr);
|
|
491
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
492
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
493
|
+
let v1;
|
|
494
|
+
if (r0 !== 0) {
|
|
495
|
+
v1 = getArrayJsValueFromWasm0(r0, r1).slice();
|
|
496
|
+
wasm.__wbindgen_free(r0, r1 * 4, 4);
|
|
497
|
+
}
|
|
498
|
+
return v1;
|
|
499
|
+
} finally {
|
|
500
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
501
|
+
}
|
|
502
|
+
}
|
|
503
|
+
/**
|
|
504
|
+
* @param {(string)[] | undefined} [arg0]
|
|
505
|
+
*/
|
|
506
|
+
set allowed_values(arg0) {
|
|
507
|
+
var ptr0 = isLikeNone(arg0) ? 0 : passArrayJsValueToWasm0(arg0, wasm.__wbindgen_malloc);
|
|
508
|
+
var len0 = WASM_VECTOR_LEN;
|
|
509
|
+
wasm.__wbg_set_excelcolumninfo_allowed_values(this.__wbg_ptr, ptr0, len0);
|
|
510
|
+
}
|
|
511
|
+
/**
|
|
512
|
+
* @param {string} key
|
|
513
|
+
* @param {string} name
|
|
514
|
+
* @param {number | undefined} [width]
|
|
515
|
+
*/
|
|
516
|
+
constructor(key, name, width) {
|
|
404
517
|
const ptr0 = passStringToWasm0(key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
405
518
|
const len0 = WASM_VECTOR_LEN;
|
|
406
519
|
const ptr1 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
407
520
|
const len1 = WASM_VECTOR_LEN;
|
|
408
|
-
const ret = wasm.excelcolumninfo_new(ptr0, len0, ptr1, len1);
|
|
521
|
+
const ret = wasm.excelcolumninfo_new(ptr0, len0, ptr1, len1, !isLikeNone(width), isLikeNone(width) ? 0 : width);
|
|
409
522
|
this.__wbg_ptr = ret >>> 0;
|
|
410
523
|
ExcelColumnInfoFinalization.register(this, this.__wbg_ptr, this);
|
|
411
524
|
return this;
|
|
412
525
|
}
|
|
526
|
+
/**
|
|
527
|
+
* @param {string} note
|
|
528
|
+
*/
|
|
529
|
+
setNote(note) {
|
|
530
|
+
const ptr0 = passStringToWasm0(note, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
531
|
+
const len0 = WASM_VECTOR_LEN;
|
|
532
|
+
wasm.excelcolumninfo_setNote(this.__wbg_ptr, ptr0, len0);
|
|
533
|
+
}
|
|
534
|
+
/**
|
|
535
|
+
* @param {ExcelDataType} data_type
|
|
536
|
+
*/
|
|
537
|
+
setDataType(data_type) {
|
|
538
|
+
wasm.excelcolumninfo_setDataType(this.__wbg_ptr, data_type);
|
|
539
|
+
}
|
|
540
|
+
/**
|
|
541
|
+
* @param {(string)[]} allowed_values
|
|
542
|
+
*/
|
|
543
|
+
setAllowedValues(allowed_values) {
|
|
544
|
+
const ptr0 = passArrayJsValueToWasm0(allowed_values, wasm.__wbindgen_malloc);
|
|
545
|
+
const len0 = WASM_VECTOR_LEN;
|
|
546
|
+
wasm.excelcolumninfo_setAllowedValues(this.__wbg_ptr, ptr0, len0);
|
|
547
|
+
}
|
|
413
548
|
}
|
|
414
549
|
|
|
415
550
|
const ExcelDataFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
416
551
|
? { register: () => {}, unregister: () => {} }
|
|
417
552
|
: new FinalizationRegistry(ptr => wasm.__wbg_exceldata_free(ptr >>> 0, 1));
|
|
418
|
-
|
|
419
|
-
*/
|
|
553
|
+
|
|
420
554
|
export class ExcelData {
|
|
421
555
|
|
|
422
556
|
static __wrap(ptr) {
|
|
@@ -439,8 +573,8 @@ export class ExcelData {
|
|
|
439
573
|
wasm.__wbg_exceldata_free(ptr, 0);
|
|
440
574
|
}
|
|
441
575
|
/**
|
|
442
|
-
|
|
443
|
-
|
|
576
|
+
* @returns {(ExcelRowData)[]}
|
|
577
|
+
*/
|
|
444
578
|
get rows() {
|
|
445
579
|
try {
|
|
446
580
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
@@ -455,16 +589,16 @@ export class ExcelData {
|
|
|
455
589
|
}
|
|
456
590
|
}
|
|
457
591
|
/**
|
|
458
|
-
|
|
459
|
-
|
|
592
|
+
* @param {(ExcelRowData)[]} arg0
|
|
593
|
+
*/
|
|
460
594
|
set rows(arg0) {
|
|
461
595
|
const ptr0 = passArrayJsValueToWasm0(arg0, wasm.__wbindgen_malloc);
|
|
462
596
|
const len0 = WASM_VECTOR_LEN;
|
|
463
597
|
wasm.__wbg_set_exceldata_rows(this.__wbg_ptr, ptr0, len0);
|
|
464
598
|
}
|
|
465
599
|
/**
|
|
466
|
-
|
|
467
|
-
|
|
600
|
+
* @param {(ExcelRowData)[]} rows
|
|
601
|
+
*/
|
|
468
602
|
constructor(rows) {
|
|
469
603
|
const ptr0 = passArrayJsValueToWasm0(rows, wasm.__wbindgen_malloc);
|
|
470
604
|
const len0 = WASM_VECTOR_LEN;
|
|
@@ -478,8 +612,7 @@ export class ExcelData {
|
|
|
478
612
|
const ExcelInfoFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
479
613
|
? { register: () => {}, unregister: () => {} }
|
|
480
614
|
: new FinalizationRegistry(ptr => wasm.__wbg_excelinfo_free(ptr >>> 0, 1));
|
|
481
|
-
|
|
482
|
-
*/
|
|
615
|
+
|
|
483
616
|
export class ExcelInfo {
|
|
484
617
|
|
|
485
618
|
__destroy_into_raw() {
|
|
@@ -494,14 +627,14 @@ export class ExcelInfo {
|
|
|
494
627
|
wasm.__wbg_excelinfo_free(ptr, 0);
|
|
495
628
|
}
|
|
496
629
|
/**
|
|
497
|
-
|
|
498
|
-
|
|
630
|
+
* @returns {string}
|
|
631
|
+
*/
|
|
499
632
|
get name() {
|
|
500
633
|
let deferred1_0;
|
|
501
634
|
let deferred1_1;
|
|
502
635
|
try {
|
|
503
636
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
504
|
-
wasm.
|
|
637
|
+
wasm.__wbg_get_excelinfo_name(retptr, this.__wbg_ptr);
|
|
505
638
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
506
639
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
507
640
|
deferred1_0 = r0;
|
|
@@ -513,22 +646,22 @@ export class ExcelInfo {
|
|
|
513
646
|
}
|
|
514
647
|
}
|
|
515
648
|
/**
|
|
516
|
-
|
|
517
|
-
|
|
649
|
+
* @param {string} arg0
|
|
650
|
+
*/
|
|
518
651
|
set name(arg0) {
|
|
519
652
|
const ptr0 = passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
520
653
|
const len0 = WASM_VECTOR_LEN;
|
|
521
|
-
wasm.
|
|
654
|
+
wasm.__wbg_set_excelinfo_name(this.__wbg_ptr, ptr0, len0);
|
|
522
655
|
}
|
|
523
656
|
/**
|
|
524
|
-
|
|
525
|
-
|
|
657
|
+
* @returns {string}
|
|
658
|
+
*/
|
|
526
659
|
get sheet_name() {
|
|
527
660
|
let deferred1_0;
|
|
528
661
|
let deferred1_1;
|
|
529
662
|
try {
|
|
530
663
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
531
|
-
wasm.
|
|
664
|
+
wasm.__wbg_get_excelinfo_sheet_name(retptr, this.__wbg_ptr);
|
|
532
665
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
533
666
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
534
667
|
deferred1_0 = r0;
|
|
@@ -540,16 +673,16 @@ export class ExcelInfo {
|
|
|
540
673
|
}
|
|
541
674
|
}
|
|
542
675
|
/**
|
|
543
|
-
|
|
544
|
-
|
|
676
|
+
* @param {string} arg0
|
|
677
|
+
*/
|
|
545
678
|
set sheet_name(arg0) {
|
|
546
679
|
const ptr0 = passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
547
680
|
const len0 = WASM_VECTOR_LEN;
|
|
548
|
-
wasm.
|
|
681
|
+
wasm.__wbg_set_excelinfo_sheet_name(this.__wbg_ptr, ptr0, len0);
|
|
549
682
|
}
|
|
550
683
|
/**
|
|
551
|
-
|
|
552
|
-
|
|
684
|
+
* @returns {(ExcelColumnInfo)[]}
|
|
685
|
+
*/
|
|
553
686
|
get columns() {
|
|
554
687
|
try {
|
|
555
688
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
@@ -564,26 +697,86 @@ export class ExcelInfo {
|
|
|
564
697
|
}
|
|
565
698
|
}
|
|
566
699
|
/**
|
|
567
|
-
|
|
568
|
-
|
|
700
|
+
* @param {(ExcelColumnInfo)[]} arg0
|
|
701
|
+
*/
|
|
569
702
|
set columns(arg0) {
|
|
570
703
|
const ptr0 = passArrayJsValueToWasm0(arg0, wasm.__wbindgen_malloc);
|
|
571
704
|
const len0 = WASM_VECTOR_LEN;
|
|
572
705
|
wasm.__wbg_set_excelinfo_columns(this.__wbg_ptr, ptr0, len0);
|
|
573
706
|
}
|
|
574
707
|
/**
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
708
|
+
* @returns {string}
|
|
709
|
+
*/
|
|
710
|
+
get author() {
|
|
711
|
+
let deferred1_0;
|
|
712
|
+
let deferred1_1;
|
|
713
|
+
try {
|
|
714
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
715
|
+
wasm.__wbg_get_excelinfo_author(retptr, this.__wbg_ptr);
|
|
716
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
717
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
718
|
+
deferred1_0 = r0;
|
|
719
|
+
deferred1_1 = r1;
|
|
720
|
+
return getStringFromWasm0(r0, r1);
|
|
721
|
+
} finally {
|
|
722
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
723
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
724
|
+
}
|
|
725
|
+
}
|
|
726
|
+
/**
|
|
727
|
+
* @param {string} arg0
|
|
728
|
+
*/
|
|
729
|
+
set author(arg0) {
|
|
730
|
+
const ptr0 = passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
731
|
+
const len0 = WASM_VECTOR_LEN;
|
|
732
|
+
wasm.__wbg_set_excelinfo_author(this.__wbg_ptr, ptr0, len0);
|
|
733
|
+
}
|
|
734
|
+
/**
|
|
735
|
+
* @returns {string}
|
|
736
|
+
*/
|
|
737
|
+
get create_time() {
|
|
738
|
+
let deferred1_0;
|
|
739
|
+
let deferred1_1;
|
|
740
|
+
try {
|
|
741
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
742
|
+
wasm.__wbg_get_excelinfo_create_time(retptr, this.__wbg_ptr);
|
|
743
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
744
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
745
|
+
deferred1_0 = r0;
|
|
746
|
+
deferred1_1 = r1;
|
|
747
|
+
return getStringFromWasm0(r0, r1);
|
|
748
|
+
} finally {
|
|
749
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
750
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
751
|
+
}
|
|
752
|
+
}
|
|
753
|
+
/**
|
|
754
|
+
* @param {string} arg0
|
|
755
|
+
*/
|
|
756
|
+
set create_time(arg0) {
|
|
757
|
+
const ptr0 = passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
758
|
+
const len0 = WASM_VECTOR_LEN;
|
|
759
|
+
wasm.__wbg_set_excelinfo_create_time(this.__wbg_ptr, ptr0, len0);
|
|
760
|
+
}
|
|
761
|
+
/**
|
|
762
|
+
* @param {string} name
|
|
763
|
+
* @param {string} sheet_name
|
|
764
|
+
* @param {(ExcelColumnInfo)[]} columns
|
|
765
|
+
* @param {string} author
|
|
766
|
+
* @param {string} create_time
|
|
767
|
+
*/
|
|
768
|
+
constructor(name, sheet_name, columns, author, create_time) {
|
|
580
769
|
const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
581
770
|
const len0 = WASM_VECTOR_LEN;
|
|
582
771
|
const ptr1 = passStringToWasm0(sheet_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
583
772
|
const len1 = WASM_VECTOR_LEN;
|
|
584
773
|
const ptr2 = passArrayJsValueToWasm0(columns, wasm.__wbindgen_malloc);
|
|
585
774
|
const len2 = WASM_VECTOR_LEN;
|
|
586
|
-
const
|
|
775
|
+
const ptr3 = passStringToWasm0(author, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
776
|
+
const len3 = WASM_VECTOR_LEN;
|
|
777
|
+
const ptr4 = passStringToWasm0(create_time, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
778
|
+
const len4 = WASM_VECTOR_LEN;
|
|
779
|
+
const ret = wasm.excelinfo_new(ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, ptr4, len4);
|
|
587
780
|
this.__wbg_ptr = ret >>> 0;
|
|
588
781
|
ExcelInfoFinalization.register(this, this.__wbg_ptr, this);
|
|
589
782
|
return this;
|
|
@@ -593,8 +786,7 @@ export class ExcelInfo {
|
|
|
593
786
|
const ExcelRowDataFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
594
787
|
? { register: () => {}, unregister: () => {} }
|
|
595
788
|
: new FinalizationRegistry(ptr => wasm.__wbg_excelrowdata_free(ptr >>> 0, 1));
|
|
596
|
-
|
|
597
|
-
*/
|
|
789
|
+
|
|
598
790
|
export class ExcelRowData {
|
|
599
791
|
|
|
600
792
|
static __wrap(ptr) {
|
|
@@ -624,8 +816,8 @@ export class ExcelRowData {
|
|
|
624
816
|
wasm.__wbg_excelrowdata_free(ptr, 0);
|
|
625
817
|
}
|
|
626
818
|
/**
|
|
627
|
-
|
|
628
|
-
|
|
819
|
+
* @returns {(ExcelColumnData)[]}
|
|
820
|
+
*/
|
|
629
821
|
get columns() {
|
|
630
822
|
try {
|
|
631
823
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
@@ -640,16 +832,16 @@ export class ExcelRowData {
|
|
|
640
832
|
}
|
|
641
833
|
}
|
|
642
834
|
/**
|
|
643
|
-
|
|
644
|
-
|
|
835
|
+
* @param {(ExcelColumnData)[]} arg0
|
|
836
|
+
*/
|
|
645
837
|
set columns(arg0) {
|
|
646
838
|
const ptr0 = passArrayJsValueToWasm0(arg0, wasm.__wbindgen_malloc);
|
|
647
839
|
const len0 = WASM_VECTOR_LEN;
|
|
648
840
|
wasm.__wbg_set_excelrowdata_columns(this.__wbg_ptr, ptr0, len0);
|
|
649
841
|
}
|
|
650
842
|
/**
|
|
651
|
-
|
|
652
|
-
|
|
843
|
+
* @param {(ExcelColumnData)[]} columns
|
|
844
|
+
*/
|
|
653
845
|
constructor(columns) {
|
|
654
846
|
const ptr0 = passArrayJsValueToWasm0(columns, wasm.__wbindgen_malloc);
|
|
655
847
|
const len0 = WASM_VECTOR_LEN;
|
|
@@ -668,7 +860,7 @@ async function __wbg_load(module, imports) {
|
|
|
668
860
|
|
|
669
861
|
} catch (e) {
|
|
670
862
|
if (module.headers.get('Content-Type') != 'application/wasm') {
|
|
671
|
-
console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve
|
|
863
|
+
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);
|
|
672
864
|
|
|
673
865
|
} else {
|
|
674
866
|
throw e;
|
|
@@ -694,34 +886,49 @@ async function __wbg_load(module, imports) {
|
|
|
694
886
|
function __wbg_get_imports() {
|
|
695
887
|
const imports = {};
|
|
696
888
|
imports.wbg = {};
|
|
697
|
-
imports.wbg.__wbg_excelcolumndata_new = function(arg0) {
|
|
698
|
-
const ret = ExcelColumnData.__wrap(arg0);
|
|
699
|
-
return addHeapObject(ret);
|
|
700
|
-
};
|
|
701
889
|
imports.wbg.__wbg_excelcolumninfo_new = function(arg0) {
|
|
702
890
|
const ret = ExcelColumnInfo.__wrap(arg0);
|
|
703
891
|
return addHeapObject(ret);
|
|
704
892
|
};
|
|
893
|
+
imports.wbg.__wbg_excelcolumndata_new = function(arg0) {
|
|
894
|
+
const ret = ExcelColumnData.__wrap(arg0);
|
|
895
|
+
return addHeapObject(ret);
|
|
896
|
+
};
|
|
705
897
|
imports.wbg.__wbg_excelrowdata_new = function(arg0) {
|
|
706
898
|
const ret = ExcelRowData.__wrap(arg0);
|
|
707
899
|
return addHeapObject(ret);
|
|
708
900
|
};
|
|
709
|
-
imports.wbg.__wbg_excelrowdata_unwrap = function(arg0) {
|
|
710
|
-
const ret = ExcelRowData.__unwrap(takeObject(arg0));
|
|
711
|
-
return ret;
|
|
712
|
-
};
|
|
713
901
|
imports.wbg.__wbg_excelcolumndata_unwrap = function(arg0) {
|
|
714
902
|
const ret = ExcelColumnData.__unwrap(takeObject(arg0));
|
|
715
903
|
return ret;
|
|
716
904
|
};
|
|
905
|
+
imports.wbg.__wbg_excelrowdata_unwrap = function(arg0) {
|
|
906
|
+
const ret = ExcelRowData.__unwrap(takeObject(arg0));
|
|
907
|
+
return ret;
|
|
908
|
+
};
|
|
717
909
|
imports.wbg.__wbg_excelcolumninfo_unwrap = function(arg0) {
|
|
718
910
|
const ret = ExcelColumnInfo.__unwrap(takeObject(arg0));
|
|
719
911
|
return ret;
|
|
720
912
|
};
|
|
721
|
-
imports.wbg.
|
|
913
|
+
imports.wbg.__wbindgen_object_drop_ref = function(arg0) {
|
|
914
|
+
takeObject(arg0);
|
|
915
|
+
};
|
|
916
|
+
imports.wbg.__wbindgen_string_new = function(arg0, arg1) {
|
|
917
|
+
const ret = getStringFromWasm0(arg0, arg1);
|
|
918
|
+
return addHeapObject(ret);
|
|
919
|
+
};
|
|
920
|
+
imports.wbg.__wbg_now_70af4fe37a792251 = function() {
|
|
722
921
|
const ret = Date.now();
|
|
723
922
|
return ret;
|
|
724
923
|
};
|
|
924
|
+
imports.wbg.__wbindgen_string_get = function(arg0, arg1) {
|
|
925
|
+
const obj = getObject(arg1);
|
|
926
|
+
const ret = typeof(obj) === 'string' ? obj : undefined;
|
|
927
|
+
var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
928
|
+
var len1 = WASM_VECTOR_LEN;
|
|
929
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
930
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
931
|
+
};
|
|
725
932
|
imports.wbg.__wbindgen_throw = function(arg0, arg1) {
|
|
726
933
|
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
727
934
|
};
|
|
@@ -748,10 +955,13 @@ function initSync(module) {
|
|
|
748
955
|
if (wasm !== undefined) return wasm;
|
|
749
956
|
|
|
750
957
|
|
|
751
|
-
if (typeof module !== 'undefined'
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
958
|
+
if (typeof module !== 'undefined') {
|
|
959
|
+
if (Object.getPrototypeOf(module) === Object.prototype) {
|
|
960
|
+
({module} = module)
|
|
961
|
+
} else {
|
|
962
|
+
console.warn('using deprecated parameters for `initSync()`; pass a single object instead')
|
|
963
|
+
}
|
|
964
|
+
}
|
|
755
965
|
|
|
756
966
|
const imports = __wbg_get_imports();
|
|
757
967
|
|
|
@@ -770,10 +980,13 @@ async function __wbg_init(module_or_path) {
|
|
|
770
980
|
if (wasm !== undefined) return wasm;
|
|
771
981
|
|
|
772
982
|
|
|
773
|
-
if (typeof module_or_path !== 'undefined'
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
983
|
+
if (typeof module_or_path !== 'undefined') {
|
|
984
|
+
if (Object.getPrototypeOf(module_or_path) === Object.prototype) {
|
|
985
|
+
({module_or_path} = module_or_path)
|
|
986
|
+
} else {
|
|
987
|
+
console.warn('using deprecated parameters for the initialization function; pass a single object instead')
|
|
988
|
+
}
|
|
989
|
+
}
|
|
777
990
|
|
|
778
991
|
if (typeof module_or_path === 'undefined') {
|
|
779
992
|
module_or_path = new URL('imexport_wasm_bg.wasm', import.meta.url);
|
|
Binary file
|