dat.gui: Add default export. Add some JSDocs. Remove spurious addColor() overloads. (#25188)

* Fix exports for usage as module. Add JSDocs. Remove addColor method.

* Rename _defaultExport to index to match implementation.
Even though this should not matter, feels cleaner.

* Remove default export
This commit is contained in:
efokschaner
2018-04-28 00:30:58 -07:00
committed by Wesley Wigham
parent 01a1a5649b
commit 3c9b95fef0

View File

@@ -1,10 +1,49 @@
// Type definitions for dat.GUI 0.6
// Type definitions for dat.GUI 0.7
// Project: https://github.com/dataarts/dat.gui
// Definitions by: Satoru Kimura <https://github.com/gyohk>, ZongJing Lu <https://github.com/sonic3d>, Richard Roylance <https://github.com/rroylance>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
export as namespace dat;
export interface GUIParams {
/**
* Handles GUI's element placement for you.
* @default true
*/
autoPlace?: boolean;
/**
* If true, starts closed.
* @default false
*/
closed?: boolean;
/**
* If true, close/open button shows on top of the GUI.
* @default false
*/
closeOnTop?: boolean;
/**
* If true, GUI is closed by the "h" keypress.
* @default false
*/
hideable?: boolean;
/**
* JSON object representing the saved state of this GUI.
*/
load?: any;
/**
* The name of this GUI.
*/
name?: string;
/**
* The identifier for a set of saved values.
*/
preset?: string;
/**
* The width of GUI element.
*/
width?: number;
}
export class GUI {
constructor(option?: GUIParams);
@@ -20,9 +59,6 @@ export class GUI {
add(target: Object, propName:string, items:Object): GUIController;
addColor(target: Object, propName:string): GUIController;
addColor(target: Object, propName:string, color: string): GUIController;
addColor(target: Object, propName:string, rgba: number[]): GUIController; // rgb or rgba
addColor(target: Object, propName:string, hsv:{h:number; s:number; v:number}): GUIController;
remove(controller: GUIController): void;
destroy(): void;
@@ -55,16 +91,6 @@ export class GUI {
useLocalStorage: boolean;
}
export interface GUIParams{
autoPlace?: boolean;
closed?: boolean;
closeOnTop?: boolean;
load?: any;
name?: string;
preset?: string;
width?: number;
}
export class GUIController {
destroy(): void;