3dviewer-sdk 1.0.10 → 1.0.11
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.d.mts +4 -1
- package/dist/index.d.ts +523 -4
- package/dist/index.js +1249 -1
- package/dist/index.mjs +23 -2
- package/dist/viewer.d.ts +4 -1
- package/dist/viewer.js +15 -2
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -475,6 +475,7 @@ declare class LanguageModule {
|
|
|
475
475
|
set(language: LanguageCode): void;
|
|
476
476
|
}
|
|
477
477
|
|
|
478
|
+
type InitialToolbarVisibility = Partial<Record<ToolbarVisibilityTarget, boolean>>;
|
|
478
479
|
type Viewer3DOptions = {
|
|
479
480
|
container: HTMLElement | string;
|
|
480
481
|
url?: string;
|
|
@@ -482,6 +483,7 @@ type Viewer3DOptions = {
|
|
|
482
483
|
viewerPath?: string;
|
|
483
484
|
uploadPath?: string;
|
|
484
485
|
file?: File;
|
|
486
|
+
initialToolbarVisibility?: InitialToolbarVisibility;
|
|
485
487
|
width?: string;
|
|
486
488
|
height?: string;
|
|
487
489
|
sandbox?: string;
|
|
@@ -510,6 +512,7 @@ declare class Viewer3D {
|
|
|
510
512
|
open(url: string): void;
|
|
511
513
|
destroy(): void;
|
|
512
514
|
private ensureInit;
|
|
515
|
+
private withInitialOptions;
|
|
513
516
|
_on<K extends SdkEventKey>(event: K, cb: (payload: SdkEventPayload<K>) => void): () => void;
|
|
514
517
|
_off<K extends SdkEventKey>(event: K, cb: (payload: SdkEventPayload<K>) => void): void;
|
|
515
518
|
_emit<K extends SdkEventKey>(event: K, payload: SdkEventPayload<K>): void;
|
|
@@ -517,4 +520,4 @@ declare class Viewer3D {
|
|
|
517
520
|
private handleMessage;
|
|
518
521
|
}
|
|
519
522
|
|
|
520
|
-
export { type ConvertOptions, type ConvertV2Options, type FileInfoCheckInput, type FileInfoCheckPayloadItem, type FilesConfig, type LanguageCode, type LoadStage, type LoadStatePayload, type MarkupAction, type MarkupListItem, type MarkupOperationResultPayload, type PreparedViewerData, Viewer3D };
|
|
523
|
+
export { type ConvertOptions, type ConvertV2Options, type FileInfoCheckInput, type FileInfoCheckPayloadItem, type FilesConfig, type InitialToolbarVisibility, type LanguageCode, type LoadStage, type LoadStatePayload, type MarkupAction, type MarkupListItem, type MarkupOperationResultPayload, type PreparedViewerData, Viewer3D };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,523 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
declare enum ViewerMessageType {
|
|
2
|
+
LANGUAGE_CHANGE = "viewer-language-change",
|
|
3
|
+
ZOOM = "viewer-zoom",
|
|
4
|
+
DRAW_MODE = "viewer-draw-mode",
|
|
5
|
+
EXPLODE = "viewer-explode",
|
|
6
|
+
MARKUP_ACTION = "viewer-markup-action",
|
|
7
|
+
MARKUP_SAVE = "viewer-markup-save",
|
|
8
|
+
MARKUP_CANCEL = "viewer-markup-cancel",
|
|
9
|
+
MARKUP_GET_LIST = "viewer-markup-get-list",
|
|
10
|
+
MARKUP_SAVE_RESULT = "viewer-markup-save-result",
|
|
11
|
+
MARKUP_CANCEL_RESULT = "viewer-markup-cancel-result",
|
|
12
|
+
MARKUP_LIST = "viewer-markup-list",
|
|
13
|
+
HOME = "viewer-home",
|
|
14
|
+
PAN_TOGGLE = "viewer-pan-toggle",
|
|
15
|
+
SELECT = "viewer-select",
|
|
16
|
+
AREA_SELECT = "viewer-area-select",
|
|
17
|
+
ORBIT = "viewer-orbit",
|
|
18
|
+
ROTATE_Z = "viewer-rotate-z",
|
|
19
|
+
WALK_THROUGH = "viewer-walk-through",
|
|
20
|
+
ZOOM_WINDOW = "viewer-zoom-window",
|
|
21
|
+
ZOOM_FIT = "viewer-zoom-fit",
|
|
22
|
+
TOOLBAR_CONFIG = "viewer-toolbar-config",
|
|
23
|
+
TOOLBAR_VISIBILITY = "viewer-toolbar-visibility",
|
|
24
|
+
PANEL_OPEN = "viewer-panel-open",
|
|
25
|
+
PANEL_CLOSE = "viewer-panel-close",
|
|
26
|
+
CUTTING_PLANE_ACTION = "viewer-cutting-plane-action",
|
|
27
|
+
SHEETS_GET_LIST = "viewer-sheets-get-list",
|
|
28
|
+
SHEETS_LIST = "viewer-sheets-list",
|
|
29
|
+
SHEETS_APPLY = "viewer-sheets-apply",
|
|
30
|
+
TREE_SELECT_NODE = "viewer-tree-select-node",
|
|
31
|
+
TREE_GET_NODE_IDS = "viewer-tree-get-node-ids",
|
|
32
|
+
TREE_NODE_IDS = "viewer-tree-node-ids",
|
|
33
|
+
PDF_PLAN_MODE = "viewer-pdf-plan-mode",
|
|
34
|
+
PDF_DOCUMENT_MODE = "viewer-pdf-document-mode",
|
|
35
|
+
PDF_FIRST_PAGE = "viewer-pdf-first-page",
|
|
36
|
+
PDF_PREVIOUS_PAGE = "viewer-pdf-previous-page",
|
|
37
|
+
PDF_NEXT_PAGE = "viewer-pdf-next-page",
|
|
38
|
+
PDF_LAST_PAGE = "viewer-pdf-last-page",
|
|
39
|
+
PDF_CURRENT_PAGE = "viewer-pdf-current-page",
|
|
40
|
+
HOME_CLICK = "viewer-home-click",
|
|
41
|
+
NODE_SELECT = "viewer-node-select",
|
|
42
|
+
PAN_CHANGE = "viewer-pan-change"
|
|
43
|
+
}
|
|
44
|
+
type LanguageCode = "en" | "vn";
|
|
45
|
+
type ToolbarVisibilityTarget = "all" | "left" | "center" | "right";
|
|
46
|
+
type MarkupAction = "line" | "arrow" | "circle" | "ellipse" | "rectangle" | "polygon" | "polyline" | "textbox" | "note" | "callout" | "cloud" | "freehand";
|
|
47
|
+
type MarkupOperationResultPayload = {
|
|
48
|
+
requestId: string;
|
|
49
|
+
success: boolean;
|
|
50
|
+
timestamp: number;
|
|
51
|
+
error?: string;
|
|
52
|
+
};
|
|
53
|
+
type MarkupListItem = {
|
|
54
|
+
id: string;
|
|
55
|
+
viewId: string;
|
|
56
|
+
viewName?: string;
|
|
57
|
+
title: string;
|
|
58
|
+
type: string;
|
|
59
|
+
shapeName?: string;
|
|
60
|
+
createdDate?: string;
|
|
61
|
+
modifiedDate?: string;
|
|
62
|
+
createdBy?: string;
|
|
63
|
+
lastModifiedBy?: string;
|
|
64
|
+
};
|
|
65
|
+
type SheetListItem = {
|
|
66
|
+
id: string | number;
|
|
67
|
+
name: string;
|
|
68
|
+
is3D?: boolean;
|
|
69
|
+
viewId?: string;
|
|
70
|
+
};
|
|
71
|
+
type PdfModeEventPayload = {
|
|
72
|
+
mode: "plan" | "document";
|
|
73
|
+
timestamp: number;
|
|
74
|
+
};
|
|
75
|
+
type PdfToolbarActionEventPayload = {
|
|
76
|
+
timestamp: number;
|
|
77
|
+
};
|
|
78
|
+
type PdfCurrentPagePayload = {
|
|
79
|
+
pageIndex: number;
|
|
80
|
+
pageNumber: number;
|
|
81
|
+
timestamp: number;
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
type ViewerEventMap = {
|
|
85
|
+
"camera:home": {
|
|
86
|
+
timestamp: number;
|
|
87
|
+
};
|
|
88
|
+
"node:select": {
|
|
89
|
+
nodeId: string;
|
|
90
|
+
timestamp: number;
|
|
91
|
+
};
|
|
92
|
+
"interaction:pan-change": {
|
|
93
|
+
enabled: boolean;
|
|
94
|
+
};
|
|
95
|
+
"toolbar:pdf-plan-mode": PdfModeEventPayload;
|
|
96
|
+
"toolbar:pdf-document-mode": PdfModeEventPayload;
|
|
97
|
+
"toolbar:pdf-first-page": PdfToolbarActionEventPayload;
|
|
98
|
+
"toolbar:pdf-previous-page": PdfToolbarActionEventPayload;
|
|
99
|
+
"toolbar:pdf-next-page": PdfToolbarActionEventPayload;
|
|
100
|
+
"toolbar:pdf-last-page": PdfToolbarActionEventPayload;
|
|
101
|
+
"toolbar:pdf-current-page": PdfCurrentPagePayload;
|
|
102
|
+
"modelTree:node-ids": {
|
|
103
|
+
requestId: string;
|
|
104
|
+
nodeIds: string[];
|
|
105
|
+
timestamp: number;
|
|
106
|
+
};
|
|
107
|
+
"sheets:list": {
|
|
108
|
+
requestId: string;
|
|
109
|
+
sheets: {
|
|
110
|
+
id: string | number;
|
|
111
|
+
name: string;
|
|
112
|
+
is3D?: boolean;
|
|
113
|
+
viewId?: string;
|
|
114
|
+
}[];
|
|
115
|
+
activeSheetId?: string | number | null;
|
|
116
|
+
timestamp: number;
|
|
117
|
+
};
|
|
118
|
+
"markup:list": {
|
|
119
|
+
requestId: string;
|
|
120
|
+
markups: MarkupListItem[];
|
|
121
|
+
timestamp: number;
|
|
122
|
+
};
|
|
123
|
+
"markup:save": MarkupOperationResultPayload;
|
|
124
|
+
"markup:cancel": MarkupOperationResultPayload;
|
|
125
|
+
};
|
|
126
|
+
type LoadStage = "idle" | "uploading" | "converting" | "rendering" | "completed" | "error";
|
|
127
|
+
type LoadStatePayload = {
|
|
128
|
+
isLoading: boolean;
|
|
129
|
+
stage: LoadStage;
|
|
130
|
+
message?: string;
|
|
131
|
+
elapsedMs?: number;
|
|
132
|
+
};
|
|
133
|
+
type PreparedViewerData = {
|
|
134
|
+
baseFileId: string;
|
|
135
|
+
baseMajorRev: number;
|
|
136
|
+
baseMinorRev: number;
|
|
137
|
+
fileName: string;
|
|
138
|
+
query: string;
|
|
139
|
+
url: string;
|
|
140
|
+
};
|
|
141
|
+
type FilesEventMap = {
|
|
142
|
+
"files:state": LoadStatePayload;
|
|
143
|
+
"files:upload:start": {
|
|
144
|
+
fileName: string;
|
|
145
|
+
};
|
|
146
|
+
"files:upload:success": {
|
|
147
|
+
fileName: string;
|
|
148
|
+
baseFileId: string;
|
|
149
|
+
};
|
|
150
|
+
"files:upload:error": {
|
|
151
|
+
fileName: string;
|
|
152
|
+
error: string;
|
|
153
|
+
};
|
|
154
|
+
"files:conversion:start": {
|
|
155
|
+
fileName: string;
|
|
156
|
+
};
|
|
157
|
+
"files:conversion:success": PreparedViewerData;
|
|
158
|
+
"files:conversion:error": {
|
|
159
|
+
fileName: string;
|
|
160
|
+
error: string;
|
|
161
|
+
};
|
|
162
|
+
"files:render:start": {
|
|
163
|
+
url: string;
|
|
164
|
+
};
|
|
165
|
+
"files:render:success": {
|
|
166
|
+
url: string;
|
|
167
|
+
};
|
|
168
|
+
"files:render:error": {
|
|
169
|
+
url?: string;
|
|
170
|
+
error: string;
|
|
171
|
+
};
|
|
172
|
+
"files:load:success": PreparedViewerData;
|
|
173
|
+
"files:load:error": {
|
|
174
|
+
error: string;
|
|
175
|
+
};
|
|
176
|
+
};
|
|
177
|
+
type SdkEventMap = ViewerEventMap & FilesEventMap;
|
|
178
|
+
type SdkEventKey = keyof SdkEventMap;
|
|
179
|
+
type SdkEventPayload<K extends SdkEventKey> = SdkEventMap[K];
|
|
180
|
+
|
|
181
|
+
declare class CameraModule {
|
|
182
|
+
private viewer;
|
|
183
|
+
on: {
|
|
184
|
+
home: (cb: (payload: {
|
|
185
|
+
timestamp: number;
|
|
186
|
+
}) => void) => () => void;
|
|
187
|
+
};
|
|
188
|
+
constructor(viewer: Viewer3D);
|
|
189
|
+
zoomIn(percent: number): void;
|
|
190
|
+
zoomOut(percent: number): void;
|
|
191
|
+
home(): void;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
declare class InteractionModule {
|
|
195
|
+
private viewer;
|
|
196
|
+
on: {
|
|
197
|
+
panChange: (cb: (payload: {
|
|
198
|
+
enabled: boolean;
|
|
199
|
+
}) => void) => () => void;
|
|
200
|
+
};
|
|
201
|
+
constructor(viewer: Viewer3D);
|
|
202
|
+
enablePan(): void;
|
|
203
|
+
disablePan(): void;
|
|
204
|
+
select(): void;
|
|
205
|
+
areaSelect(): void;
|
|
206
|
+
orbit(): void;
|
|
207
|
+
rotateZ(): void;
|
|
208
|
+
walkThrough(): void;
|
|
209
|
+
zoomWindow(): void;
|
|
210
|
+
zoomFit(): void;
|
|
211
|
+
drawModeShaded(): void;
|
|
212
|
+
drawModeWireframe(): void;
|
|
213
|
+
drawModeHiddenLine(): void;
|
|
214
|
+
drawModeShadedWire(): void;
|
|
215
|
+
drawModeXRay(): void;
|
|
216
|
+
drawModeGhosting(): void;
|
|
217
|
+
explode(magnitude: number): void;
|
|
218
|
+
explodeOff(): void;
|
|
219
|
+
private setDrawMode;
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
declare class NodeModule {
|
|
223
|
+
private viewer;
|
|
224
|
+
on: {
|
|
225
|
+
select: (cb: (payload: {
|
|
226
|
+
nodeId: string;
|
|
227
|
+
timestamp: number;
|
|
228
|
+
}) => void) => () => void;
|
|
229
|
+
};
|
|
230
|
+
constructor(viewer: Viewer3D);
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
type FilesConfig = {
|
|
234
|
+
baseUrl?: string;
|
|
235
|
+
viewerPath?: string;
|
|
236
|
+
uploadPath?: string;
|
|
237
|
+
};
|
|
238
|
+
type ConvertOptions = {
|
|
239
|
+
downloadUrl?: string;
|
|
240
|
+
};
|
|
241
|
+
type ConvertV2Options = {
|
|
242
|
+
filename: string;
|
|
243
|
+
originalFilePath: string;
|
|
244
|
+
downloadUrl: string;
|
|
245
|
+
baseFileId: string;
|
|
246
|
+
baseMajorRev?: number;
|
|
247
|
+
baseMinorRev?: number;
|
|
248
|
+
overwrite?: boolean;
|
|
249
|
+
project?: string;
|
|
250
|
+
convertOptions?: Partial<StreamConvertOptions>;
|
|
251
|
+
};
|
|
252
|
+
type FileInfoCheckInput = string | string[];
|
|
253
|
+
type FileInfoCheckPayloadItem = {
|
|
254
|
+
baseFileId: string;
|
|
255
|
+
};
|
|
256
|
+
type StreamConvertOptions = {
|
|
257
|
+
convert3DModel: number;
|
|
258
|
+
convert2DSheet: number;
|
|
259
|
+
extractProperties: number;
|
|
260
|
+
childModels: number;
|
|
261
|
+
};
|
|
262
|
+
declare class FilesModule {
|
|
263
|
+
private viewer;
|
|
264
|
+
on: {
|
|
265
|
+
state: (cb: (payload: LoadStatePayload) => void) => () => void;
|
|
266
|
+
uploadStart: (cb: (payload: {
|
|
267
|
+
fileName: string;
|
|
268
|
+
}) => void) => () => void;
|
|
269
|
+
uploadSuccess: (cb: (payload: {
|
|
270
|
+
fileName: string;
|
|
271
|
+
baseFileId: string;
|
|
272
|
+
}) => void) => () => void;
|
|
273
|
+
uploadError: (cb: (payload: {
|
|
274
|
+
fileName: string;
|
|
275
|
+
error: string;
|
|
276
|
+
}) => void) => () => void;
|
|
277
|
+
conversionStart: (cb: (payload: {
|
|
278
|
+
fileName: string;
|
|
279
|
+
}) => void) => () => void;
|
|
280
|
+
conversionSuccess: (cb: (payload: PreparedViewerData) => void) => () => void;
|
|
281
|
+
conversionError: (cb: (payload: {
|
|
282
|
+
fileName: string;
|
|
283
|
+
error: string;
|
|
284
|
+
}) => void) => () => void;
|
|
285
|
+
renderStart: (cb: (payload: {
|
|
286
|
+
url: string;
|
|
287
|
+
}) => void) => () => void;
|
|
288
|
+
renderSuccess: (cb: (payload: {
|
|
289
|
+
url: string;
|
|
290
|
+
}) => void) => () => void;
|
|
291
|
+
renderError: (cb: (payload: {
|
|
292
|
+
url?: string;
|
|
293
|
+
error: string;
|
|
294
|
+
}) => void) => () => void;
|
|
295
|
+
loadSuccess: (cb: (payload: PreparedViewerData) => void) => () => void;
|
|
296
|
+
loadError: (cb: (payload: {
|
|
297
|
+
error: string;
|
|
298
|
+
}) => void) => () => void;
|
|
299
|
+
};
|
|
300
|
+
private config;
|
|
301
|
+
private operationStartTime;
|
|
302
|
+
private state;
|
|
303
|
+
private lastUploadSession;
|
|
304
|
+
constructor(viewer: Viewer3D);
|
|
305
|
+
setConfig(next: FilesConfig): void;
|
|
306
|
+
getState(): LoadStatePayload;
|
|
307
|
+
upload(file?: File): Promise<{
|
|
308
|
+
fileName: string;
|
|
309
|
+
baseFileId: string;
|
|
310
|
+
}>;
|
|
311
|
+
convert(file?: File, options?: ConvertOptions): Promise<PreparedViewerData>;
|
|
312
|
+
prepare(file?: File, options?: ConvertOptions): Promise<PreparedViewerData>;
|
|
313
|
+
convertV2(options: ConvertV2Options): Promise<PreparedViewerData>;
|
|
314
|
+
checkFileInfo(baseFileIds: FileInfoCheckInput): Promise<unknown>;
|
|
315
|
+
open(input: PreparedViewerData | {
|
|
316
|
+
url: string;
|
|
317
|
+
}): void;
|
|
318
|
+
render(file?: File, options?: ConvertOptions): Promise<PreparedViewerData>;
|
|
319
|
+
private resolveFile;
|
|
320
|
+
private normalizeBaseUrl;
|
|
321
|
+
private resolveBaseUrl;
|
|
322
|
+
private resolveViewerPath;
|
|
323
|
+
private resolveViewerOrigin;
|
|
324
|
+
private resolveHostConversion;
|
|
325
|
+
private getUploadPath;
|
|
326
|
+
private fileSignature;
|
|
327
|
+
private createBaseFileId;
|
|
328
|
+
private createUploadSession;
|
|
329
|
+
private getUploadSessionForFile;
|
|
330
|
+
private uploadInternal;
|
|
331
|
+
private buildCachePayload;
|
|
332
|
+
private buildConvertV2Payload;
|
|
333
|
+
private buildFileInfoPayload;
|
|
334
|
+
private cacheFile;
|
|
335
|
+
private cacheFileV2;
|
|
336
|
+
private convertInternal;
|
|
337
|
+
private convertV2Internal;
|
|
338
|
+
private updateState;
|
|
339
|
+
private withOperation;
|
|
340
|
+
private toErrorMessage;
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
type GetSheetsOptions = {
|
|
344
|
+
timeoutMs?: number;
|
|
345
|
+
};
|
|
346
|
+
declare class ToolbarModule {
|
|
347
|
+
private viewer;
|
|
348
|
+
on: {
|
|
349
|
+
planMode: (cb: (payload: {
|
|
350
|
+
mode: "plan" | "document";
|
|
351
|
+
timestamp: number;
|
|
352
|
+
}) => void) => () => void;
|
|
353
|
+
documentMode: (cb: (payload: {
|
|
354
|
+
mode: "plan" | "document";
|
|
355
|
+
timestamp: number;
|
|
356
|
+
}) => void) => () => void;
|
|
357
|
+
firstPage: (cb: (payload: {
|
|
358
|
+
timestamp: number;
|
|
359
|
+
}) => void) => () => void;
|
|
360
|
+
previousPage: (cb: (payload: {
|
|
361
|
+
timestamp: number;
|
|
362
|
+
}) => void) => () => void;
|
|
363
|
+
nextPage: (cb: (payload: {
|
|
364
|
+
timestamp: number;
|
|
365
|
+
}) => void) => () => void;
|
|
366
|
+
lastPage: (cb: (payload: {
|
|
367
|
+
timestamp: number;
|
|
368
|
+
}) => void) => () => void;
|
|
369
|
+
currentPage: (cb: (payload: {
|
|
370
|
+
pageIndex: number;
|
|
371
|
+
pageNumber: number;
|
|
372
|
+
timestamp: number;
|
|
373
|
+
}) => void) => () => void;
|
|
374
|
+
};
|
|
375
|
+
constructor(viewer: Viewer3D);
|
|
376
|
+
setDisabled3D(operators: string[]): void;
|
|
377
|
+
setDisabledPdf(operators: string[]): void;
|
|
378
|
+
clearDisabled3D(): void;
|
|
379
|
+
clearDisabledPdf(): void;
|
|
380
|
+
disableAll3D(): void;
|
|
381
|
+
disableAllPdf(): void;
|
|
382
|
+
enableAll3D(): void;
|
|
383
|
+
enableAllPdf(): void;
|
|
384
|
+
hideToolbar(): void;
|
|
385
|
+
showToolbar(): void;
|
|
386
|
+
setToolbarVisible(visible: boolean, target?: ToolbarVisibilityTarget): void;
|
|
387
|
+
hideLeftToolbar(): void;
|
|
388
|
+
showLeftToolbar(): void;
|
|
389
|
+
hideCenterToolbar(): void;
|
|
390
|
+
showCenterToolbar(): void;
|
|
391
|
+
hideRightToolbar(): void;
|
|
392
|
+
showRightToolbar(): void;
|
|
393
|
+
openClippingPlanes(): void;
|
|
394
|
+
closeClippingPlanes(): void;
|
|
395
|
+
openSetting(): void;
|
|
396
|
+
closeSetting(): void;
|
|
397
|
+
openSetting3D(): void;
|
|
398
|
+
closeSetting3D(): void;
|
|
399
|
+
openSettingPdf(): void;
|
|
400
|
+
closeSettingPdf(): void;
|
|
401
|
+
openStatesObjects(): void;
|
|
402
|
+
closeStatesObjects(): void;
|
|
403
|
+
openLinkedObjects(): void;
|
|
404
|
+
closeLinkedObjects(): void;
|
|
405
|
+
openModelTree(): void;
|
|
406
|
+
closeModelTree(): void;
|
|
407
|
+
openObjectProperties(): void;
|
|
408
|
+
closeObjectProperties(): void;
|
|
409
|
+
openSheets(): void;
|
|
410
|
+
closeSheets(): void;
|
|
411
|
+
getSheets(options?: GetSheetsOptions): Promise<SheetListItem[]>;
|
|
412
|
+
applySheet(sheetId: string | number): void;
|
|
413
|
+
cuttingCloseSections(): void;
|
|
414
|
+
cuttingMultipleSides(): void;
|
|
415
|
+
cuttingToggleSelection(): void;
|
|
416
|
+
cuttingTogglePlanes(): void;
|
|
417
|
+
cuttingPlaneX(): void;
|
|
418
|
+
cuttingPlaneY(): void;
|
|
419
|
+
cuttingPlaneZ(): void;
|
|
420
|
+
cuttingPlaneBox(): void;
|
|
421
|
+
cuttingRotateBox(): void;
|
|
422
|
+
cuttingReversePlaneX(): void;
|
|
423
|
+
cuttingReversePlaneY(): void;
|
|
424
|
+
cuttingReversePlaneZ(): void;
|
|
425
|
+
private postConfig;
|
|
426
|
+
private postToolbarVisibility;
|
|
427
|
+
private postPanelOpen;
|
|
428
|
+
private postPanelClose;
|
|
429
|
+
private postCuttingAction;
|
|
430
|
+
private postSheetsGetList;
|
|
431
|
+
private postSheetsApply;
|
|
432
|
+
}
|
|
433
|
+
|
|
434
|
+
type GetNodeIdsOptions = {
|
|
435
|
+
onlyRealNodes?: boolean;
|
|
436
|
+
timeoutMs?: number;
|
|
437
|
+
};
|
|
438
|
+
declare class ModelTreeModule {
|
|
439
|
+
private viewer;
|
|
440
|
+
constructor(viewer: Viewer3D);
|
|
441
|
+
open(): void;
|
|
442
|
+
selectNode(nodeId: string | number): void;
|
|
443
|
+
getNodeIds(options?: GetNodeIdsOptions): Promise<string[]>;
|
|
444
|
+
}
|
|
445
|
+
|
|
446
|
+
type MarkupRequestOptions = {
|
|
447
|
+
timeoutMs?: number;
|
|
448
|
+
};
|
|
449
|
+
declare class MarkupModule {
|
|
450
|
+
private viewer;
|
|
451
|
+
constructor(viewer: Viewer3D);
|
|
452
|
+
action(action: MarkupAction): void;
|
|
453
|
+
drawLine(): void;
|
|
454
|
+
drawArrow(): void;
|
|
455
|
+
drawCircle(): void;
|
|
456
|
+
drawEllipse(): void;
|
|
457
|
+
drawRectangle(): void;
|
|
458
|
+
drawPolygon(): void;
|
|
459
|
+
drawPolyline(): void;
|
|
460
|
+
drawTextBox(): void;
|
|
461
|
+
drawNote(): void;
|
|
462
|
+
drawCallout(): void;
|
|
463
|
+
drawCloud(): void;
|
|
464
|
+
drawFreehand(): void;
|
|
465
|
+
save(options?: MarkupRequestOptions): Promise<void>;
|
|
466
|
+
cancel(options?: MarkupRequestOptions): Promise<void>;
|
|
467
|
+
getList(options?: MarkupRequestOptions): Promise<MarkupListItem[]>;
|
|
468
|
+
private runRequest;
|
|
469
|
+
}
|
|
470
|
+
|
|
471
|
+
declare class LanguageModule {
|
|
472
|
+
private viewer;
|
|
473
|
+
constructor(viewer: Viewer3D);
|
|
474
|
+
change(language: LanguageCode): void;
|
|
475
|
+
set(language: LanguageCode): void;
|
|
476
|
+
}
|
|
477
|
+
|
|
478
|
+
type InitialToolbarVisibility = Partial<Record<ToolbarVisibilityTarget, boolean>>;
|
|
479
|
+
type Viewer3DOptions = {
|
|
480
|
+
container: HTMLElement | string;
|
|
481
|
+
url?: string;
|
|
482
|
+
baseUrl?: string;
|
|
483
|
+
viewerPath?: string;
|
|
484
|
+
uploadPath?: string;
|
|
485
|
+
file?: File;
|
|
486
|
+
initialToolbarVisibility?: InitialToolbarVisibility;
|
|
487
|
+
width?: string;
|
|
488
|
+
height?: string;
|
|
489
|
+
sandbox?: string;
|
|
490
|
+
allowedOrigin?: string;
|
|
491
|
+
};
|
|
492
|
+
declare class Viewer3D {
|
|
493
|
+
private options;
|
|
494
|
+
private containerEl;
|
|
495
|
+
private iframeEl;
|
|
496
|
+
private initialized;
|
|
497
|
+
private emitter;
|
|
498
|
+
camera: CameraModule;
|
|
499
|
+
interaction: InteractionModule;
|
|
500
|
+
node: NodeModule;
|
|
501
|
+
files: FilesModule;
|
|
502
|
+
toolbar: ToolbarModule;
|
|
503
|
+
modelTree: ModelTreeModule;
|
|
504
|
+
markup: MarkupModule;
|
|
505
|
+
language: LanguageModule;
|
|
506
|
+
constructor(options: Viewer3DOptions);
|
|
507
|
+
getOptions(): Viewer3DOptions;
|
|
508
|
+
patchOptions(next: Partial<Viewer3DOptions>): void;
|
|
509
|
+
getUrl(): string | null;
|
|
510
|
+
init(): void;
|
|
511
|
+
render(file?: File): Promise<PreparedViewerData | void>;
|
|
512
|
+
open(url: string): void;
|
|
513
|
+
destroy(): void;
|
|
514
|
+
private ensureInit;
|
|
515
|
+
private withInitialOptions;
|
|
516
|
+
_on<K extends SdkEventKey>(event: K, cb: (payload: SdkEventPayload<K>) => void): () => void;
|
|
517
|
+
_off<K extends SdkEventKey>(event: K, cb: (payload: SdkEventPayload<K>) => void): void;
|
|
518
|
+
_emit<K extends SdkEventKey>(event: K, payload: SdkEventPayload<K>): void;
|
|
519
|
+
postToViewer<TPayload = unknown>(type: ViewerMessageType, payload?: TPayload): void;
|
|
520
|
+
private handleMessage;
|
|
521
|
+
}
|
|
522
|
+
|
|
523
|
+
export { type ConvertOptions, type ConvertV2Options, type FileInfoCheckInput, type FileInfoCheckPayloadItem, type FilesConfig, type InitialToolbarVisibility, type LanguageCode, type LoadStage, type LoadStatePayload, type MarkupAction, type MarkupListItem, type MarkupOperationResultPayload, type PreparedViewerData, Viewer3D };
|