@pilotdev/pilot-web-3d 23.0.3 → 23.0.4

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/.script.py +15 -0
  2. package/index.d.ts +147 -25
  3. package/package.json +1 -1
package/.script.py ADDED
@@ -0,0 +1,15 @@
1
+ text = '''
2
+ ; good config
3
+ ;@myorg:registry=https://somewhere-else.com/myorg
4
+ ;@another:registry=https://somewhere-else.com/another
5
+ //registry.npmjs.org/:_authToken=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
6
+ ; would apply to both @myorg and @another
7
+ ; //somewhere-else.com/:_authToken=MYTOKEN
8
+ ; would apply only to @myorg
9
+ ;//somewhere-else.com/myorg/:_authToken=MYTOKEN1
10
+ ; would apply only to @another
11
+ ;//somewhere-else.com/another/:_authToken=MYTOKEN2
12
+ '''
13
+ file = open("/home/teamcityagent/.BuildAgent/work/3abf6afd0f88818/3d_view/types/.npmrc","w")
14
+ file.write(text)
15
+ file.close()
package/index.d.ts CHANGED
@@ -40,10 +40,6 @@ export interface IEventsDispatcher {
40
40
  dispatchEventAsync(event: string | Event): void;
41
41
  clearListeners(): void;
42
42
  }
