@senlinz/import-export 0.1.2 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -24
- package/README.zh.md +6 -24
- package/dist/assets/imexport_wasm_bg-lSJMSNpC.wasm +0 -0
- package/dist/index.js +1 -1
- package/dist/types/ExcelDefinition.d.ts +1 -1
- package/dist/types/index.d.ts +2 -14
- package/package.json +5 -5
- package/dist/types/runtime.d.ts +0 -20
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
type ExcelColumnDataType = "text" | "number" | "date" | "image";
|
|
5
5
|
/**
|
|
6
6
|
* Runtime support:
|
|
7
|
-
* - Browser ESM environments with `Blob`, `FileReader`, `
|
|
7
|
+
* - Browser ESM environments with `Blob`, `FileReader`, `fetch`, and `URL.createObjectURL`.
|
|
8
8
|
* - Node.js can use `fromExcel`, `toExcel`, and `generateExcelTemplate` when compatible browser globals are available.
|
|
9
9
|
*
|
|
10
10
|
* Known limitations:
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,19 +1,7 @@
|
|
|
1
1
|
export type * from './ExcelDefinition';
|
|
2
|
-
export type { InitializeWasmOptions } from './runtime.js';
|
|
3
2
|
import { ExcelDefinition } from './ExcelDefinition';
|
|
4
3
|
import type { DynamicExcelImportOptions, DynamicExcelImportResult } from './ExcelDefinition';
|
|
5
|
-
import {
|
|
6
|
-
import { bundledWasmSource, initializeWasm } from './runtime.js';
|
|
7
|
-
declare function getUtils(): {
|
|
8
|
-
importExcel: typeof importExcel;
|
|
9
|
-
importExcelDynamic: typeof importExcelDynamic;
|
|
10
|
-
exportExcel: typeof exportExcel;
|
|
11
|
-
downloadExcelTemplate: typeof downloadExcelTemplate;
|
|
12
|
-
fromExcel: typeof fromExcel;
|
|
13
|
-
fromExcelDynamic: typeof fromExcelDynamic;
|
|
14
|
-
toExcel: typeof toExcel;
|
|
15
|
-
generateExcelTemplate: typeof generateExcelTemplate;
|
|
16
|
-
};
|
|
4
|
+
import { testUtils } from './utils.js';
|
|
17
5
|
declare function _importExcel<T>(definition: ExcelDefinition): Promise<T[]>;
|
|
18
6
|
declare function _importExcelDynamic(options?: DynamicExcelImportOptions): Promise<DynamicExcelImportResult>;
|
|
19
7
|
declare function _exportExcel<T>(definition: ExcelDefinition, data: T[]): Promise<void>;
|
|
@@ -22,4 +10,4 @@ declare function _fromExcelDynamic(buffer: Uint8Array, options?: DynamicExcelImp
|
|
|
22
10
|
declare function _toExcel<T>(definition: ExcelDefinition, data: T[]): Promise<Uint8Array>;
|
|
23
11
|
declare function _downloadExcelTemplate(definition: ExcelDefinition): Promise<void>;
|
|
24
12
|
declare function _generateExcelTemplate(definition: ExcelDefinition): Promise<Uint8Array>;
|
|
25
|
-
export {
|
|
13
|
+
export { _importExcel as importExcel, _importExcelDynamic as importExcelDynamic, _exportExcel as exportExcel, _fromExcel as fromExcel, _fromExcelDynamic as fromExcelDynamic, _toExcel as toExcel, _downloadExcelTemplate as downloadExcelTemplate, _generateExcelTemplate as generateExcelTemplate, testUtils, };
|
package/package.json
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@senlinz/import-export",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.0",
|
|
4
4
|
"description": "import/export excel core",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist/**/*.js",
|
|
7
7
|
"dist/**/*.d.ts",
|
|
8
|
+
"dist/**/*.wasm",
|
|
8
9
|
"README.md",
|
|
9
10
|
"README.zh.md"
|
|
10
11
|
],
|
|
@@ -24,10 +25,10 @@
|
|
|
24
25
|
"@rollup/plugin-typescript": "^12.1.2",
|
|
25
26
|
"@types/jest": "^29.5.6",
|
|
26
27
|
"@types/node": "^16.18.108",
|
|
28
|
+
"fflate": "^0.8.2",
|
|
27
29
|
"jest": "^29.7.0",
|
|
28
30
|
"jest-cli": "^29.7.0",
|
|
29
|
-
"rollup": "^4.
|
|
30
|
-
"rollup-plugin-terser": "^7.0.2",
|
|
31
|
+
"rollup": "^4.60.2",
|
|
31
32
|
"tslib": "^2.8.1",
|
|
32
33
|
"typescript": "^5.8.2"
|
|
33
34
|
},
|
|
@@ -38,8 +39,7 @@
|
|
|
38
39
|
"url": "git+https://github.com/gui-xie/import-export.git"
|
|
39
40
|
},
|
|
40
41
|
"dependencies": {
|
|
41
|
-
"
|
|
42
|
-
"@senlinz/import-export-wasm": "0.1.2"
|
|
42
|
+
"@senlinz/import-export-wasm": "1.0.0"
|
|
43
43
|
},
|
|
44
44
|
"keywords": [
|
|
45
45
|
"rust",
|
package/dist/types/runtime.d.ts
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
type WasmInitializationInputKind = 'source' | 'bytes' | 'module';
|
|
2
|
-
interface InitializeWasmOptions {
|
|
3
|
-
/**
|
|
4
|
-
* Gzipped base64-encoded WASM source text.
|
|
5
|
-
*/
|
|
6
|
-
source?: string;
|
|
7
|
-
/**
|
|
8
|
-
* Raw WebAssembly bytes loaded by the caller.
|
|
9
|
-
*/
|
|
10
|
-
bytes?: BufferSource;
|
|
11
|
-
/**
|
|
12
|
-
* A precompiled WebAssembly module loaded by the caller.
|
|
13
|
-
*/
|
|
14
|
-
module?: WebAssembly.Module;
|
|
15
|
-
}
|
|
16
|
-
declare const bundledWasmSource: string;
|
|
17
|
-
declare function ensureWasmInitialized(): void;
|
|
18
|
-
declare function initializeWasm(options?: InitializeWasmOptions): void;
|
|
19
|
-
export { bundledWasmSource, ensureWasmInitialized, initializeWasm, };
|
|
20
|
-
export type { InitializeWasmOptions, WasmInitializationInputKind, };
|