@xtctwins/tctwins-core 1.0.18 → 1.0.20

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.
@@ -7,242 +7,256 @@ import { CameraControl } from "./scene/CameraControl/CameraControl";
7
7
  import { Plugin } from "./Plugin";
8
8
 
9
9
  export declare type ViewerConfiguration = {
10
- /** Optional ID for this Viewer, defaults to the ID of {@link Viewer.scene}, which xeokit automatically generates. */
11
- id?: string;
12
- /** ID of an existing HTML canvas for the {@link Viewer.scene} - either this or canvasElement is mandatory. When both values are given, the element reference is always preferred to the ID. */
13
- canvasId?: string;
14
- /** Reference of an existing HTML canvas for the {@link Viewer.scene} - either this or canvasId is mandatory. When both values are given, the element reference is always preferred to the ID. */
15
- canvasElement?: HTMLCanvasElement;
16
- /** Optional reference to HTML element on which key events should be handled. Defaults to the HTML Document. */
17
- keyboardEventsElement?: HTMLElement;
18
- /** ID of existing HTML element to show the {@link Spinner} - internally creates a default element automatically if this is omitted. */
19
- spinnerElementId?: string;
20
- /** The number of times the {@link Viewer.scene} renders per frame. */
21
- passes?: number;
22
- /** When doing multiple passes per frame, specifies if to clear the canvas before each pass (true) or just before the first pass (false). */
23
- clearEachPass?: boolean;
24
- /** Whether or not to preserve the WebGL drawing buffer. This needs to be ````true```` for {@link Viewer.getSnapshot} to work.*/
25
- preserveDrawingBuffer?: boolean;
26
- /** Whether or not the canvas is transparent. */
27
- transparent?: boolean;
28
- /** Whether or not you want alpha composition with premultiplied alpha. Highlighting and selection works best when this is ````false````. */
29
- premultipliedAlpha?: boolean;
30
- /** When true, expects that all textures and colors are premultiplied gamma. */
31
- gammaInput?: boolean;
32
- /** Whether or not to render with pre-multiplied gama. */
33
- gammaOutput?: boolean;
34
- /** The gamma factor to use when rendering with pre-multiplied gamma. */
35
- gammaFactor?: number;
36
- /** Sets the canvas background color to use when ````transparent```` is false. */
37
- backgroundColor?: number[];
38
- /**When ````transparent```` is false, set this ````true```` to derive the canvas background color from {@link AmbientLight.color}, or ````false```` to set the canvas background to ````backgroundColor````. */
39
- backgroundColorFromAmbientLight?: boolean;
40
- /** The measurement unit type. */
41
- units?: "meters" | "centimeters" | "millimeters" | "yards" | "feet" | "inches";
42
- /** The number of Real-space units in each World-space coordinate system unit. */
43
- scale?: number;
44
- /** The Real-space 3D origin, in current measurement units, at which the World-space coordinate origin ````[0,0,0]```` sits. */
45
- origin?: number[];
46
- /** Whether to enable Scalable Ambient Obscurance (SAO) effect. See {@link SAO} for more info. */
47
- saoEnabled?: boolean;
48
- /** Whether to enable anti-aliasing. */
49
- antialias?: boolean;
50
- /** Whether writing into the depth buffer is enabled or disabled when rendering transparent objects. */
51
- alphaDepthMask?: boolean;
52
- /** Whether to enable {@link Entity.offset}. For best performance, only set this ````true```` when you need to use {@link Entity.offset}. */
53
- entityOffsetsEnabled?: boolean;
54
- /** Whether to enable full-precision accuracy when surface picking with {@link Scene.pick}. */
55
- pickSurfacePrecisionEnabled?: boolean;
56
- /** Whether to enable logarithmic depth buffer. */
57
- logarithmicDepthBufferEnabled?: boolean;
58
- /** Whether to enable base color texture rendering. */
59
- colorTextureEnabled?: boolean;
60
- /** Whether to enable physically-based rendering. */
61
- pbrEnabled?: boolean;
62
- /** Optional locale-based translation service. */
63
- localeService?: LocaleService;
64
- /** Whether to enable data texture-based (DTX) scene representation within the Viewer. */
65
- dtxEnabled?: boolean;
66
- /** Whether to show edges */
67
- edgesEnabled?:boolean;
68
- /** Enhances the efficiency of SectionPlane creation by proactively allocating Viewer resources for a specified quantity of SectionPlanes.*/
69
- numCachedSectionPlanes?: number;
10
+ /** Optional ID for this Viewer, defaults to the ID of {@link Viewer.scene}, which xeokit automatically generates. */
11
+ id?: string;
12
+ /** ID of an existing HTML canvas for the {@link Viewer.scene} - either this or canvasElement is mandatory. When both values are given, the element reference is always preferred to the ID. */
13
+ canvasId?: string;
14
+ /** Reference of an existing HTML canvas for the {@link Viewer.scene} - either this or canvasId is mandatory. When both values are given, the element reference is always preferred to the ID. */
15
+ canvasElement?: HTMLCanvasElement;
16
+ /** Reference of an existing div to contain the canvas */
17
+ viewerElement?: HTMLDivElement;
18
+ /** Optional reference to HTML element on which key events should be handled. Defaults to the HTML Document. */
19
+ keyboardEventsElement?: HTMLElement;
20
+ /** ID of existing HTML element to show the {@link Spinner} - internally creates a default element automatically if this is omitted. */
21
+ spinnerElementId?: string;
22
+ /** The number of times the {@link Viewer.scene} renders per frame. */
23
+ passes?: number;
24
+ /** When doing multiple passes per frame, specifies if to clear the canvas before each pass (true) or just before the first pass (false). */
25
+ clearEachPass?: boolean;
26
+ /** Whether or not to preserve the WebGL drawing buffer. This needs to be ````true```` for {@link Viewer.getSnapshot} to work.*/
27
+ preserveDrawingBuffer?: boolean;
28
+ /** Whether or not the canvas is transparent. */
29
+ transparent?: boolean;
30
+ /** Whether or not you want alpha composition with premultiplied alpha. Highlighting and selection works best when this is ````false````. */
31
+ premultipliedAlpha?: boolean;
32
+ /** When true, expects that all textures and colors are premultiplied gamma. */
33
+ gammaInput?: boolean;
34
+ /** Whether or not to render with pre-multiplied gama. */
35
+ gammaOutput?: boolean;
36
+ /** The gamma factor to use when rendering with pre-multiplied gamma. */
37
+ gammaFactor?: number;
38
+ /** Sets the canvas background color to use when ````transparent```` is false. */
39
+ backgroundColor?: number[];
40
+ /**When ````transparent```` is false, set this ````true```` to derive the canvas background color from {@link AmbientLight.color}, or ````false```` to set the canvas background to ````backgroundColor````. */
41
+ backgroundColorFromAmbientLight?: boolean;
42
+ /** The measurement unit type. */
43
+ units?: "meters" | "centimeters" | "millimeters" | "yards" | "feet" | "inches";
44
+ /** The number of Real-space units in each World-space coordinate system unit. */
45
+ scale?: number;
46
+ /** The Real-space 3D origin, in current measurement units, at which the World-space coordinate origin ````[0,0,0]```` sits. */
47
+ origin?: number[];
48
+ /** Whether to enable Scalable Ambient Obscurance (SAO) effect. See {@link SAO} for more info. */
49
+ saoEnabled?: boolean;
50
+ /**snapRadius for measurements */
51
+ snapRadius?: number;
52
+ /** Whether to enable anti-aliasing. */
53
+ antialias?: boolean;
54
+ /** Whether writing into the depth buffer is enabled or disabled when rendering transparent objects. */
55
+ alphaDepthMask?: boolean;
56
+ /** Whether to enable {@link Entity.offset}. For best performance, only set this ````true```` when you need to use {@link Entity.offset}. */
57
+ entityOffsetsEnabled?: boolean;
58
+ /** Whether to enable full-precision accuracy when surface picking with {@link Scene.pick}. */
59
+ pickSurfacePrecisionEnabled?: boolean;
60
+ /** Whether to enable logarithmic depth buffer. */
61
+ logarithmicDepthBufferEnabled?: boolean;
62
+ /** Whether to enable base color texture rendering. */
63
+ colorTextureEnabled?: boolean;
64
+ /** Whether to enable physically-based rendering. */
65
+ pbrEnabled?: boolean;
66
+ /** Optional locale-based translation service. */
67
+ localeService?: LocaleService;
68
+ /** Whether to enable data texture-based (DTX) scene representation within the Viewer. */
69
+ dtxEnabled?: boolean;
70
+ /** Whether to show edges */
71
+ edgesEnabled?: boolean;
72
+ /** Enhances the efficiency of SectionPlane creation by proactively allocating Viewer resources for a specified quantity of SectionPlanes.*/
73
+ numCachedSectionPlanes?: number;
70
74
  };
