@xviewer.js/debug 1.0.0-alpha.7 → 1.0.0-alpha.8
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/package.json +23 -21
- package/types/InspectorPlugin.d.ts +22 -0
- package/types/StatsPlugin.d.ts +10 -0
- package/types/gui/GUI.d.ts +257 -0
- package/types/gui/common/UIElement.d.ts +18 -0
- package/types/gui/common/UIInteger.d.ts +14 -0
- package/types/gui/common/UINumber.d.ts +19 -0
- package/types/gui/controllers/BooleanController.d.ts +7 -0
- package/types/gui/controllers/ColorController.d.ts +18 -0
- package/types/gui/controllers/Controller.d.ts +207 -0
- package/types/gui/controllers/CurveController.d.ts +8 -0
- package/types/gui/controllers/FunctionController.d.ts +6 -0
- package/types/gui/controllers/ImageController.d.ts +12 -0
- package/types/gui/controllers/NumberController.d.ts +32 -0
- package/types/gui/controllers/OptionController.d.ts +11 -0
- package/types/gui/controllers/StringController.d.ts +7 -0
- package/types/gui/controllers/TextureController.d.ts +9 -0
- package/types/gui/controllers/VectorController.d.ts +19 -0
- package/types/gui/curve/CurveEditor.d.ts +26 -0
- package/types/gui/curve/CurveViewer.d.ts +53 -0
- package/types/gui/curve/IAnimationCurve.d.ts +8 -0
- package/types/gui/curve/ICurvePoint.d.ts +6 -0
- package/types/gui/utils/getColorFormat.d.ts +21 -0
- package/types/gui/utils/index.d.ts +6 -0
- package/types/gui/utils/normalizeColorString.d.ts +1 -0
- package/types/index.d.ts +3 -12
- package/types/Component.d.ts +0 -34
- package/types/ComponentManager.d.ts +0 -48
- package/types/ComponentScheduler.d.ts +0 -19
- package/types/DebugManager.d.ts +0 -2
- package/types/DetectUA.d.ts +0 -79
- package/types/DeviceInput.d.ts +0 -60
- package/types/ObjectInstance.d.ts +0 -7
- package/types/Plugin.d.ts +0 -10
- package/types/PluginManager.d.ts +0 -17
- package/types/Pressability.d.ts +0 -17
- package/types/PropertyManager.d.ts +0 -19
- package/types/Scheduler.d.ts +0 -13
- package/types/SystemInfo.d.ts +0 -24
- package/types/Task.d.ts +0 -5
- package/types/TaskManager.d.ts +0 -15
- package/types/TextureSettings.d.ts +0 -13
- package/types/Utils.d.ts +0 -6
- package/types/Viewer.d.ts +0 -143
- package/types/WebGL.d.ts +0 -14
- package/types/asset/ResourceManager.d.ts +0 -42
- package/types/asset/aLoader.d.ts +0 -17
- package/types/base/EventEmitter.d.ts +0 -29
- package/types/base/Logger.d.ts +0 -11
- package/types/base/index.d.ts +0 -3
- package/types/base/mixin.d.ts +0 -1
- package/types/cinestation/CinestationBlendDefinition.d.ts +0 -11
- package/types/cinestation/CinestationBrain.d.ts +0 -21
- package/types/cinestation/FreelookVirtualCamera.d.ts +0 -63
- package/types/cinestation/VirtualCamera.d.ts +0 -25
- package/types/cinestation/index.d.ts +0 -4
- package/types/enums/Orientation.d.ts +0 -5
- package/types/loader/aEXRLoader.d.ts +0 -5
- package/types/loader/aFBXLoader.d.ts +0 -5
- package/types/loader/aGLTFLoader.d.ts +0 -5
- package/types/loader/aHDRLoader.d.ts +0 -5
- package/types/loader/aJSONLoader.d.ts +0 -5
- package/types/loader/aTextureLoader.d.ts +0 -5
- package/types/loader/index.d.ts +0 -6
- package/types/material/getShaderMaterial.d.ts +0 -4
- package/types/material/glsl/boxfilterblur.glsl.d.ts +0 -1
- package/types/material/glsl/copy.glsl.d.ts +0 -1
- package/types/material/glsl/fullscreen.glsl.d.ts +0 -1
- package/types/material/glsl/panorama.glsl.d.ts +0 -2
- package/types/math/AnimationCurve.d.ts +0 -23
- package/types/math/Constant.d.ts +0 -2
- package/types/math/Damp.d.ts +0 -10
- package/types/math/Interpolation.d.ts +0 -9
- package/types/primitives/Box.d.ts +0 -4
- package/types/primitives/Plane.d.ts +0 -4
- package/types/primitives/Sphere.d.ts +0 -4
- package/types/primitives/index.d.ts +0 -3
- package/types/tween/TweenChain.d.ts +0 -15
- package/types/tween/TweenManager.d.ts +0 -10
- package/types/tween/index.d.ts +0 -3
- package/types/types.d.ts +0 -54
package/package.json
CHANGED
|
@@ -1,23 +1,25 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
"
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
"
|
|
21
|
-
|
|
22
|
-
|
|
2
|
+
"name": "@xviewer.js/debug",
|
|
3
|
+
"version": "1.0.0-alpha.8",
|
|
4
|
+
"publishConfig": {
|
|
5
|
+
"access": "public",
|
|
6
|
+
"registry": "https://registry.npmjs.org"
|
|
7
|
+
},
|
|
8
|
+
"license": "MIT",
|
|
9
|
+
"type": "module",
|
|
10
|
+
"sideEffects": false,
|
|
11
|
+
"main": "dist/main.js",
|
|
12
|
+
"module": "dist/module.js",
|
|
13
|
+
"types": "types/index.d.ts",
|
|
14
|
+
"debug": "src/index.ts",
|
|
15
|
+
"files": [
|
|
16
|
+
"dist/**/*",
|
|
17
|
+
"types/**/*"
|
|
18
|
+
],
|
|
19
|
+
"dependencies": {
|
|
20
|
+
"@xviewer.js/core": "1.0.0-alpha.8"
|
|
21
|
+
},
|
|
22
|
+
"scripts": {
|
|
23
|
+
"b:types": "tsc"
|
|
24
|
+
}
|
|
23
25
|
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Plugin } from "@xviewer.js/core";
|
|
2
|
+
type uuidObject = {
|
|
3
|
+
uuid: string;
|
|
4
|
+
name: string;
|
|
5
|
+
type: string;
|
|
6
|
+
};
|
|
7
|
+
export declare class InspectorPlugin extends Plugin {
|
|
8
|
+
static _getTargetName(target: uuidObject): string;
|
|
9
|
+
private _gui;
|
|
10
|
+
private _statesMap;
|
|
11
|
+
private _targetMap;
|
|
12
|
+
constructor();
|
|
13
|
+
onUpdate(dt: number): void;
|
|
14
|
+
private _initFolders;
|
|
15
|
+
private _initViewer;
|
|
16
|
+
private _updateFolders;
|
|
17
|
+
private _getPropertiesList;
|
|
18
|
+
inspect<T extends uuidObject>(target: T): T;
|
|
19
|
+
private _addPropsListGUI;
|
|
20
|
+
uninspect(target: uuidObject): void;
|
|
21
|
+
}
|
|
22
|
+
export {};
|
|
@@ -0,0 +1,257 @@
|
|
|
1
|
+
import "./css/index.scss";
|
|
2
|
+
import { Controller } from "./controllers/Controller";
|
|
3
|
+
import { OptionController } from "./controllers/OptionController";
|
|
4
|
+
import { NumberController } from "./controllers/NumberController";
|
|
5
|
+
import { BooleanController } from "./controllers/BooleanController";
|
|
6
|
+
import { StringController } from "./controllers/StringController";
|
|
7
|
+
import { FunctionController } from "./controllers/FunctionController";
|
|
8
|
+
import { ColorController } from "./controllers/ColorController";
|
|
9
|
+
import { ImageController } from "./controllers/ImageController";
|
|
10
|
+
import { VectorController } from "./controllers/VectorController";
|
|
11
|
+
import { CurveController } from "./controllers/CurveController";
|
|
12
|
+
import { TextureController } from "./controllers/TextureController";
|
|
13
|
+
export declare class GUI {
|
|
14
|
+
id: string;
|
|
15
|
+
parent: GUI;
|
|
16
|
+
root: GUI;
|
|
17
|
+
children: Array<GUI | Controller>;
|
|
18
|
+
controllers: Array<Controller>;
|
|
19
|
+
folders: Array<GUI>;
|
|
20
|
+
domElement: HTMLElement;
|
|
21
|
+
$title: HTMLElement;
|
|
22
|
+
$children: HTMLElement;
|
|
23
|
+
/**
|
|
24
|
+
* Current title of the GUI. Use `gui.title( 'Title' )` to modify this value.
|
|
25
|
+
*/
|
|
26
|
+
_title: string;
|
|
27
|
+
_closed: boolean;
|
|
28
|
+
_hidden: boolean;
|
|
29
|
+
_closeFolders: boolean;
|
|
30
|
+
private _onChange;
|
|
31
|
+
/**
|
|
32
|
+
* Used to access the function bound to `onFinishChange` events. Don't modify this value
|
|
33
|
+
* directly. Use the `gui.onFinishChange( callback )` method instead.
|
|
34
|
+
*/
|
|
35
|
+
private _onFinishChange;
|
|
36
|
+
private _onOpenClose;
|
|
37
|
+
constructor({ parent, container, width, autoPlace, title, id, closeFolders, touchStyles, }?: {
|
|
38
|
+
parent?: GUI;
|
|
39
|
+
container?: HTMLElement;
|
|
40
|
+
autoPlace?: boolean;
|
|
41
|
+
width?: number;
|
|
42
|
+
title?: string;
|
|
43
|
+
id?: string;
|
|
44
|
+
closeFolders?: boolean;
|
|
45
|
+
touchStyles?: boolean;
|
|
46
|
+
});
|
|
47
|
+
/**
|
|
48
|
+
* Adds a controller to the GUI, inferring controller type using the `typeof` operator.
|
|
49
|
+
* @example
|
|
50
|
+
* gui.add( object, 'property' );
|
|
51
|
+
* gui.add( object, 'number', 0, 100, 1 );
|
|
52
|
+
* gui.add( object, 'options', [ 1, 2, 3 ] );
|
|
53
|
+
*
|
|
54
|
+
* @param {object} object The object the controller will modify.
|
|
55
|
+
* @param {string} property Name of the property to control.
|
|
56
|
+
* @param {number|object|Array} [$1] Minimum value for number controllers, or the set of
|
|
57
|
+
* selectable values for a dropdown.
|
|
58
|
+
* @param {number} [max] Maximum value for number controllers.
|
|
59
|
+
* @param {number} [step] Step value for number controllers.
|
|
60
|
+
* @returns {Controller}
|
|
61
|
+
*/
|
|
62
|
+
add(object: Object, property: string, $1?: number | object | Array<any>, max?: number, step?: number): OptionController | NumberController | BooleanController | StringController | FunctionController;
|
|
63
|
+
/**
|
|
64
|
+
* Adds a color controller to the GUI.
|
|
65
|
+
* @example
|
|
66
|
+
* params = {
|
|
67
|
+
* cssColor: '#ff00ff',
|
|
68
|
+
* rgbColor: { r: 0, g: 0.2, b: 0.4 },
|
|
69
|
+
* customRange: [ 0, 127, 255 ],
|
|
70
|
+
* };
|
|
71
|
+
*
|
|
72
|
+
* gui.addColor( params, 'cssColor' );
|
|
73
|
+
* gui.addColor( params, 'rgbColor' );
|
|
74
|
+
* gui.addColor( params, 'customRange', 255 );
|
|
75
|
+
*
|
|
76
|
+
* @param {object} object The object the controller will modify.
|
|
77
|
+
* @param {string} property Name of the property to control.
|
|
78
|
+
* @param {number} rgbScale Maximum value for a color channel when using an RGB color. You may
|
|
79
|
+
* need to set this to 255 if your colors are too bright.
|
|
80
|
+
* @returns {Controller}
|
|
81
|
+
*/
|
|
82
|
+
addColor(object: Object, property: string, rgbScale?: number): ColorController;
|
|
83
|
+
/**
|
|
84
|
+
*
|
|
85
|
+
* @param {object} object
|
|
86
|
+
* @param {string} property Name of the property to control.
|
|
87
|
+
* @returns {Controller}
|
|
88
|
+
*/
|
|
89
|
+
addImage(object: Object, property: string): ImageController;
|
|
90
|
+
addTexture(object: Object, property: string): TextureController;
|
|
91
|
+
/**
|
|
92
|
+
*
|
|
93
|
+
* @param {object} object
|
|
94
|
+
* @param {string} property
|
|
95
|
+
* @param min
|
|
96
|
+
* @param max
|
|
97
|
+
* @param step
|
|
98
|
+
* @returns {Controller}
|
|
99
|
+
*/
|
|
100
|
+
addVector(object: Object, property: string, min?: number, max?: number, step?: number): VectorController;
|
|
101
|
+
addCurve(object: Object, property: string): CurveController;
|
|
102
|
+
/**
|
|
103
|
+
* Adds a folder to the GUI, which is just another GUI. This method returns
|
|
104
|
+
* the nested GUI so you can add controllers to it.
|
|
105
|
+
* @example
|
|
106
|
+
* const folder = gui.addFolder( 'Position' );
|
|
107
|
+
* folder.add( position, 'x' );
|
|
108
|
+
* folder.add( position, 'y' );
|
|
109
|
+
* folder.add( position, 'z' );
|
|
110
|
+
*
|
|
111
|
+
* @param {string} title Name to display in the folder's title bar.
|
|
112
|
+
* @param {string} id Id
|
|
113
|
+
* @returns {GUI}
|
|
114
|
+
*/
|
|
115
|
+
addFolder(title: string, id?: string): GUI;
|
|
116
|
+
/**
|
|
117
|
+
*
|
|
118
|
+
* @param {string} id
|
|
119
|
+
* @returns {this}
|
|
120
|
+
*/
|
|
121
|
+
removeFolder(id: string): this;
|
|
122
|
+
/**
|
|
123
|
+
*
|
|
124
|
+
* @param {string} id
|
|
125
|
+
* @returns {GUI}
|
|
126
|
+
*/
|
|
127
|
+
getFolder(id: string): GUI;
|
|
128
|
+
/**
|
|
129
|
+
* Recalls values that were saved with `gui.save()`.
|
|
130
|
+
* @param {object} obj
|
|
131
|
+
* @param {boolean} recursive Pass false to exclude folders descending from this GUI.
|
|
132
|
+
* @returns {this}
|
|
133
|
+
*/
|
|
134
|
+
load(obj: GUI, recursive?: boolean): this;
|
|
135
|
+
/**
|
|
136
|
+
* Returns an object mapping controller names to values. The object can be passed to `gui.load()` to
|
|
137
|
+
* recall these values.
|
|
138
|
+
* @example
|
|
139
|
+
* {
|
|
140
|
+
* controllers: {
|
|
141
|
+
* prop1: 1,
|
|
142
|
+
* prop2: 'value',
|
|
143
|
+
* ...
|
|
144
|
+
* },
|
|
145
|
+
* folders: {
|
|
146
|
+
* folderName1: { controllers, folders },
|
|
147
|
+
* folderName2: { controllers, folders }
|
|
148
|
+
* ...
|
|
149
|
+
* }
|
|
150
|
+
* }
|
|
151
|
+
*
|
|
152
|
+
* @param {boolean} recursive Pass false to exclude folders descending from this GUI.
|
|
153
|
+
* @returns {object}
|
|
154
|
+
*/
|
|
155
|
+
save(recursive?: boolean): {
|
|
156
|
+
controllers: {};
|
|
157
|
+
folders: {};
|
|
158
|
+
};
|
|
159
|
+
/**
|
|
160
|
+
* Opens a GUI or folder. GUI and folders are open by default.
|
|
161
|
+
* @param {boolean} open Pass false to close
|
|
162
|
+
* @returns {this}
|
|
163
|
+
* @example
|
|
164
|
+
* gui.open(); // open
|
|
165
|
+
* gui.open( false ); // close
|
|
166
|
+
* gui.open( gui._closed ); // toggle
|
|
167
|
+
*/
|
|
168
|
+
open(open?: boolean): this;
|
|
169
|
+
/**
|
|
170
|
+
* Closes the GUI.
|
|
171
|
+
* @returns {this}
|
|
172
|
+
*/
|
|
173
|
+
close(): this;
|
|
174
|
+
private _setClosed;
|
|
175
|
+
/**
|
|
176
|
+
* Shows the GUI after it's been hidden.
|
|
177
|
+
* @param {boolean} show
|
|
178
|
+
* @returns {this}
|
|
179
|
+
* @example
|
|
180
|
+
* gui.show();
|
|
181
|
+
* gui.show( false ); // hide
|
|
182
|
+
* gui.show( gui._hidden ); // toggle
|
|
183
|
+
*/
|
|
184
|
+
show(show?: boolean): this;
|
|
185
|
+
/**
|
|
186
|
+
* Hides the GUI.
|
|
187
|
+
* @returns {this}
|
|
188
|
+
*/
|
|
189
|
+
hide(): this;
|
|
190
|
+
openAnimated(open?: boolean): this;
|
|
191
|
+
/**
|
|
192
|
+
* Change the title of this GUI.
|
|
193
|
+
* @param {string} title
|
|
194
|
+
* @returns {this}
|
|
195
|
+
*/
|
|
196
|
+
title(title: string): this;
|
|
197
|
+
/**
|
|
198
|
+
* Resets all controllers to their initial values.
|
|
199
|
+
* @param {boolean} recursive Pass false to exclude folders descending from this GUI.
|
|
200
|
+
* @returns {this}
|
|
201
|
+
*/
|
|
202
|
+
reset(recursive?: boolean): this;
|
|
203
|
+
/**
|
|
204
|
+
* Pass a function to be called whenever a controller in this GUI changes.
|
|
205
|
+
* @param {function({object:object, property:string, value:any, controller:Controller})} callback
|
|
206
|
+
* @returns {this}
|
|
207
|
+
* @example
|
|
208
|
+
* gui.onChange( event => {
|
|
209
|
+
* event.object // object that was modified
|
|
210
|
+
* event.property // string, name of property
|
|
211
|
+
* event.value // new value of controller
|
|
212
|
+
* event.controller // controller that was modified
|
|
213
|
+
* } );
|
|
214
|
+
*/
|
|
215
|
+
onChange(callback: any): this;
|
|
216
|
+
_callOnChange(controller: any): void;
|
|
217
|
+
/**
|
|
218
|
+
* Pass a function to be called whenever a controller in this GUI has finished changing.
|
|
219
|
+
* @param {function({object:object, property:string, value:any, controller:Controller})} callback
|
|
220
|
+
* @returns {this}
|
|
221
|
+
* @example
|
|
222
|
+
* gui.onFinishChange( event => {
|
|
223
|
+
* event.object // object that was modified
|
|
224
|
+
* event.property // string, name of property
|
|
225
|
+
* event.value // new value of controller
|
|
226
|
+
* event.controller // controller that was modified
|
|
227
|
+
* } );
|
|
228
|
+
*/
|
|
229
|
+
onFinishChange(callback: Function): this;
|
|
230
|
+
_callOnFinishChange(controller: Controller): void;
|
|
231
|
+
/**
|
|
232
|
+
* Pass a function to be called when this GUI or its descendants are opened or closed.
|
|
233
|
+
* @param {function(GUI)} callback
|
|
234
|
+
* @returns {this}
|
|
235
|
+
* @example
|
|
236
|
+
* gui.onOpenClose( changedGUI => {
|
|
237
|
+
* console.log( changedGUI._closed );
|
|
238
|
+
* } );
|
|
239
|
+
*/
|
|
240
|
+
onOpenClose(callback: Function): this;
|
|
241
|
+
private _callOnOpenClose;
|
|
242
|
+
/**
|
|
243
|
+
* Destroys all DOM elements and event listeners associated with this GUI
|
|
244
|
+
*/
|
|
245
|
+
destroy(): void;
|
|
246
|
+
/**
|
|
247
|
+
* Returns an array of controllers contained by this GUI and its descendents.
|
|
248
|
+
* @returns {Controller[]}
|
|
249
|
+
*/
|
|
250
|
+
controllersRecursive(): Controller[];
|
|
251
|
+
/**
|
|
252
|
+
* Returns an array of folders contained by this GUI and its descendents.
|
|
253
|
+
* @returns {GUI[]}
|
|
254
|
+
*/
|
|
255
|
+
foldersRecursive(): GUI[];
|
|
256
|
+
update(): void;
|
|
257
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export declare class UIElement<T extends HTMLElement = HTMLElement> {
|
|
2
|
+
dom: T & {
|
|
3
|
+
disabled?: boolean;
|
|
4
|
+
};
|
|
5
|
+
constructor(dom: T);
|
|
6
|
+
add(...args: HTMLElement[]): this;
|
|
7
|
+
remove(...args: HTMLElement[]): this;
|
|
8
|
+
clear(): void;
|
|
9
|
+
setId(id: string): this;
|
|
10
|
+
getId(): string;
|
|
11
|
+
setClass(name: string): this;
|
|
12
|
+
addClass(name: any): this;
|
|
13
|
+
removeClass(name: any): this;
|
|
14
|
+
setStyle(style: string, array: any[]): this;
|
|
15
|
+
setDisabled(value: boolean): this;
|
|
16
|
+
setTextContent(value: string): this;
|
|
17
|
+
getIndexOfChild(element: UIElement): any;
|
|
18
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { UIElement } from './UIElement';
|
|
2
|
+
export declare class UIInteger extends UIElement<HTMLInputElement> {
|
|
3
|
+
value: number;
|
|
4
|
+
min: number;
|
|
5
|
+
max: number;
|
|
6
|
+
step: number;
|
|
7
|
+
nudge: number;
|
|
8
|
+
constructor(number: number);
|
|
9
|
+
getValue(): number;
|
|
10
|
+
setValue(value: any): this;
|
|
11
|
+
setStep(step: any): this;
|
|
12
|
+
setNudge(nudge: number): this;
|
|
13
|
+
setRange(min: number, max: number): this;
|
|
14
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { UIElement } from './UIElement';
|
|
2
|
+
export declare class UINumber extends UIElement<HTMLInputElement> {
|
|
3
|
+
value: number;
|
|
4
|
+
min: number;
|
|
5
|
+
max: number;
|
|
6
|
+
step: number;
|
|
7
|
+
nudge: number;
|
|
8
|
+
unit: string;
|
|
9
|
+
private _onChangeCallback;
|
|
10
|
+
constructor(value: number, min: number, max: number, step: number);
|
|
11
|
+
equals(v: number): boolean;
|
|
12
|
+
getValue(): number;
|
|
13
|
+
setValue(value: any): this;
|
|
14
|
+
updateDisplay(): void;
|
|
15
|
+
private _getImplicitStep;
|
|
16
|
+
private _snap;
|
|
17
|
+
onChange(callback: Function): this;
|
|
18
|
+
setUnit(unit: string): this;
|
|
19
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { GUI } from "../GUI";
|
|
2
|
+
import { Controller } from "./Controller";
|
|
3
|
+
export declare class ColorController extends Controller {
|
|
4
|
+
$input: HTMLInputElement;
|
|
5
|
+
$text: HTMLInputElement;
|
|
6
|
+
$display: HTMLDivElement;
|
|
7
|
+
$alpha: HTMLDivElement;
|
|
8
|
+
private _textFocused;
|
|
9
|
+
private _initialValueHexString;
|
|
10
|
+
private _rgbScale;
|
|
11
|
+
private _format;
|
|
12
|
+
constructor(parent: GUI, object: Object, property: string, rgbScale: number);
|
|
13
|
+
reset(): this;
|
|
14
|
+
private _setValueFromHexString;
|
|
15
|
+
save(): any;
|
|
16
|
+
load(value: string): this;
|
|
17
|
+
updateDisplay(): this;
|
|
18
|
+
}
|
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
import { GUI } from "../GUI";
|
|
2
|
+
export declare class Controller {
|
|
3
|
+
static nextNameID: number;
|
|
4
|
+
parent: GUI;
|
|
5
|
+
object: Object;
|
|
6
|
+
property: string;
|
|
7
|
+
/**
|
|
8
|
+
* The value of `object[ property ]` when the controller was created.
|
|
9
|
+
*/
|
|
10
|
+
initialValue: any;
|
|
11
|
+
/**
|
|
12
|
+
* The outermost container DOM element for this controller.
|
|
13
|
+
*/
|
|
14
|
+
domElement: HTMLElement;
|
|
15
|
+
/**
|
|
16
|
+
* The DOM element that contains the controller's name.
|
|
17
|
+
*/
|
|
18
|
+
$name: HTMLElement;
|
|
19
|
+
/**
|
|
20
|
+
* The DOM element that contains the controller's "widget" (which differs by controller type).
|
|
21
|
+
*/
|
|
22
|
+
$widget: HTMLElement;
|
|
23
|
+
/**
|
|
24
|
+
* The DOM element that receives the disabled attribute when using disable()
|
|
25
|
+
*/
|
|
26
|
+
$disable: HTMLElement;
|
|
27
|
+
/**
|
|
28
|
+
* Used to determine if the controller is disabled.
|
|
29
|
+
* Use `controller.disable( true|false )` to modify this value
|
|
30
|
+
*/
|
|
31
|
+
protected _disabled: boolean;
|
|
32
|
+
/**
|
|
33
|
+
* Used to determine if the Controller is hidden.
|
|
34
|
+
* Use `controller.show()` or `controller.hide()` to change this.
|
|
35
|
+
*/
|
|
36
|
+
protected _hidden: boolean;
|
|
37
|
+
protected _changed: boolean;
|
|
38
|
+
/**
|
|
39
|
+
* Used to determine if the controller is currently listening. Don't modify this value
|
|
40
|
+
* directly. Use the `controller.listen( true|false )` method instead.
|
|
41
|
+
*/
|
|
42
|
+
protected _listening: boolean;
|
|
43
|
+
protected _listenCallbackID: number;
|
|
44
|
+
protected _listenPrevValue: any;
|
|
45
|
+
/**
|
|
46
|
+
* The controller's name. Use `controller.name( 'Name' )` to modify this value.
|
|
47
|
+
*/
|
|
48
|
+
_name: string;
|
|
49
|
+
/**
|
|
50
|
+
* Used to access the function bound to `onChange` events. Don't modify this value directly.
|
|
51
|
+
* Use the `controller.onChange( callback )` method instead.
|
|
52
|
+
*/
|
|
53
|
+
protected _onChange: Function;
|
|
54
|
+
/**
|
|
55
|
+
* Used to access the function bound to `onFinishChange` events. Don't modify this value
|
|
56
|
+
* directly. Use the `controller.onFinishChange( callback )` method instead.
|
|
57
|
+
*/
|
|
58
|
+
protected _onFinishChange: Function;
|
|
59
|
+
constructor(parent: GUI, object: Object, property: string, className: string, widgetTag?: string);
|
|
60
|
+
/**
|
|
61
|
+
* Sets the name of the controller and its label in the GUI.
|
|
62
|
+
* @param {string} name
|
|
63
|
+
* @returns {this}
|
|
64
|
+
*/
|
|
65
|
+
name(name: string): this;
|
|
66
|
+
/**
|
|
67
|
+
* Pass a function to be called whenever the value is modified by this controller.
|
|
68
|
+
* The function receives the new value as its first parameter. The value of `this` will be the
|
|
69
|
+
* controller.
|
|
70
|
+
*
|
|
71
|
+
* For function controllers, the `onChange` callback will be fired on click, after the function
|
|
72
|
+
* executes.
|
|
73
|
+
* @param {Function} callback
|
|
74
|
+
* @returns {this}
|
|
75
|
+
* @example
|
|
76
|
+
* const controller = gui.add( object, 'property' );
|
|
77
|
+
*
|
|
78
|
+
* controller.onChange( function( v ) {
|
|
79
|
+
* console.log( 'The value is now ' + v );
|
|
80
|
+
* console.assert( this === controller );
|
|
81
|
+
* } );
|
|
82
|
+
*/
|
|
83
|
+
onChange(callback: Function): this;
|
|
84
|
+
/**
|
|
85
|
+
* Calls the onChange methods of this controller and its parent GUI.
|
|
86
|
+
*/
|
|
87
|
+
protected _callOnChange(): void;
|
|
88
|
+
/**
|
|
89
|
+
* Pass a function to be called after this controller has been modified and loses focus.
|
|
90
|
+
* @param {Function} callback
|
|
91
|
+
* @returns {this}
|
|
92
|
+
* @example
|
|
93
|
+
* const controller = gui.add( object, 'property' );
|
|
94
|
+
*
|
|
95
|
+
* controller.onFinishChange( function( v ) {
|
|
96
|
+
* console.log( 'Changes complete: ' + v );
|
|
97
|
+
* console.assert( this === controller );
|
|
98
|
+
* } );
|
|
99
|
+
*/
|
|
100
|
+
onFinishChange(callback: Function): this;
|
|
101
|
+
/**
|
|
102
|
+
* Should be called by Controller when its widgets lose focus.
|
|
103
|
+
*/
|
|
104
|
+
protected _callOnFinishChange(): void;
|
|
105
|
+
/**
|
|
106
|
+
* Sets the controller back to its initial value.
|
|
107
|
+
* @returns {this}
|
|
108
|
+
*/
|
|
109
|
+
reset(): this;
|
|
110
|
+
/**
|
|
111
|
+
* Enables this controller.
|
|
112
|
+
* @param {boolean} enabled
|
|
113
|
+
* @returns {this}
|
|
114
|
+
* @example
|
|
115
|
+
* controller.enable();
|
|
116
|
+
* controller.enable( false ); // disable
|
|
117
|
+
* controller.enable( controller._disabled ); // toggle
|
|
118
|
+
*/
|
|
119
|
+
enable(enabled?: boolean): this;
|
|
120
|
+
/**
|
|
121
|
+
* Disables this controller.
|
|
122
|
+
* @param {boolean} disabled
|
|
123
|
+
* @returns {this}
|
|
124
|
+
* @example
|
|
125
|
+
* controller.disable();
|
|
126
|
+
* controller.disable( false ); // enable
|
|
127
|
+
* controller.disable( !controller._disabled ); // toggle
|
|
128
|
+
*/
|
|
129
|
+
disable(disabled?: boolean): this;
|
|
130
|
+
/**
|
|
131
|
+
* Shows the Controller after it's been hidden.
|
|
132
|
+
* @param {boolean} show
|
|
133
|
+
* @returns {this}
|
|
134
|
+
* @example
|
|
135
|
+
* controller.show();
|
|
136
|
+
* controller.show( false ); // hide
|
|
137
|
+
* controller.show( controller._hidden ); // toggle
|
|
138
|
+
*/
|
|
139
|
+
show(show?: boolean): this;
|
|
140
|
+
/**
|
|
141
|
+
* Hides the Controller.
|
|
142
|
+
* @returns {this}
|
|
143
|
+
*/
|
|
144
|
+
hide(): this;
|
|
145
|
+
options(options: any): this;
|
|
146
|
+
/**
|
|
147
|
+
* Sets the minimum value. Only works on number controllers.
|
|
148
|
+
* @param {number} min
|
|
149
|
+
* @returns {this}
|
|
150
|
+
*/
|
|
151
|
+
min(min: number): this;
|
|
152
|
+
/**
|
|
153
|
+
* Sets the maximum value. Only works on number controllers.
|
|
154
|
+
* @param {number} max
|
|
155
|
+
* @returns {this}
|
|
156
|
+
*/
|
|
157
|
+
max(max: number): this;
|
|
158
|
+
/**
|
|
159
|
+
* Values set by this controller will be rounded to multiples of `step`. Only works on number
|
|
160
|
+
* controllers.
|
|
161
|
+
* @param {number} step
|
|
162
|
+
* @returns {this}
|
|
163
|
+
*/
|
|
164
|
+
step(step: number): this;
|
|
165
|
+
/**
|
|
166
|
+
* Rounds the displayed value to a fixed number of decimals, without affecting the actual value
|
|
167
|
+
* like `step()`. Only works on number controllers.
|
|
168
|
+
* @example
|
|
169
|
+
* gui.add( object, 'property' ).listen().decimals( 4 );
|
|
170
|
+
* @param {number} decimals
|
|
171
|
+
* @returns {this}
|
|
172
|
+
*/
|
|
173
|
+
decimals(decimals: number): this;
|
|
174
|
+
/**
|
|
175
|
+
* Calls `updateDisplay()` every animation frame. Pass `false` to stop listening.
|
|
176
|
+
* @param {boolean} listen
|
|
177
|
+
* @returns {this}
|
|
178
|
+
*/
|
|
179
|
+
listen(listen?: boolean): this;
|
|
180
|
+
needsUpdateDisplay(): boolean;
|
|
181
|
+
private _listenCallback;
|
|
182
|
+
/**
|
|
183
|
+
* Returns `object[ property ]`.
|
|
184
|
+
* @returns {any}
|
|
185
|
+
*/
|
|
186
|
+
getValue(): any;
|
|
187
|
+
/**
|
|
188
|
+
* Sets the value of `object[ property ]`, invokes any `onChange` handlers and updates the display.
|
|
189
|
+
* @param {any} value
|
|
190
|
+
* @param {boolean} callOnChange
|
|
191
|
+
* @returns {this}
|
|
192
|
+
*/
|
|
193
|
+
setValue(value: any): this;
|
|
194
|
+
update(): void;
|
|
195
|
+
/**
|
|
196
|
+
* Updates the display to keep it in sync with the current value. Useful for updating your
|
|
197
|
+
* controllers when their values have been modified outside of the GUI.
|
|
198
|
+
* @returns {this}
|
|
199
|
+
*/
|
|
200
|
+
updateDisplay(): this;
|
|
201
|
+
load(value: any): this;
|
|
202
|
+
save(): any;
|
|
203
|
+
/**
|
|
204
|
+
* Destroys this controller and removes it from the parent GUI.
|
|
205
|
+
*/
|
|
206
|
+
destroy(): void;
|
|
207
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { GUI } from "../GUI";
|
|
2
|
+
import { Controller } from "./Controller";
|
|
3
|
+
export declare class CurveController extends Controller {
|
|
4
|
+
private _curveEditor;
|
|
5
|
+
constructor(parent: GUI, object: Object, property: string);
|
|
6
|
+
needsUpdateDisplay(): boolean;
|
|
7
|
+
updateDisplay(): this;
|
|
8
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { GUI } from "../GUI";
|
|
2
|
+
import { Controller } from "./Controller";
|
|
3
|
+
export declare class ImageController extends Controller {
|
|
4
|
+
static _context: any;
|
|
5
|
+
static _imageMap: WeakMap<WeakKey, any>;
|
|
6
|
+
static toDataURL(img: HTMLImageElement | ImageBitmap & {
|
|
7
|
+
data?: any;
|
|
8
|
+
}): Promise<any>;
|
|
9
|
+
$img: HTMLImageElement;
|
|
10
|
+
constructor(parent: GUI, object: Object, property: string);
|
|
11
|
+
updateDisplay(): this;
|
|
12
|
+
}
|