import { File } from "../Api/File"; import { Assembly } from "../Api/Assembly"; import { Model } from "../Api/Model"; /** * A {@link Viewer} event that fires when model loading has been canceled. * * @event */ export interface CancelEvent { /** * Event type. */ type: "cancel"; } /** * A {@link Viewer} event that fires when the active dragger has been changed. * * @event */ export interface ChangeActiveDraggerEvent { /** * Event type. */ type: "changeactivedragger"; /** * Dragger name. */ data: string; } /** * A {@link Viewer} event that fires when the markup color has been changed. * * @event */ export interface ChangeMarkupColorEvent { /** * Event type. */ type: "changemarkupcolor"; /** * New color. */ data: { r: number; g: number; b: number; }; } /** * A {@link Viewer} event that fires when the viewer has been cleared. * * @event */ export interface ClearEvent { /** * Event type. */ type: "clear"; } /** * A {@link Viewer} event that fires after viewer executes the command. * * @event */ export interface CommandEvent { /** * Event type. */ type: "command"; /** * Command name. */ data: string; /** * Command arguments. */ args: any[]; } /** * A {@link Viewer} event that fires when the model scene description file has been loaded. * * @event */ export interface DatabaseChunkEvent { /** * Event type. */ type: "databasechunk"; /** * Scene description file. */ data?: Uint8Array; /** * Model instance to open. */ model?: Model; /** * Buffer to open. */ buffer?: Uint8Array | ArrayBuffer; } /** * A {@link Viewer} event that fires before viewer resources has been released. * * @event */ export interface DisposeEvent { /** * Event type. */ type: "dispose"; } /** * A {@link Viewer} event that fires when the model geometry data chunk has been loaded. Note * that small files are loaded in one chunk, and `geometrychunk` event does not fire, only the * `databasechink` event fires. * * @event */ export interface GeometryChunkEvent { /** * Event type. */ type: "geometrychunk"; /** * Geometry data chunk. */ data: Uint8Array; /** * Model instance to open. */ model?: Model; /** * Buffer to open. */ buffer?: Uint8Array | ArrayBuffer; } /** * A {@link Viewer} event that fires after model has been successfully loaded. * * @event */ export interface GeometryEndEvent { /** * Event type. */ type: "geometryend"; /** * Model instance to open. */ model?: Model; /** * Buffer to open. */ buffer?: Uint8Array | ArrayBuffer; /** * Loaded data (viewer depended). */ data?: any; } /** * A {@link Viewer} event that fires when the model fails to load. * * @event */ export interface GeometryErrorEvent { /** * Event type. */ type: "geometryerror"; /** * Thrown exception. */ data: Error; /** * Model instance to open. */ model?: Model; /** * Buffer to open. */ buffer?: Uint8Array | ArrayBuffer; } /** * A {@link Viewer} event measuring progress of the model loading process. * * @event */ export interface GeometryProgressEvent { /** * Event type. */ type: "geometryprogress"; /** * The non-rounded progress value from 0 to 1. To get a percentage (%), multiply the `data` by 100. */ data: number; /** * Model instance to open. */ model?: Model; /** * Buffer to open. */ buffer?: Uint8Array | ArrayBuffer; } /** * A {@link Viewer} event that fires before the model loads. * * @event */ export interface GeometryStartEvent { /** * Event type. */ type: "geometrystart"; /** * Model instance to open. */ model?: Model; /** * Buffer to open. */ buffer?: Uint8Array | ArrayBuffer; } /** * A {@link Viewer} event that fires before model opens. * * @event */ export interface OpenEvent { /** * Event type. */ type: "open"; /** * Model instance to open. */ model?: File | Assembly | Model; /** * Buffer to open. */ buffer?: Uint8Array | ArrayBuffer; } /** * A {@link Viewer} event that fires when rendering occurs. * * @event */ export interface RenderEvent { /** * Event type. */ type: "render"; time: DOMHighResTimeStamp; deltaTime: DOMHighResTimeStamp; } /** * A {@link Viewer} event that fires when resize occurs. * * @event */ export interface ResizeEvent { /** * Event type. */ type: "resize"; /** * New width. */ width: number; /** * New height. */ height: number; } /** * A {@link Viewer} event that fires when the selection changes. * * @event */ export interface SelectEvent { /** * Event type. */ type: "select"; /** * Selection set. */ data: any; /** * Handles of selected entities. */ handles: string[]; } /** * A {@link Viewer} event that fires when an update occurs. * * @event */ export interface UpdateEvent { /** * Event type. */ type: "update"; /** * `true` to force the update, otherwise the update is delayed until the next animation frame. */ data: boolean; } /** * A {@link Viewer} event measuring progress of loading a `VisualizeJS` library. * * @event */ export interface VisualizeProgressEvent { /** * Event type. */ type: "visualizeprogress"; /** * A 64-bit unsigned integer value indicating the amount of work already performed by the * underlying process. The ratio of work done can be calculated by dividing total by the * value of this property. */ loaded: number; /** * A 64-bit unsigned integer representing the total amount of work that the underlying * process is in the progress of performing. */ total: number; } /** * A {@link Viewer} event that fires when walk speed changing. * * @event */ export interface WalkSpeedChangeEvent { /** * Event type. */ type: "walkspeedchange"; /** * Multiplier */ data: number; } /** * A {@link Viewer} event that fires when walk started. * * @event */ export interface WalkStartEvent { /** * Event type. */ type: "walkstart"; } /** * A {@link Viewer} pan to event. * * @event */ export interface PanEvent { /** * Event type. */ type: "pan"; /** * X coordinate. */ x: number; /** * Y coordinate. */ y: number; /** * delta X coordinate. */ dX: number; /** * delta Y coordinate. */ dY: number; } /** * A {@link Viewer} zoom event. * * @event */ export interface ZoomEvent { /** * Event type. */ type: "zoom"; /** * New view parameters. */ data?: any; } /** * A {@link Viewer} zoom at event. * * @event */ export interface ZoomAtEvent { /** * Event type. */ type: "zoomat"; /** * Zoom factor */ data: number; } /** * A {@link Viewer} zoom to entity event. * * @event */ export interface ZoomToEntityEvent { /** * Event type. */ type: "zoomtoentity"; /** * Entity */ data: any; } /** * Viewer Events */ export interface ViewerEventMap { /** * A {@link Viewer} event that fires when model loading has been canceled. */ cancel: CancelEvent; /** * A {@link Viewer} event that fires when the active dragger has been changed. */ changeactivedragger: ChangeActiveDraggerEvent; /** * A {@link Viewer} event that fires when the markup color has been changed. */ changemarkupcolor: ChangeMarkupColorEvent; /** * A {@link Viewer} event that fires when the viewer has been cleared. */ clear: ClearEvent; /** * A {@link Viewer} event that fires after viewer executes the command. */ command: CommandEvent; /** * A {@link Viewer} event that fires when the model scene description file has been loaded. */ databasechunk: DatabaseChunkEvent; /** * A {@link Viewer} event that fires before viewer resources has been released. */ dispose: DisposeEvent; /** * A {@link Viewer} event that fires when the model geometry data chunk has been loaded. */ geometrychunk: GeometryChunkEvent; /** * A {@link Viewer} event that fires after model has been successfully loaded. */ geometryend: GeometryEndEvent; /** * A {@link Viewer} event that fires when the model fails to open. */ geometryerror: GeometryErrorEvent; /** * A {@link Viewer} event measuring progress of the model loading process. */ geometryprogress: GeometryProgressEvent; /** * A {@link Viewer} event that fires before the model opens. */ geometrystart: GeometryStartEvent; /** * A {@link Viewer} event that fires before model opens. */ open: OpenEvent; /** * A {@link Viewer} event that fires when an rendering occurs. */ render: RenderEvent; /** * A {@link Viewer} event that fires when resize occurs. */ resize: ResizeEvent; /** * A {@link Viewer} event that fires when the selection changes. */ select: SelectEvent; /** * A {@link Viewer} event that fires when an update occurs. */ update: UpdateEvent; /** * A {@link Viewer} event measuring progress of loading a `VisualizeJS` library. */ visualizeprogress: VisualizeProgressEvent; /** * A {@link Viewer} event that fires when walk speed changing. */ walkspeedchange: WalkSpeedChangeEvent; /** * A {@link Viewer} event that fires when walk started. */ walkstart: WalkStartEvent; /** * A {@link Viewer} pan event. */ pan: PanEvent; /** * A {@link Viewer} zoom event. */ zoom: ZoomEvent; /** * A {@link Viewer} zoom at event. */ zoomat: ZoomAtEvent; /** * A {@link Viewer} zoom to entity event. */ zoomtoentity: ZoomToEntityEvent; /** * {@link Viewer} event that fires when the user attempts to open a context menu. */ contextmenu: PointerEvent; /** * {@link Viewer} event that fires on mouse click. */ click: MouseEvent; /** * A {@link Viewer} event that fires on mouse double click. */ dblclick: MouseEvent; /** * A {@link Viewer} event that fires on mouse button is down. */ mousedown: MouseEvent; /** * A {@link Viewer} event that fires on mouse leave. */ mouseleave: MouseEvent; /** * A {@link Viewer} event that fires on mouse move. */ mousemove: MouseEvent; /** * A {@link Viewer} event that fires on mouse button is up. */ mouseup: MouseEvent; /** * A {@link Viewer} event is fired when the browser determines that there are unlikely to be * any more pointer events. */ pointercancel: PointerEvent; /** * A {@link Viewer} event that fires on mouse button is down. */ pointerdown: PointerEvent; /** * A {@link Viewer} event that fires on mouse leave. */ pointerleave: PointerEvent; /** * A {@link Viewer} event that fires on mouse move. */ pointermove: PointerEvent; /** * A {@link Viewer} event that fires on mouse button is up. */ pointerup: PointerEvent; /** * A {@link Viewer} event that fires touch is canceled. */ touchcancel: TouchEvent; /** * A {@link Viewer} event that fires touch is ended. */ touchend: TouchEvent; /** * A {@link Viewer} event that fires touch is moving. */ touchmove: TouchEvent; /** * A {@link Viewer} event that fires when touch is started. */ touchstart: TouchEvent; /** * A {@link Viewer} event that fires when mouse wheel is moving. */ wheel: MouseEvent; } //# sourceMappingURL=ViewerEvents.d.ts.map