71
75
 
72
76
  /**
73
77
  * The 3D Viewer at the heart of the xeokit SDK.
74
78
  */
75
79
  export declare class Viewer {
76
- /**
77
- * @constructor
78
- * @param {ViewerConfiguration} cfg Viewer configuration.
79
- */
80
- constructor(cfg: ViewerConfiguration);
81
-
82
- /**
83
- * The viewer's locale service.
84
- *
85
- * This is configured via the Viewer's constructor.
86
- *
87
- * By default, this service will be an instance of {@link LocaleService}, which will just return
88
- * null translations for all given strings and phrases.
89
- *
90
- * @property localeService
91
- * @type {LocaleService}
92
- * @since 2.0
93
- */
94
- localeService: LocaleService;
95
-
96
- /**
97
- * The Viewer's {@link Scene}.
98
- * @property scene
99
- * @type {Scene}
100
- */
101
- scene: Scene;
102
-
103
- /**
104
- * Metadata about the {@link Scene} and the models and objects within it.
105
- * @property metaScene
106
- * @type {MetaScene}
107
- * @readonly
108
- */
109
- readonly metaScene: MetaScene;
110
-
111
- /**
112
- * The Viewer's ID.
113
- * @property id
114
- *
115
- * @type {String|Number}
116
- */
117
- id: string | number;
118
-
119
- /**
120
- * The Viewer's {@link Camera}. This is also found on {@link Scene.camera}.
121
- * @property camera
122
- * @type {Camera}
123
- */
124
- camera: Camera;
125
-
126
- /**
127
- * The Viewer's {@link CameraFlightAnimation}, which
128
- * is used to fly the {@link Scene}'s {@link Camera} to given targets.
129
- * @property cameraFlight
130
- * @type {CameraFlightAnimation}
131
- */
132
- cameraFlight: CameraFlightAnimation;
133
-
134
- /**
135
- * The Viewer's {@link CameraControl}, which
136
- * controls the {@link Scene}'s {@link Camera} with mouse, touch and keyboard input.
137
- * @property cameraControl
138
- * @type {CameraControl}
139
- */
140
- cameraControl: CameraControl;
141
-
142
- /**
143
- * Subscribes to an event fired at this Viewer.
144
- *
145
- * @param {String} event The event
146
- * @param {Function} callback Callback fired on the event
147
- */
148
- on(event: string, callback: Function): void;
149
-
150
- /**
151
- * Fires an event at this Viewer.
152
- *
153
- * @param {String} event Event name
154
- * @param {Object} value Event parameters
155
- */
156
- fire(event: string, value: any): void;
157
-
158
- /**
159
- * Logs a message to the JavaScript developer console, prefixed with the ID of this Viewer.
160
- *
161
- * @param {String} msg The message
162
- */
163
- log(msg: string): void;
164
-
165
- /**
166
- * Logs an error message to the JavaScript developer console, prefixed with the ID of this Viewer.
167
- *
168
- * @param {String} msg The error message
169
- */
170
- error(msg: string): void;
171
-
172
- /**
173
- * Installs a Plugin.
174
- *
175
- * @private
176
- */
177
- addPlugin(plugin: Plugin): void;
178
-
179
- /**
180
- * Enter snapshot mode.
181
- *
182
- * Switches rendering to a hidden snapshot canvas.
183
- *
184
- * Exit snapshot mode using {@link Viewer.endSnapshot}.
185
- */
186
- beginSnapshot(): void;
187
-
188
- /**
189
- * Gets a snapshot of this Viewer's {@link Scene} as a Base64-encoded image.
190
- *
191
- * #### Usage:
192
- *
193
- * ````javascript
194
- * const imageData = viewer.getSnapshot({
195
- * width: 500,
196
- * height: 500,
197
- * format: "png"
198
- * });
199
- * ````
200
- * @param {*} [params] Capture options.
201
- * @param {Number} [params.width] Desired width of result in pixels - defaults to width of canvas.
202
- * @param {Number} [params.height] Desired height of result in pixels - defaults to height of canvas.
203
- * @param {String} [params.format="jpeg"] Desired format; "jpeg", "png" or "bmp".
204
- * @param {Boolean} [params.includeGizmos=false] When true, will include gizmos like {@link SectionPlane} in the snapshot.
205
- * @returns {String} String-encoded image data URI.
206
- */
207
- getSnapshot(params: { width?: number, height?: number, format?: "jpeg" | "png" | "bmp", includeGizmos?: boolean }): string;
208
-
209
- /**
210
- * Gets a snapshot of this Viewer's {@link Scene} as a Base64-encoded image which includes
211
- * the HTML elements created by various plugins.
212
- *
213
- * The snapshot image is composed of an image of the viewer canvas, overlaid with an image
214
- * of the HTML container element belonging to each installed Viewer plugin. Each container
215
- * element is only rendered once, so it's OK for plugins to share the same container.
216
- *
217
- * #### Usage:
218
- *
219
- * ````javascript
220
- * viewer.getSnapshotWithPlugins({
221
- * width: 500,
222
- * height: 500,
223
- * format: "png"
224
- * }).then((imageData)=>{
225
- *
226
- * });
227
- * ````
228
- * @param {*} [params] Capture options.
229
- * @param {Number} [params.width] Desired width of result in pixels - defaults to width of canvas.
230
- * @param {Number} [params.height] Desired height of result in pixels - defaults to height of canvas.
231
- * @param {String} [params.format="jpeg"] Desired format; "jpeg", "png" or "bmp".
232
- * @param {Boolean} [params.includeGizmos=false] When true, will include gizmos like {@link SectionPlane} in the snapshot.
233
- * @returns {Promise} Promise which returns a string-encoded image data URI.
234
- */
235
- getSnapshotWithPlugins(params: { width?: number, height?: number, format?: "jpeg" | "png" | "bmp", includeGizmos?: boolean }): Promise<String>;
236
-
237
- /**
238
- * Exits snapshot mode.
239
- *
240
- * Switches rendering back to the main canvas.
241
- *
242
- */
243
- endSnapshot(): void;
244
-
245
- /** Destroys this Viewer.
246
- */
247
- destroy(): void;
80
+ /**
81
+ * @constructor
82
+ * @param {ViewerConfiguration} cfg Viewer configuration.
83
+ */
84
+ constructor(cfg: ViewerConfiguration);
85
+
86
+ /**
87
+ * The viewer's locale service.
88
+ *
89
+ * This is configured via the Viewer's constructor.
90
+ *
91
+ * By default, this service will be an instance of {@link LocaleService}, which will just return
92
+ * null translations for all given strings and phrases.
93
+ *
94
+ * @property localeService
95
+ * @type {LocaleService}
96
+ * @since 2.0
97
+ */
98
+ localeService: LocaleService;
99
+
100
+ /**
101
+ * The Viewer's {@link Scene}.
102
+ * @property scene
103
+ * @type {Scene}
104
+ */
105
+ scene: Scene;
106
+
107
+ /**
108
+ * Metadata about the {@link Scene} and the models and objects within it.
109
+ * @property metaScene
110
+ * @type {MetaScene}
111
+ * @readonly
112
+ */
113
+ readonly metaScene: MetaScene;
114
+
115
+ /**
116
+ * The Viewer's ID.
117
+ * @property id
118
+ *
119
+ * @type {String|Number}
120
+ */
121
+ id: string | number;
122
+
123
+ /**
124
+ * The Viewer's {@link Camera}. This is also found on {@link Scene.camera}.
125
+ * @property camera
126
+ * @type {Camera}
127
+ */
128
+ camera: Camera;
129
+
130
+ /**
131
+ * The Viewer's {@link CameraFlightAnimation}, which
132
+ * is used to fly the {@link Scene}'s {@link Camera} to given targets.
133
+ * @property cameraFlight
134
+ * @type {CameraFlightAnimation}
135
+ */
136
+ cameraFlight: CameraFlightAnimation;
137
+
138
+ /**
139
+ * The Viewer's {@link CameraControl}, which
140
+ * controls the {@link Scene}'s {@link Camera} with mouse, touch and keyboard input.
141
+ * @property cameraControl
142
+ * @type {CameraControl}
143
+ */
144
+ cameraControl: CameraControl;
145
+
146
+ /**
147
+ * Subscribes to an event fired at this Viewer.
148
+ *
149
+ * @param {String} event The event
150
+ * @param {Function} callback Callback fired on the event
151
+ */
152
+ on(event: string, callback: Function): void;
153
+
154
+ /**
155
+ * Fires an event at this Viewer.
156
+ *
157
+ * @param {String} event Event name
158
+ * @param {Object} value Event parameters
159
+ */
160
+ fire(event: string, value: any): void;
161
+
162
+ /**
163
+ * Logs a message to the JavaScript developer console, prefixed with the ID of this Viewer.
164
+ *
165
+ * @param {String} msg The message
166
+ */
167
+ log(msg: string): void;
168
+
169
+ /**
170
+ * Logs an error message to the JavaScript developer console, prefixed with the ID of this Viewer.
171
+ *
172
+ * @param {String} msg The error message
173
+ */
174
+ error(msg: string): void;
175
+
176
+ /**
177
+ * Installs a Plugin.
178
+ *
179
+ * @private
180
+ */
181
+ addPlugin(plugin: Plugin): void;
182
+
183
+ /**
184
+ * Enter snapshot mode.
185
+ *
186
+ * Switches rendering to a hidden snapshot canvas.
187
+ *
188
+ * Exit snapshot mode using {@link Viewer.endSnapshot}.
189
+ */
190
+ beginSnapshot(): void;
191
+
192
+ /**
193
+ * Gets a snapshot of this Viewer's {@link Scene} as a Base64-encoded image.
194
+ *
195
+ * #### Usage:
196
+ *
197
+ * ````javascript
198
+ * const imageData = viewer.getSnapshot({
199
+ * width: 500,
200
+ * height: 500,
201
+ * format: "png"
202
+ * });
203
+ * ````
204
+ * @param {*} [params] Capture options.
205
+ * @param {Number} [params.width] Desired width of result in pixels - defaults to width of canvas.
206
+ * @param {Number} [params.height] Desired height of result in pixels - defaults to height of canvas.
207
+ * @param {String} [params.format="jpeg"] Desired format; "jpeg", "png" or "bmp".
208
+ * @param {Boolean} [params.includeGizmos=false] When true, will include gizmos like {@link SectionPlane} in the snapshot.
209
+ * @returns {String} String-encoded image data URI.
210
+ */
211
+ getSnapshot(params: {
212
+ width?: number;
213
+ height?: number;
214
+ format?: "jpeg" | "png" | "bmp";
215
+ includeGizmos?: boolean;
216
+ }): string;
217
+
218
+ /**
219
+ * Gets a snapshot of this Viewer's {@link Scene} as a Base64-encoded image which includes
220
+ * the HTML elements created by various plugins.
221
+ *
222
+ * The snapshot image is composed of an image of the viewer canvas, overlaid with an image
223
+ * of the HTML container element belonging to each installed Viewer plugin. Each container
224
+ * element is only rendered once, so it's OK for plugins to share the same container.
225
+ *
226
+ * #### Usage:
227
+ *
228
+ * ````javascript
229
+ * viewer.getSnapshotWithPlugins({
230
+ * width: 500,
231
+ * height: 500,
232
+ * format: "png"
233
+ * }).then((imageData)=>{
234
+ *
235
+ * });
236
+ * ````
237
+ * @param {*} [params] Capture options.
238
+ * @param {Number} [params.width] Desired width of result in pixels - defaults to width of canvas.
239
+ * @param {Number} [params.height] Desired height of result in pixels - defaults to height of canvas.
240
+ * @param {String} [params.format="jpeg"] Desired format; "jpeg", "png" or "bmp".
241
+ * @param {Boolean} [params.includeGizmos=false] When true, will include gizmos like {@link SectionPlane} in the snapshot.
242
+ * @returns {Promise} Promise which returns a string-encoded image data URI.
243
+ */
244
+ getSnapshotWithPlugins(params: {
245
+ width?: number;
246
+ height?: number;
247
+ format?: "jpeg" | "png" | "bmp";
248
+ includeGizmos?: boolean;
249
+ }): Promise<String>;
250
+
251
+ /**
252
+ * Exits snapshot mode.
253
+ *
254
+ * Switches rendering back to the main canvas.
255
+ *
256
+ */
257
+ endSnapshot(): void;
258
+
259
+ /** Destroys this Viewer.
260
+ */
261
+ destroy(): void;
248
262
  }