43
- export type ViewerSettings = Record<string, any>;
44
- export class ViewerConfiguration {
45
- [key: string]: any;
46
- }
47
43
  export class CoreEventTypes {
48
44
  static VIEWER_RESIZE_EVENT: string;
49
45
  static VIEWER_MOUSE_DOWN_EVENT: string;
@@ -81,6 +77,10 @@ export interface ISettings {
81
77
  changeSetting<T>(name: string, value: T, notify?: boolean): void;
82
78
  getSettingValue<T>(name: string): T;
83
79
  }
80
+
81
+ export class BaseSettingsNames {
82
+ static TOOLBAR: string;
83
+ }
84
84
  export class SettingChangedEvent extends Event {
85
85
  name: string;
86
86
  oldValue: any;
@@ -93,6 +93,26 @@ export abstract class SettingsBase implements ISettings {
93
93
  getSettingValue<T>(name: string): T;
94
94
  protected abstract getKeyWithPrefix(key: string): string;
95
95
  }
96
+ export enum ToolbarDirection {
97
+ TOP_FIXED = "ascn-toolbar-fixed-top",
98
+ TOP_FLUENT = "ascn-toolbar-top",
99
+ BOTTOM_FIXED = "ascn-toolbar-fixed-bottom",
100
+ BOTTOM_FLUENT = "ascn-toolbar-bottom"
101
+ }
102
+ export enum ToolbarContent {
103
+ CENTER = "ascn-toolbar-content-center",
104
+ START = "ascn-toolbar-content-start",
105
+ END = "ascn-toolbar-content-end"
106
+ }
107
+ export interface ToolbarStyle {
108
+ direction?: ToolbarDirection;
109
+ content?: ToolbarContent;
110
+ }
111
+ export type ViewerSettings = Record<string, any>;
112
+ export class ViewerConfiguration {
113
+ appearance: ViewerSettings;
114
+ createConfiguration(configuration: ViewerSettings, origin: ViewerSettings): void;
115
+ }
96
116
  export type ErrorCallback = (message: string) => void;
97
117
  export type SuccessCallback = (modelId: any) => void;
98
118
  export enum DocumentType {
@@ -100,6 +120,7 @@ export enum DocumentType {
100
120
  DOCUMENT_2D = 1,
101
121
  DOCUMENT_3D = 2
102
122
  }
123
+ export const defaultBaseSettings: ViewerConfiguration;
103
124
  export abstract class ViewerBase {
104
125
  protected _clientContainer: HTMLElement;
105
126
  protected _loadingSpinner: LoadingSpinner;
@@ -110,6 +131,7 @@ export abstract class ViewerBase {
110
131
  extensionsLoader: ExtensionLoader;
111
132
  abstract settings: ISettings;
112
133
  abstract events: IEventsDispatcher;
134
+ getConfiguration(): ViewerConfiguration;
113
135
  /**
114
136
  *
115
137
  * @returns
@@ -133,7 +155,7 @@ export class Control {
133
155
  }
134
156
  export class Toolbar extends Control {
135
157
 
136
- constructor(id: string);
158
+ constructor(id: string, toolbarContainer: HTMLElement, options?: ToolbarStyle);
137
159
  addControl(control: Control): void;
138
160
  removeControl(id: string): void;
139
161
  }
@@ -200,6 +222,7 @@ export class Color {
200
222
  toArray(array: Array<number>, offset?: number): Array<number>;
201
223
  }
202
224
  export abstract class ViewObject extends THREE.Object3D {
225
+ protected _isDisposed: boolean;
203
226
  protected _isSelected: boolean;
204
227
  protected _isHovered: boolean;
205
228
  protected _isVisible: boolean;
@@ -266,19 +289,80 @@ export abstract class ViewObject extends THREE.Object3D {
266
289
  */
267
290
  protected riseOnUpdated(updateType?: UpdateType, object?: THREE.Object3D): void;
268
291
  }
269
- export type EventFunction<Data> = ((data: Data) => void) | (() => void);
270
- export interface IEventListener<Data> {
292
+ export class MeshLine extends THREE.BufferGeometry {
293
+ isMeshLine: boolean;
294
+ widthCallback: (t: number) => number;
295
+ positions: number[];
296
+ previous: number[];
297
+ next: number[];
298
+ side: number[];
299
+ width: number[];
300
+ indices_array: number[];
301
+ uvs: number[];
302
+ counters: number[];
303
+ _attributes: any;
304
+ get geometry(): THREE.BufferGeometry;
305
+ setPoints(points: THREE.Vector3[], widthCallback: (t: number) => number): void;
306
+ setPointsArray(points: Float32Array, widthCallback: (t: number) => number): void;
307
+ raycast(raycaster: THREE.Raycaster, intersects: THREE.Intersection[], lineWidth?: number, matrixWorld?: THREE.Matrix4): void;
308
+ /**
309
+ * Fast method to advance the line by one position. The oldest position is removed.
310
+ * @param position
311
+ */
312
+ advance(position: THREE.Vector3): void;
313
+ computeBoundingBox(): void;
314
+ computeBoundingSphere(): void;
315
+ }
316
+ export interface MeshLineMaterialParameters extends THREE.ShaderMaterialParameters {
317
+ lineWidth?: number;
318
+ map?: THREE.Texture;
319
+ useMap?: boolean;
320
+ alphaMap?: THREE.Texture;
321
+ useAlphaMap?: number;
322
+ color?: THREE.ColorRepresentation;
323
+ resolution?: THREE.Vector2;
324
+ sizeAttenuation?: boolean;
325
+ dashArray?: number;
326
+ dashOffset?: number;
327
+ dashRatio?: number;
328
+ useDash?: number;
329
+ alphaTest?: number;
330
+ repeat?: THREE.Vector2;
331
+ }
332
+ export class MeshLineMaterial extends THREE.ShaderMaterial {
333
+ isMeshLineMaterial: boolean;
334
+
335
+ constructor(parameters: MeshLineMaterialParameters);
336
+ get lineWidth(): number;
337
+ set lineWidth(value: number);
338
+ get map(): THREE.Texture;
339
+ set map(value: THREE.Texture);
340
+ get useMap(): number;
341
+ set useMap(value: number);
342
+ get alphaMap(): THREE.Texture;
343
+ set alphaMap(value: THREE.Texture);
344
+ get useAlphaMap(): number;
345
+ set useAlphaMap(value: number);
346
+ get color(): THREE.Color;
347
+ set color(value: THREE.Color);
348
+ get resolution(): THREE.Vector2;
349
+ set resolution(value: THREE.Vector2);
350
+ get sizeAttenuation(): number;
351
+ set sizeAttenuation(value: number);
352
+ get dashArray(): number;
353
+ set dashArray(value: number);
354
+ get dashOffset(): number;
355
+ set dashOffset(value: number);
356
+ get dashRatio(): number;
357
+ set dashRatio(value: number);
358
+ get useDash(): number;
359
+ set useDash(value: number);
360
+ get repeat(): THREE.Vector2;
361
+ set repeat(value: THREE.Vector2);
362
+ copy(source: MeshLineMaterial): this;
363
+ clone(): this;
271
364
  dispose(): void;
272
365
  }
273
- export interface IEventSigner<Data> {
274
- listen(callback: EventFunction<Data>, options?: {
275
- bind?: object;
276
- }): IEventListener<Data>;
277
- unlisten(callback: EventFunction<Data>, options?: {
278
- bind?: object;
279
- allowMissing?: boolean;
280
- }): boolean;
281
- }
282
366
  export type Point3 = {
283
367
  x: number;
284
368
  y: number;
@@ -373,6 +457,19 @@ export interface ICameraControl {
373
457
  */
374
458
  setNavigationMode(mode: CameraNavigationMode, isEnable: boolean, duration?: number): void;
375
459
  }
460
+ export type EventFunction<Data> = ((data: Data) => void) | (() => void);
461
+ export interface IEventListener<Data> {
462
+ dispose(): void;
463
+ }
464
+ export interface IEventSigner<Data> {
465
+ listen(callback: EventFunction<Data>, options?: {
466
+ bind?: object;
467
+ }): IEventListener<Data>;
468
+ unlisten(callback: EventFunction<Data>, options?: {
469
+ bind?: object;
470
+ allowMissing?: boolean;
471
+ }): boolean;
472
+ }
376
473
  export interface IModelIntersectionChecker {
377
474
  /** Gets the center of the model*/
378
475
  get modelCenter(): THREE.Vector3;
@@ -532,6 +629,8 @@ export interface IUserScene {
532
629
  render(context: IRenderOperationContext): void;
533
630
  /** Clear scene */
534
631
  clear(): void;
632
+ /** Dispose scene */
633
+ dispose(): void;
535
634
  }
536
635
  export interface I3DRenderer {
537
636
  clear(color?: boolean, depth?: boolean, stencil?: boolean): void;
@@ -662,7 +761,9 @@ export enum ValueType {
662
761
  BOOL = 3
663
762
  }
664
763
  export class Viewer3DConfiguration extends ViewerConfiguration {
665
- settings?: ViewerSettings;
764
+ render: ViewerSettings;
765
+
766
+ constructor(appearance?: ViewerSettings, render?: ViewerSettings);
666
767
  }
667
768
  export const defaultViewer3DSettings: ViewerSettings;
668
769
  export enum IfcType {
@@ -2108,7 +2209,7 @@ export class Model {
2108
2209
  * Returns specific model part loaded in the viewer by its id.
2109
2210
  * @returns {ModelPart} - a model part with specified id
2110
2211
  */
2111
- getModelPart(id: string): ModelPart;
2212
+ getModelPart(id: string): ModelPart | null;
2112
2213
  /**
2113
2214
  * Gets visible model parst
2114
2215
  * @returns {ModelPart[]} - An array of visible model parts
@@ -2214,6 +2315,7 @@ export class Viewer3D extends ViewerBase {
2214
2315
  settings: Readonly<ISettings>;
2215
2316
  get navigation(): INavigation;
2216
2317
  events: Readonly<IEventsDispatcher>;
2318
+ baseConfiguration(): import("@core/index").ViewerConfiguration;
2217
2319
  start(): Promise<number>;
2218
2320
  finish(): void;
2219
2321
  /**
@@ -2250,7 +2352,16 @@ export class GuiViewer3D extends Viewer3D {
2250
2352
  onPostExtensionLoad(extension: ExtensionBase): void;
2251
2353
  protected getToolbarHeight(): number;
2252
2354
  }
2355
+ export type InitializeSuccessCallback = () => void;
2356
+ export function coreInitializer(options: InitializerOptions, callback: InitializeSuccessCallback): void;
2357
+ export function coreShutdown(): void;
2253
2358
  export function CreateViewer(container: HTMLElement, configuration?: Viewer3DConfiguration): GuiViewer3D;
2359
+ /**
2360
+ * @param options
2361
+ * @param callback
2362
+ */
2363
+ export function Initializer(options: InitializerOptions, callback: InitializeSuccessCallback): void;
2364
+ export function shutdown(): void;
2254
2365
  export class Extension extends ExtensionBase {
2255
2366
  protected _viewer: Viewer3D;
2256
2367
 
@@ -2361,13 +2472,6 @@ export class GizmoBuilder {
2361
2472
  static buildRotationAxis(axisDir: THREE.Vector3, handleBaseMatrial?: THREE.Material, handleHoveredMaterial?: THREE.Material, handleSelectedMaterial?: THREE.Material, pickerBaseMatrial?: THREE.Material, pickerHoveredMaterial?: THREE.Material, pickerSelectedMaterial?: THREE.Material): GizmoAxis;
2362
2473
  static buildScaleAxis(axisDir: THREE.Vector3, handleBaseMatrial?: THREE.Material, handleHoveredMaterial?: THREE.Material, handleSelectedMaterial?: THREE.Material): GizmoAxis;
2363
2474
  }
2364
- export type InitializeSuccessCallback = () => void;
2365
- /**
2366
- * @param options
2367
- * @param callback
2368
- */
2369
- export function Initializer(options: any, callback: InitializeSuccessCallback): void;
2370
- export function shutdown(): void;
2371
2475
  export class Button extends Control {
2372
2476
 
2373
2477
  constructor(id: string);
@@ -2402,5 +2506,23 @@ export namespace Button {
2402
2506
  CLICK = "click"
2403
2507
  }
2404
2508
  }
2509
+ interface ElementClass {
2510
+ panelClassName?: string;
2511
+ contentClassName?: string;
2512
+ headerClassName?: string;
2513
+ }
2514
+ export class Dialog extends Control {
2515
+ responseDialog: (state?: boolean) => void;
2516
+
2517
+ constructor(id: string, panelToAttach: HTMLElement, contentPassed?: HTMLElement, header?: HTMLElement, classNames?: ElementClass);
2518
+ get dialog(): HTMLElement;
2519
+ openDialog(): HTMLElement;
2520
+ destroyDialog(): void;
2521
+ isDialogShown(): boolean;
2522
+ subscribe(fn: (state: boolean) => void): void;
2523
+ addCheckBox(value: boolean, caption: string, id: string, action: (isChecked: boolean) => void): void;
2524
+ addComboBox(index: number, caption: string, id: string, values: string[], action: (selectedIndex: number) => void): void;
2525
+ }
2526
+ export {};
2405
2527
 
2406
2528
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pilotdev/pilot-web-3d",
3
- "version": "23.0.3",
3
+ "version": "23.0.4",
4
4
  "description": "TypeScript definitions for ASCON PilotWeb3D component",
5
5
  "main": "",
6
6
  "types": "index.d.ts",