ducjs 3.5.0 → 4.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/dist/wasm.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { applyDeltaChangeset as _applyDeltaChangeset, createDeltaChangeset as _createDeltaChangeset, getCurrentSchemaVersion as _getCurrentSchemaVersion, getExternalFile as _getExternalFile, listExternalFiles as _listExternalFiles, listVersions as _listVersions, parseDuc as _parseDuc, parseDucLazy as _parseDucLazy, readVersionGraph as _readVersionGraph, restoreCheckpoint as _restoreCheckpoint, restoreVersion as _restoreVersion, revertToVersion as _revertToVersion, serializeDuc as _serializeDuc } from "../dist/ducjs_wasm";
1
+ import { DucOpfsDocument as _DucOpfsDocument, DucOpfsImporter as _DucOpfsImporter, applyDeltaChangeset as _applyDeltaChangeset, createDeltaChangeset as _createDeltaChangeset, getCurrentSchemaVersion as _getCurrentSchemaVersion, parseDuc as _parseDuc, parseDucLazy as _parseDucLazy, serializeDuc as _serializeDuc, getExternalFile as _getExternalFile, listExternalFiles as _listExternalFiles, restoreVersion as _restoreVersion, restoreCheckpoint as _restoreCheckpoint, listVersions as _listVersions, readVersionGraph as _readVersionGraph, revertToVersion as _revertToVersion } from "../dist/ducjs_wasm";
2
2
  export declare function ensureWasm(wasmUrl?: string | URL | BufferSource): Promise<void>;
3
3
  /**
4
4
  * Fetch the raw WASM binary as an ArrayBuffer.
@@ -7,6 +7,24 @@ export declare function ensureWasm(wasmUrl?: string | URL | BufferSource): Promi
7
7
  * without being able to resolve the file URL itself.
8
8
  */
9
9
  export declare function getWasmBinary(): Promise<ArrayBuffer>;
10
+ export declare const wasmGetCurrentSchemaVersion: typeof _getCurrentSchemaVersion;
11
+ export declare const wasmCreateDeltaChangeset: typeof _createDeltaChangeset;
12
+ export declare const wasmApplyDeltaChangeset: typeof _applyDeltaChangeset;
13
+ /**
14
+ * Low-level Origin Private File System (OPFS) SQLite document handle generated by WebAssembly.
15
+ *
16
+ * Provides high-performance, atomic read/write access to `.duc` binary databases inside browser OPFS storage
17
+ * using synchronous file access handles (`SyncAccessHandle`) and embedded WASM SQLite.
18
+ *
19
+ * @see {@link BrowserDucDocument} for the high-level idiomatic browser document API wrapper.
20
+ */
21
+ export declare const DucOpfsDocument: typeof _DucOpfsDocument;
22
+ /**
23
+ * Streaming importer handle generated by WebAssembly for writing chunked `.duc` data directly into OPFS storage.
24
+ *
25
+ * Allows high-throughput chunked stream ingestion without buffering full files into memory.
26
+ */
27
+ export declare const DucOpfsImporter: typeof _DucOpfsImporter;
10
28
  export declare const wasmParseDuc: typeof _parseDuc;
11
29
  export declare const wasmParseDucLazy: typeof _parseDucLazy;
12
30
  export declare const wasmSerializeDuc: typeof _serializeDuc;
@@ -17,6 +35,3 @@ export declare const wasmRestoreCheckpoint: typeof _restoreCheckpoint;
17
35
  export declare const wasmListVersions: typeof _listVersions;
18
36
  export declare const wasmReadVersionGraph: typeof _readVersionGraph;
19
37
  export declare const wasmRevertToVersion: typeof _revertToVersion;
20
- export declare const wasmGetCurrentSchemaVersion: typeof _getCurrentSchemaVersion;
21
- export declare const wasmCreateDeltaChangeset: typeof _createDeltaChangeset;
22
- export declare const wasmApplyDeltaChangeset: typeof _applyDeltaChangeset;
package/dist/wasm.js CHANGED
@@ -7,7 +7,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
7
7
  step((generator = generator.apply(thisArg, _arguments || [])).next());
8
8
  });
9
9
  };