@@ -680,4 +680,21 @@ export declare class CameraControl extends Component {
680
680
  * @returns {Boolean} Returns ````true```` when pivoting by default about the selected point on the virtual sphere, or ````false```` when pivoting by default about {@link Camera.look}.
681
681
  */
682
682
  get smartPivot(): boolean;
683
+
684
+ /**
685
+ * Sets the current snap radius for "hoverSnapOrSurface" events, to specify whether the radius
686
+ * within which the pointer snaps to the nearest vertex or the nearest edge.
687
+ *
688
+ * Default value is 30 pixels.
689
+ *
690
+ * @param {Number} snapRadius The snap radius.
691
+ */
692
+ set snapRadius(snapRadius: number);
693
+
694
+ /**
695
+ * Gets the current snap radius.
696
+ *
697
+ * @returns {Number} The snap radius.
698
+ */
699
+ get snapRadius(): number;
683
700
  }
@@ -9,45 +9,61 @@ import { Component } from "../Component";
9
9
  * * Located at {@link Scene#input}
10
10
  */
11
11
  export declare class Input extends Component {
12
- readonly KEY_CTRL: number;
13
-
14
- keyDown: boolean[];
15
-
16
- keyboardEnabled: boolean;
17
-
18
- /**
19
- * Sets whether input handlers are enabled.
20
- */
21
- setEnabled(enable: boolean): void;
22
-
23
- /**
24
- * Gets whether input handlers are enabled.
25
- */
26
- getEnabled(): boolean
27
-
28
- /**
29
- * Sets whether or not keyboard input is enabled.
30
- */
31
- setKeyboardEnabled(enable: boolean): void;
32
-
33
- /**
34
- * Gets whether keyboard input is enabled.
35
- */
36
- getKeyboardEnabled(): boolean;
37
-
38
- /**
39
- * Fires on mouse events
40
- * @param event The loaded event
41
- * @param callback Called fired on the event
42
- * @param scope Scope for the callback
43
- */
44
- on(event: "mousedown" | "mouseup" | "mouseclicked" | "dblclick", callback: (canvasCoords: number[]) => void, scope?: any): string;
45
-
46
- /**
47
- * Fires on keyboard events
48
- * @param event The loaded event
49
- * @param callback Called fired on the event
50
- * @param scope Scope for the callback
51
- */
52
- on(event: "keydown" | "keyup", callback: (keyCode: number) => void, scope?: any): string;
53
- }
12
+ readonly KEY_CTRL: number;
13
+
14
+ keyDown: boolean[];
15
+
16
+ keyboardEnabled: boolean;
17
+
18
+ /**
19
+ * Sets whether input handlers are enabled.
20
+ */
21
+ setEnabled(enable: boolean): void;
22
+
23
+ /**
24
+ * Gets whether input handlers are enabled.
25
+ */
26
+ getEnabled(): boolean;
27
+
28
+ /**
29
+ * Sets whether or not keyboard input is enabled.
30
+ */
31
+ setKeyboardEnabled(enable: boolean): void;
32
+
33
+ /**
34
+ * Gets whether keyboard input is enabled.
35
+ */
36
+ getKeyboardEnabled(): boolean;
37
+
38
+ /**
39
+ * Fires on mouse events
40
+ * @param event The loaded event
41
+ * @param callback Called fired on the event
42
+ * @param scope Scope for the callback
43
+ */
44
+ on(
45
+ event: "mousedown" | "mouseup" | "mouseclicked" | "dblclick",
46
+ callback: (canvasCoords: number[]) => void,
47
+ scope?: any
48
+ ): string;
49
+
50
+ /**
51
+ * Fires on touch events
52
+ * @param event The loaded event
53
+ * @param callback Called fired on the event
54
+ * @param scope Scope for the callback
55
+ */
56
+ on(
57
+ event: "touchstart" | "touchend" | "touchclicked",
58
+ callback: (canvasCoords: number[]) => void,
59
+ scope?: any
60
+ ): string;
61
+
62
+ /**
63
+ * Fires on keyboard events
64
+ * @param event The loaded event
65
+ * @param callback Called fired on the event
66
+ * @param scope Scope for the callback
67
+ */
68
+ on(event: "keydown" | "keyup", callback: (keyCode: number) => void, scope?: any): string;
69
+ }