@pilotdev/pilot-web-2d 23.0.8 → 23.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.
Files changed (2) hide show
  1. package/index.d.ts +45 -15
  2. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -23,16 +23,22 @@ export class Localization {
23
23
  export type InitializeSuccessCallback = () => void;
24
24
  export function coreInitializer(options: InitializerOptions, callback: InitializeSuccessCallback): void;
25
25
  export function coreShutdown(): void;
26
+ export class DeviceEventHandler {
27
+ static isMobile: boolean;
28
+ static eventStartType: string;
29
+ static eventProcessType: string;
30
+ static eventEndType: string;
31
+ }
26
32
  export interface IWindowStyle {
27
33
  width: string;
28
34
  height: string;
29
35
  left: string;
30
- right: string;
31
36
  top: string;
32
37
  }
33
38
  export interface IWindowStateOptions {
34
39
  saveKey: string;
35
- restoreWindowSize: boolean;
40
+ restoreWindowSize?: boolean;
41
+ restoreWindowPosition?: boolean;
36
42
  }
37
43
  export class WindowStater {
38
44
  get windowStylesState(): IWindowStyle;
@@ -82,6 +88,7 @@ export namespace Viewer2DIcons {
82
88
  const REMARK_CIRCLE_ICON: string;
83
89
  const ZOOM_IN: string;
84
90
  const ZOOM_OUT: string;
91
+ const FIT_WIDTH: string;
85
92
  }
86
93
  export interface ISettings {
87
94
  changeSetting<T>(name: string, value: T, notify?: boolean, providedData?: any): void;
@@ -109,12 +116,19 @@ export class CoreEventTypes {
109
116
  static VIEWER_MOUSE_MOVE_EVENT: string;
110
117
  static VIEWER_MOUSE_UP_EVENT: string;
111
118
  static VIEWER_MOUSE_LONG_TOUCH_EVENT: string;
119
+ static VIEWER_MOUSE_WHEEL: string;
112
120
  static VIEWER_TOUCHSTART_EVENT: string;
113
121
  static VIEWER_TOUCHEND_EVENT: string;
114
122
  static SETTING_CHANGED_EVENT: string;
115
123
  static SETTING_RESET_EVENT: string;
116
124
  static SETTING_LANGUAGE_CHANGED_EVENT: string;
117
125
  static SETTING_THEME_CHANGED_EVENT: string;
126
+ static EXTENSION_LOADED: string;
127
+ static EXTENSION_UNLOADING: string;
128
+ static EXTENSION_UNLOADED: string;
129
+ }
130
+ export class ExtensionEvent extends Event {
131
+ extensionName: string;
118
132
  }
119
133
  export namespace ControlState {
120
134
  enum State {
@@ -198,7 +212,6 @@ export class ExtensionBase {
198
212
  onToolbarCreated(toolbar: Toolbar): void;
199
213
  onTouchStart(event: TouchEvent): void;
200
214
  onTouchEnd(event: TouchEvent): void;
201
- protected bindDomEvents(): void;
202
215
  }
203
216
  export class ExtensionManager {
204
217
  registerExtensionType(extensionId: string, extension: typeof ExtensionBase): boolean;
@@ -285,6 +298,8 @@ export abstract class ViewerBase {
285
298
  */
286
299
  finish(): void;
287
300
  onPostExtensionLoad(extension: ExtensionBase): void;
301
+ onExtensionUnloading(extension: ExtensionBase): void;
302
+ onPostExtensionUnload(extension: ExtensionBase): void;
288
303
  protected loadExtensions(): void;
289
304
  protected setThemeFromSettings(): void;
290
305
  }
@@ -411,6 +426,7 @@ export class Dialog extends Control {
411
426
  setResizable(value: boolean): Dialog;
412
427
  setWindowOptions(value: IWindowStateOptions): Dialog;
413
428
  setDraggable(value: boolean): Dialog;
429
+ setCloseble(value: boolean): Dialog;
414
430
  openDialog(x?: number, y?: number): HTMLElement;
415
431
  destroyDialog(): void;
416
432
  isDialogShown(): boolean;
@@ -475,19 +491,11 @@ export interface IDocumentPage {
475
491
  update(params?: IPageUpdateParams): void;
476
492
  dispose(): any;
477
493
  }
478
- export class PageRenderedEvent extends Event {
479
- page: IDocumentPage;
480
-
481
- constructor(type: string, page: IDocumentPage, eventInitDict?: EventInit);
482
- }
483
- export class EventTypes extends CoreEventTypes {
484
- static PAGE_RENDERED: string;
485
- }
486
494
  export interface IDocument {
487
495
  loadDocumentAsync(arrayBuffer: ArrayBuffer): Promise<void>;
488
496
  increaseScale(scaleFactor?: number): void;
489
497
  decreaseScale(scaleFactor?: number): void;
490
- fit(): void;
498
+ fitWidth(): void;
491
499
  getPageAsync(pageNumber: number): Promise<IDocumentPage>;
492
500
  getPageByTarget(element: HTMLElement): IDocumentPage | undefined;
493
501
  scrollPageIntoViewAsync(pageNumber: number): Promise<void>;
@@ -497,17 +505,31 @@ export const ZOOM_IN_SCALE_FACTOR = 1.15;
497
505
  export const ZOOM_OUT_SCALE_FACTOR = 0.85;
498
506
  export const ZOOM_MAX_SCALE = 10;
499
507
  export const ZOOM_MIN_SCALE = 4;
508
+ export class EventTypes extends CoreEventTypes {
509
+ static PAGE_RENDERED: string;
510
+ static DOCUMENT_ZOOM_IN: string;
511
+ static DOCUMENT_ZOOM_OUT: string;
512
+ static DOCUMENT_FIT_WIDTH: string;
513
+ }
514
+ export class PageRenderedEvent extends Event {
515
+ page: IDocumentPage;
516
+
517
+ constructor(type: string, page: IDocumentPage, eventInitDict?: EventInit);
518
+ }
519
+ export class DocumentLoadingOptions {
520
+ documentId?: string;
521
+
522
+ constructor(documentId?: string);
523
+ }
500
524
  export let ViewerInstance: Viewer2D;
501
525
  export class Viewer2D extends ViewerBase {
502
526
  readonly settings: Readonly<ISettings>;
503
527
  readonly events: Readonly<IEventsDispatcher>;
504
528
  get document(): IDocument;
505
- loadDocument(data: ArrayBuffer | string, options: object, onSuccessCallback: SuccessCallback, onErrorCallback: ErrorCallback): void;
529
+ loadDocument(data: ArrayBuffer | string, options: DocumentLoadingOptions, onSuccessCallback: SuccessCallback, onErrorCallback: ErrorCallback): void;
506
530
  unloadDocument(): void;
507
531
  start(): Promise<number>;
508
532
  finish(): void;
509
- protected zoomIn(event: MouseEvent): void;
510
- protected zoomOut(event: MouseEvent): void;
511
533
  }
512
534
  export class GuiViewer2D extends Viewer2D {
513
535
  loadDocument(buffer: ArrayBuffer, options: object, onSuccessCallback: SuccessCallback, onErrorCallback: ErrorCallback): void;
@@ -515,6 +537,14 @@ export class GuiViewer2D extends Viewer2D {
515
537
  onPostExtensionLoad(extension: ExtensionBase): void;
516
538
  protected getToolbarHeight(): number;
517
539
  }
540
+ export function CreateViewer(container: HTMLElement, configuration?: Viewer2DConfiguration): GuiViewer2D;
541
+ export function CreateBasicViewer(container: HTMLElement, configuration?: Viewer2DConfiguration): Viewer2D;
542
+ /**
543
+ * @param options
544
+ * @param callback
545
+ */
546
+ export function Initializer(options: InitializerOptions, callback: InitializeSuccessCallback): void;
547
+ export function shutdown(): void;
518
548
  export class Extension extends ExtensionBase {
519
549
  protected _viewer: Viewer2D;
520
550
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pilotdev/pilot-web-2d",
3
- "version": "23.0.8",
3
+ "version": "23.0.11",
4
4
  "description": "TypeScript definitions for ASCON PilotWeb2D component",
5
5
  "main": "",
6
6
  "types": "index.d.ts",