@thatopen/services 0.3.15 → 0.3.16

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.
@@ -1,881 +1,1048 @@
1
- /* eslint-disable @typescript-eslint/no-explicit-any, @typescript-eslint/no-unused-vars */
2
- /**
3
- * Built-in component types and runtime stubs.
4
- * Auto-generated by platform_builtin-components/scripts/distribute-types.mjs
5
- */
6
-
7
- import type * as OBC from '@thatopen/components';
8
- import type * as THREE from 'three';
9
- import type { EngineServicesClient, Item, ItemFolder, ItemVersion, PlatformClient } from '../';
10
-
11
- export interface CDEContext {
12
- client: PlatformClient;
13
- projectId: string;
14
- }
15
- export interface CDEUserPermissions {
16
- canRead: boolean;
17
- canCreate: boolean;
18
- canUpdate: boolean;
19
- canDelete: boolean;
20
- canManage: boolean;
21
- }
22
- export type CDEMetadataValue = string | number | boolean | null;
23
- export interface CDENamingSegment {
24
- key: string;
25
- config?: {
26
- transform: (value: CDEMetadataValue) => string;
27
- };
28
- }
29
- export interface CDENamingSchema {
30
- separator: string;
31
- segments: CDENamingSegment[];
32
- }
33
- export interface CDEFile extends Omit<Item, 'creatingUser'> {
34
- createdBy: string;
35
- metadata: Record<string, CDEMetadataValue>;
36
- versions?: ItemVersion[];
37
- /** Tag of the file's current version (set by CDEManager from the loaded version). */
38
- versionTag?: string;
39
- }
40
- export interface CDEMetadataField {
41
- type: "string" | "number" | "boolean" | "list";
42
- description?: string;
43
- required?: boolean;
44
- label: string;
45
- icon?: string;
46
- options?: {
47
- value: string | number | boolean;
48
- label: string;
49
- }[];
50
- }
51
- export type CDEMetadataSchema = Record<string, CDEMetadataField>;
52
- export interface CDEFileActivity {
53
- user: string;
54
- action: string;
55
- timestamp: string;
56
- }
57
- export interface CDEFileHistoryEntry {
58
- fileId: string;
59
- activity: CDEFileActivity[];
60
- }
61
- export interface CDEMetadataView {
62
- id: string;
63
- name: string;
64
- fields: string[];
65
- }
66
- export type CDEPendingMetadata = Record<string, CDEMetadataValue>;
67
- export type CDEPendingMetadataSchemaEdits = Record<string, CDEMetadataField | null>;
68
- export type FolderPendingChange = {
69
- kind: "create";
70
- tempId: string;
71
- name: string;
72
- parentId: string | null;
73
- } | {
74
- kind: "rename";
75
- folderId: string;
76
- name: string;
77
- } | {
78
- kind: "archive";
79
- folderId: string;
80
- };
81
- export type FolderPendingChanges = FolderPendingChange[];
82
- export type CDEViewFileStatus = "loading" | "ready" | "failed" | "cancelled";
83
- export type CDEMachineState = {
84
- kind: "idle";
85
- } | {
86
- kind: "loading";
87
- } | {
88
- kind: "preparing";
89
- files: CDEFile[];
90
- } | {
91
- kind: "selected";
92
- files: CDEFile[];
93
- } | {
94
- kind: "viewing";
95
- files: CDEFile[];
96
- fileStatus: Record<string, CDEViewFileStatus>;
97
- selectedFiles?: CDEFile[];
98
- } | {
99
- kind: "editing";
100
- files: CDEFile[];
101
- pendingMetadata: CDEPendingMetadata;
102
- } | {
103
- kind: "saving";
104
- files: CDEFile[];
105
- pendingMetadata: CDEPendingMetadata;
106
- } | {
107
- kind: "deleting";
108
- files: CDEFile[];
109
- } | {
110
- kind: "configuringMetadataSchema";
111
- pendingEdits: CDEPendingMetadataSchemaEdits;
112
- } | {
113
- kind: "savingMetadataSchema";
114
- pendingEdits: CDEPendingMetadataSchemaEdits;
115
- } | {
116
- kind: "configuringMetadataViews";
117
- pendingViews: CDEMetadataView[];
118
- } | {
119
- kind: "savingMetadataViews";
120
- pendingViews: CDEMetadataView[];
121
- } | {
122
- kind: "dragging";
123
- files: CDEFile[];
124
- sourceFolderId: string | null;
125
- previousState: CDEMachineState;
126
- } | {
127
- kind: "movingFiles";
128
- files: CDEFile[];
129
- targetFolderId: string;
130
- } | {
131
- kind: "draggingFolder";
132
- folderId: string;
133
- parentFolderId: string | null;
134
- previousState: CDEMachineState;
135
- } | {
136
- kind: "movingFolder";
137
- folderId: string;
138
- targetFolderId: string | null;
139
- } | {
140
- kind: "editingFolders";
141
- pendingChanges: FolderPendingChanges;
142
- } | {
143
- kind: "savingFolderChanges";
144
- pendingChanges: FolderPendingChanges;
145
- } | {
146
- kind: "editingFiles";
147
- pendingEdits: Record<string, Record<string, CDEMetadataValue>>;
148
- pendingArchives: string[];
149
- pendingRenames: Record<string, string>;
150
- previousState: {
151
- kind: "idle";
152
- } | {
153
- kind: "selected";
154
- files: CDEFile[];
155
- };
156
- } | {
157
- kind: "savingFiles";
158
- pendingEdits: Record<string, Record<string, CDEMetadataValue>>;
159
- pendingArchives: string[];
160
- pendingRenames: Record<string, string>;
161
- previousState: {
162
- kind: "idle";
163
- } | {
164
- kind: "selected";
165
- files: CDEFile[];
166
- };
167
- } | {
168
- kind: "error";
169
- reason: string;
170
- previous: CDEMachineState;
171
- };
172
- export type CDEMachineEvent = {
173
- type: "LOAD";
174
- } | {
175
- type: "UPLOAD";
176
- } | {
177
- type: "DOWNLOAD";
178
- } | {
179
- type: "SELECT";
180
- files: CDEFile[];
181
- } | {
182
- type: "DESELECT";
183
- } | {
184
- type: "VIEW";
185
- } | {
186
- type: "ADD_TO_VIEW";
187
- file: CDEFile;
188
- } | {
189
- type: "REMOVE_FROM_VIEW";
190
- fileId: string;
191
- } | {
192
- type: "CLOSE_VIEW";
193
- } | {
194
- type: "SET_VIEW_FILE_STATUS";
195
- fileId: string;
196
- status: CDEViewFileStatus;
197
- } | {
198
- type: "START_EDIT";
199
- } | {
200
- type: "UPDATE_METADATA";
201
- key: string;
202
- value: CDEMetadataValue;
203
- } | {
204
- type: "SAVE";
205
- } | {
206
- type: "CANCEL_EDIT";
207
- } | {
208
- type: "ARCHIVE_FILE";
209
- } | {
210
- type: "START_CONFIGURE_METADATA_SCHEMA";
211
- } | {
212
- type: "ADD_METADATA_FIELD";
213
- } | {
214
- type: "UPDATE_METADATA_FIELD";
215
- key: string;
216
- value: CDEMetadataField;
217
- } | {
218
- type: "DELETE_METADATA_FIELD";
219
- key: string;
220
- } | {
221
- type: "RESTORE_METADATA_FIELD";
222
- key: string;
223
- } | {
224
- type: "SAVE_METADATA_SCHEMA";
225
- } | {
226
- type: "CANCEL_CONFIGURE_METADATA_SCHEMA";
227
- } | {
228
- type: "START_DRAG";
229
- files: CDEFile[];
230
- sourceFolderId: string | null;
231
- } | {
232
- type: "END_DRAG";
233
- } | {
234
- type: "DROP_FILES";
235
- targetFolderId: string | null;
236
- } | {
237
- type: "START_FOLDER_DRAG";
238
- folderId: string;
239
- parentFolderId: string | null;
240
- } | {
241
- type: "END_FOLDER_DRAG";
242
- } | {
243
- type: "DROP_FOLDER";
244
- targetFolderId: string | null;
245
- } | {
246
- type: "START_EDIT_FILES";
247
- } | {
248
- type: "UPDATE_FILE_METADATA";
249
- fileId: string;
250
- key: string;
251
- value: CDEMetadataValue;
252
- } | {
253
- type: "REVERT_FILE_METADATA";
254
- fileId: string;
255
- } | {
256
- type: "ARCHIVE_FILE_EDIT";
257
- fileId: string;
258
- } | {
259
- type: "UNARCHIVE_FILE_EDIT";
260
- fileId: string;
261
- } | {
262
- type: "RENAME_FILE";
263
- fileId: string;
264
- name: string;
265
- } | {
266
- type: "RENAME_FILE_IMMEDIATE";
267
- fileId: string;
268
- name: string;
269
- } | {
270
- type: "SAVE_FILE_EDITS";
271
- } | {
272
- type: "CANCEL_EDIT_FILES";
273
- } | {
274
- type: "START_EDIT_FOLDERS";
275
- } | {
276
- type: "ADD_FOLDER";
277
- tempId: string;
278
- name: string;
279
- parentId: string | null;
280
- } | {
281
- type: "RENAME_FOLDER";
282
- folderId: string;
283
- name: string;
284
- } | {
285
- type: "ARCHIVE_FOLDER";
286
- folderId: string;
287
- } | {
288
- type: "SAVE_FOLDER_CHANGES";
289
- } | {
290
- type: "CANCEL_FOLDER_CHANGES";
291
- } | {
292
- type: "RESET_FOLDER";
293
- folderId: string;
294
- } | {
295
- type: "START_CONFIGURE_METADATA_VIEWS";
296
- } | {
297
- type: "ADD_METADATA_VIEW";
298
- } | {
299
- type: "UPDATE_METADATA_VIEW";
300
- id: string;
301
- view: CDEMetadataView;
302
- } | {
303
- type: "DELETE_METADATA_VIEW";
304
- id: string;
305
- } | {
306
- type: "SAVE_METADATA_VIEWS";
307
- } | {
308
- type: "CANCEL_CONFIGURE_METADATA_VIEWS";
309
- } | {
310
- type: "SET_ACTIVE_METADATA_VIEW";
311
- id: string | null;
312
- } | {
313
- type: "SET_GROUPS_VIEW_MODE";
314
- mode: "groups" | "metadata";
315
- } | {
316
- type: "FAIL";
317
- reason: string;
318
- } | {
319
- type: "DISMISS";
320
- };
321
-
322
- declare class _CDEManager extends OBC.Component implements OBC.Transitionable<CDEMachineState, CDEMachineEvent> {
323
- static readonly uuid: "a3f82c1d-5b74-4e9a-bc30-d7e12f894a61";
324
- readonly onFilesChanged: OBC.Event<CDEFile[]>;
325
- readonly onFoldersChanged: OBC.Event<ItemFolder[]>;
326
- readonly onPermissionsChanged: OBC.Event<CDEUserPermissions>;
327
- readonly onSelectedGroupChanged: OBC.Event<string | null>;
328
- readonly onMachineStateChanged: OBC.Event<CDEMachineState>;
329
- readonly onMetadataViewsChanged: OBC.Event<CDEMetadataView[]>;
330
- readonly onGroupsViewModeChanged: OBC.Event<"groups" | "metadata">;
331
- readonly onMetadataGroupChanged: OBC.Event<Record<string, string> | null>;
332
- readonly onDownloadReady: OBC.Event<{
333
- blob: Blob;
334
- filename: string;
335
- }>;
336
- readonly onUploadCompleted: OBC.Event<{
337
- created: CDEFile[];
338
- versioned: CDEFile[];
339
- }>;
340
- readonly onFolderChangesCompleted: OBC.Event<{
341
- created: number;
342
- renamed: number;
343
- archived: number;
344
- }>;
345
- readonly onFilesMovedCompleted: OBC.Event<{
346
- files: CDEFile[];
347
- targetFolderName: string | null;
348
- }>;
349
- readonly onRenameCompleted: OBC.Event<{
350
- success: boolean;
351
- error?: string;
352
- }>;
353
- readonly onFolderMovedCompleted: OBC.Event<{
354
- folderName: string;
355
- targetFolderName: string | null;
356
- }>;
357
- readonly onShowArchivedChanged: OBC.Event<boolean>;
358
- readonly onRestoreCompleted: OBC.Event<{
359
- files?: CDEFile[];
360
- folder?: ItemFolder;
361
- }>;
362
- readonly onUploadStarted: OBC.Event<{
363
- count: number;
364
- }>;
365
- readonly onIfcConversionStarted: OBC.Event<{
366
- file: CDEFile;
367
- }>;
368
- readonly onIfcConversionProgress: OBC.Event<{
369
- file: CDEFile;
370
- progress: number;
371
- }>;
372
- readonly onIfcConversionCompleted: OBC.Event<{
373
- file: CDEFile;
374
- success: boolean;
375
- error?: string;
376
- }>;
377
- readonly conversionProgress: Map<string, number>;
378
- enabled: boolean;
379
- projectName: string;
380
- missingMetadataPlaceholder: string;
381
- availableColumns: Set<string>;
382
- visibleColumns: Set<string>;
383
- ctx?: CDEContext;
384
- private _machineState;
385
- private _activeUploads;
386
- private _showArchived;
387
- private _preArchivedViewMode;
388
- private _archivedFiles;
389
- private _archivedFolders;
390
- private _archivedLoaded;
391
- viewerGroups: {
392
- extensions: string[];
393
- multiple?: boolean;
394
- }[];
395
- get viewableExtensions(): Set<string>;
396
- private _files;
397
- private _folders;
398
- private _fileHistory;
399
- private _metadataSchema;
400
- private _metadataViews;
401
- private _activeMetadataViewId;
402
- private _groupsViewMode;
403
- private _selectedGroup;
404
- private _selectedMetadataGroup;
405
- private _namingSchema;
406
- cacheMaxBytes: number;
407
- cacheExtensions: Set<string>;
408
- private _fileCache;
409
- private _fileCacheBytes;
410
- private _dedup;
411
- private _cacheKey;
412
- private _isCacheable;
413
- private _addToCache;
414
- downloadFile(file: CDEFile): Promise<ArrayBuffer>;
415
- private _permissions;
416
- private _projectDataFolderId;
417
- private _appFolderIds;
418
- private _excludedFolderIds;
419
- private _projectMembers;
420
- get projectMembers(): {
421
- fullName: string;
422
- email: string;
423
- role: string;
424
- }[];
425
- get userPermissions(): CDEUserPermissions;
426
- query: string | null;
427
- get machineState(): CDEMachineState;
428
- get files(): CDEFile[];
429
- set files(value: CDEFile[]);
430
- get folders(): ItemFolder[];
431
- set folders(value: ItemFolder[]);
432
- get showArchived(): boolean;
433
- set showArchived(value: boolean);
434
- get fileHistory(): CDEFileHistoryEntry[];
435
- set fileHistory(value: CDEFileHistoryEntry[]);
436
- get metadataSchema(): CDEMetadataSchema;
437
- set metadataSchema(value: CDEMetadataSchema);
438
- get selectedGroup(): string | null;
439
- set selectedGroup(value: string | null);
440
- get metadataViews(): CDEMetadataView[];
441
- get activeMetadataViewId(): string | null;
442
- get activeMetadataView(): CDEMetadataView | null;
443
- get groupsViewMode(): "groups" | "metadata";
444
- get selectedMetadataGroup(): Record<string, string> | null;
445
- set selectedMetadataGroup(value: Record<string, string> | null);
446
- get visibleFiles(): CDEFile[];
447
- get namingSchema(): CDENamingSchema | null;
448
- constructor(components: OBC.Components);
449
- hasViewer(extension: string): boolean;
450
- private _groupOf;
451
- private _sameGroup;
452
- canView(files: CDEFile[]): boolean;
453
- canAddToView(files: CDEFile[]): boolean;
454
- setNamingSchema(schema: CDENamingSchema): void;
455
- buildFileName(file: CDEFile): string;
456
- getSelectedFiles(): CDEFile[];
457
- getActivity(fileId: string): CDEFileActivity[];
458
- updateFilesMetadata(fileIds: string[], updates: Record<string, string>): Promise<void>;
459
- readProjectData(app: string, filename: string): Promise<any>;
460
- writeProjectData(app: string, filename: string, data: unknown): Promise<string>;
461
- private _ensureProjectDataFolder;
462
- private _ensureAppFolder;
463
- private _loadPermissions;
464
- loadFolders(): Promise<void>;
465
- createFolder(name: string, parentId?: string): Promise<ItemFolder>;
466
- getUserId(): Promise<string | undefined>;
467
- loadUserConfig(): Promise<{
468
- visibleColumns?: string[];
469
- metadataViews?: CDEMetadataView[];
470
- } | null>;
471
- saveUserConfig(config: {
472
- visibleColumns?: string[];
473
- metadataViews?: CDEMetadataView[];
474
- }): Promise<string | undefined>;
475
- loadMetadataSchema(): Promise<void>;
476
- initMetadataViews(views: CDEMetadataView[], activeId: string | null): void;
477
- loadArchivedItems(): Promise<void>;
478
- restoreFiles(files: CDEFile[]): Promise<void>;
479
- restoreFolder(folderId: string): Promise<void>;
480
- detectConflicts(files: File[]): {
481
- file: File;
482
- existing: CDEFile;
483
- }[];
484
- checkMoveConflicts(files: CDEFile[], targetFolderId: string | null): {
485
- file: CDEFile;
486
- existing: CDEFile;
487
- }[];
488
- resolveViewFile(file: CDEFile): CDEFile;
489
- private _saveConversionIndex;
490
- private _loadConversionIndex;
491
- private _resumePendingConversions;
492
- /** Cached id of the IfcFragmenter component, resolved by name for this session. */
493
- private _ifcFragmenterId?;
494
- /**
495
- * Resolves the platform IFC→FRAG cloud component's id by its stable name
496
- * (`IfcFragmenter`) within the current project, so it works across dev/prod
497
- * without a hardcoded id. Cached for the session. Returns `undefined` if no
498
- * such component is available in the project.
499
- */
500
- private _resolveIfcFragmenterId;
501
- private _triggerIfcConversions;
502
- uploadFiles(files: File[], folderId?: string | null, options?: {
503
- forceNew?: boolean;
504
- }): Promise<void>;
505
- sendMachineEvent(event: CDEMachineEvent): void;
506
- private _transition;
507
- private _getAllArchivedIds;
508
- private _collectTempDescendants;
509
- private _saveFolderChanges;
510
- private _moveFolder;
511
- moveFiles(files: CDEFile[], targetFolderId: string | null): Promise<void>;
512
- private _moveFiles;
513
- private _resolveFullName;
514
- private _prepareDownload;
515
- private _saveMetadataSchema;
516
- private _resolveKeys;
517
- private _saveFileMetadata;
518
- private _renameFileImmediate;
519
- private _saveFileEdits;
520
- private _applyMetadataEdits;
521
- private _applyMetadataSchemaEdits;
522
- private _saveMetadataViews;
523
- private _archiveFiles;
524
- }
525
-
526
- export type CDEManager = InstanceType<typeof _CDEManager>;
527
- export const CDEManager = { uuid: 'a3f82c1d-5b74-4e9a-bc30-d7e12f894a61' } as typeof _CDEManager & { uuid: 'a3f82c1d-5b74-4e9a-bc30-d7e12f894a61' };
528
-
529
- export type ClashStatus = "new" | "active" | "resolved" | "acknowledged";
530
- export type ClashType = "hard" | "clearance";
531
- export interface ClashElement {
532
- guid: string;
533
- name: string;
534
- localId: number;
535
- modelId: string;
536
- }
537
- export interface ClashQueryFilter {
538
- categories?: string[];
539
- attributes?: {
540
- aggregation?: 'exclusive' | 'inclusive';
541
- queries: Array<{
542
- name: string;
543
- value?: string | string[] | number | boolean;
544
- type?: string;
545
- negate?: boolean;
546
- }>;
547
- };
548
- relation?: {
549
- name: string;
550
- query?: ClashQueryFilter;
551
- };
552
- }
553
- export interface ClashQuery {
554
- id: string;
555
- name: string;
556
- modelFileIds: string[];
557
- /** Filter conditions. Omit or leave empty to match all elements with geometry. */
558
- query?: ClashQueryFilter;
559
- }
560
- export interface ClashMatrix {
561
- id: string;
562
- name: string;
563
- /** Ordered list of query IDs — index order = priority (0 = most constrained). */
564
- queryIds: string[];
565
- /** Active cell job IDs (subset of upper-triangle pairs). */
566
- jobIds: string[];
567
- /** Active upper-triangle pair keys in the form "queryAId:queryBId". */
568
- activePairs: string[];
569
- /** Clash type applied to all jobs generated by this matrix. Defaults to 'hard'. */
570
- jobType?: ClashType;
571
- /** Clearance tolerance in metres. Only used when jobType is 'clearance'. */
572
- tolerance?: number;
573
- }
574
- export interface ClashJob {
575
- id: string;
576
- name: string;
577
- type: ClashType;
578
- queryAId: string;
579
- queryBId: string;
580
- matrixId?: string;
581
- /** Clearance tolerance in metres. Only present when type is 'clearance'. */
582
- tolerance?: number;
583
- }
584
- export interface ClashRun {
585
- id: string;
586
- jobId: string;
587
- date: string;
588
- clashCount: number;
589
- }
590
- interface ClashBase {
591
- /** Deterministic FNV-1a hash of the normalized pair (elementA.guid, elementB.guid). Stable across runs. */
592
- id: string;
593
- jobId: string;
594
- firstSeenRunId: string;
595
- lastSeenRunId: string;
596
- elementA: ClashElement;
597
- elementB: ClashElement;
598
- point: [number, number, number];
599
- status: ClashStatus;
600
- comments?: string;
601
- }
602
- export interface HardClash extends ClashBase {
603
- type: "hard";
604
- volume?: number;
605
- }
606
- export interface ClearanceClash extends ClashBase {
607
- type: "clearance";
608
- distance: number;
609
- }
610
- export type Clash = HardClash | ClearanceClash;
611
- export interface MarkerGroup {
612
- id?: string;
613
- point: [number, number, number];
614
- count: number;
615
- status?: ClashStatus;
616
- }
617
-
618
- declare class _ClashesManager extends OBC.Component {
619
- static readonly uuid: "2c9f4e8d-3a1b-4c5e-9d7f-0a2b6c8e1d3f";
620
- enabled: boolean;
621
- readonly onQueriesChanged: OBC.Event<ClashQuery[]>;
622
- readonly onMatricesChanged: OBC.Event<ClashMatrix[]>;
623
- readonly onJobsChanged: OBC.Event<ClashJob[]>;
624
- readonly onRunsChanged: OBC.Event<ClashRun[]>;
625
- readonly onClashesChanged: OBC.Event<Clash[]>;
626
- readonly onClashStatusChanged: OBC.Event<Clash[]>;
627
- /** Dispara cuando empieza el debounce de guardado (pendiente de persistir). */
628
- readonly onSaveStart: OBC.Event<void>;
629
- /** Dispara al terminar el guardado. true = éxito, false = error. */
630
- readonly onSaveComplete: OBC.Event<boolean>;
631
- world?: OBC.World;
632
- /** Suprimir auto-save durante carga de datos (usar loadingData = true antes, false después). */
633
- loadingData: boolean;
634
- /** Registrar desde la app host para recargar datos desde el storage al terminar una ejecución. */
635
- reload?: () => Promise<void>;
636
- /** Registrar desde la app host para consultar qué jobIds tienen ejecución activa en storage. */
637
- checkExecutions?: () => Promise<Set<string>>;
638
- /** Registrar desde la app host para persistir queries y matrices al storage del proyecto. */
639
- save?: () => Promise<void>;
640
- /** Jobs con una ejecución cloud activa. Poblado por la app host al arrancar. */
641
- readonly runningJobIds: Set<string>;
642
- /** Mapa jobId → executionId para reconectar al WebSocket. Poblado por la app host al arrancar. */
643
- readonly activeExecutions: Map<string, string>;
644
- readonly onRunningJobsChanged: OBC.Event<Set<string>>;
645
- readonly onRunProgress: OBC.Event<{
646
- message: string;
647
- progress: number;
648
- }>;
649
- readonly onRunComplete: OBC.Event<{
650
- runId: string;
651
- clashCount: number;
652
- }>;
653
- readonly onRunError: OBC.Event<{
654
- code?: string;
655
- message: string;
656
- }>;
657
- readonly onReloadingChanged: OBC.Event<boolean>;
658
- isReloading: boolean;
659
- /** True once init(client) has been called — safe to call run(). */
660
- get ready(): boolean;
661
- private _client?;
662
- private _projectId?;
663
- private _reconnectingJobIds;
664
- private _queries;
665
- private _matrices;
666
- private _saveTimer?;
667
- private _savePromise?;
668
- private _jobs;
669
- private _runs;
670
- private _clashes;
671
- private _markers;
672
- private static _geo;
673
- get queries(): ClashQuery[];
674
- set queries(value: ClashQuery[]);
675
- get matrices(): ClashMatrix[];
676
- set matrices(value: ClashMatrix[]);
677
- private _scheduleSave;
678
- private _doSave;
679
- /** Cancela el debounce pendiente y ejecuta el save inmediatamente. Espera a que complete. */
680
- flush(): Promise<void>;
681
- get jobs(): ClashJob[];
682
- set jobs(value: ClashJob[]);
683
- get runs(): ClashRun[];
684
- set runs(value: ClashRun[]);
685
- get clashes(): Clash[];
686
- set clashes(value: Clash[]);
687
- queryById(id: string): ClashQuery | undefined;
688
- private _clashStylesRegistered;
689
- private readonly STYLE_A;
690
- private readonly STYLE_B;
691
- private _clashStyle;
692
- highlightAllClashes(clashes: Clash[]): void;
693
- ghostClashes(clashes: Clash[]): Promise<void>;
694
- ghostClash(clash: Clash): Promise<void>;
695
- clearGhostClash(): Promise<void>;
696
- highlightClash(clash: Clash): void;
697
- clearClashHighlight(): void;
698
- showMarkers(groups: MarkerGroup[]): void;
699
- hideMarkers(): void;
700
- toViewerPoint(point: [number, number, number]): THREE.Vector3;
701
- private _toViewer;
702
- private _renderMarkers;
703
- private _clearMarkers;
704
- cluster(clashes: Clash[], threshold: number): Clash[][];
705
- private _setHighlighterEnabled;
706
- private _isolatedMaterials;
707
- runsForJob(jobId: string): ClashRun[];
708
- clashesForRun(runId: string): Clash[];
709
- updateClash(id: string, changes: {
710
- status?: ClashStatus;
711
- comments?: string;
712
- }): void;
713
- /**
714
- * Initializes the manager from cloud storage: loads clash data, wires save/reload,
715
- * reads in-flight executions, and resolves the viewer world (non-blocking).
716
- * Consumer apps call this once instead of wiring all the pieces manually.
717
- */
718
- init(client: PlatformClient): Promise<void>;
719
- /** Launches clash detection in a Web Worker. Fires onRunProgress/onRunComplete/onRunError. */
720
- run(jobId: string): void;
721
- private _handleWorkerComplete;
722
- /** Reconnects to an in-flight execution when the user opens a job that was running before page load. */
723
- reconnectIfRunning(jobId: string): void;
724
- private _listenToExecution;
725
- private _firstWorld;
726
- }
727
-
728
- export type ClashesManager = InstanceType<typeof _ClashesManager>;
729
- export const ClashesManager = { uuid: '2c9f4e8d-3a1b-4c5e-9d7f-0a2b6c8e1d3f' } as typeof _ClashesManager & { uuid: '2c9f4e8d-3a1b-4c5e-9d7f-0a2b6c8e1d3f' };
730
-
731
- /**
732
- * Which action buttons to expose per file row. All default to `true`.
733
- */
734
- export interface FileListActions {
735
- download?: boolean;
736
- rename?: boolean;
737
- delete?: boolean;
738
- }
739
- /**
740
- * Config passed to {@link FileList.create}.
741
- */
742
- export interface FileListConfig {
743
- /** Services client used to list and mutate files. */
744
- client: EngineServicesClient;
745
- /** Optional folder ID to scope the list. If omitted, lists root files. */
746
- folderId?: string;
747
- /** Which action buttons to show per row. Defaults to all enabled. */
748
- actions?: FileListActions;
749
- /** Called when a file row is clicked (not an action button). */
750
- onFileClick?: (file: Item) => void;
751
- }
752
- /**
753
- * The result returned by {@link FileList.create}.
754
- */
755
- export interface FileListInstance {
756
- /** The DOM element to mount somewhere in your layout. */
757
- element: HTMLElement;
758
- /** Reloads the list from the services client. */
759
- refresh: () => Promise<void>;
760
- /** Changes the folder scope and reloads. Pass `undefined` for the root. */
761
- setFolder: (folderId?: string) => Promise<void>;
762
- /** Removes the element and forgets the instance. */
763
- dispose: () => void;
764
- }
765
-
766
- /**
767
- * Built-in component that renders a file list backed by the services client,
768
- * with built-in download / rename / delete actions.
769
- *
770
- * The backing data comes from {@link EngineServicesClient.listFiles}, so the
771
- * list stays in sync with the storage service. Each call to {@link create}
772
- * returns an independent instance with its own DOM element.
773
- *
774
- * @example
775
- * ```ts
776
- * const fileList = components.get(FileList);
777
- * const { element, refresh } = fileList.create({
778
- * client: app.client,
779
- * folderId: someFolderId,
780
- * });
781
- * container.appendChild(element);
782
- * ```
783
- */
784
- declare class _FileList extends OBC.Component {
785
- static readonly uuid: "b0b5e2a2-0b3a-4a6b-8b1c-0b1c4a6b8b1c";
786
- enabled: boolean;
787
- readonly name = "FileList";
788
- private _instances;
789
- /**
790
- * Creates a new file-list instance. Returns the DOM element to mount plus a
791
- * `refresh` handle to reload the list, a `setFolder` to change scope, and a
792
- * `dispose` to remove it.
793
- */
794
- create(config: FileListConfig): FileListInstance;
795
- /**
796
- * Removes every instance this manager has created.
797
- */
798
- dispose(): void;
799
- }
800
-
801
- /**
802
- * Built-in component that renders a file list backed by the services client,
803
- * with built-in download / rename / delete actions.
804
- *
805
- * The backing data comes from {@link EngineServicesClient.listFiles}, so the
806
- * list stays in sync with the storage service. Each call to {@link create}
807
- * returns an independent instance with its own DOM element.
808
- *
809
- * @example
810
- * ```ts
811
- * const fileList = components.get(FileList);
812
- * const { element, refresh } = fileList.create({
813
- * client: app.client,
814
- * folderId: someFolderId,
815
- * });
816
- * container.appendChild(element);
817
- * ```
818
- */
819
- export type FileList = InstanceType<typeof _FileList>;
820
- /**
821
- * Built-in component that renders a file list backed by the services client,
822
- * with built-in download / rename / delete actions.
823
- *
824
- * The backing data comes from {@link EngineServicesClient.listFiles}, so the
825
- * list stays in sync with the storage service. Each call to {@link create}
826
- * returns an independent instance with its own DOM element.
827
- *
828
- * @example
829
- * ```ts
830
- * const fileList = components.get(FileList);
831
- * const { element, refresh } = fileList.create({
832
- * client: app.client,
833
- * folderId: someFolderId,
834
- * });
835
- * container.appendChild(element);
836
- * ```
837
- */
838
- export const FileList = { uuid: 'b0b5e2a2-0b3a-4a6b-8b1c-0b1c4a6b8b1c' } as typeof _FileList & { uuid: 'b0b5e2a2-0b3a-4a6b-8b1c-0b1c4a6b8b1c' };
839
-
840
- /**
841
- * A simple test component to validate the built-in component pipeline.
842
- * Replace this with real components once the infrastructure is verified.
843
- */
844
- declare class _HelloWorld extends OBC.Component {
845
- static readonly uuid: "2c4ae432-fc24-43e9-9783-0c960c674e96";
846
- enabled: boolean;
847
- readonly name = "HelloWorld";
848
- constructor(components: OBC.Components);
849
- /**
850
- * Returns a greeting message and logs it to the console.
851
- * @param who - The name to greet. Defaults to `"World"`.
852
- */
853
- greet(who?: string): string;
854
- }
855
- /**
856
- * PlatformComponents.import() expects a `main` variable in scope with
857
- * a `componentDefinition` property pointing to the OBC.Component class.
858
- * The IIFE build (name: 'main') assigns this to `var main = ...`.
859
- */
860
-
861
- /**
862
- * A simple test component to validate the built-in component pipeline.
863
- * Replace this with real components once the infrastructure is verified.
864
- */
865
- export type HelloWorld = InstanceType<typeof _HelloWorld>;
866
- /**
867
- * A simple test component to validate the built-in component pipeline.
868
- * Replace this with real components once the infrastructure is verified.
869
- */
870
- export const HelloWorld = { uuid: '2c4ae432-fc24-43e9-9783-0c960c674e96' } as typeof _HelloWorld & { uuid: '2c4ae432-fc24-43e9-9783-0c960c674e96' };
871
-
872
- declare class _UIManager extends OBC.Component {
873
- #private;
874
- static readonly uuid: "234f1416-528d-452a-9cc9-a16c5239b2eb";
875
- enabled: boolean;
876
- readonly name = "UIManager";
877
- init(): void;
878
- }
879
-
880
- export type UIManager = InstanceType<typeof _UIManager>;
881
- export const UIManager = { uuid: '234f1416-528d-452a-9cc9-a16c5239b2eb' } as typeof _UIManager & { uuid: '234f1416-528d-452a-9cc9-a16c5239b2eb' };
1
+ /* eslint-disable @typescript-eslint/no-explicit-any, @typescript-eslint/no-unused-vars */
2
+ /**
3
+ * Built-in component types and runtime stubs.
4
+ * Auto-generated by platform_builtin-components/scripts/distribute-types.mjs
5
+ */
6
+
7
+ import type * as OBC from '@thatopen/components';
8
+ import type * as THREE from 'three';
9
+ import type { EngineServicesClient, Item, ItemFolder, ItemVersion, PlatformClient } from '../';
10
+
11
+ export interface CDEContext {
12
+ client: PlatformClient;
13
+ projectId: string;
14
+ }
15
+ export interface CDEUserPermissions {
16
+ canRead: boolean;
17
+ canCreate: boolean;
18
+ canUpdate: boolean;
19
+ canDelete: boolean;
20
+ canManage: boolean;
21
+ }
22
+ export type CDEMetadataValue = string | number | boolean | null;
23
+ export interface CDENamingSegment {
24
+ key: string;
25
+ config?: {
26
+ transform: (value: CDEMetadataValue) => string;
27
+ };
28
+ }
29
+ export interface CDENamingSchema {
30
+ separator: string;
31
+ segments: CDENamingSegment[];
32
+ }
33
+ export interface CDEFile extends Omit<Item, 'creatingUser'> {
34
+ createdBy: string;
35
+ metadata: Record<string, CDEMetadataValue>;
36
+ versions?: ItemVersion[];
37
+ /** Tag of the file's current version (set by CDEManager from the loaded version). */
38
+ versionTag?: string;
39
+ }
40
+ export interface CDEMetadataField {
41
+ type: "string" | "number" | "boolean" | "list";
42
+ description?: string;
43
+ required?: boolean;
44
+ label: string;
45
+ icon?: string;
46
+ options?: {
47
+ value: string | number | boolean;
48
+ label: string;
49
+ }[];
50
+ }
51
+ export type CDEMetadataSchema = Record<string, CDEMetadataField>;
52
+ export interface CDEFileActivity {
53
+ user: string;
54
+ action: string;
55
+ timestamp: string;
56
+ }
57
+ export interface CDEFileHistoryEntry {
58
+ fileId: string;
59
+ activity: CDEFileActivity[];
60
+ }
61
+ export interface CDEMetadataView {
62
+ id: string;
63
+ name: string;
64
+ fields: string[];
65
+ }
66
+ export type CDEPendingMetadata = Record<string, CDEMetadataValue>;
67
+ export type CDEPendingMetadataSchemaEdits = Record<string, CDEMetadataField | null>;
68
+ export type FolderPendingChange = {
69
+ kind: "create";
70
+ tempId: string;
71
+ name: string;
72
+ parentId: string | null;
73
+ } | {
74
+ kind: "rename";
75
+ folderId: string;
76
+ name: string;
77
+ } | {
78
+ kind: "archive";
79
+ folderId: string;
80
+ };
81
+ export type FolderPendingChanges = FolderPendingChange[];
82
+ export type CDEViewFileStatus = "loading" | "ready" | "failed" | "cancelled";
83
+ export type CDEMachineState = {
84
+ kind: "idle";
85
+ } | {
86
+ kind: "loading";
87
+ } | {
88
+ kind: "preparing";
89
+ files: CDEFile[];
90
+ } | {
91
+ kind: "selected";
92
+ files: CDEFile[];
93
+ } | {
94
+ kind: "viewing";
95
+ files: CDEFile[];
96
+ fileStatus: Record<string, CDEViewFileStatus>;
97
+ selectedFiles?: CDEFile[];
98
+ } | {
99
+ kind: "editing";
100
+ files: CDEFile[];
101
+ pendingMetadata: CDEPendingMetadata;
102
+ } | {
103
+ kind: "saving";
104
+ files: CDEFile[];
105
+ pendingMetadata: CDEPendingMetadata;
106
+ } | {
107
+ kind: "deleting";
108
+ files: CDEFile[];
109
+ } | {
110
+ kind: "configuringMetadataSchema";
111
+ pendingEdits: CDEPendingMetadataSchemaEdits;
112
+ } | {
113
+ kind: "savingMetadataSchema";
114
+ pendingEdits: CDEPendingMetadataSchemaEdits;
115
+ } | {
116
+ kind: "configuringMetadataViews";
117
+ pendingViews: CDEMetadataView[];
118
+ } | {
119
+ kind: "savingMetadataViews";
120
+ pendingViews: CDEMetadataView[];
121
+ } | {
122
+ kind: "dragging";
123
+ files: CDEFile[];
124
+ sourceFolderId: string | null;
125
+ previousState: CDEMachineState;
126
+ } | {
127
+ kind: "movingFiles";
128
+ files: CDEFile[];
129
+ targetFolderId: string;
130
+ } | {
131
+ kind: "draggingFolder";
132
+ folderId: string;
133
+ parentFolderId: string | null;
134
+ previousState: CDEMachineState;
135
+ } | {
136
+ kind: "movingFolder";
137
+ folderId: string;
138
+ targetFolderId: string | null;
139
+ } | {
140
+ kind: "editingFolders";
141
+ pendingChanges: FolderPendingChanges;
142
+ } | {
143
+ kind: "savingFolderChanges";
144
+ pendingChanges: FolderPendingChanges;
145
+ } | {
146
+ kind: "editingFiles";
147
+ pendingEdits: Record<string, Record<string, CDEMetadataValue>>;
148
+ pendingArchives: string[];
149
+ pendingRenames: Record<string, string>;
150
+ previousState: {
151
+ kind: "idle";
152
+ } | {
153
+ kind: "selected";
154
+ files: CDEFile[];
155
+ };
156
+ } | {
157
+ kind: "savingFiles";
158
+ pendingEdits: Record<string, Record<string, CDEMetadataValue>>;
159
+ pendingArchives: string[];
160
+ pendingRenames: Record<string, string>;
161
+ previousState: {
162
+ kind: "idle";
163
+ } | {
164
+ kind: "selected";
165
+ files: CDEFile[];
166
+ };
167
+ } | {
168
+ kind: "error";
169
+ reason: string;
170
+ previous: CDEMachineState;
171
+ };
172
+ export type CDEMachineEvent = {
173
+ type: "LOAD";
174
+ } | {
175
+ type: "UPLOAD";
176
+ } | {
177
+ type: "DOWNLOAD";
178
+ } | {
179
+ type: "SELECT";
180
+ files: CDEFile[];
181
+ } | {
182
+ type: "DESELECT";
183
+ } | {
184
+ type: "VIEW";
185
+ } | {
186
+ type: "ADD_TO_VIEW";
187
+ file: CDEFile;
188
+ } | {
189
+ type: "REMOVE_FROM_VIEW";
190
+ fileId: string;
191
+ } | {
192
+ type: "CLOSE_VIEW";
193
+ } | {
194
+ type: "SET_VIEW_FILE_STATUS";
195
+ fileId: string;
196
+ status: CDEViewFileStatus;
197
+ } | {
198
+ type: "START_EDIT";
199
+ } | {
200
+ type: "UPDATE_METADATA";
201
+ key: string;
202
+ value: CDEMetadataValue;
203
+ } | {
204
+ type: "SAVE";
205
+ } | {
206
+ type: "CANCEL_EDIT";
207
+ } | {
208
+ type: "ARCHIVE_FILE";
209
+ } | {
210
+ type: "START_CONFIGURE_METADATA_SCHEMA";
211
+ } | {
212
+ type: "ADD_METADATA_FIELD";
213
+ } | {
214
+ type: "UPDATE_METADATA_FIELD";
215
+ key: string;
216
+ value: CDEMetadataField;
217
+ } | {
218
+ type: "DELETE_METADATA_FIELD";
219
+ key: string;
220
+ } | {
221
+ type: "RESTORE_METADATA_FIELD";
222
+ key: string;
223
+ } | {
224
+ type: "SAVE_METADATA_SCHEMA";
225
+ } | {
226
+ type: "CANCEL_CONFIGURE_METADATA_SCHEMA";
227
+ } | {
228
+ type: "START_DRAG";
229
+ files: CDEFile[];
230
+ sourceFolderId: string | null;
231
+ } | {
232
+ type: "END_DRAG";
233
+ } | {
234
+ type: "DROP_FILES";
235
+ targetFolderId: string | null;
236
+ } | {
237
+ type: "START_FOLDER_DRAG";
238
+ folderId: string;
239
+ parentFolderId: string | null;
240
+ } | {
241
+ type: "END_FOLDER_DRAG";
242
+ } | {
243
+ type: "DROP_FOLDER";
244
+ targetFolderId: string | null;
245
+ } | {
246
+ type: "START_EDIT_FILES";
247
+ } | {
248
+ type: "UPDATE_FILE_METADATA";
249
+ fileId: string;
250
+ key: string;
251
+ value: CDEMetadataValue;
252
+ } | {
253
+ type: "REVERT_FILE_METADATA";
254
+ fileId: string;
255
+ } | {
256
+ type: "ARCHIVE_FILE_EDIT";
257
+ fileId: string;
258
+ } | {
259
+ type: "UNARCHIVE_FILE_EDIT";
260
+ fileId: string;
261
+ } | {
262
+ type: "RENAME_FILE";
263
+ fileId: string;
264
+ name: string;
265
+ } | {
266
+ type: "RENAME_FILE_IMMEDIATE";
267
+ fileId: string;
268
+ name: string;
269
+ } | {
270
+ type: "SAVE_FILE_EDITS";
271
+ } | {
272
+ type: "CANCEL_EDIT_FILES";
273
+ } | {
274
+ type: "START_EDIT_FOLDERS";
275
+ } | {
276
+ type: "ADD_FOLDER";
277
+ tempId: string;
278
+ name: string;
279
+ parentId: string | null;
280
+ } | {
281
+ type: "RENAME_FOLDER";
282
+ folderId: string;
283
+ name: string;
284
+ } | {
285
+ type: "ARCHIVE_FOLDER";
286
+ folderId: string;
287
+ } | {
288
+ type: "SAVE_FOLDER_CHANGES";
289
+ } | {
290
+ type: "CANCEL_FOLDER_CHANGES";
291
+ } | {
292
+ type: "RESET_FOLDER";
293
+ folderId: string;
294
+ } | {
295
+ type: "START_CONFIGURE_METADATA_VIEWS";
296
+ } | {
297
+ type: "ADD_METADATA_VIEW";
298
+ } | {
299
+ type: "UPDATE_METADATA_VIEW";
300
+ id: string;
301
+ view: CDEMetadataView;
302
+ } | {
303
+ type: "DELETE_METADATA_VIEW";
304
+ id: string;
305
+ } | {
306
+ type: "SAVE_METADATA_VIEWS";
307
+ } | {
308
+ type: "CANCEL_CONFIGURE_METADATA_VIEWS";
309
+ } | {
310
+ type: "SET_ACTIVE_METADATA_VIEW";
311
+ id: string | null;
312
+ } | {
313
+ type: "SET_GROUPS_VIEW_MODE";
314
+ mode: "groups" | "metadata";
315
+ } | {
316
+ type: "FAIL";
317
+ reason: string;
318
+ } | {
319
+ type: "DISMISS";
320
+ };
321
+
322
+ declare class _CDEManager extends OBC.Component implements OBC.Transitionable<CDEMachineState, CDEMachineEvent> {
323
+ static readonly uuid: "a3f82c1d-5b74-4e9a-bc30-d7e12f894a61";
324
+ readonly onFilesChanged: OBC.Event<CDEFile[]>;
325
+ readonly onFoldersChanged: OBC.Event<ItemFolder[]>;
326
+ readonly onPermissionsChanged: OBC.Event<CDEUserPermissions>;
327
+ readonly onSelectedGroupChanged: OBC.Event<string | null>;
328
+ readonly onMachineStateChanged: OBC.Event<CDEMachineState>;
329
+ readonly onMetadataViewsChanged: OBC.Event<CDEMetadataView[]>;
330
+ readonly onGroupsViewModeChanged: OBC.Event<"groups" | "metadata">;
331
+ readonly onMetadataGroupChanged: OBC.Event<Record<string, string> | null>;
332
+ readonly onDownloadReady: OBC.Event<{
333
+ blob: Blob;
334
+ filename: string;
335
+ }>;
336
+ readonly onUploadCompleted: OBC.Event<{
337
+ created: CDEFile[];
338
+ versioned: CDEFile[];
339
+ }>;
340
+ readonly onFolderChangesCompleted: OBC.Event<{
341
+ created: number;
342
+ renamed: number;
343
+ archived: number;
344
+ }>;
345
+ readonly onFilesMovedCompleted: OBC.Event<{
346
+ files: CDEFile[];
347
+ targetFolderName: string | null;
348
+ }>;
349
+ readonly onRenameCompleted: OBC.Event<{
350
+ success: boolean;
351
+ error?: string;
352
+ }>;
353
+ readonly onFolderMovedCompleted: OBC.Event<{
354
+ folderName: string;
355
+ targetFolderName: string | null;
356
+ }>;
357
+ readonly onShowArchivedChanged: OBC.Event<boolean>;
358
+ readonly onRestoreCompleted: OBC.Event<{
359
+ files?: CDEFile[];
360
+ folder?: ItemFolder;
361
+ }>;
362
+ readonly onUploadStarted: OBC.Event<{
363
+ count: number;
364
+ }>;
365
+ readonly onIfcConversionStarted: OBC.Event<{
366
+ file: CDEFile;
367
+ }>;
368
+ readonly onIfcConversionProgress: OBC.Event<{
369
+ file: CDEFile;
370
+ progress: number;
371
+ }>;
372
+ readonly onIfcConversionCompleted: OBC.Event<{
373
+ file: CDEFile;
374
+ success: boolean;
375
+ error?: string;
376
+ }>;
377
+ /** Fires when `_derivedFileIds` finishes a (re)sync — consumers that filter
378
+ * or resolve by source↔derived link (e.g. `top-files-panel` hiding an
379
+ * already-linked `.frag` row) should reload on this, since it can complete
380
+ * after `onFilesChanged` already fired with the (still unsynced) list. */
381
+ readonly onDerivedFileIdsChanged: OBC.Event<Record<string, string>>;
382
+ readonly conversionProgress: Map<string, number>;
383
+ enabled: boolean;
384
+ projectName: string;
385
+ missingMetadataPlaceholder: string;
386
+ availableColumns: Set<string>;
387
+ visibleColumns: Set<string>;
388
+ ctx?: CDEContext;
389
+ private _machineState;
390
+ private _activeUploads;
391
+ private _showArchived;
392
+ private _preArchivedViewMode;
393
+ private _archivedFiles;
394
+ private _archivedFolders;
395
+ private _archivedLoaded;
396
+ viewerGroups: {
397
+ extensions: string[];
398
+ multiple?: boolean;
399
+ }[];
400
+ get viewableExtensions(): Set<string>;
401
+ private _files;
402
+ /** ifcFileId → its linked derivedFileId (FRAG today; other source formats
403
+ * once they get a converter too), read from each IFC's own version
404
+ * metadata. Kept as an in-memory cache — synced by `_syncDerivedFileIds`
405
+ * whenever `_files` is (re)set, or right after a conversion succeeds —
406
+ * rather than fetched live per call, so `resolveViewFile` can stay a plain
407
+ * synchronous lookup (same contract as before, no ripple into
408
+ * `sendMachineEvent`'s callers). */
409
+ private _derivedFileIds;
410
+ private _folders;
411
+ private _fileHistory;
412
+ private _metadataSchema;
413
+ private _metadataViews;
414
+ private _activeMetadataViewId;
415
+ private _groupsViewMode;
416
+ private _selectedGroup;
417
+ private _selectedMetadataGroup;
418
+ private _namingSchema;
419
+ cacheMaxBytes: number;
420
+ cacheExtensions: Set<string>;
421
+ private _fileCache;
422
+ private _fileCacheBytes;
423
+ private _dedup;
424
+ private _cacheKey;
425
+ private _isCacheable;
426
+ private _addToCache;
427
+ downloadFile(file: CDEFile): Promise<ArrayBuffer>;
428
+ private _permissions;
429
+ private _projectDataFolderId;
430
+ private _appFolderIds;
431
+ private _excludedFolderIds;
432
+ private _projectMembers;
433
+ get projectMembers(): {
434
+ fullName: string;
435
+ email: string;
436
+ role: string;
437
+ }[];
438
+ get userPermissions(): CDEUserPermissions;
439
+ query: string | null;
440
+ get machineState(): CDEMachineState;
441
+ get files(): CDEFile[];
442
+ set files(value: CDEFile[]);
443
+ /** ifcFileId → derivedFileId — see `_derivedFileIds`. */
444
+ get derivedFileIds(): Record<string, string>;
445
+ get folders(): ItemFolder[];
446
+ set folders(value: ItemFolder[]);
447
+ get showArchived(): boolean;
448
+ set showArchived(value: boolean);
449
+ get fileHistory(): CDEFileHistoryEntry[];
450
+ set fileHistory(value: CDEFileHistoryEntry[]);
451
+ get metadataSchema(): CDEMetadataSchema;
452
+ set metadataSchema(value: CDEMetadataSchema);
453
+ get selectedGroup(): string | null;
454
+ set selectedGroup(value: string | null);
455
+ get metadataViews(): CDEMetadataView[];
456
+ get activeMetadataViewId(): string | null;
457
+ get activeMetadataView(): CDEMetadataView | null;
458
+ get groupsViewMode(): "groups" | "metadata";
459
+ get selectedMetadataGroup(): Record<string, string> | null;
460
+ set selectedMetadataGroup(value: Record<string, string> | null);
461
+ get visibleFiles(): CDEFile[];
462
+ get namingSchema(): CDENamingSchema | null;
463
+ constructor(components: OBC.Components);
464
+ hasViewer(extension: string): boolean;
465
+ private _groupOf;
466
+ private _sameGroup;
467
+ canView(files: CDEFile[]): boolean;
468
+ canAddToView(files: CDEFile[]): boolean;
469
+ setNamingSchema(schema: CDENamingSchema): void;
470
+ buildFileName(file: CDEFile): string;
471
+ getSelectedFiles(): CDEFile[];
472
+ getActivity(fileId: string): CDEFileActivity[];
473
+ updateFilesMetadata(fileIds: string[], updates: Record<string, string>): Promise<void>;
474
+ readProjectData(app: string, filename: string): Promise<any>;
475
+ writeProjectData(app: string, filename: string, data: unknown): Promise<string>;
476
+ private _ensureProjectDataFolder;
477
+ private _ensureAppFolder;
478
+ private _loadPermissions;
479
+ loadFolders(): Promise<void>;
480
+ createFolder(name: string, parentId?: string): Promise<ItemFolder>;
481
+ getUserId(): Promise<string | undefined>;
482
+ loadUserConfig(): Promise<{
483
+ visibleColumns?: string[];
484
+ metadataViews?: CDEMetadataView[];
485
+ hideDerivedFiles?: boolean;
486
+ } | null>;
487
+ saveUserConfig(config: {
488
+ visibleColumns?: string[];
489
+ metadataViews?: CDEMetadataView[];
490
+ hideDerivedFiles?: boolean;
491
+ }): Promise<string | undefined>;
492
+ loadMetadataSchema(): Promise<void>;
493
+ initMetadataViews(views: CDEMetadataView[], activeId: string | null): void;
494
+ loadArchivedItems(): Promise<void>;
495
+ restoreFiles(files: CDEFile[]): Promise<void>;
496
+ restoreFolder(folderId: string): Promise<void>;
497
+ detectConflicts(files: File[]): {
498
+ file: File;
499
+ existing: CDEFile;
500
+ }[];
501
+ checkMoveConflicts(files: CDEFile[], targetFolderId: string | null): {
502
+ file: CDEFile;
503
+ existing: CDEFile;
504
+ }[];
505
+ /** Which file to actually load when the user views `file` — its linked FRAG
506
+ * if it has one, else the IFC itself. Reads `_derivedFileIds` (the IFC's
507
+ * own version metadata, kept in sync — see `_syncDerivedFileIds`), NOT a
508
+ * name+folder match anymore. Stays synchronous: `_derivedFileIds` is a
509
+ * pre-synced in-memory cache, so this is a plain lookup, keeping the
510
+ * contract every existing caller (`sendMachineEvent`'s `VIEW` case,
511
+ * `top-files-panel`'s "add to view" actions) already relies on. */
512
+ resolveViewFile(file: CDEFile): CDEFile;
513
+ /** Populates `_derivedFileIds` from every IFC's own version metadata — the
514
+ * source of truth for the IFC↔FRAG link (same mechanism as `models-list`'s
515
+ * `_syncDerivedFileIds`). Reads the unified `derivedFileId` key, falling
516
+ * back to the legacy `fragmentsFileId` key that `IfcFragmenter` still
517
+ * stamps until it's updated (see issue #3, Task 3). Called whenever
518
+ * `_files` is (re)set and right after a conversion succeeds — never
519
+ * cached indefinitely, so a reconversion or manual metadata edit is picked
520
+ * up on the next sync instead of going stale. */
521
+ private _syncDerivedFileIds;
522
+ private _saveConversionIndex;
523
+ private _loadConversionIndex;
524
+ private _resumePendingConversions;
525
+ /** Cached id of the IfcFragmenter component, resolved by name for this session. */
526
+ private _ifcFragmenterId?;
527
+ /**
528
+ * Resolves the platform IFC→FRAG cloud component's id by its stable name
529
+ * (`IfcFragmenter`) within the current project, so it works across dev/prod
530
+ * without a hardcoded id. Cached for the session. Returns `undefined` if no
531
+ * such component is available in the project.
532
+ */
533
+ private _resolveIfcFragmenterId;
534
+ private _triggerIfcConversions;
535
+ uploadFiles(files: File[], folderId?: string | null, options?: {
536
+ forceNew?: boolean;
537
+ }): Promise<void>;
538
+ sendMachineEvent(event: CDEMachineEvent): void;
539
+ private _transition;
540
+ private _getAllArchivedIds;
541
+ private _collectTempDescendants;
542
+ private _saveFolderChanges;
543
+ private _moveFolder;
544
+ moveFiles(files: CDEFile[], targetFolderId: string | null): Promise<void>;
545
+ private _moveFiles;
546
+ private _resolveFullName;
547
+ private _prepareDownload;
548
+ private _saveMetadataSchema;
549
+ private _resolveKeys;
550
+ private _saveFileMetadata;
551
+ private _renameFileImmediate;
552
+ private _saveFileEdits;
553
+ private _applyMetadataEdits;
554
+ private _applyMetadataSchemaEdits;
555
+ private _saveMetadataViews;
556
+ private _archiveFiles;
557
+ }
558
+
559
+ export type CDEManager = InstanceType<typeof _CDEManager>;
560
+ export const CDEManager = { uuid: 'a3f82c1d-5b74-4e9a-bc30-d7e12f894a61' } as typeof _CDEManager & { uuid: 'a3f82c1d-5b74-4e9a-bc30-d7e12f894a61' };
561
+
562
+ export type ClashStatus = "new" | "active" | "resolved" | "acknowledged";
563
+ export type ClashType = "hard" | "clearance";
564
+ export interface ClashElement {
565
+ guid: string;
566
+ name: string;
567
+ localId: number;
568
+ modelId: string;
569
+ }
570
+ export interface ClashQueryFilter {
571
+ categories?: string[];
572
+ attributes?: {
573
+ aggregation?: 'exclusive' | 'inclusive';
574
+ queries: Array<{
575
+ name: string;
576
+ value?: string | string[] | number | boolean;
577
+ type?: string;
578
+ negate?: boolean;
579
+ }>;
580
+ };
581
+ relation?: {
582
+ name: string;
583
+ query?: ClashQueryFilter;
584
+ };
585
+ }
586
+ export interface ClashQuery {
587
+ id: string;
588
+ name: string;
589
+ modelFileIds: string[];
590
+ /** Filter conditions. Omit or leave empty to match all elements with geometry. */
591
+ query?: ClashQueryFilter;
592
+ }
593
+ export interface ClashMatrix {
594
+ id: string;
595
+ name: string;
596
+ /** Ordered list of query IDs — index order = priority (0 = most constrained). */
597
+ queryIds: string[];
598
+ /** Active cell job IDs (subset of upper-triangle pairs). */
599
+ jobIds: string[];
600
+ /** Active upper-triangle pair keys in the form "queryAId:queryBId". */
601
+ activePairs: string[];
602
+ /** Clash type applied to all jobs generated by this matrix. Defaults to 'hard'. */
603
+ jobType?: ClashType;
604
+ /** Clearance tolerance in metres. Only used when jobType is 'clearance'. */
605
+ tolerance?: number;
606
+ }
607
+ export interface ClashJob {
608
+ id: string;
609
+ name: string;
610
+ type: ClashType;
611
+ queryAId: string;
612
+ queryBId: string;
613
+ matrixId?: string;
614
+ /** Clearance tolerance in metres. Only present when type is 'clearance'. */
615
+ tolerance?: number;
616
+ }
617
+ export interface ClashRun {
618
+ id: string;
619
+ jobId: string;
620
+ date: string;
621
+ clashCount: number;
622
+ }
623
+ interface ClashBase {
624
+ /** Deterministic FNV-1a hash of the normalized pair (elementA.guid, elementB.guid). Stable across runs. */
625
+ id: string;
626
+ jobId: string;
627
+ firstSeenRunId: string;
628
+ lastSeenRunId: string;
629
+ elementA: ClashElement;
630
+ elementB: ClashElement;
631
+ point: [number, number, number];
632
+ status: ClashStatus;
633
+ comments?: string;
634
+ }
635
+ export interface HardClash extends ClashBase {
636
+ type: "hard";
637
+ volume?: number;
638
+ }
639
+ export interface ClearanceClash extends ClashBase {
640
+ type: "clearance";
641
+ distance: number;
642
+ }
643
+ export type Clash = HardClash | ClearanceClash;
644
+ export interface MarkerGroup {
645
+ id?: string;
646
+ point: [number, number, number];
647
+ count: number;
648
+ status?: ClashStatus;
649
+ }
650
+
651
+ /** `clashes.frag`'s path relative to `__project_data/`, for consumers that
652
+ * persist it via `projectStorageContext` instead of talking to `client`
653
+ * directly (see `buildClashBuffer`). */
654
+ export declare const CLASH_DATA_PATH = "collider/clashes.frag";
655
+ export interface ExecutionEntry {
656
+ jobId: string;
657
+ executionId: string;
658
+ startedAt: string;
659
+ }
660
+ /** `cachedFileId`, when given, skips folder/file resolution (3 of the 4
661
+ * network round-trips this normally takes) — the file's ID never changes
662
+ * once created, so callers that already know it (see `ClashesManager`'s
663
+ * `_clashFragFileId`) should always pass it. */
664
+ export declare function ensureClashFragFileId(client: PlatformClient, projectId: string, cachedFileId?: string): Promise<string>;
665
+ export declare function getExecutions(client: PlatformClient, projectId: string | undefined): Promise<ExecutionEntry[]>;
666
+ export interface ClashData {
667
+ jobs: ClashJob[];
668
+ runs: ClashRun[];
669
+ clashes: Clash[];
670
+ queries: ClashQuery[];
671
+ matrices: ClashMatrix[];
672
+ /** Resolved once here — callers should cache and pass back into
673
+ * `loadClashData`/`buildClashBuffer` as `cachedFileId` to skip
674
+ * re-resolving it (see `ensureClashFragFileId`). */
675
+ fileId: string;
676
+ }
677
+ export declare function loadClashData(client: PlatformClient, projectId: string, cachedFileId?: string): Promise<ClashData>;
678
+ /**
679
+ * Diffs `data` against the persisted `clashes.frag` and builds the updated
680
+ * buffer, WITHOUT uploading it — callers decide how/where to persist the
681
+ * result (direct `client.updateFile`, via `projectStorageContext`, etc).
682
+ * Still reads the current file via `client` to diff against (job/id
683
+ * reconciliation needs the previous state), same as `saveClashData` always did.
684
+ */
685
+ export declare function buildClashBuffer(client: PlatformClient, projectId: string, data: {
686
+ queries: ClashQuery[];
687
+ matrices: ClashMatrix[];
688
+ jobs: ClashJob[];
689
+ clashes: Clash[];
690
+ }, onJobsReconciled: (toAdd: ClashJob[], toRemove: Set<string>) => void, cachedFileId?: string): Promise<{
691
+ blob: Blob;
692
+ fileId: string;
693
+ }>;
694
+ /** Default persistence path: builds the buffer and uploads it straight to
695
+ * `client`. Kept as the manager's out-of-the-box behavior for any consumer
696
+ * that never overrides `ClashesManager.save` (e.g. doesn't route through
697
+ * `projectStorageContext`). */
698
+ export declare function saveClashData(client: PlatformClient, projectId: string, data: {
699
+ queries: ClashQuery[];
700
+ matrices: ClashMatrix[];
701
+ jobs: ClashJob[];
702
+ clashes: Clash[];
703
+ }, onJobsReconciled: (toAdd: ClashJob[], toRemove: Set<string>) => void): Promise<void>;
704
+
705
+
706
+ declare class _ClashesManager extends OBC.Component {
707
+ static readonly uuid: "2c9f4e8d-3a1b-4c5e-9d7f-0a2b6c8e1d3f";
708
+ enabled: boolean;
709
+ readonly onQueriesChanged: OBC.Event<ClashQuery[]>;
710
+ readonly onMatricesChanged: OBC.Event<ClashMatrix[]>;
711
+ readonly onJobsChanged: OBC.Event<ClashJob[]>;
712
+ readonly onRunsChanged: OBC.Event<ClashRun[]>;
713
+ readonly onClashesChanged: OBC.Event<Clash[]>;
714
+ readonly onClashStatusChanged: OBC.Event<Clash[]>;
715
+ /** Dispara cuando empieza el debounce de guardado (pendiente de persistir). */
716
+ readonly onSaveStart: OBC.Event<void>;
717
+ /** Dispara al terminar el guardado. true = éxito, false = error. */
718
+ readonly onSaveComplete: OBC.Event<boolean>;
719
+ world?: OBC.World;
720
+ /** Suprimir auto-save durante carga de datos (usar loadingData = true antes, false después). */
721
+ loadingData: boolean;
722
+ /** Registrar desde la app host para recargar datos desde el storage al terminar una ejecución. */
723
+ reload?: () => Promise<void>;
724
+ /** Registrar desde la app host para consultar qué jobIds tienen ejecución activa en storage. */
725
+ checkExecutions?: () => Promise<Set<string>>;
726
+ /** Registrar desde la app host para persistir queries y matrices al storage del proyecto. */
727
+ save?: () => Promise<void>;
728
+ /** Jobs con una ejecución cloud activa. Poblado por la app host al arrancar. */
729
+ readonly runningJobIds: Set<string>;
730
+ /** Mapa jobId → executionId para reconectar al WebSocket. Poblado por la app host al arrancar. */
731
+ readonly activeExecutions: Map<string, string>;
732
+ readonly onRunningJobsChanged: OBC.Event<Set<string>>;
733
+ readonly onRunProgress: OBC.Event<{
734
+ message: string;
735
+ progress: number;
736
+ }>;
737
+ readonly onRunComplete: OBC.Event<{
738
+ runId: string;
739
+ clashCount: number;
740
+ }>;
741
+ readonly onRunError: OBC.Event<{
742
+ code?: string;
743
+ message: string;
744
+ }>;
745
+ readonly onReloadingChanged: OBC.Event<boolean>;
746
+ isReloading: boolean;
747
+ /** True once init(client) has been called — safe to call run(). */
748
+ get ready(): boolean;
749
+ private _client?;
750
+ private _projectId?;
751
+ /** `clashes.frag`'s file ID, resolved once by `init()`/`reload()`'s
752
+ * `loadClashData` call. Never changes once the file exists — passing it
753
+ * into `buildClashBuffer` skips 3 of its 4 network round-trips. */
754
+ private _clashFragFileId?;
755
+ private _reconnectingJobIds;
756
+ private _queries;
757
+ private _matrices;
758
+ private _saveTimer?;
759
+ private _savePromise?;
760
+ private _jobs;
761
+ private _runs;
762
+ private _clashes;
763
+ private _markers;
764
+ private static _geo;
765
+ get queries(): ClashQuery[];
766
+ set queries(value: ClashQuery[]);
767
+ get matrices(): ClashMatrix[];
768
+ set matrices(value: ClashMatrix[]);
769
+ private _scheduleSave;
770
+ /** Chains onto any save already in flight instead of firing a second,
771
+ * concurrent `_doSave()` — two overlapping calls would race on
772
+ * `buildClashBuffer`'s read-diff-reconcile cycle (real network I/O;
773
+ * `onJobsReconciled` mutating `this.jobs` from two stale reads at once)
774
+ * and on the upload itself. It also keeps `flush()` correct: it just
775
+ * awaits `_savePromise`, so if that got overwritten by a newer, unrelated
776
+ * save instead of chained, flush() could resolve while an earlier save
777
+ * was still genuinely in flight. */
778
+ private _queueSave;
779
+ private _doSave;
780
+ /** Cancela el debounce pendiente y ejecuta el save inmediatamente. Espera a que complete. */
781
+ flush(): Promise<void>;
782
+ /**
783
+ * Builds the current `clashes.frag` buffer (diffed/reconciled against what's
784
+ * persisted) WITHOUT uploading it. For consumers (e.g. `clashes-panel`) that
785
+ * override `save` to persist via `projectStorageContext` instead of the
786
+ * default direct-`client` path.
787
+ */
788
+ buildClashBuffer(): Promise<Blob>;
789
+ get jobs(): ClashJob[];
790
+ set jobs(value: ClashJob[]);
791
+ get runs(): ClashRun[];
792
+ set runs(value: ClashRun[]);
793
+ get clashes(): Clash[];
794
+ set clashes(value: Clash[]);
795
+ queryById(id: string): ClashQuery | undefined;
796
+ private _clashStylesRegistered;
797
+ /** Green — elementA's highlight color. Public so consumers (e.g. "create
798
+ * topic from clash") can build a matching BCF viewpoint `componentColors`
799
+ * entry without duplicating the hex value. */
800
+ readonly STYLE_A = "#22c55e";
801
+ /** Red — elementB's highlight color. Same reasoning as `STYLE_A`. */
802
+ readonly STYLE_B = "#ef4444";
803
+ private _clashStyle;
804
+ highlightAllClashes(clashes: Clash[]): void;
805
+ ghostClashes(clashes: Clash[]): Promise<void>;
806
+ ghostClash(clash: Clash): Promise<void>;
807
+ clearGhostClash(): Promise<void>;
808
+ highlightClash(clash: Clash): void;
809
+ clearClashHighlight(): void;
810
+ showMarkers(groups: MarkerGroup[]): void;
811
+ hideMarkers(): void;
812
+ toViewerPoint(point: [number, number, number]): THREE.Vector3;
813
+ private _toViewer;
814
+ private _renderMarkers;
815
+ private _clearMarkers;
816
+ cluster(clashes: Clash[], threshold: number): Clash[][];
817
+ private _setHighlighterEnabled;
818
+ private _isolatedMaterials;
819
+ runsForJob(jobId: string): ClashRun[];
820
+ clashesForRun(runId: string): Clash[];
821
+ updateClash(id: string, changes: {
822
+ status?: ClashStatus;
823
+ comments?: string;
824
+ }): void;
825
+ /**
826
+ * Initializes the manager from cloud storage: loads clash data, wires save/reload,
827
+ * reads in-flight executions, and resolves the viewer world (non-blocking).
828
+ * Consumer apps call this once instead of wiring all the pieces manually.
829
+ */
830
+ init(client: PlatformClient): Promise<void>;
831
+ /** Launches clash detection in a Web Worker. Fires onRunProgress/onRunComplete/onRunError. */
832
+ run(jobId: string): void;
833
+ private _handleWorkerComplete;
834
+ /** Reconnects to an in-flight execution when the user opens a job that was running before page load. */
835
+ reconnectIfRunning(jobId: string): void;
836
+ private _listenToExecution;
837
+ private _firstWorld;
838
+ }
839
+
840
+ export type ClashesManager = InstanceType<typeof _ClashesManager>;
841
+ export const ClashesManager = { uuid: '2c9f4e8d-3a1b-4c5e-9d7f-0a2b6c8e1d3f' } as typeof _ClashesManager & { uuid: '2c9f4e8d-3a1b-4c5e-9d7f-0a2b6c8e1d3f' };
842
+
843
+ /**
844
+ * Which action buttons to expose per file row. All default to `true`.
845
+ */
846
+ export interface FileListActions {
847
+ download?: boolean;
848
+ rename?: boolean;
849
+ delete?: boolean;
850
+ }
851
+ /**
852
+ * Config passed to {@link FileList.create}.
853
+ */
854
+ export interface FileListConfig {
855
+ /** Services client used to list and mutate files. */
856
+ client: EngineServicesClient;
857
+ /** Optional folder ID to scope the list. If omitted, lists root files. */
858
+ folderId?: string;
859
+ /** Which action buttons to show per row. Defaults to all enabled. */
860
+ actions?: FileListActions;
861
+ /** Called when a file row is clicked (not an action button). */
862
+ onFileClick?: (file: Item) => void;
863
+ }
864
+ /**
865
+ * The result returned by {@link FileList.create}.
866
+ */
867
+ export interface FileListInstance {
868
+ /** The DOM element to mount somewhere in your layout. */
869
+ element: HTMLElement;
870
+ /** Reloads the list from the services client. */
871
+ refresh: () => Promise<void>;
872
+ /** Changes the folder scope and reloads. Pass `undefined` for the root. */
873
+ setFolder: (folderId?: string) => Promise<void>;
874
+ /** Removes the element and forgets the instance. */
875
+ dispose: () => void;
876
+ }
877
+
878
+ /**
879
+ * Built-in component that renders a file list backed by the services client,
880
+ * with built-in download / rename / delete actions.
881
+ *
882
+ * The backing data comes from {@link EngineServicesClient.listFiles}, so the
883
+ * list stays in sync with the storage service. Each call to {@link create}
884
+ * returns an independent instance with its own DOM element.
885
+ *
886
+ * @example
887
+ * ```ts
888
+ * const fileList = components.get(FileList);
889
+ * const { element, refresh } = fileList.create({
890
+ * client: app.client,
891
+ * folderId: someFolderId,
892
+ * });
893
+ * container.appendChild(element);
894
+ * ```
895
+ */
896
+ declare class _FileList extends OBC.Component {
897
+ static readonly uuid: "b0b5e2a2-0b3a-4a6b-8b1c-0b1c4a6b8b1c";
898
+ enabled: boolean;
899
+ readonly name = "FileList";
900
+ private _instances;
901
+ /**
902
+ * Creates a new file-list instance. Returns the DOM element to mount plus a
903
+ * `refresh` handle to reload the list, a `setFolder` to change scope, and a
904
+ * `dispose` to remove it.
905
+ */
906
+ create(config: FileListConfig): FileListInstance;
907
+ /**
908
+ * Removes every instance this manager has created.
909
+ */
910
+ dispose(): void;
911
+ }
912
+
913
+ /**
914
+ * Built-in component that renders a file list backed by the services client,
915
+ * with built-in download / rename / delete actions.
916
+ *
917
+ * The backing data comes from {@link EngineServicesClient.listFiles}, so the
918
+ * list stays in sync with the storage service. Each call to {@link create}
919
+ * returns an independent instance with its own DOM element.
920
+ *
921
+ * @example
922
+ * ```ts
923
+ * const fileList = components.get(FileList);
924
+ * const { element, refresh } = fileList.create({
925
+ * client: app.client,
926
+ * folderId: someFolderId,
927
+ * });
928
+ * container.appendChild(element);
929
+ * ```
930
+ */
931
+ export type FileList = InstanceType<typeof _FileList>;
932
+ /**
933
+ * Built-in component that renders a file list backed by the services client,
934
+ * with built-in download / rename / delete actions.
935
+ *
936
+ * The backing data comes from {@link EngineServicesClient.listFiles}, so the
937
+ * list stays in sync with the storage service. Each call to {@link create}
938
+ * returns an independent instance with its own DOM element.
939
+ *
940
+ * @example
941
+ * ```ts
942
+ * const fileList = components.get(FileList);
943
+ * const { element, refresh } = fileList.create({
944
+ * client: app.client,
945
+ * folderId: someFolderId,
946
+ * });
947
+ * container.appendChild(element);
948
+ * ```
949
+ */
950
+ export const FileList = { uuid: 'b0b5e2a2-0b3a-4a6b-8b1c-0b1c4a6b8b1c' } as typeof _FileList & { uuid: 'b0b5e2a2-0b3a-4a6b-8b1c-0b1c4a6b8b1c' };
951
+
952
+ /**
953
+ * A simple test component to validate the built-in component pipeline.
954
+ * Replace this with real components once the infrastructure is verified.
955
+ */
956
+ declare class _HelloWorld extends OBC.Component {
957
+ static readonly uuid: "2c4ae432-fc24-43e9-9783-0c960c674e96";
958
+ enabled: boolean;
959
+ readonly name = "HelloWorld";
960
+ constructor(components: OBC.Components);
961
+ /**
962
+ * Returns a greeting message and logs it to the console.
963
+ * @param who - The name to greet. Defaults to `"World"`.
964
+ */
965
+ greet(who?: string): string;
966
+ }
967
+ /**
968
+ * PlatformComponents.import() expects a `main` variable in scope with
969
+ * a `componentDefinition` property pointing to the OBC.Component class.
970
+ * The IIFE build (name: 'main') assigns this to `var main = ...`.
971
+ */
972
+
973
+ /**
974
+ * A simple test component to validate the built-in component pipeline.
975
+ * Replace this with real components once the infrastructure is verified.
976
+ */
977
+ export type HelloWorld = InstanceType<typeof _HelloWorld>;
978
+ /**
979
+ * A simple test component to validate the built-in component pipeline.
980
+ * Replace this with real components once the infrastructure is verified.
981
+ */
982
+ export const HelloWorld = { uuid: '2c4ae432-fc24-43e9-9783-0c960c674e96' } as typeof _HelloWorld & { uuid: '2c4ae432-fc24-43e9-9783-0c960c674e96' };
983
+
984
+ /** `main.bcf`'s path relative to `__project_data/` — shared with
985
+ * `requestBcfSave` (`UIManager/src/utils/bcf-storage.ts`) so both sides of
986
+ * the save/load round-trip agree on where the file lives. */
987
+ export declare const BCF_DATA_PATH = "topics/main.bcf";
988
+ /** Downloads `__project_data/topics/main.bcf` and loads it into `BCFTopics`,
989
+ * if it already has content. A freshly-created file is empty (0 bytes) —
990
+ * not a valid BCF zip — so there's nothing to load yet in that case. */
991
+ export declare function loadBcfTopics(client: PlatformClient, projectId: string, components: OBC.Components): Promise<void>;
992
+
993
+
994
+ /**
995
+ * Wires up everything `top-topics-panel` (and `clashes-panel`'s "create
996
+ * topic from clash" feature) needs to work out of the box: `BCFTopics`
997
+ * configuration (version, author, assignable users — all from real project
998
+ * data), loading whatever BCF was previously saved for this project, and
999
+ * resolving `Viewpoints.world` — including backfilling it onto viewpoints
1000
+ * restored from a saved BCF before the 3D world existed yet (`top-viewer`
1001
+ * only creates its `World` once `top-app` finishes mounting, which is later
1002
+ * than `init()` typically runs).
1003
+ */
1004
+ declare class _TopicsManager extends OBC.Component {
1005
+ static readonly uuid: "69af63aa-19ba-4fc7-b17b-75647bac1d76";
1006
+ enabled: boolean;
1007
+ /**
1008
+ * Consumer apps call this once — same pattern as `ClashesManager.init(client)`
1009
+ * — instead of wiring `BCFTopics.setup()`, loading the saved BCF, and
1010
+ * backfilling viewpoint worlds by hand.
1011
+ */
1012
+ init(client: PlatformClient): Promise<void>;
1013
+ private _firstWorld;
1014
+ }
1015
+
1016
+ /**
1017
+ * Wires up everything `top-topics-panel` (and `clashes-panel`'s "create
1018
+ * topic from clash" feature) needs to work out of the box: `BCFTopics`
1019
+ * configuration (version, author, assignable users — all from real project
1020
+ * data), loading whatever BCF was previously saved for this project, and
1021
+ * resolving `Viewpoints.world` — including backfilling it onto viewpoints
1022
+ * restored from a saved BCF before the 3D world existed yet (`top-viewer`
1023
+ * only creates its `World` once `top-app` finishes mounting, which is later
1024
+ * than `init()` typically runs).
1025
+ */
1026
+ export type TopicsManager = InstanceType<typeof _TopicsManager>;
1027
+ /**
1028
+ * Wires up everything `top-topics-panel` (and `clashes-panel`'s "create
1029
+ * topic from clash" feature) needs to work out of the box: `BCFTopics`
1030
+ * configuration (version, author, assignable users — all from real project
1031
+ * data), loading whatever BCF was previously saved for this project, and
1032
+ * resolving `Viewpoints.world` — including backfilling it onto viewpoints
1033
+ * restored from a saved BCF before the 3D world existed yet (`top-viewer`
1034
+ * only creates its `World` once `top-app` finishes mounting, which is later
1035
+ * than `init()` typically runs).
1036
+ */
1037
+ export const TopicsManager = { uuid: '69af63aa-19ba-4fc7-b17b-75647bac1d76' } as typeof _TopicsManager & { uuid: '69af63aa-19ba-4fc7-b17b-75647bac1d76' };
1038
+
1039
+ declare class _UIManager extends OBC.Component {
1040
+ #private;
1041
+ static readonly uuid: "234f1416-528d-452a-9cc9-a16c5239b2eb";
1042
+ enabled: boolean;
1043
+ readonly name = "UIManager";
1044
+ init(): void;
1045
+ }
1046
+
1047
+ export type UIManager = InstanceType<typeof _UIManager>;
1048
+ export const UIManager = { uuid: '234f1416-528d-452a-9cc9-a16c5239b2eb' } as typeof _UIManager & { uuid: '234f1416-528d-452a-9cc9-a16c5239b2eb' };