10
- import init, { applyDeltaChangeset as _applyDeltaChangeset, createDeltaChangeset as _createDeltaChangeset, getCurrentSchemaVersion as _getCurrentSchemaVersion, getExternalFile as _getExternalFile, listExternalFiles as _listExternalFiles, listVersions as _listVersions, parseDuc as _parseDuc, parseDucLazy as _parseDucLazy, readVersionGraph as _readVersionGraph, restoreCheckpoint as _restoreCheckpoint, restoreVersion as _restoreVersion, revertToVersion as _revertToVersion, serializeDuc as _serializeDuc, } from "../dist/ducjs_wasm";
10
+ import init, { DucOpfsDocument as _DucOpfsDocument, DucOpfsImporter as _DucOpfsImporter, applyDeltaChangeset as _applyDeltaChangeset, createDeltaChangeset as _createDeltaChangeset, getCurrentSchemaVersion as _getCurrentSchemaVersion, parseDuc as _parseDuc, parseDucLazy as _parseDucLazy, serializeDuc as _serializeDuc, getExternalFile as _getExternalFile, listExternalFiles as _listExternalFiles, restoreVersion as _restoreVersion, restoreCheckpoint as _restoreCheckpoint, listVersions as _listVersions, readVersionGraph as _readVersionGraph, revertToVersion as _revertToVersion, } from "../dist/ducjs_wasm";
11
11
  let initialized = false;
12
12
  let initPromise = null;
13
13
  const DEFAULT_WASM_URL = new URL("../dist/ducjs_wasm_bg.wasm", import.meta.url);
@@ -58,6 +58,25 @@ export function getWasmBinary() {
58
58
  return resp.arrayBuffer();
59
59
  });
60
60
  }
61
+ export const wasmGetCurrentSchemaVersion = _getCurrentSchemaVersion;
62
+ export const wasmCreateDeltaChangeset = _createDeltaChangeset;
63
+ export const wasmApplyDeltaChangeset = _applyDeltaChangeset;
64
+ /**
65
+ * Low-level Origin Private File System (OPFS) SQLite document handle generated by WebAssembly.
66
+ *
67
+ * Provides high-performance, atomic read/write access to `.duc` binary databases inside browser OPFS storage
68
+ * using synchronous file access handles (`SyncAccessHandle`) and embedded WASM SQLite.
69
+ *
70
+ * @see {@link BrowserDucDocument} for the high-level idiomatic browser document API wrapper.
71
+ */
72
+ export const DucOpfsDocument = _DucOpfsDocument;
73
+ /**
74
+ * Streaming importer handle generated by WebAssembly for writing chunked `.duc` data directly into OPFS storage.
75
+ *
76
+ * Allows high-throughput chunked stream ingestion without buffering full files into memory.
77
+ */
78
+ export const DucOpfsImporter = _DucOpfsImporter;
79
+ // Byte-buffer compatibility API
61
80
  export const wasmParseDuc = _parseDuc;
62
81
  export const wasmParseDucLazy = _parseDucLazy;
63
82
  export const wasmSerializeDuc = _serializeDuc;
@@ -68,6 +87,3 @@ export const wasmRestoreCheckpoint = _restoreCheckpoint;
68
87
  export const wasmListVersions = _listVersions;
69
88
  export const wasmReadVersionGraph = _readVersionGraph;
70
89
  export const wasmRevertToVersion = _revertToVersion;
71
- export const wasmGetCurrentSchemaVersion = _getCurrentSchemaVersion;
72
- export const wasmCreateDeltaChangeset = _createDeltaChangeset;
73
- export const wasmApplyDeltaChangeset = _applyDeltaChangeset;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ducjs",
3
- "version": "3.5.0",
3
+ "version": "4.0.0",
4
4
  "description": "The duc 2D CAD file format is a cornerstone of our advanced design system, conceived to cater to professionals seeking precision and efficiency in their design work.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -29,16 +29,22 @@
29
29
  },
30
30
  "scripts": {
31
31
  "build": "node scripts/build.js",
32
- "test": "bun run check-types",
32
+ "build:wasi": "node scripts/build.js --wasi",
33
+ "test": "bun test tests && bun run check-types",
33
34
  "check-types": "tsc --noEmit",
35
+ "gen:docs": "bunx typedoc",
36
+ "dev:docs": "bun run gen:docs && python3 -m http.server 8241 --directory docs",
34
37
  "semantic-release": "semantic-release"
35
38
  },
36
39
  "author": "Ducflair",
37
40
  "license": "MIT",
38
41
  "devDependencies": {
39
42
  "@types/bun": "latest",
43
+ "@types/node": "^22.10.0",
44
+ "@types/react": "^19.0.0",
40
45
  "@types/tinycolor2": "^1.4.6",
41
46
  "semantic-release": "^24.1.2",
47
+ "typedoc": "^0.27.9",
42
48
  "turbo": "^2.1.3",
43
49
  "typescript": "^5.8.3",
44
50
  "undici-types": "^6.21.0"