@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.
- package/dist/tctwins-core.es.js +8056 -5406
- package/dist/tctwins-core.min.es.js +5 -5
- package/package.json +3 -3
- package/types/extras/PointerCircle/PointerCircle.d.ts +51 -0
- package/types/extras/PointerCircle/index.d.ts +1 -0
- package/types/extras/index.d.ts +1 -0
- package/types/plugins/AngleMeasurementsPlugin/AngleMeasurementsPlugin.d.ts +14 -0
- package/types/plugins/AngleMeasurementsPlugin/AngleMeasurementsTouchControl.d.ts +117 -0
- package/types/plugins/AngleMeasurementsPlugin/index.d.ts +2 -1
- package/types/plugins/DistanceMeasurementsPlugin/DistanceMeasurementsMouseControl.d.ts +0 -1
- package/types/plugins/DistanceMeasurementsPlugin/DistanceMeasurementsPlugin.d.ts +142 -129
- package/types/plugins/DistanceMeasurementsPlugin/DistanceMeasurementsTouchControl.d.ts +96 -0
- package/types/plugins/DistanceMeasurementsPlugin/index.d.ts +1 -0
- package/types/plugins/NavCubePlugin/NavCubePlugin.d.ts +140 -138
- package/types/viewer/Viewer.d.ts +246 -232
- package/types/viewer/scene/CameraControl/CameraControl.d.ts +17 -0
- package/types/viewer/scene/input/input.d.ts +58 -42
package/types/viewer/Viewer.d.ts
CHANGED
|
@@ -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
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
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
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
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
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
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
|
+
}
|