ducjs 4.1.0 → 4.2.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.
Files changed (117) hide show
  1. package/dist/duc_locator_wasm.d.ts +48 -0
  2. package/dist/duc_locator_wasm.js +296 -0
  3. package/dist/duc_locator_wasm_bg.wasm +0 -0
  4. package/dist/duc_locator_wasm_bg.wasm.d.ts +13 -0
  5. package/dist/ducjs_wasi.wasm +0 -0
  6. package/dist/ducjs_wasm.d.ts +14 -2
  7. package/dist/ducjs_wasm.js +96 -8
  8. package/dist/ducjs_wasm_bg.wasm +0 -0
  9. package/dist/ducjs_wasm_bg.wasm.d.ts +6 -2
  10. package/dist/index.d.ts +4 -1
  11. package/dist/index.js +4 -1
  12. package/dist/locator-runtime.d.ts +4 -0
  13. package/dist/locator-runtime.js +7 -0
  14. package/dist/restore/restoreDataState.d.ts +13 -24
  15. package/dist/restore/restoreDataState.js +47 -81
  16. package/dist/restore/restoreElements.d.ts +10 -15
  17. package/dist/restore/restoreElements.js +115 -124
  18. package/dist/thumbnails/bounds.d.ts +21 -0
  19. package/dist/thumbnails/bounds.js +84 -0
  20. package/dist/thumbnails/browserRunner.d.ts +60 -0
  21. package/dist/thumbnails/browserRunner.js +446 -0
  22. package/dist/thumbnails/cameraPresets.d.ts +47 -0
  23. package/dist/thumbnails/cameraPresets.js +222 -0
  24. package/dist/thumbnails/cli.d.ts +2 -0
  25. package/dist/thumbnails/cli.js +102 -0
  26. package/dist/thumbnails/index.d.ts +11 -0
  27. package/dist/thumbnails/index.js +11 -0
  28. package/dist/thumbnails/lib/clientBundle.min.js +10427 -0
  29. package/dist/thumbnails/lib/clientEntry.d.ts +3 -0
  30. package/dist/thumbnails/lib/clientEntry.js +8 -0
  31. package/dist/thumbnails/lib/clippingUtils.d.ts +10 -0
  32. package/dist/thumbnails/lib/clippingUtils.js +3 -0
  33. package/dist/thumbnails/lib/defaultModelColor.d.ts +3 -0
  34. package/dist/thumbnails/lib/defaultModelColor.js +22 -0
  35. package/dist/thumbnails/lib/index.d.ts +12 -0
  36. package/dist/thumbnails/lib/index.js +12 -0
  37. package/dist/thumbnails/lib/mapViewerStateToOptions.d.ts +34 -0
  38. package/dist/thumbnails/lib/mapViewerStateToOptions.js +69 -0
  39. package/dist/thumbnails/lib/offscreen-dxf-thumbnail.d.ts +16 -0
  40. package/dist/thumbnails/lib/offscreen-dxf-thumbnail.js +173 -0
  41. package/dist/thumbnails/lib/offscreen-model-thumbnail.d.ts +16 -0
  42. package/dist/thumbnails/lib/offscreen-model-thumbnail.js +209 -0
  43. package/dist/thumbnails/lib/parametricClip.d.ts +18 -0
  44. package/dist/thumbnails/lib/parametricClip.js +177 -0
  45. package/dist/thumbnails/lib/parametricShapes.d.ts +1 -0
  46. package/dist/thumbnails/lib/parametricShapes.js +75 -0
  47. package/dist/thumbnails/lib/parametricViewerState.d.ts +26 -0
  48. package/dist/thumbnails/lib/parametricViewerState.js +198 -0
  49. package/dist/thumbnails/lib/thumbnail-camera-fit.d.ts +6 -0
  50. package/dist/thumbnails/lib/thumbnail-camera-fit.js +292 -0
  51. package/dist/thumbnails/lib/thumbnail-capture.d.ts +23 -0
  52. package/dist/thumbnails/lib/thumbnail-capture.js +161 -0
  53. package/dist/thumbnails/lib/thumbnail-visibility.d.ts +12 -0
  54. package/dist/thumbnails/lib/thumbnail-visibility.js +97 -0
  55. package/dist/thumbnails/lib/viewerGrid.d.ts +13 -0
  56. package/dist/thumbnails/lib/viewerGrid.js +57 -0
  57. package/dist/thumbnails/modelCache.d.ts +56 -0
  58. package/dist/thumbnails/modelCache.js +165 -0
  59. package/dist/thumbnails/modelOutputArtifact.d.ts +19 -0
  60. package/dist/thumbnails/modelOutputArtifact.js +87 -0
  61. package/dist/thumbnails/render.d.ts +45 -0
  62. package/dist/thumbnails/render.js +162 -0
  63. package/dist/thumbnails/templates.d.ts +16 -0
  64. package/dist/thumbnails/templates.js +786 -0
  65. package/dist/thumbnails/tessellator.d.ts +33 -0
  66. package/dist/thumbnails/tessellator.js +349 -0
  67. package/dist/thumbnails/types.d.ts +233 -0
  68. package/dist/thumbnails/types.js +1 -0
  69. package/dist/thumbnails/worker.d.ts +10 -0
  70. package/dist/thumbnails/worker.js +119 -0
  71. package/dist/transform.d.ts +1 -1
  72. package/dist/transform.js +20 -22
  73. package/dist/types/elements/index.d.ts +22 -28
  74. package/dist/types/elements/index.js +0 -1
  75. package/dist/types/geometry.types.d.ts +5 -5
  76. package/dist/types/index.d.ts +13 -59
  77. package/dist/types/index.js +0 -1
  78. package/dist/types/issues.types.d.ts +1 -2
  79. package/dist/utils/bounds.d.ts +10 -11
  80. package/dist/utils/bounds.js +105 -84
  81. package/dist/utils/constants.d.ts +5 -7
  82. package/dist/utils/constants.js +10 -15
  83. package/dist/utils/elements/freedrawElement.js +6 -3
  84. package/dist/utils/elements/index.d.ts +2 -6
  85. package/dist/utils/elements/index.js +4 -9
  86. package/dist/utils/elements/linearElement.d.ts +12 -14
  87. package/dist/utils/elements/linearElement.js +81 -66
  88. package/dist/utils/elements/newElement.d.ts +37 -22
  89. package/dist/utils/elements/newElement.js +70 -64
  90. package/dist/utils/elements/textElement.d.ts +34 -35
  91. package/dist/utils/elements/textElement.js +79 -83
  92. package/dist/utils/index.d.ts +1 -1
  93. package/dist/utils/index.js +1 -1
  94. package/dist/utils/locator.d.ts +43 -0
  95. package/dist/utils/locator.js +112 -0
  96. package/dist/utils/math/bbox.d.ts +1 -2
  97. package/dist/utils/math/geometry.js +5 -4
  98. package/dist/utils/math/index.d.ts +13 -17
  99. package/dist/utils/math/index.js +53 -41
  100. package/dist/utils/normalize.d.ts +5 -5
  101. package/dist/utils/normalize.js +15 -10
  102. package/dist/utils/shape.d.ts +3 -4
  103. package/dist/utils/shape.js +64 -48
  104. package/dist/utils/state/index.d.ts +3 -4
  105. package/dist/utils/state/index.js +8 -23
  106. package/dist/wasi.js +38 -12
  107. package/package.json +23 -9
  108. package/dist/technical/index.d.ts +0 -2
  109. package/dist/technical/index.js +0 -2
  110. package/dist/technical/measurements.d.ts +0 -31
  111. package/dist/technical/measurements.js +0 -64
  112. package/dist/technical/scopes.d.ts +0 -261
  113. package/dist/technical/scopes.js +0 -676
  114. package/dist/types/typeChecks.d.ts +0 -5
  115. package/dist/types/typeChecks.js +0 -10
  116. package/dist/utils/traverse.d.ts +0 -30
  117. package/dist/utils/traverse.js +0 -124
