@senlinz/import-export 0.1.2 → 1.0.1

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.
@@ -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`, `atob`, and `URL.createObjectURL`.
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:
@@ -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 { importExcel, importExcelDynamic, exportExcel, downloadExcelTemplate, fromExcel, fromExcelDynamic, toExcel, generateExcelTemplate, testUtils } from './utils.js';
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 { bundledWasmSource, getUtils, initializeWasm, _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, };
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, };
@@ -1,6 +1,6 @@
1
1
  import { ExcelColumnDefinition, ExcelDefinition, DynamicExcelImportOptions, DynamicExcelImportResult } from './ExcelDefinition';
2
2
  declare const SUPPORTED_DATA_TYPES: readonly ["text", "number", "date", "image"];
3
- type NormalizedDataType = typeof SUPPORTED_DATA_TYPES[number];
3
+ type NormalizedDataType = (typeof SUPPORTED_DATA_TYPES)[number];
4
4
  type NormalizedExcelColumnDefinition = Omit<ExcelColumnDefinition, 'dataType'> & {
5
5
  dataType?: NormalizedDataType;
6
6
  };
@@ -28,4 +28,4 @@ declare function download(data: Uint8Array | string, name: string, type?: string
28
28
  declare function importExcel<T>(definition: ExcelDefinition): Promise<T[]>;
29
29
  declare function importExcelDynamic(options?: DynamicExcelImportOptions): Promise<DynamicExcelImportResult>;
30
30
  declare function exportExcel<T>(definition: ExcelDefinition, data: T[]): Promise<void>;
31
- export { importExcel, importExcelDynamic, exportExcel, downloadExcelTemplate, _fromExcel as fromExcel, _fromExcelDynamic as fromExcelDynamic, _toExcel as toExcel, generateExcelTemplate, download, testUtils };
31
+ export { importExcel, importExcelDynamic, exportExcel, downloadExcelTemplate, _fromExcel as fromExcel, _fromExcelDynamic as fromExcelDynamic, _toExcel as toExcel, generateExcelTemplate, download, testUtils, };
package/package.json CHANGED
@@ -1,10 +1,11 @@
1
1
  {
2
2
  "name": "@senlinz/import-export",
3
- "version": "0.1.2",
3
+ "version": "1.0.1",
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
  ],
@@ -20,14 +21,15 @@
20
21
  "devDependencies": {
21
22
  "@rollup/plugin-commonjs": "^28.0.3",
22
23
  "@rollup/plugin-node-resolve": "^16.0.1",
23
- "@rollup/plugin-terser": "^0.4.4",
24
+ "@rollup/plugin-terser": "^1.0.0",
24
25
  "@rollup/plugin-typescript": "^12.1.2",
25
26
  "@types/jest": "^29.5.6",
26
27
  "@types/node": "^16.18.108",
28
+ "fast-check": "^4.7.0",
29
+ "fflate": "^0.8.2",
27
30
  "jest": "^29.7.0",
28
31
  "jest-cli": "^29.7.0",
29
- "rollup": "^4.39.0",
30
- "rollup-plugin-terser": "^7.0.2",
32
+ "rollup": "^4.60.2",
31
33
  "tslib": "^2.8.1",
32
34
  "typescript": "^5.8.2"
33
35
  },
@@ -38,8 +40,7 @@
38
40
  "url": "git+https://github.com/gui-xie/import-export.git"
39
41
  },
40
42
  "dependencies": {
41
- "fflate": "^0.8.2",
42
- "@senlinz/import-export-wasm": "0.1.2"
43
+ "@senlinz/import-export-wasm": "1.0.1"
43
44
  },
44
45
  "keywords": [
45
46
  "rust",
@@ -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, };