@pilotdev/pilot-web-3d 1.0.5 → 1.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/README.md +3 -3
  2. package/index.d.ts +96 -20
  3. package/package.json +4 -2
package/README.md CHANGED
@@ -1,9 +1,9 @@
1
1
  # Installation
2
- > `npm install --save @pilotdev/pilot-web-3d`
2
+ > `npm install --save-dev @pilotdev/pilot-web-3d`
3
3
 
4
4
  # Summary
5
- This package contains type definitions for Ascon Pilot.Web.3D component (https://pilotcloud.ascon.net/).
5
+ This package contains type definitions for Ascon **PilotWeb3D** component (https://pilotcloud.ascon.net/).
6
6
 
7
7
  ### Additional Details
8
- * Last updated: Thu, 2 Sept 2022 10:10:25 GMT
8
+ * Last updated: Thu, 15 Nov 2022 16:10:25 GMT
9
9
  * Global values: `PilotWeb3d`
package/index.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ ///// <reference types="@types/three" />
1
2
  /// <reference path="./three/three.d.ts" />
2
3
  declare namespace PilotWeb3D {
3
4
 
@@ -82,6 +83,16 @@ declare namespace PilotWeb3D {
82
83
  * @returns {ModelElementIds[]} Array of the currently selected model elements.
83
84
  */
84
85
  getSelection(): ModelElementIds[];
86
+ /**
87
+ * Returns the hidden element ids.
88
+ * @returns {ModelElementIds[]} Array of the currently hidden model elements.
89
+ */
90
+ getHiddenElements(): ModelElementIds[];
91
+ /**
92
+ * Returns the visible element ids.
93
+ * @returns {ModelElementIds[]} Array of the currently visible model elements.
94
+ */
95
+ getVisibleElements(): ModelElementIds[];
85
96
  /**
86
97
  * Sets color to elements
87
98
  * @param {string[] | string} elementIds - element or array of elements to change color.
@@ -135,6 +146,8 @@ declare namespace PilotWeb3D {
135
146
  static VIEWER_MOUSE_MOVE_EVENT: string;
136
147
  static VIEWER_MOUSE_UP_EVENT: string;
137
148
  static VIEWER_MOUSE_LONG_TOUCH_EVENT: string;
149
+ static SETTING_CHANGED_EVENT: string;
150
+ static SETTING_RESET_EVENT: string;
138
151
  }
139
152
  class EventTypes extends CoreEventTypes {
140
153
  static SELECTION_CHANGED_EVENT: string;
@@ -145,11 +158,14 @@ declare namespace PilotWeb3D {
145
158
  selected: string[];
146
159
  modelPartId: string;
147
160
  }
148
-
161
+ class SettingChangedEvent extends Event {
162
+ name: string;
163
+ oldValue: any;
164
+ newValue: any;
165
+ }
149
166
  class ModelPartEvent extends Event {
150
167
  modelPartId: string;
151
168
  }
152
-
153
169
  interface EventsDispatcher {
154
170
  addEventListener(event: string, listener: EventListener, options?: any): void;
155
171
  removeEventListener(event: string, listener: EventListener): void;
@@ -210,7 +226,8 @@ declare namespace PilotWeb3D {
210
226
  container: HTMLElement;
211
227
  layerManagers: Map<number, ILayerManager>;
212
228
  extensionsLoader: ExtensionLoader;
213
- get events(): EventsDispatcher;
229
+ settingsManager: Readonly<ISettingsManager>;
230
+ events: Readonly<EventsDispatcher>;
214
231
  /**
215
232
  *
216
233
  * @returns
@@ -230,8 +247,41 @@ declare namespace PilotWeb3D {
230
247
  getExtensions(): Extension[];
231
248
  }
232
249
 
233
- function CreateViewer(container: HTMLElement): GuiViewer3D;
250
+ function CreateViewer(container: HTMLElement, configuration?: Viewer3DConfiguration): GuiViewer3D;
234
251
 
252
+ type ViewerSettings = Record<string, any>;
253
+ class ViewerConfiguration {
254
+ [key: string]: any;
255
+ }
256
+ class Viewer3DConfiguration extends ViewerConfiguration {
257
+ settings?: ViewerSettings;
258
+ }
259
+ class SettingsNames {
260
+ static TELEMETRY: string;
261
+ static AXES: string;
262
+ static CAMERA_ANIMATION: string;
263
+ static HIDE_SMALL_ELEMENTS: string;
264
+ static GLOBAL_LIGHT: string;
265
+ static LIGHT_SOURCE: string;
266
+ static ANTI_ALIASING: string;
267
+ static HIDE_SMALL_ELEMENTS_WHEN_NAVIGATING: string;
268
+ static SMALL_ELEMENT_SIZE: string;
269
+ static LABEL_LINE_LENGTH: string;
270
+ static HIDE_EDGES_WHEN_NAVIGATING: string;
271
+ static DISPLAY_MODE: string;
272
+ static NAVIGATION_CUBE: string;
273
+ }
274
+ enum DisplayMode {
275
+ FACES_AND_EDGES = 0,
276
+ FACES = 1,
277
+ EDGES = 2
278
+ }
279
+ enum ValueType {
280
+ STRING = 0,
281
+ NUMBER = 1,
282
+ ENUM = 2,
283
+ BOOL = 3
284
+ }
235
285
  interface ILayerManager {
236
286
  createLayer(name: string): ILayer;
237
287
  deleteLayer(name: string): boolean;
@@ -257,45 +307,71 @@ declare namespace PilotWeb3D {
257
307
 
258
308
  class Control {
259
309
  container: HTMLElement;
260
- id: string;
310
+ constructor(id: string);
261
311
  addClass(cssClass: string): void;
262
312
  removeClass(cssClass: string): void;
313
+ getId(): string;
314
+ setToolTip(tooltipText: string): void;
263
315
  }
264
316
 
265
317
  class ViewerToolbar extends Toolbar {
266
318
  }
267
319
 
268
- class ToolbarBuilder {
269
- addButton(id: string): ButtonBuilder;
270
- removeItem(id: string): void;
320
+ class Button extends Control {
321
+ constructor(id: string);
322
+ setIsChecked(value: boolean): void;
323
+ setState(state: Button.State): boolean;
324
+ getState(): Button.State;
325
+ setIcon(iconClassName: string): void;
326
+ /**
327
+ * Override this method to be notified when the user clicks on the button.
328
+ * @param {MouseEvent} event
329
+ */
330
+ onClick: (event: MouseEvent) => void;
331
+ /**
332
+ * Override this method to be notified when the mouse enters the button.
333
+ * @param {MouseEvent} event
334
+ */
335
+ onMouseOver: (event: MouseEvent) => void;
336
+ /**
337
+ * Override this method to be notified when the mouse leaves the button.
338
+ * @param {MouseEvent} event
339
+ */
340
+ onMouseOut: (event: MouseEvent) => void;
271
341
  }
272
- class ButtonBuilder {
273
- withCaption(caption: string): ButtonBuilder;
274
- withIcon(icon: string): ButtonBuilder;
275
- withClickAction(action: EventListener): ButtonBuilder;
276
- withIsChecked(value: boolean): ButtonBuilder;
342
+ namespace Button {
343
+ enum State {
344
+ ACTIVE = 0,
345
+ INACTIVE = 1,
346
+ DISABLED = 2
347
+ }
348
+ enum Event {
349
+ STATE_CHANGED = "Button.StateChanged",
350
+ CLICK = "click"
351
+ }
352
+ }
353
+ interface ISettingsManager {
354
+ changeSetting<T>(name: string, value: T, notify?: boolean): void;
355
+ getSettingValue<T>(name: string): T;
277
356
  }
278
-
279
357
  class ExtensionBase {
280
358
  protected _viewer: ViewerBase;
281
359
  constructor(viewer3D: ViewerBase, options?: object);
282
360
  load(): boolean | Promise<boolean>;
283
361
  unload(): boolean;
284
- /**
285
- * Gets the name of the extension.
286
- * @returns {string} Returns the name of the extension.
287
- */
362
+ activate() : boolean;
363
+ deactivate(): boolean;
288
364
  getName(): string;
289
365
  onMouseDown(event: MouseEvent): void;
290
366
  onMouseMove(event: MouseEvent): void;
291
367
  onMouseUp(event: MouseEvent): void;
292
368
  onMouseLongTouch(event: MouseEvent): void;
293
- onToolbarCreated(builder: ToolbarBuilder): void;
369
+ onToolbarCreated(builder: Toolbar): void;
294
370
  }
295
371
 
296
372
  class Extension extends ExtensionBase{
297
373
  protected _viewer: Viewer3D;
298
- constructor(viewer: Viewer3D, options?: object);
374
+ constructor(viewer: Viewer3D, options?: any);
299
375
  }
300
376
 
301
377
  class ExtensionManager {
package/package.json CHANGED
@@ -1,11 +1,13 @@
1
1
  {
2
2
  "name": "@pilotdev/pilot-web-3d",
3
- "version": "1.0.5",
3
+ "version": "1.0.6",
4
4
  "description": "TypeScript definitions for ASCON Pilot.Web.3D component",
5
5
  "main": "",
6
6
  "types": "index.d.ts",
7
7
  "scripts": {},
8
8
  "license": "MIT",
9
9
  "typeScriptVersion": "4.4.3",
10
- "dependencies": {}
10
+ "dependencies": {
11
+ "three": "0.135.0"
12
+ }
11
13
  }