@@ -0,0 +1,48 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+
4
+ export function getOwningDucDirectory(path: string): string;
5
+
6
+ export function normalizeHostPath(path: string): string;
7
+
8
+ export function normalizePathSegments(path: string): string;
9
+
10
+ export function resolveLocatorPath(kind: string, path: string, owner?: string | null): string;
11
+
12
+ export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
13
+
14
+ export interface InitOutput {
15
+ readonly memory: WebAssembly.Memory;
16
+ readonly getOwningDucDirectory: (a: number, b: number) => [number, number];
17
+ readonly normalizeHostPath: (a: number, b: number) => [number, number];
18
+ readonly normalizePathSegments: (a: number, b: number) => [number, number];
19
+ readonly resolveLocatorPath: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number, number, number];
20
+ readonly __wbindgen_externrefs: WebAssembly.Table;
21
+ readonly __wbindgen_malloc: (a: number, b: number) => number;
22
+ readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
23
+ readonly __wbindgen_free: (a: number, b: number, c: number) => void;
24
+ readonly __externref_table_dealloc: (a: number) => void;
25
+ readonly __wbindgen_start: () => void;
26
+ }
27
+
28
+ export type SyncInitInput = BufferSource | WebAssembly.Module;
29
+
30
+ /**
31
+ * Instantiates the given `module`, which can either be bytes or
32
+ * a precompiled `WebAssembly.Module`.
33
+ *
34
+ * @param {{ module: SyncInitInput }} module - Passing `SyncInitInput` directly is deprecated.
35
+ *
36
+ * @returns {InitOutput}
37
+ */
38
+ export function initSync(module: { module: SyncInitInput } | SyncInitInput): InitOutput;
39
+
40
+ /**
41
+ * If `module_or_path` is {RequestInfo} or {URL}, makes a request and
42
+ * for everything else, calls `WebAssembly.instantiate` directly.
43
+ *
44
+ * @param {{ module_or_path: InitInput | Promise<InitInput> }} module_or_path - Passing `InitInput` directly is deprecated.
45
+ *
46
+ * @returns {Promise<InitOutput>}
47
+ */
48
+ export default function __wbg_init (module_or_path?: { module_or_path: InitInput | Promise<InitInput> } | InitInput | Promise<InitInput>): Promise<InitOutput>;
@@ -0,0 +1,296 @@
1
+ /* @ts-self-types="./duc_locator_wasm.d.ts" */
2
+
3
+ /**
4
+ * @param {string} path
5
+ * @returns {string}
6
+ */
7
+ export function getOwningDucDirectory(path) {
8
+ let deferred2_0;
9
+ let deferred2_1;
10
+ try {
11
+ const ptr0 = passStringToWasm0(path, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
12
+ const len0 = WASM_VECTOR_LEN;
13
+ const ret = wasm.getOwningDucDirectory(ptr0, len0);
14
+ deferred2_0 = ret[0];
15
+ deferred2_1 = ret[1];
16
+ return getStringFromWasm0(ret[0], ret[1]);
17
+ } finally {
18
+ wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
19
+ }
20
+ }
21
+
22
+ /**
23
+ * @param {string} path
24
+ * @returns {string}
25
+ */
26
+ export function normalizeHostPath(path) {
27
+ let deferred2_0;
28
+ let deferred2_1;
29
+ try {
30
+ const ptr0 = passStringToWasm0(path, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
31
+ const len0 = WASM_VECTOR_LEN;
32
+ const ret = wasm.normalizeHostPath(ptr0, len0);
33
+ deferred2_0 = ret[0];
34
+ deferred2_1 = ret[1];
35
+ return getStringFromWasm0(ret[0], ret[1]);
36
+ } finally {
37
+ wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
38
+ }
39
+ }
40
+
41
+ /**
42
+ * @param {string} path
43
+ * @returns {string}
44
+ */
45
+ export function normalizePathSegments(path) {
46
+ let deferred2_0;
47
+ let deferred2_1;
48
+ try {
49
+ const ptr0 = passStringToWasm0(path, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
50
+ const len0 = WASM_VECTOR_LEN;
51
+ const ret = wasm.normalizePathSegments(ptr0, len0);
52
+ deferred2_0 = ret[0];
53
+ deferred2_1 = ret[1];
54
+ return getStringFromWasm0(ret[0], ret[1]);
55
+ } finally {
56
+ wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
57
+ }
58
+ }
59
+
60
+ /**
61
+ * @param {string} kind
62
+ * @param {string} path
63
+ * @param {string | null} [owner]
64
+ * @returns {string}
65
+ */
66
+ export function resolveLocatorPath(kind, path, owner) {
67
+ let deferred5_0;
68
+ let deferred5_1;
69
+ try {
70
+ const ptr0 = passStringToWasm0(kind, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
71
+ const len0 = WASM_VECTOR_LEN;
72
+ const ptr1 = passStringToWasm0(path, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
73
+ const len1 = WASM_VECTOR_LEN;
74
+ var ptr2 = isLikeNone(owner) ? 0 : passStringToWasm0(owner, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
75
+ var len2 = WASM_VECTOR_LEN;
76
+ const ret = wasm.resolveLocatorPath(ptr0, len0, ptr1, len1, ptr2, len2);
77
+ var ptr4 = ret[0];
78
+ var len4 = ret[1];
79
+ if (ret[3]) {
80
+ ptr4 = 0; len4 = 0;
81
+ throw takeFromExternrefTable0(ret[2]);
82
+ }
83
+ deferred5_0 = ptr4;
84
+ deferred5_1 = len4;
85
+ return getStringFromWasm0(ptr4, len4);
86
+ } finally {
87
+ wasm.__wbindgen_free(deferred5_0, deferred5_1, 1);
88
+ }
89
+ }
90
+ function __wbg_get_imports() {
91
+ const import0 = {
92
+ __proto__: null,
93
+ __wbg_Error_408e67f47ca7b58b: function(arg0, arg1) {
94
+ const ret = Error(getStringFromWasm0(arg0, arg1));
95
+ return ret;
96
+ },
97
+ __wbindgen_init_externref_table: function() {
98
+ const table = wasm.__wbindgen_externrefs;
99
+ const offset = table.grow(4);
100
+ table.set(0, undefined);
101
+ table.set(offset + 0, undefined);
102
+ table.set(offset + 1, null);
103
+ table.set(offset + 2, true);
104
+ table.set(offset + 3, false);
105
+ },
106
+ };
107
+ return {
108
+ __proto__: null,
109
+ "./duc_locator_wasm_bg.js": import0,
110
+ };
111
+ }
112
+
113
+ function getStringFromWasm0(ptr, len) {
114
+ return decodeText(ptr >>> 0, len);
115
+ }
116
+
117
+ let cachedUint8ArrayMemory0 = null;
118
+ function getUint8ArrayMemory0() {
119
+ if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
120
+ cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
121
+ }
122
+ return cachedUint8ArrayMemory0;
123
+ }
124
+
125
+ function isLikeNone(x) {
126
+ return x === undefined || x === null;
127
+ }
128
+
129
+ function passStringToWasm0(arg, malloc, realloc) {
130
+ if (realloc === undefined) {
131
+ const buf = cachedTextEncoder.encode(arg);
132
+ const ptr = malloc(buf.length, 1) >>> 0;
133
+ getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
134
+ WASM_VECTOR_LEN = buf.length;
135
+ return ptr;
136
+ }
137
+
138
+ let len = arg.length;
139
+ let ptr = malloc(len, 1) >>> 0;
140
+
141
+ const mem = getUint8ArrayMemory0();
142
+
143
+ let offset = 0;
144
+
145
+ for (; offset < len; offset++) {
146
+ const code = arg.charCodeAt(offset);
147
+ if (code > 0x7F) break;
148
+ mem[ptr + offset] = code;
149
+ }
150
+ if (offset !== len) {
151
+ if (offset !== 0) {
152
+ arg = arg.slice(offset);
153
+ }
154
+ ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
155
+ const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
156
+ const ret = cachedTextEncoder.encodeInto(arg, view);
157
+
158
+ offset += ret.written;
159
+ ptr = realloc(ptr, len, offset, 1) >>> 0;
160
+ }
161
+
162
+ WASM_VECTOR_LEN = offset;
163
+ return ptr;
164
+ }
165
+
166
+ function takeFromExternrefTable0(idx) {
167
+ const value = wasm.__wbindgen_externrefs.get(idx);
168
+ wasm.__externref_table_dealloc(idx);
169
+ return value;
170
+ }
171
+
172
+ let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
173
+ cachedTextDecoder.decode();
174
+ const MAX_SAFARI_DECODE_BYTES = 2146435072;
175
+ let numBytesDecoded = 0;
176
+ function decodeText(ptr, len) {
177
+ numBytesDecoded += len;
178
+ if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
179
+ cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
180
+ cachedTextDecoder.decode();
181
+ numBytesDecoded = len;
182
+ }
183
+ return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
184
+ }
185
+
186
+ const cachedTextEncoder = new TextEncoder();
187
+
188
+ if (!('encodeInto' in cachedTextEncoder)) {
189
+ cachedTextEncoder.encodeInto = function (arg, view) {
190
+ const buf = cachedTextEncoder.encode(arg);
191
+ view.set(buf);
192
+ return {
193
+ read: arg.length,
194
+ written: buf.length
195
+ };
196
+ };
197
+ }
198
+
199
+ let WASM_VECTOR_LEN = 0;
200
+
201
+ let wasmModule, wasmInstance, wasm;
202
+ function __wbg_finalize_init(instance, module) {
203
+ wasmInstance = instance;
204
+ wasm = instance.exports;
205
+ wasmModule = module;
206
+ cachedUint8ArrayMemory0 = null;
207
+ wasm.__wbindgen_start();
208
+ return wasm;
209
+ }
210
+
211
+ async function __wbg_load(module, imports) {
212
+ if (typeof Response === 'function' && module instanceof Response) {
213
+ if (!module.ok) {
214
+ throw new Error(`failed to fetch Wasm: ${module.status} ${module.statusText} fetching '${module.url}'`);
215
+ }
216
+
217
+ if (typeof WebAssembly.instantiateStreaming === 'function') {
218
+ try {
219
+ return await WebAssembly.instantiateStreaming(module, imports);
220
+ } catch (e) {
221
+ const validResponse = expectedResponseType(module.type);
222
+
223
+ if (validResponse && module.headers.get('Content-Type') !== 'application/wasm') {
224
+ 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);
225
+
226
+ } else { throw e; }
227
+ }
228
+ }
229
+
230
+ const bytes = await module.arrayBuffer();
231
+ return await WebAssembly.instantiate(bytes, imports);
232
+ } else {
233
+ const instance = await WebAssembly.instantiate(module, imports);
234
+
235
+ if (instance instanceof WebAssembly.Instance) {
236
+ return { instance, module };
237
+ } else {
238
+ return instance;
239
+ }
240
+ }
241
+
242
+ function expectedResponseType(type) {
243
+ switch (type) {
244
+ case 'basic': case 'cors': case 'default': return true;
245
+ }
246
+ return false;
247
+ }
248
+ }
249
+
250
+ function initSync(module) {
251
+ if (wasm !== undefined) return wasm;
252
+
253
+
254
+ if (module !== undefined) {
255
+ if (Object.getPrototypeOf(module) === Object.prototype) {
256
+ ({module} = module)
257
+ } else {
258
+ console.warn('using deprecated parameters for `initSync()`; pass a single object instead')
259
+ }
260
+ }
261
+
262
+ const imports = __wbg_get_imports();
263
+ if (!(module instanceof WebAssembly.Module)) {
264
+ module = new WebAssembly.Module(module);
265
+ }
266
+ const instance = new WebAssembly.Instance(module, imports);
267
+ return __wbg_finalize_init(instance, module);
268
+ }
269
+
270
+ async function __wbg_init(module_or_path) {
271
+ if (wasm !== undefined) return wasm;
272
+
273
+
274
+ if (module_or_path !== undefined) {
275
+ if (Object.getPrototypeOf(module_or_path) === Object.prototype) {
276
+ ({module_or_path} = module_or_path)
277
+ } else {
278
+ console.warn('using deprecated parameters for the initialization function; pass a single object instead')
279
+ }
280
+ }
281
+
282
+ if (module_or_path === undefined) {
283
+ module_or_path = new URL('duc_locator_wasm_bg.wasm', import.meta.url);
284
+ }
285
+ const imports = __wbg_get_imports();
286
+
287
+ if (typeof module_or_path === 'string' || (typeof Request === 'function' && module_or_path instanceof Request) || (typeof URL === 'function' && module_or_path instanceof URL)) {
288
+ module_or_path = fetch(module_or_path);
289
+ }
290
+
291
+ const { instance, module } = await __wbg_load(await module_or_path, imports);
292
+
293
+ return __wbg_finalize_init(instance, module);
294
+ }
295
+
296
+ export { initSync, __wbg_init as default };
Binary file
@@ -0,0 +1,13 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ export const memory: WebAssembly.Memory;
4
+ export const getOwningDucDirectory: (a: number, b: number) => [number, number];
5
+ export const normalizeHostPath: (a: number, b: number) => [number, number];
6
+ export const normalizePathSegments: (a: number, b: number) => [number, number];
7
+ export const resolveLocatorPath: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number, number, number];
8
+ export const __wbindgen_externrefs: WebAssembly.Table;
9
+ export const __wbindgen_malloc: (a: number, b: number) => number;
10
+ export const __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
11
+ export const __wbindgen_free: (a: number, b: number, c: number) => void;
12
+ export const __externref_table_dealloc: (a: number) => void;
13
+ export const __wbindgen_start: () => void;
Binary file
@@ -134,11 +134,17 @@ export function createDeltaChangeset(base_state: Uint8Array, current_state: Uint
134
134
  */
135
135
  export function getCurrentSchemaVersion(): number;
136
136
 
137
+ export function getOwningDucDirectory(path: string): string;
138
+
137
139
  /**
138
140
  * List all versions (checkpoints + deltas) from a `.duc` file buffer.
139
141
  */
140
142
  export function listVersions(duc_buf: Uint8Array): any;
141
143
 
144
+ export function normalizeHostPath(path: string): string;
145
+
146
+ export function normalizePathSegments(path: string): string;
147
+
142
148
  /**
143
149
  * Parse a `.duc` file (Uint8Array) into a JS object (ExportedDataState).
144
150
  */
@@ -149,6 +155,8 @@ export function parseDuc(buf: Uint8Array): any;
149
155
  */
150
156
  export function readVersionGraph(duc_buf: Uint8Array): any;
151
157
 
158
+ export function resolveLocatorPath(kind: string, path: string, owner?: string | null): string;
159
+
152
160
  /**
153
161
  * Restore a specific checkpoint by its ID from a `.duc` file buffer.
154
162
  */
@@ -218,6 +226,10 @@ export interface InitOutput {
218
226
  readonly restoreVersion: (a: number, b: number, c: number) => [number, number, number];
219
227
  readonly revertToVersion: (a: number, b: number, c: number) => [number, number, number];
220
228
  readonly serializeDuc: (a: any) => [number, number, number, number];
229
+ readonly getOwningDucDirectory: (a: number, b: number) => [number, number];
230
+ readonly normalizeHostPath: (a: number, b: number) => [number, number];
231
+ readonly normalizePathSegments: (a: number, b: number) => [number, number];
232
+ readonly resolveLocatorPath: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number, number, number];
221
233
  readonly rust_sqlite_wasm_abort: () => void;
222
234
  readonly rust_sqlite_wasm_assert_fail: (a: number, b: number, c: number, d: number) => void;
223
235
  readonly rust_sqlite_wasm_calloc: (a: number, b: number) => number;
@@ -228,8 +240,8 @@ export interface InitOutput {
228
240
  readonly rust_sqlite_wasm_realloc: (a: number, b: number) => number;
229
241
  readonly sqlite3_os_end: () => number;
230
242
  readonly sqlite3_os_init: () => number;
231
- readonly wasm_bindgen_adb4849040331bf2___convert__closures_____invoke___wasm_bindgen_adb4849040331bf2___JsValue__core_ed718c3d60ebd546___result__Result_____wasm_bindgen_adb4849040331bf2___JsError___true_: (a: number, b: number, c: any) => [number, number];
232
- readonly wasm_bindgen_adb4849040331bf2___convert__closures_____invoke___js_sys_495b1fea2679fcbe___Function_fn_wasm_bindgen_adb4849040331bf2___JsValue_____wasm_bindgen_adb4849040331bf2___sys__Undefined___js_sys_495b1fea2679fcbe___Function_fn_wasm_bindgen_adb4849040331bf2___JsValue_____wasm_bindgen_adb4849040331bf2___sys__Undefined_______true_: (a: number, b: number, c: any, d: any) => void;
243
+ readonly wasm_bindgen_222cd6dcc2029346___convert__closures_____invoke___wasm_bindgen_222cd6dcc2029346___JsValue__core_37ee0ce0c4cd57d5___result__Result_____wasm_bindgen_222cd6dcc2029346___JsError___true_: (a: number, b: number, c: any) => [number, number];
244
+ readonly wasm_bindgen_222cd6dcc2029346___convert__closures_____invoke___js_sys_7801c184e5cea5ad___Function_fn_wasm_bindgen_222cd6dcc2029346___JsValue_____wasm_bindgen_222cd6dcc2029346___sys__Undefined___js_sys_7801c184e5cea5ad___Function_fn_wasm_bindgen_222cd6dcc2029346___JsValue_____wasm_bindgen_222cd6dcc2029346___sys__Undefined_______true_: (a: number, b: number, c: any, d: any) => void;
233
245
  readonly __wbindgen_malloc: (a: number, b: number) => number;
234
246
  readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
235
247
  readonly __wbindgen_exn_store: (a: number) => void;
@@ -513,7 +513,26 @@ export function createDeltaChangeset(base_state, current_state) {
513
513
  * @returns {number}
514
514
  */
515
515
  export function getCurrentSchemaVersion() {
516
- return 4000000;
516
+ return 4000001;
517
+ }
518
+
519
+ /**
520
+ * @param {string} path
521
+ * @returns {string}
522
+ */
523
+ export function getOwningDucDirectory(path) {
524
+ let deferred2_0;
525
+ let deferred2_1;
526
+ try {
527
+ const ptr0 = passStringToWasm0(path, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
528
+ const len0 = WASM_VECTOR_LEN;
529
+ const ret = wasm.getOwningDucDirectory(ptr0, len0);
530
+ deferred2_0 = ret[0];
531
+ deferred2_1 = ret[1];
532
+ return getStringFromWasm0(ret[0], ret[1]);
533
+ } finally {
534
+ wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
535
+ }
517
536
  }
518
537
 
519
538
  /**
@@ -531,6 +550,44 @@ export function listVersions(duc_buf) {
531
550
  return takeFromExternrefTable0(ret[0]);
532
551
  }
533
552
 
553
+ /**
554
+ * @param {string} path
555
+ * @returns {string}
556
+ */
557
+ export function normalizeHostPath(path) {
558
+ let deferred2_0;
559
+ let deferred2_1;
560
+ try {
561
+ const ptr0 = passStringToWasm0(path, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
562
+ const len0 = WASM_VECTOR_LEN;
563
+ const ret = wasm.normalizeHostPath(ptr0, len0);
564
+ deferred2_0 = ret[0];
565
+ deferred2_1 = ret[1];
566
+ return getStringFromWasm0(ret[0], ret[1]);
567
+ } finally {
568
+ wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
569
+ }
570
+ }
571
+
572
+ /**
573
+ * @param {string} path
574
+ * @returns {string}
575
+ */
576
+ export function normalizePathSegments(path) {
577
+ let deferred2_0;
578
+ let deferred2_1;
579
+ try {
580
+ const ptr0 = passStringToWasm0(path, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
581
+ const len0 = WASM_VECTOR_LEN;
582
+ const ret = wasm.normalizePathSegments(ptr0, len0);
583
+ deferred2_0 = ret[0];
584
+ deferred2_1 = ret[1];
585
+ return getStringFromWasm0(ret[0], ret[1]);
586
+ } finally {
587
+ wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
588
+ }
589
+ }
590
+
534
591
  /**
535
592
  * Parse a `.duc` file (Uint8Array) into a JS object (ExportedDataState).
536
593
  * @param {Uint8Array} buf
@@ -561,6 +618,37 @@ export function readVersionGraph(duc_buf) {
561
618
  return takeFromExternrefTable0(ret[0]);
562
619
  }
563
620
 
621
+ /**
622
+ * @param {string} kind
623
+ * @param {string} path
624
+ * @param {string | null} [owner]
625
+ * @returns {string}
626
+ */
627
+ export function resolveLocatorPath(kind, path, owner) {
628
+ let deferred5_0;
629
+ let deferred5_1;
630
+ try {
631
+ const ptr0 = passStringToWasm0(kind, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
632
+ const len0 = WASM_VECTOR_LEN;
633
+ const ptr1 = passStringToWasm0(path, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
634
+ const len1 = WASM_VECTOR_LEN;
635
+ var ptr2 = isLikeNone(owner) ? 0 : passStringToWasm0(owner, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
636
+ var len2 = WASM_VECTOR_LEN;
637
+ const ret = wasm.resolveLocatorPath(ptr0, len0, ptr1, len1, ptr2, len2);
638
+ var ptr4 = ret[0];
639
+ var len4 = ret[1];
640
+ if (ret[3]) {
641
+ ptr4 = 0; len4 = 0;
642
+ throw takeFromExternrefTable0(ret[2]);
643
+ }
644
+ deferred5_0 = ptr4;
645
+ deferred5_1 = len4;
646
+ return getStringFromWasm0(ptr4, len4);
647
+ } finally {
648
+ wasm.__wbindgen_free(deferred5_0, deferred5_1, 1);
649
+ }
650
+ }
651
+
564
652
  /**
565
653
  * Restore a specific checkpoint by its ID from a `.duc` file buffer.
566
654
  * @param {Uint8Array} duc_buf
@@ -955,7 +1043,7 @@ function __wbg_get_imports() {
955
1043
  const a = state0.a;
956
1044
  state0.a = 0;
957
1045
  try {
958
- return wasm_bindgen_adb4849040331bf2___convert__closures_____invoke___js_sys_495b1fea2679fcbe___Function_fn_wasm_bindgen_adb4849040331bf2___JsValue_____wasm_bindgen_adb4849040331bf2___sys__Undefined___js_sys_495b1fea2679fcbe___Function_fn_wasm_bindgen_adb4849040331bf2___JsValue_____wasm_bindgen_adb4849040331bf2___sys__Undefined_______true_(a, state0.b, arg0, arg1);
1046
+ return wasm_bindgen_222cd6dcc2029346___convert__closures_____invoke___js_sys_7801c184e5cea5ad___Function_fn_wasm_bindgen_222cd6dcc2029346___JsValue_____wasm_bindgen_222cd6dcc2029346___sys__Undefined___js_sys_7801c184e5cea5ad___Function_fn_wasm_bindgen_222cd6dcc2029346___JsValue_____wasm_bindgen_222cd6dcc2029346___sys__Undefined_______true_(a, state0.b, arg0, arg1);
959
1047
  } finally {
960
1048
  state0.a = a;
961
1049
  }
@@ -1096,8 +1184,8 @@ function __wbg_get_imports() {
1096
1184
  return ret;
1097
1185
  }, arguments); },
1098
1186
  __wbindgen_cast_0000000000000001: function(arg0, arg1) {
1099
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 99, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
1100
- const ret = makeMutClosure(arg0, arg1, wasm_bindgen_adb4849040331bf2___convert__closures_____invoke___wasm_bindgen_adb4849040331bf2___JsValue__core_ed718c3d60ebd546___result__Result_____wasm_bindgen_adb4849040331bf2___JsError___true_);
1187
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 97, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
1188
+ const ret = makeMutClosure(arg0, arg1, wasm_bindgen_222cd6dcc2029346___convert__closures_____invoke___wasm_bindgen_222cd6dcc2029346___JsValue__core_37ee0ce0c4cd57d5___result__Result_____wasm_bindgen_222cd6dcc2029346___JsError___true_);
1101
1189
  return ret;
1102
1190
  },
1103
1191
  __wbindgen_cast_0000000000000002: function(arg0) {
@@ -1148,15 +1236,15 @@ function __wbg_get_imports() {
1148
1236
  };
1149
1237
  }
1150
1238
 
1151
- function wasm_bindgen_adb4849040331bf2___convert__closures_____invoke___wasm_bindgen_adb4849040331bf2___JsValue__core_ed718c3d60ebd546___result__Result_____wasm_bindgen_adb4849040331bf2___JsError___true_(arg0, arg1, arg2) {
1152
- const ret = wasm.wasm_bindgen_adb4849040331bf2___convert__closures_____invoke___wasm_bindgen_adb4849040331bf2___JsValue__core_ed718c3d60ebd546___result__Result_____wasm_bindgen_adb4849040331bf2___JsError___true_(arg0, arg1, arg2);
1239
+ function wasm_bindgen_222cd6dcc2029346___convert__closures_____invoke___wasm_bindgen_222cd6dcc2029346___JsValue__core_37ee0ce0c4cd57d5___result__Result_____wasm_bindgen_222cd6dcc2029346___JsError___true_(arg0, arg1, arg2) {
1240
+ const ret = wasm.wasm_bindgen_222cd6dcc2029346___convert__closures_____invoke___wasm_bindgen_222cd6dcc2029346___JsValue__core_37ee0ce0c4cd57d5___result__Result_____wasm_bindgen_222cd6dcc2029346___JsError___true_(arg0, arg1, arg2);
1153
1241
  if (ret[1]) {
1154
1242
  throw takeFromExternrefTable0(ret[0]);
1155
1243
  }
1156
1244
  }
1157
1245
 
1158
- function wasm_bindgen_adb4849040331bf2___convert__closures_____invoke___js_sys_495b1fea2679fcbe___Function_fn_wasm_bindgen_adb4849040331bf2___JsValue_____wasm_bindgen_adb4849040331bf2___sys__Undefined___js_sys_495b1fea2679fcbe___Function_fn_wasm_bindgen_adb4849040331bf2___JsValue_____wasm_bindgen_adb4849040331bf2___sys__Undefined_______true_(arg0, arg1, arg2, arg3) {
1159
- wasm.wasm_bindgen_adb4849040331bf2___convert__closures_____invoke___js_sys_495b1fea2679fcbe___Function_fn_wasm_bindgen_adb4849040331bf2___JsValue_____wasm_bindgen_adb4849040331bf2___sys__Undefined___js_sys_495b1fea2679fcbe___Function_fn_wasm_bindgen_adb4849040331bf2___JsValue_____wasm_bindgen_adb4849040331bf2___sys__Undefined_______true_(arg0, arg1, arg2, arg3);
1246
+ function wasm_bindgen_222cd6dcc2029346___convert__closures_____invoke___js_sys_7801c184e5cea5ad___Function_fn_wasm_bindgen_222cd6dcc2029346___JsValue_____wasm_bindgen_222cd6dcc2029346___sys__Undefined___js_sys_7801c184e5cea5ad___Function_fn_wasm_bindgen_222cd6dcc2029346___JsValue_____wasm_bindgen_222cd6dcc2029346___sys__Undefined_______true_(arg0, arg1, arg2, arg3) {
1247
+ wasm.wasm_bindgen_222cd6dcc2029346___convert__closures_____invoke___js_sys_7801c184e5cea5ad___Function_fn_wasm_bindgen_222cd6dcc2029346___JsValue_____wasm_bindgen_222cd6dcc2029346___sys__Undefined___js_sys_7801c184e5cea5ad___Function_fn_wasm_bindgen_222cd6dcc2029346___JsValue_____wasm_bindgen_222cd6dcc2029346___sys__Undefined_______true_(arg0, arg1, arg2, arg3);
1160
1248
  }
1161
1249
 
1162
1250
  const DucOpfsDocumentFinalization = (typeof FinalizationRegistry === 'undefined')
Binary file
@@ -46,6 +46,10 @@ export const restoreCheckpoint: (a: number, b: number, c: number, d: number) =>
46
46
  export const restoreVersion: (a: number, b: number, c: number) => [number, number, number];
47
47
  export const revertToVersion: (a: number, b: number, c: number) => [number, number, number];
48
48
  export const serializeDuc: (a: any) => [number, number, number, number];
49
+ export const getOwningDucDirectory: (a: number, b: number) => [number, number];
50
+ export const normalizeHostPath: (a: number, b: number) => [number, number];
51
+ export const normalizePathSegments: (a: number, b: number) => [number, number];
52
+ export const resolveLocatorPath: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number, number, number];
49
53
  export const rust_sqlite_wasm_abort: () => void;
50
54
  export const rust_sqlite_wasm_assert_fail: (a: number, b: number, c: number, d: number) => void;
51
55
  export const rust_sqlite_wasm_calloc: (a: number, b: number) => number;
@@ -56,8 +60,8 @@ export const rust_sqlite_wasm_localtime: (a: number) => number;
56
60
  export const rust_sqlite_wasm_realloc: (a: number, b: number) => number;
57
61
  export const sqlite3_os_end: () => number;
58
62
  export const sqlite3_os_init: () => number;
59
- export const wasm_bindgen_adb4849040331bf2___convert__closures_____invoke___wasm_bindgen_adb4849040331bf2___JsValue__core_ed718c3d60ebd546___result__Result_____wasm_bindgen_adb4849040331bf2___JsError___true_: (a: number, b: number, c: any) => [number, number];
60
- export const wasm_bindgen_adb4849040331bf2___convert__closures_____invoke___js_sys_495b1fea2679fcbe___Function_fn_wasm_bindgen_adb4849040331bf2___JsValue_____wasm_bindgen_adb4849040331bf2___sys__Undefined___js_sys_495b1fea2679fcbe___Function_fn_wasm_bindgen_adb4849040331bf2___JsValue_____wasm_bindgen_adb4849040331bf2___sys__Undefined_______true_: (a: number, b: number, c: any, d: any) => void;
63
+ export const wasm_bindgen_222cd6dcc2029346___convert__closures_____invoke___wasm_bindgen_222cd6dcc2029346___JsValue__core_37ee0ce0c4cd57d5___result__Result_____wasm_bindgen_222cd6dcc2029346___JsError___true_: (a: number, b: number, c: any) => [number, number];
64
+ export const wasm_bindgen_222cd6dcc2029346___convert__closures_____invoke___js_sys_7801c184e5cea5ad___Function_fn_wasm_bindgen_222cd6dcc2029346___JsValue_____wasm_bindgen_222cd6dcc2029346___sys__Undefined___js_sys_7801c184e5cea5ad___Function_fn_wasm_bindgen_222cd6dcc2029346___JsValue_____wasm_bindgen_222cd6dcc2029346___sys__Undefined_______true_: (a: number, b: number, c: any, d: any) => void;
61
65
  export const __wbindgen_malloc: (a: number, b: number) => number;
62
66
  export const __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
63
67
  export const __wbindgen_exn_store: (a: number) => void;
package/dist/index.d.ts CHANGED
@@ -2,9 +2,12 @@ export * from "./enums";
2
2
  export * from "./opfs";
3
3
  export * from "./opfs-import";
4
4
  export * from "./restore";
5
- export * from "./technical";
6
5
  export * from "./transform";
7
6
  export * from "./types";
8
7
  export * from "./utils";
8
+ export * from "./thumbnails/types";
9
+ export * from "./thumbnails/bounds";
10
+ export * from "./thumbnails/cameraPresets";
11
+ export * from "./thumbnails/lib";
9
12
  export * as vc from "./version-control";
10
13
  export { DucOpfsDocument, ensureWasm, getWasmBinary } from "./wasm";
package/dist/index.js CHANGED
@@ -2,9 +2,12 @@ export * from "./enums";
2
2
  export * from "./opfs";
3
3
  export * from "./opfs-import";
4
4
  export * from "./restore";
5
- export * from "./technical";
6
5
  export * from "./transform";
7
6
  export * from "./types";
8
7
  export * from "./utils";
8
+ export * from "./thumbnails/types";
9
+ export * from "./thumbnails/bounds";
10
+ export * from "./thumbnails/cameraPresets";
11
+ export * from "./thumbnails/lib";
9
12
  export * as vc from "./version-control";
10
13
  export { DucOpfsDocument, ensureWasm, getWasmBinary } from "./wasm";
@@ -0,0 +1,4 @@
1
+ export function normalizeHostPath(path: string): string;
2
+ export function normalizePathSegments(path: string): string;
3
+ export function getOwningDucDirectory(path: string): string;
4
+ export function resolveLocatorPath(kind: string, path: string, owner?: string): string;