@senlinz/import-export-wasm 0.0.1-beta.5 → 0.1.0-beta.7
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 +13 -1
- package/README.md +2 -109
- package/package.json +4 -3
- package/pkg/imexport_wasm.d.ts +80 -74
- package/pkg/imexport_wasm.js +330 -142
- package/pkg/imexport_wasm_bg.wasm +0 -0
package/LICENSE
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
MIT License
|
|
2
2
|
|
|
3
|
-
Copyright (c)
|
|
3
|
+
Copyright (c) 2024, senlinz
|
|
4
4
|
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
6
|
of this software and associated documentation files (the "Software"), to deal
|
|
@@ -19,3 +19,15 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
|
19
19
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
20
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
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
|
@@ -9,112 +9,5 @@
|
|
|
9
9
|
- Write using [rust_xlsxwriter](https://docs.rs/rust_xlsxwriter/).
|
|
10
10
|
|
|
11
11
|
## Usage
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
<html lang="en">
|
|
15
|
-
|
|
16
|
-
<head>
|
|
17
|
-
<meta charset="UTF-8">
|
|
18
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
19
|
-
<title>Demo (@senlin/import-export-wasm)</title>
|
|
20
|
-
</head>
|
|
21
|
-
|
|
22
|
-
<button id="downloadTemplate">Download Template</button>
|
|
23
|
-
<button id="exportWithData">Export With Data</button>
|
|
24
|
-
<button id="importWithData">Import With Data</button>
|
|
25
|
-
<a id="download" style="display: none"></a>
|
|
26
|
-
<input type="file" accept=".xlsx" id="file" style="display: none">
|
|
27
|
-
|
|
28
|
-
<body>
|
|
29
|
-
<script type="module">
|
|
30
|
-
import initAsync, { createTemplate, exportData, importData, ExcelInfo, ExcelColumnInfo, ExcelData, ExcelRowData, ExcelColumnData } from 'https://cdn.jsdelivr.net/npm/@senlinz/import-export-wasm/pkg/imexport_wasm.js';
|
|
31
|
-
await initAsync({ path: 'https://cdn.jsdelivr.net/npm/@senlinz/import-export-wasm/pkg/imexport_wasm_bg.wasm' });
|
|
32
|
-
|
|
33
|
-
const downloadEl = document.getElementById('download');
|
|
34
|
-
const fileEl = document.getElementById('file');
|
|
35
|
-
|
|
36
|
-
fileEl.addEventListener('change', fileChange);
|
|
37
|
-
document.getElementById('downloadTemplate').addEventListener('click', downloadTemplate);
|
|
38
|
-
document.getElementById('exportWithData').addEventListener('click', exportWithData);
|
|
39
|
-
document.getElementById('importWithData').addEventListener('click', importWithData);
|
|
40
|
-
|
|
41
|
-
const res = await fetch('https://cdn.jsdelivr.net/npm/@senlinz/import-export-wasm/pkg/imexport_wasm_bg.wasm');
|
|
42
|
-
const bytes = await res.arrayBuffer();
|
|
43
|
-
|
|
44
|
-
function downloadTemplate() {
|
|
45
|
-
const info = getExcelInfo();
|
|
46
|
-
download(info.name, createTemplate(info));
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
function exportWithData() {
|
|
50
|
-
const info = getExcelInfo();
|
|
51
|
-
const data = new ExcelData([
|
|
52
|
-
new ExcelRowData([
|
|
53
|
-
new ExcelColumnData("name", "Tom"),
|
|
54
|
-
new ExcelColumnData("age", "12"),
|
|
55
|
-
new ExcelColumnData("category", "Cat")
|
|
56
|
-
]),
|
|
57
|
-
new ExcelRowData([
|
|
58
|
-
new ExcelColumnData("name", "Jerry"),
|
|
59
|
-
new ExcelColumnData("age", "10"),
|
|
60
|
-
new ExcelColumnData("category", "Mouse")
|
|
61
|
-
])
|
|
62
|
-
]);
|
|
63
|
-
download(info.name, exportData(info, data));
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
function importWithData() {
|
|
67
|
-
fileEl.click();
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
function fileChange(e) {
|
|
71
|
-
const file = e.target.files[0];
|
|
72
|
-
const reader = new FileReader();
|
|
73
|
-
reader.onload = (e) => {
|
|
74
|
-
const data = new Uint8Array(e.target.result);
|
|
75
|
-
const info = getExcelInfo();
|
|
76
|
-
const excelData = importData(info, data);
|
|
77
|
-
console.log(toJson(excelData));
|
|
78
|
-
};
|
|
79
|
-
reader.readAsArrayBuffer(file);
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
function download(name, excelData) {
|
|
83
|
-
const blob = new Blob([excelData], { type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' });
|
|
84
|
-
const url = URL.createObjectURL(blob);
|
|
85
|
-
downloadEl.download = `${name}.xlsx`;
|
|
86
|
-
downloadEl.href = url;
|
|
87
|
-
downloadEl.click();
|
|
88
|
-
URL.revokeObjectURL(url);
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
function getExcelInfo() {
|
|
92
|
-
const excelName = "TomAndJerry";
|
|
93
|
-
const columns = [
|
|
94
|
-
new ExcelColumnInfo("name", "Name", 20),
|
|
95
|
-
new ExcelColumnInfo("age", "Age"),
|
|
96
|
-
new ExcelColumnInfo("category", "Category")
|
|
97
|
-
];
|
|
98
|
-
const info = new ExcelInfo(excelName, "sheet1", columns);
|
|
99
|
-
return info;
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
function toJson(excelData) {
|
|
103
|
-
const data = [];
|
|
104
|
-
const info = getExcelInfo();
|
|
105
|
-
for (let i = 0; i < excelData.rows.length; i++) {
|
|
106
|
-
const item = {};
|
|
107
|
-
let row = excelData.rows[i];
|
|
108
|
-
for (let j = 0; j < row.columns.length; j++) {
|
|
109
|
-
let column = row.columns[j];
|
|
110
|
-
item[column.key] = column.value;
|
|
111
|
-
}
|
|
112
|
-
data.push(item);
|
|
113
|
-
}
|
|
114
|
-
return data;
|
|
115
|
-
}
|
|
116
|
-
</script>
|
|
117
|
-
</body>
|
|
118
|
-
|
|
119
|
-
</html>
|
|
120
|
-
```
|
|
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.7",
|
|
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,100 +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
|
-
* @param {number | undefined} [width]
|
|
44
|
-
*/
|
|
36
|
+
/**
|
|
37
|
+
* @param {string} key
|
|
38
|
+
* @param {string} name
|
|
39
|
+
* @param {number | undefined} [width]
|
|
40
|
+
*/
|
|
45
41
|
constructor(key: string, name: string, width?: number);
|
|
46
|
-
/**
|
|
47
|
-
|
|
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;
|
|
48
56
|
key: string;
|
|
49
|
-
/**
|
|
50
|
-
*/
|
|
51
57
|
name: string;
|
|
52
|
-
|
|
53
|
-
*/
|
|
58
|
+
note?: string;
|
|
54
59
|
width?: number;
|
|
55
60
|
}
|
|
56
|
-
/**
|
|
57
|
-
*/
|
|
58
61
|
export class ExcelData {
|
|
59
62
|
free(): void;
|
|
60
|
-
/**
|
|
61
|
-
* @param {(ExcelRowData)[]} rows
|
|
62
|
-
*/
|
|
63
|
+
/**
|
|
64
|
+
* @param {(ExcelRowData)[]} rows
|
|
65
|
+
*/
|
|
63
66
|
constructor(rows: (ExcelRowData)[]);
|
|
64
|
-
/**
|
|
65
|
-
*/
|
|
66
67
|
rows: (ExcelRowData)[];
|
|
67
68
|
}
|
|
68
|
-
/**
|
|
69
|
-
*/
|
|
70
69
|
export class ExcelInfo {
|
|
71
70
|
free(): void;
|
|
72
|
-
/**
|
|
73
|
-
* @param {string} name
|
|
74
|
-
* @param {string} sheet_name
|
|
75
|
-
* @param {(ExcelColumnInfo)[]} columns
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
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;
|
|
80
80
|
columns: (ExcelColumnInfo)[];
|
|
81
|
-
|
|
82
|
-
*/
|
|
81
|
+
create_time: string;
|
|
83
82
|
name: string;
|
|
84
|
-
/**
|
|
85
|
-
*/
|
|
86
83
|
sheet_name: string;
|
|
87
84
|
}
|
|
88
|
-
/**
|
|
89
|
-
*/
|
|
90
85
|
export class ExcelRowData {
|
|
91
86
|
free(): void;
|
|
92
|
-
/**
|
|
93
|
-
* @param {(ExcelColumnData)[]} columns
|
|
94
|
-
*/
|
|
87
|
+
/**
|
|
88
|
+
* @param {(ExcelColumnData)[]} columns
|
|
89
|
+
*/
|
|
95
90
|
constructor(columns: (ExcelColumnData)[]);
|
|
96
|
-
/**
|
|
97
|
-
*/
|
|
98
91
|
columns: (ExcelColumnData)[];
|
|
99
92
|
}
|
|
100
93
|
|
|
@@ -102,20 +95,20 @@ export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembl
|
|
|
102
95
|
|
|
103
96
|
export interface InitOutput {
|
|
104
97
|
readonly memory: WebAssembly.Memory;
|
|
105
|
-
readonly __wbg_exceldata_free: (a: number, b: number) => void;
|
|
106
|
-
readonly __wbg_get_exceldata_rows: (a: number, b: number) => void;
|
|
107
|
-
readonly __wbg_set_exceldata_rows: (a: number, b: number, c: number) => void;
|
|
108
|
-
readonly exceldata_new: (a: number, b: number) => number;
|
|
109
|
-
readonly __wbg_excelrowdata_free: (a: number, b: number) => void;
|
|
110
|
-
readonly __wbg_get_excelrowdata_columns: (a: number, b: number) => void;
|
|
111
|
-
readonly __wbg_set_excelrowdata_columns: (a: number, b: number, c: number) => void;
|
|
112
|
-
readonly excelrowdata_new: (a: number, b: number) => number;
|
|
113
98
|
readonly __wbg_excelcolumndata_free: (a: number, b: number) => void;
|
|
114
99
|
readonly __wbg_get_excelcolumndata_key: (a: number, b: number) => void;
|
|
115
100
|
readonly __wbg_set_excelcolumndata_key: (a: number, b: number, c: number) => void;
|
|
116
101
|
readonly __wbg_get_excelcolumndata_value: (a: number, b: number) => void;
|
|
117
102
|
readonly __wbg_set_excelcolumndata_value: (a: number, b: number, c: number) => void;
|
|
118
103
|
readonly excelcolumndata_new: (a: number, b: number, c: number, d: number) => number;
|
|
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;
|
|
119
112
|
readonly __wbg_excelinfo_free: (a: number, b: number) => void;
|
|
120
113
|
readonly __wbg_get_excelinfo_name: (a: number, b: number) => void;
|
|
121
114
|
readonly __wbg_set_excelinfo_name: (a: number, b: number, c: number) => void;
|
|
@@ -123,7 +116,11 @@ export interface InitOutput {
|
|
|
123
116
|
readonly __wbg_set_excelinfo_sheet_name: (a: number, b: number, c: number) => void;
|
|
124
117
|
readonly __wbg_get_excelinfo_columns: (a: number, b: number) => void;
|
|
125
118
|
readonly __wbg_set_excelinfo_columns: (a: number, b: number, c: number) => void;
|
|
126
|
-
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;
|
|
127
124
|
readonly __wbg_excelcolumninfo_free: (a: number, b: number) => void;
|
|
128
125
|
readonly __wbg_get_excelcolumninfo_key: (a: number, b: number) => void;
|
|
129
126
|
readonly __wbg_set_excelcolumninfo_key: (a: number, b: number, c: number) => void;
|
|
@@ -131,14 +128,23 @@ export interface InitOutput {
|
|
|
131
128
|
readonly __wbg_set_excelcolumninfo_name: (a: number, b: number, c: number) => void;
|
|
132
129
|
readonly __wbg_get_excelcolumninfo_width: (a: number, b: number) => void;
|
|
133
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;
|
|
134
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;
|
|
135
141
|
readonly createTemplate: (a: number, b: number) => void;
|
|
136
|
-
readonly importData: (a: number, b: number, c: number) =>
|
|
142
|
+
readonly importData: (a: number, b: number, c: number, d: number) => void;
|
|
137
143
|
readonly exportData: (a: number, b: number, c: number) => void;
|
|
138
|
-
readonly __wbindgen_add_to_stack_pointer: (a: number) => number;
|
|
139
|
-
readonly __wbindgen_free: (a: number, b: number, c: number) => void;
|
|
140
144
|
readonly __wbindgen_malloc: (a: number, b: number) => number;
|
|
141
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;
|
|
142
148
|
}
|
|
143
149
|
|
|
144
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
|
|
|
@@ -136,6 +107,35 @@ function isLikeNone(x) {
|
|
|
136
107
|
return x === undefined || x === null;
|
|
137
108
|
}
|
|
138
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
|
+
|
|
139
139
|
function _assertClass(instance, klass) {
|
|
140
140
|
if (!(instance instanceof klass)) {
|
|
141
141
|
throw new Error(`expected instance of ${klass.name}`);
|
|
@@ -148,9 +148,9 @@ function getArrayU8FromWasm0(ptr, len) {
|
|
|
148
148
|
return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
|
|
149
149
|
}
|
|
150
150
|
/**
|
|
151
|
-
* @param {ExcelInfo} info
|
|
152
|
-
* @returns {Uint8Array}
|
|
153
|
-
*/
|
|
151
|
+
* @param {ExcelInfo} info
|
|
152
|
+
* @returns {Uint8Array}
|
|
153
|
+
*/
|
|
154
154
|
export function createTemplate(info) {
|
|
155
155
|
try {
|
|
156
156
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
@@ -159,6 +159,11 @@ export function createTemplate(info) {
|
|
|
159
159
|
wasm.createTemplate(retptr, ptr0);
|
|
160
160
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
161
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
|
+
}
|
|
162
167
|
var v2 = getArrayU8FromWasm0(r0, r1).slice();
|
|
163
168
|
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
164
169
|
return v2;
|
|
@@ -174,24 +179,35 @@ function passArray8ToWasm0(arg, malloc) {
|
|
|
174
179
|
return ptr;
|
|
175
180
|
}
|
|
176
181
|
/**
|
|
177
|
-
* @param {ExcelInfo} info
|
|
178
|
-
* @param {Uint8Array} excel_bytes
|
|
179
|
-
* @returns {ExcelData}
|
|
180
|
-
*/
|
|
182
|
+
* @param {ExcelInfo} info
|
|
183
|
+
* @param {Uint8Array} excel_bytes
|
|
184
|
+
* @returns {ExcelData}
|
|
185
|
+
*/
|
|
181
186
|
export function importData(info, excel_bytes) {
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
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
|
+
}
|
|
188
204
|
}
|
|
189
205
|
|
|
190
206
|
/**
|
|
191
|
-
* @param {ExcelInfo} info
|
|
192
|
-
* @param {ExcelData} data
|
|
193
|
-
* @returns {Uint8Array}
|
|
194
|
-
*/
|
|
207
|
+
* @param {ExcelInfo} info
|
|
208
|
+
* @param {ExcelData} data
|
|
209
|
+
* @returns {Uint8Array}
|
|
210
|
+
*/
|
|
195
211
|
export function exportData(info, data) {
|
|
196
212
|
try {
|
|
197
213
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
@@ -202,6 +218,11 @@ export function exportData(info, data) {
|
|
|
202
218
|
wasm.exportData(retptr, ptr0, ptr1);
|
|
203
219
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
204
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
|
+
}
|
|
205
226
|
var v3 = getArrayU8FromWasm0(r0, r1).slice();
|
|
206
227
|
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
207
228
|
return v3;
|
|
@@ -210,11 +231,12 @@ export function exportData(info, data) {
|
|
|
210
231
|
}
|
|
211
232
|
}
|
|
212
233
|
|
|
234
|
+
export const ExcelDataType = Object.freeze({ Text:0,"0":"Text",Number:1,"1":"Number", });
|
|
235
|
+
|
|
213
236
|
const ExcelColumnDataFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
214
237
|
? { register: () => {}, unregister: () => {} }
|
|
215
238
|
: new FinalizationRegistry(ptr => wasm.__wbg_excelcolumndata_free(ptr >>> 0, 1));
|
|
216
|
-
|
|
217
|
-
*/
|
|
239
|
+
|
|
218
240
|
export class ExcelColumnData {
|
|
219
241
|
|
|
220
242
|
static __wrap(ptr) {
|
|
@@ -244,8 +266,8 @@ export class ExcelColumnData {
|
|
|
244
266
|
wasm.__wbg_excelcolumndata_free(ptr, 0);
|
|
245
267
|
}
|
|
246
268
|
/**
|
|
247
|
-
|
|
248
|
-
|
|
269
|
+
* @returns {string}
|
|
270
|
+
*/
|
|
249
271
|
get key() {
|
|
250
272
|
let deferred1_0;
|
|
251
273
|
let deferred1_1;
|
|
@@ -263,16 +285,16 @@ export class ExcelColumnData {
|
|
|
263
285
|
}
|
|
264
286
|
}
|
|
265
287
|
/**
|
|
266
|
-
|
|
267
|
-
|
|
288
|
+
* @param {string} arg0
|
|
289
|
+
*/
|
|
268
290
|
set key(arg0) {
|
|
269
291
|
const ptr0 = passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
270
292
|
const len0 = WASM_VECTOR_LEN;
|
|
271
293
|
wasm.__wbg_set_excelcolumndata_key(this.__wbg_ptr, ptr0, len0);
|
|
272
294
|
}
|
|
273
295
|
/**
|
|
274
|
-
|
|
275
|
-
|
|
296
|
+
* @returns {string}
|
|
297
|
+
*/
|
|
276
298
|
get value() {
|
|
277
299
|
let deferred1_0;
|
|
278
300
|
let deferred1_1;
|
|
@@ -290,17 +312,17 @@ export class ExcelColumnData {
|
|
|
290
312
|
}
|
|
291
313
|
}
|
|
292
314
|
/**
|
|
293
|
-
|
|
294
|
-
|
|
315
|
+
* @param {string} arg0
|
|
316
|
+
*/
|
|
295
317
|
set value(arg0) {
|
|
296
318
|
const ptr0 = passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
297
319
|
const len0 = WASM_VECTOR_LEN;
|
|
298
320
|
wasm.__wbg_set_excelcolumndata_value(this.__wbg_ptr, ptr0, len0);
|
|
299
321
|
}
|
|
300
322
|
/**
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
323
|
+
* @param {string} key
|
|
324
|
+
* @param {string} value
|
|
325
|
+
*/
|
|
304
326
|
constructor(key, value) {
|
|
305
327
|
const ptr0 = passStringToWasm0(key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
306
328
|
const len0 = WASM_VECTOR_LEN;
|
|
@@ -316,8 +338,7 @@ export class ExcelColumnData {
|
|
|
316
338
|
const ExcelColumnInfoFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
317
339
|
? { register: () => {}, unregister: () => {} }
|
|
318
340
|
: new FinalizationRegistry(ptr => wasm.__wbg_excelcolumninfo_free(ptr >>> 0, 1));
|
|
319
|
-
|
|
320
|
-
*/
|
|
341
|
+
|
|
321
342
|
export class ExcelColumnInfo {
|
|
322
343
|
|
|
323
344
|
static __wrap(ptr) {
|
|
@@ -347,8 +368,8 @@ export class ExcelColumnInfo {
|
|
|
347
368
|
wasm.__wbg_excelcolumninfo_free(ptr, 0);
|
|
348
369
|
}
|
|
349
370
|
/**
|
|
350
|
-
|
|
351
|
-
|
|
371
|
+
* @returns {string}
|
|
372
|
+
*/
|
|
352
373
|
get key() {
|
|
353
374
|
let deferred1_0;
|
|
354
375
|
let deferred1_1;
|
|
@@ -366,16 +387,16 @@ export class ExcelColumnInfo {
|
|
|
366
387
|
}
|
|
367
388
|
}
|
|
368
389
|
/**
|
|
369
|
-
|
|
370
|
-
|
|
390
|
+
* @param {string} arg0
|
|
391
|
+
*/
|
|
371
392
|
set key(arg0) {
|
|
372
393
|
const ptr0 = passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
373
394
|
const len0 = WASM_VECTOR_LEN;
|
|
374
395
|
wasm.__wbg_set_excelcolumninfo_key(this.__wbg_ptr, ptr0, len0);
|
|
375
396
|
}
|
|
376
397
|
/**
|
|
377
|
-
|
|
378
|
-
|
|
398
|
+
* @returns {string}
|
|
399
|
+
*/
|
|
379
400
|
get name() {
|
|
380
401
|
let deferred1_0;
|
|
381
402
|
let deferred1_1;
|
|
@@ -393,16 +414,16 @@ export class ExcelColumnInfo {
|
|
|
393
414
|
}
|
|
394
415
|
}
|
|
395
416
|
/**
|
|
396
|
-
|
|
397
|
-
|
|
417
|
+
* @param {string} arg0
|
|
418
|
+
*/
|
|
398
419
|
set name(arg0) {
|
|
399
420
|
const ptr0 = passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
400
421
|
const len0 = WASM_VECTOR_LEN;
|
|
401
422
|
wasm.__wbg_set_excelcolumninfo_name(this.__wbg_ptr, ptr0, len0);
|
|
402
423
|
}
|
|
403
424
|
/**
|
|
404
|
-
|
|
405
|
-
|
|
425
|
+
* @returns {number | undefined}
|
|
426
|
+
*/
|
|
406
427
|
get width() {
|
|
407
428
|
try {
|
|
408
429
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
@@ -415,16 +436,83 @@ export class ExcelColumnInfo {
|
|
|
415
436
|
}
|
|
416
437
|
}
|
|
417
438
|
/**
|
|
418
|
-
|
|
419
|
-
|
|
439
|
+
* @param {number | undefined} [arg0]
|
|
440
|
+
*/
|
|
420
441
|
set width(arg0) {
|
|
421
442
|
wasm.__wbg_set_excelcolumninfo_width(this.__wbg_ptr, !isLikeNone(arg0), isLikeNone(arg0) ? 0 : arg0);
|
|
422
443
|
}
|
|
423
444
|
/**
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
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
|
+
*/
|
|
428
516
|
constructor(key, name, width) {
|
|
429
517
|
const ptr0 = passStringToWasm0(key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
430
518
|
const len0 = WASM_VECTOR_LEN;
|
|
@@ -435,13 +523,34 @@ export class ExcelColumnInfo {
|
|
|
435
523
|
ExcelColumnInfoFinalization.register(this, this.__wbg_ptr, this);
|
|
436
524
|
return this;
|
|
437
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
|
+
}
|
|
438
548
|
}
|
|
439
549
|
|
|
440
550
|
const ExcelDataFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
441
551
|
? { register: () => {}, unregister: () => {} }
|
|
442
552
|
: new FinalizationRegistry(ptr => wasm.__wbg_exceldata_free(ptr >>> 0, 1));
|
|
443
|
-
|
|
444
|
-
*/
|
|
553
|
+
|
|
445
554
|
export class ExcelData {
|
|
446
555
|
|
|
447
556
|
static __wrap(ptr) {
|
|
@@ -464,8 +573,8 @@ export class ExcelData {
|
|
|
464
573
|
wasm.__wbg_exceldata_free(ptr, 0);
|
|
465
574
|
}
|
|
466
575
|
/**
|
|
467
|
-
|
|
468
|
-
|
|
576
|
+
* @returns {(ExcelRowData)[]}
|
|
577
|
+
*/
|
|
469
578
|
get rows() {
|
|
470
579
|
try {
|
|
471
580
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
@@ -480,16 +589,16 @@ export class ExcelData {
|
|
|
480
589
|
}
|
|
481
590
|
}
|
|
482
591
|
/**
|
|
483
|
-
|
|
484
|
-
|
|
592
|
+
* @param {(ExcelRowData)[]} arg0
|
|
593
|
+
*/
|
|
485
594
|
set rows(arg0) {
|
|
486
595
|
const ptr0 = passArrayJsValueToWasm0(arg0, wasm.__wbindgen_malloc);
|
|
487
596
|
const len0 = WASM_VECTOR_LEN;
|
|
488
597
|
wasm.__wbg_set_exceldata_rows(this.__wbg_ptr, ptr0, len0);
|
|
489
598
|
}
|
|
490
599
|
/**
|
|
491
|
-
|
|
492
|
-
|
|
600
|
+
* @param {(ExcelRowData)[]} rows
|
|
601
|
+
*/
|
|
493
602
|
constructor(rows) {
|
|
494
603
|
const ptr0 = passArrayJsValueToWasm0(rows, wasm.__wbindgen_malloc);
|
|
495
604
|
const len0 = WASM_VECTOR_LEN;
|
|
@@ -503,8 +612,7 @@ export class ExcelData {
|
|
|
503
612
|
const ExcelInfoFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
504
613
|
? { register: () => {}, unregister: () => {} }
|
|
505
614
|
: new FinalizationRegistry(ptr => wasm.__wbg_excelinfo_free(ptr >>> 0, 1));
|
|
506
|
-
|
|
507
|
-
*/
|
|
615
|
+
|
|
508
616
|
export class ExcelInfo {
|
|
509
617
|
|
|
510
618
|
__destroy_into_raw() {
|
|
@@ -519,8 +627,8 @@ export class ExcelInfo {
|
|
|
519
627
|
wasm.__wbg_excelinfo_free(ptr, 0);
|
|
520
628
|
}
|
|
521
629
|
/**
|
|
522
|
-
|
|
523
|
-
|
|
630
|
+
* @returns {string}
|
|
631
|
+
*/
|
|
524
632
|
get name() {
|
|
525
633
|
let deferred1_0;
|
|
526
634
|
let deferred1_1;
|
|
@@ -538,16 +646,16 @@ export class ExcelInfo {
|
|
|
538
646
|
}
|
|
539
647
|
}
|
|
540
648
|
/**
|
|
541
|
-
|
|
542
|
-
|
|
649
|
+
* @param {string} arg0
|
|
650
|
+
*/
|
|
543
651
|
set name(arg0) {
|
|
544
652
|
const ptr0 = passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
545
653
|
const len0 = WASM_VECTOR_LEN;
|
|
546
654
|
wasm.__wbg_set_excelinfo_name(this.__wbg_ptr, ptr0, len0);
|
|
547
655
|
}
|
|
548
656
|
/**
|
|
549
|
-
|
|
550
|
-
|
|
657
|
+
* @returns {string}
|
|
658
|
+
*/
|
|
551
659
|
get sheet_name() {
|
|
552
660
|
let deferred1_0;
|
|
553
661
|
let deferred1_1;
|
|
@@ -565,16 +673,16 @@ export class ExcelInfo {
|
|
|
565
673
|
}
|
|
566
674
|
}
|
|
567
675
|
/**
|
|
568
|
-
|
|
569
|
-
|
|
676
|
+
* @param {string} arg0
|
|
677
|
+
*/
|
|
570
678
|
set sheet_name(arg0) {
|
|
571
679
|
const ptr0 = passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
572
680
|
const len0 = WASM_VECTOR_LEN;
|
|
573
681
|
wasm.__wbg_set_excelinfo_sheet_name(this.__wbg_ptr, ptr0, len0);
|
|
574
682
|
}
|
|
575
683
|
/**
|
|
576
|
-
|
|
577
|
-
|
|
684
|
+
* @returns {(ExcelColumnInfo)[]}
|
|
685
|
+
*/
|
|
578
686
|
get columns() {
|
|
579
687
|
try {
|
|
580
688
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
@@ -589,26 +697,86 @@ export class ExcelInfo {
|
|
|
589
697
|
}
|
|
590
698
|
}
|
|
591
699
|
/**
|
|
592
|
-
|
|
593
|
-
|
|
700
|
+
* @param {(ExcelColumnInfo)[]} arg0
|
|
701
|
+
*/
|
|
594
702
|
set columns(arg0) {
|
|
595
703
|
const ptr0 = passArrayJsValueToWasm0(arg0, wasm.__wbindgen_malloc);
|
|
596
704
|
const len0 = WASM_VECTOR_LEN;
|
|
597
705
|
wasm.__wbg_set_excelinfo_columns(this.__wbg_ptr, ptr0, len0);
|
|
598
706
|
}
|
|
599
707
|
/**
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
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) {
|
|
605
769
|
const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
606
770
|
const len0 = WASM_VECTOR_LEN;
|
|
607
771
|
const ptr1 = passStringToWasm0(sheet_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
608
772
|
const len1 = WASM_VECTOR_LEN;
|
|
609
773
|
const ptr2 = passArrayJsValueToWasm0(columns, wasm.__wbindgen_malloc);
|
|
610
774
|
const len2 = WASM_VECTOR_LEN;
|
|
611
|
-
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);
|
|
612
780
|
this.__wbg_ptr = ret >>> 0;
|
|
613
781
|
ExcelInfoFinalization.register(this, this.__wbg_ptr, this);
|
|
614
782
|
return this;
|
|
@@ -618,8 +786,7 @@ export class ExcelInfo {
|
|
|
618
786
|
const ExcelRowDataFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
619
787
|
? { register: () => {}, unregister: () => {} }
|
|
620
788
|
: new FinalizationRegistry(ptr => wasm.__wbg_excelrowdata_free(ptr >>> 0, 1));
|
|
621
|
-
|
|
622
|
-
*/
|
|
789
|
+
|
|
623
790
|
export class ExcelRowData {
|
|
624
791
|
|
|
625
792
|
static __wrap(ptr) {
|
|
@@ -649,8 +816,8 @@ export class ExcelRowData {
|
|
|
649
816
|
wasm.__wbg_excelrowdata_free(ptr, 0);
|
|
650
817
|
}
|
|
651
818
|
/**
|
|
652
|
-
|
|
653
|
-
|
|
819
|
+
* @returns {(ExcelColumnData)[]}
|
|
820
|
+
*/
|
|
654
821
|
get columns() {
|
|
655
822
|
try {
|
|
656
823
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
@@ -665,16 +832,16 @@ export class ExcelRowData {
|
|
|
665
832
|
}
|
|
666
833
|
}
|
|
667
834
|
/**
|
|
668
|
-
|
|
669
|
-
|
|
835
|
+
* @param {(ExcelColumnData)[]} arg0
|
|
836
|
+
*/
|
|
670
837
|
set columns(arg0) {
|
|
671
838
|
const ptr0 = passArrayJsValueToWasm0(arg0, wasm.__wbindgen_malloc);
|
|
672
839
|
const len0 = WASM_VECTOR_LEN;
|
|
673
840
|
wasm.__wbg_set_excelrowdata_columns(this.__wbg_ptr, ptr0, len0);
|
|
674
841
|
}
|
|
675
842
|
/**
|
|
676
|
-
|
|
677
|
-
|
|
843
|
+
* @param {(ExcelColumnData)[]} columns
|
|
844
|
+
*/
|
|
678
845
|
constructor(columns) {
|
|
679
846
|
const ptr0 = passArrayJsValueToWasm0(columns, wasm.__wbindgen_malloc);
|
|
680
847
|
const len0 = WASM_VECTOR_LEN;
|
|
@@ -693,7 +860,7 @@ async function __wbg_load(module, imports) {
|
|
|
693
860
|
|
|
694
861
|
} catch (e) {
|
|
695
862
|
if (module.headers.get('Content-Type') != 'application/wasm') {
|
|
696
|
-
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);
|
|
697
864
|
|
|
698
865
|
} else {
|
|
699
866
|
throw e;
|
|
@@ -731,22 +898,37 @@ function __wbg_get_imports() {
|
|
|
731
898
|
const ret = ExcelRowData.__wrap(arg0);
|
|
732
899
|
return addHeapObject(ret);
|
|
733
900
|
};
|
|
734
|
-
imports.wbg.__wbg_excelrowdata_unwrap = function(arg0) {
|
|
735
|
-
const ret = ExcelRowData.__unwrap(takeObject(arg0));
|
|
736
|
-
return ret;
|
|
737
|
-
};
|
|
738
901
|
imports.wbg.__wbg_excelcolumndata_unwrap = function(arg0) {
|
|
739
902
|
const ret = ExcelColumnData.__unwrap(takeObject(arg0));
|
|
740
903
|
return ret;
|
|
741
904
|
};
|
|
905
|
+
imports.wbg.__wbg_excelrowdata_unwrap = function(arg0) {
|
|
906
|
+
const ret = ExcelRowData.__unwrap(takeObject(arg0));
|
|
907
|
+
return ret;
|
|
908
|
+
};
|
|
742
909
|
imports.wbg.__wbg_excelcolumninfo_unwrap = function(arg0) {
|
|
743
910
|
const ret = ExcelColumnInfo.__unwrap(takeObject(arg0));
|
|
744
911
|
return ret;
|
|
745
912
|
};
|
|
746
|
-
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() {
|
|
747
921
|
const ret = Date.now();
|
|
748
922
|
return ret;
|
|
749
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
|
+
};
|
|
750
932
|
imports.wbg.__wbindgen_throw = function(arg0, arg1) {
|
|
751
933
|
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
752
934
|
};
|
|
@@ -773,10 +955,13 @@ function initSync(module) {
|
|
|
773
955
|
if (wasm !== undefined) return wasm;
|
|
774
956
|
|
|
775
957
|
|
|
776
|
-
if (typeof module !== 'undefined'
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
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
|
+
}
|
|
780
965
|
|
|
781
966
|
const imports = __wbg_get_imports();
|
|
782
967
|
|
|
@@ -795,10 +980,13 @@ async function __wbg_init(module_or_path) {
|
|
|
795
980
|
if (wasm !== undefined) return wasm;
|
|
796
981
|
|
|
797
982
|
|
|
798
|
-
if (typeof module_or_path !== 'undefined'
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
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
|
+
}
|
|
802
990
|
|
|
803
991
|
if (typeof module_or_path === 'undefined') {
|
|
804
992
|
module_or_path = new URL('imexport_wasm_bg.wasm', import.meta.url);
|
|
Binary file
|