viral-viewer-2 6.9.8 → 7.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/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { s as i, v as r, C as l, u as s, r as t, t as n, D as o, E as V, F as u, G as d, H as g, I as m, L as c, x as E, T as M, c as T, V as y, i as f, d as h, y as p, j as v, z as C, h as D, g as R, b, w as B, f as S, e as F, p as k, o as w, l as G, k as H, A as I, n as L, m as P, J as x, q as z } from "./index-B55mwbMr.mjs";
1
+ import { s as i, v as r, C as l, u as s, r as t, t as n, D as o, E as V, F as u, G as d, H as g, I as m, L as c, x as E, T as M, c as T, V as y, i as f, d as h, y as p, j as v, z as C, h as D, g as R, b, w as B, f as S, e as F, p as k, o as w, l as G, k as H, A as I, n as L, m as P, J as x, q as z } from "./index-D6VcfG2I.mjs";
2
2
  export {
3
3
  i as BufferElement,
4
4
  r as CheckClashResult,
package/dist/types.d.ts CHANGED
@@ -6,6 +6,11 @@ export interface ViewerOptions {
6
6
  enableNavigationCube: boolean;
7
7
  enableTools: boolean;
8
8
  enablePostProcessing?: boolean;
9
+ /**
10
+ * Optimize Edge rendering, Show/ Hide edges base on camera movement
11
+ */
12
+ adaptiveEdges?: boolean;
13
+ adaptiveAmbientOcclusion?: boolean;
9
14
  }
10
15
  export interface ViralViewerRevitProject {
11
16
  Materials: RenderMaterial[];
@@ -99,7 +104,8 @@ export declare enum ViralutionEvent {
99
104
  LOADED_CUBE = 4,
100
105
  LOADED_TOOLS = 5,
101
106
  LOADED_SEPERATE_MODEL = 6,
102
- GENERATED_MERGE_MODEL = 7
107
+ GENERATED_MERGE_MODEL = 7,
108
+ LOADED_DATA = 8
103
109
  }
104
110
  export declare class Dictionary<TKey, TValue> {
105
111
  private items;
@@ -199,30 +205,116 @@ export declare class TreeNode {
199
205
  children: Map<string, TreeNode>;
200
206
  keys: Set<number>;
201
207
  }
208
+ export interface SerializedTreeNode {
209
+ children: {
210
+ [char: string]: SerializedTreeNode;
211
+ };
212
+ keys: number[];
213
+ }
214
+ /**
215
+ * Optimized DataTree with flat key-value storage
216
+ * - Memory efficient: Uses flat Map instead of nested objects
217
+ * - Fast queries: O(1) element lookup, O(n) search
218
+ * - Lazy search index: Only builds trie when search is called
219
+ */
202
220
  export declare class DataTree {
203
- elementData: {
221
+ private _elementMap;
222
+ private _searchIndex;
223
+ private _searchIndexBuilt;
224
+ get elementData(): {
204
225
  [key: number]: {
205
226
  [key: string]: {
206
227
  [key: string]: string;
207
228
  };
208
229
  };
209
230
  }[];
210
- private root;
211
- constructor(elementData: {
231
+ constructor(elementData?: {
212
232
  [key: number]: {
213
233
  [key: string]: {
214
234
  [key: string]: string;
215
235
  };
216
236
  };
217
- }[], treeNode?: TreeNode);
218
- private buildSuffixTrie;
219
- private insert;
220
- search(query: string): number[];
237
+ }[], treeNode?: SerializedTreeNode);
238
+ /**
239
+ * Add elements to the data tree (batch operation)
240
+ * @param data Object with elementId as key
241
+ */
242
+ addElements(data: {
243
+ [key: number]: {
244
+ [key: string]: {
245
+ [key: string]: string;
246
+ };
247
+ };
248
+ }): void;
249
+ /**
250
+ * Get element data by ID - O(1) lookup
251
+ */
221
252
  getObjectByKey(key: number): {
222
253
  [key: string]: {
223
254
  [key: string]: string;
224
255
  };
225
256
  } | null;
257
+ /**
258
+ * Get all element IDs
259
+ */
260
+ getElementIds(): number[];
261
+ /**
262
+ * Get element count
263
+ */
264
+ get size(): number;
265
+ /**
266
+ * Get all elements with their data
267
+ * @returns Array of { elementId, data } objects
268
+ */
269
+ getAllElements(): {
270
+ elementId: number;
271
+ data: {
272
+ [key: string]: {
273
+ [key: string]: string;
274
+ };
275
+ };
276
+ }[];
277
+ /**
278
+ * Get all elements as a Map (more efficient for large datasets)
279
+ * @returns Map<elementId, elementData>
280
+ */
281
+ getAllElementsMap(): Map<number, {
282
+ [key: string]: {
283
+ [key: string]: string;
284
+ };
285
+ }>;
286
+ /**
287
+ * Iterate over all elements without creating intermediate arrays
288
+ * More memory efficient for large datasets
289
+ * @param callback Function to call for each element
290
+ */
291
+ forEachElement(callback: (elementId: number, data: {
292
+ [key: string]: {
293
+ [key: string]: string;
294
+ };
295
+ }) => void): void;
296
+ /**
297
+ * Search for elements containing the query string
298
+ * Builds search index lazily on first search
299
+ */
300
+ search(query: string): number[];
301
+ /**
302
+ * Build inverted index for search
303
+ * Maps: "search term" -> Set<elementId>
304
+ */
305
+ private _buildSearchIndex;
306
+ /**
307
+ * Rebuild search index from serialized worker result
308
+ */
309
+ private _rebuildSearchIndexFromSerialized;
310
+ /**
311
+ * Clear search index to free memory
312
+ */
313
+ clearSearchIndex(): void;
314
+ /**
315
+ * Dispose and clear all data
316
+ */
317
+ dispose(): void;
226
318
  }
227
319
  export declare class CompareModelsResult {
228
320
  deleted: number[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "viral-viewer-2",
3
- "version": "6.9.8",
3
+ "version": "7.0.0",
4
4
  "description": "",
5
5
  "main": "dist/index.mjs",
6
6
  "types": "dist/index.d.ts",