babylon.inspector.d.ts 45 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398
  1. declare module INSPECTOR {
  2. class Inspector {
  3. private _c2diwrapper;
  4. /** The panel displayed at the top of the inspector */
  5. private _topPanel;
  6. /** The div containing the content of the active tab */
  7. private _tabPanel;
  8. /** The panel containing the list if items */
  9. /** The list if tree items displayed in the tree panel. */
  10. private _items;
  11. private _tabbar;
  12. private _scene;
  13. /** The HTML document relative to this inspector (the window or the popup depending on its mode) */
  14. static DOCUMENT: HTMLDocument;
  15. /** The HTML window. In popup mode, it's the popup itself. Otherwise, it's the current tab */
  16. static WINDOW: Window;
  17. /** True if the inspector is built as a popup tab */
  18. private _popupMode;
  19. /** The original canvas style, before applying the inspector*/
  20. private _canvasStyle;
  21. private _initialTab;
  22. private _parentElement;
  23. /** The inspector is created with the given engine.
  24. * If the parameter 'popup' is false, the inspector is created as a right panel on the main window.
  25. * If the parameter 'popup' is true, the inspector is created in another popup.
  26. */
  27. constructor(scene: BABYLON.Scene, popup?: boolean, initialTab?: number, parentElement?: HTMLElement, newColors?: {
  28. backgroundColor?: string;
  29. backgroundColorLighter?: string;
  30. backgroundColorLighter2?: string;
  31. backgroundColorLighter3?: string;
  32. color?: string;
  33. colorTop?: string;
  34. colorBot?: string;
  35. });
  36. /**
  37. * If the given element has a position 'asbolute' or 'relative',
  38. * returns the first parent of the given element that has a position 'relative' or 'absolute'.
  39. * If the given element has no position, returns the first parent
  40. *
  41. */
  42. private _getRelativeParent(elem, lookForAbsoluteOrRelative?);
  43. /** Build the inspector panel in the given HTML element */
  44. private _buildInspector(parent);
  45. readonly scene: BABYLON.Scene;
  46. readonly popupMode: boolean;
  47. /**
  48. * Filter the list of item present in the tree.
  49. * All item returned should have the given filter contained in the item id.
  50. */
  51. filterItem(filter: string): void;
  52. /** Display the mesh tab on the given object */
  53. displayObjectDetails(mesh: BABYLON.AbstractMesh): void;
  54. /** Clean the whole tree of item and rebuilds it */
  55. refresh(): void;
  56. /** Remove the inspector panel when it's built as a right panel:
  57. * remove the right panel and remove the wrapper
  58. */
  59. dispose(): void;
  60. /** Open the inspector in a new popup
  61. * Set 'firstTime' to true if there is no inspector created beforehands
  62. */
  63. openPopup(firstTime?: boolean): void;
  64. getActiveTabIndex(): number;
  65. }
  66. }
  67. declare module INSPECTOR {
  68. var PROPERTIES: {
  69. format: (obj: any) => any;
  70. 'type_not_defined': {
  71. properties: any[];
  72. format: () => string;
  73. };
  74. 'Vector2': {
  75. type: typeof BABYLON.Vector2;
  76. properties: string[];
  77. format: (vec: BABYLON.Vector2) => string;
  78. };
  79. 'Vector3': {
  80. type: typeof BABYLON.Vector3;
  81. properties: string[];
  82. format: (vec: BABYLON.Vector3) => string;
  83. };
  84. 'Color3': {
  85. type: typeof BABYLON.Color3;
  86. properties: string[];
  87. format: (color: BABYLON.Color3) => string;
  88. slider: {
  89. r: {
  90. min: number;
  91. max: number;
  92. step: number;
  93. };
  94. g: {
  95. min: number;
  96. max: number;
  97. step: number;
  98. };
  99. b: {
  100. min: number;
  101. max: number;
  102. step: number;
  103. };
  104. };
  105. };
  106. 'Color4': {
  107. type: typeof BABYLON.Color4;
  108. properties: string[];
  109. format: (color: BABYLON.Color4) => string;
  110. slider: {
  111. r: {
  112. min: number;
  113. max: number;
  114. step: number;
  115. };
  116. g: {
  117. min: number;
  118. max: number;
  119. step: number;
  120. };
  121. b: {
  122. min: number;
  123. max: number;
  124. step: number;
  125. };
  126. };
  127. };
  128. 'Quaternion': {
  129. type: typeof BABYLON.Quaternion;
  130. properties: string[];
  131. };
  132. 'Size': {
  133. type: typeof BABYLON.Size;
  134. properties: string[];
  135. format: (size: BABYLON.Size) => string;
  136. };
  137. 'Texture': {
  138. type: typeof BABYLON.Texture;
  139. properties: string[];
  140. format: (tex: BABYLON.Texture) => string;
  141. };
  142. 'MapTexture': {
  143. type: typeof BABYLON.MapTexture;
  144. };
  145. 'RenderTargetTexture': {
  146. type: typeof BABYLON.RenderTargetTexture;
  147. };
  148. 'DynamicTexture': {
  149. type: typeof BABYLON.DynamicTexture;
  150. };
  151. 'BaseTexture': {
  152. type: typeof BABYLON.BaseTexture;
  153. };
  154. 'CubeTexture': {
  155. type: typeof BABYLON.CubeTexture;
  156. };
  157. 'HDRCubeTexture': {
  158. type: typeof BABYLON.HDRCubeTexture;
  159. };
  160. 'FontTexture': {
  161. type: typeof BABYLON.FontTexture;
  162. };
  163. 'Sound': {
  164. type: typeof BABYLON.Sound;
  165. properties: string[];
  166. };
  167. 'ArcRotateCamera': {
  168. type: typeof BABYLON.ArcRotateCamera;
  169. properties: string[];
  170. slider: {
  171. alpha: {
  172. min: number;
  173. max: number;
  174. step: number;
  175. };
  176. };
  177. };
  178. 'FreeCamera': {
  179. type: typeof BABYLON.FreeCamera;
  180. properties: string[];
  181. };
  182. 'Scene': {
  183. type: typeof BABYLON.Scene;
  184. properties: string[];
  185. };
  186. 'Mesh': {
  187. type: typeof BABYLON.Mesh;
  188. properties: string[];
  189. format: (m: BABYLON.Mesh) => string;
  190. };
  191. 'StandardMaterial': {
  192. type: typeof BABYLON.StandardMaterial;
  193. properties: string[];
  194. format: (mat: BABYLON.StandardMaterial) => string;
  195. slider: {
  196. alpha: {
  197. min: number;
  198. max: number;
  199. step: number;
  200. };
  201. };
  202. };
  203. 'PrimitiveAlignment': {
  204. type: typeof BABYLON.PrimitiveAlignment;
  205. properties: string[];
  206. };
  207. 'PrimitiveThickness': {
  208. type: typeof BABYLON.PrimitiveThickness;
  209. properties: string[];
  210. };
  211. 'BoundingInfo2D': {
  212. type: typeof BABYLON.BoundingInfo2D;
  213. properties: string[];
  214. };
  215. 'SolidColorBrush2D': {
  216. type: typeof BABYLON.SolidColorBrush2D;
  217. properties: string[];
  218. };
  219. 'GradientColorBrush2D': {
  220. type: typeof BABYLON.GradientColorBrush2D;
  221. properties: string[];
  222. };
  223. 'PBRMaterial': {
  224. type: typeof BABYLON.PBRMaterial;
  225. properties: string[];
  226. slider: {
  227. alpha: {
  228. min: number;
  229. max: number;
  230. step: number;
  231. };
  232. };
  233. };
  234. 'Canvas2D': {
  235. type: typeof BABYLON.Canvas2D;
  236. };
  237. 'Canvas2DEngineBoundData': {
  238. type: typeof BABYLON.Canvas2DEngineBoundData;
  239. };
  240. 'Ellipse2D': {
  241. type: typeof BABYLON.Ellipse2D;
  242. };
  243. 'Ellipse2DInstanceData': {
  244. type: typeof BABYLON.Ellipse2DInstanceData;
  245. };
  246. 'Ellipse2DRenderCache': {
  247. type: typeof BABYLON.Ellipse2DRenderCache;
  248. };
  249. 'Group2D': {
  250. type: typeof BABYLON.Group2D;
  251. };
  252. 'IntersectInfo2D': {
  253. type: typeof BABYLON.IntersectInfo2D;
  254. };
  255. 'Lines2D': {
  256. type: typeof BABYLON.Lines2D;
  257. };
  258. 'Lines2DInstanceData': {
  259. type: typeof BABYLON.Lines2DInstanceData;
  260. };
  261. 'Lines2DRenderCache': {
  262. type: typeof BABYLON.Lines2DRenderCache;
  263. };
  264. 'PrepareRender2DContext': {
  265. type: typeof BABYLON.PrepareRender2DContext;
  266. };
  267. 'Prim2DBase': {
  268. type: typeof BABYLON.Prim2DBase;
  269. };
  270. 'Prim2DClassInfo': {
  271. type: typeof BABYLON.Prim2DClassInfo;
  272. };
  273. 'Prim2DPropInfo': {
  274. type: typeof BABYLON.Prim2DPropInfo;
  275. };
  276. 'Rectangle2D': {
  277. type: typeof BABYLON.Rectangle2D;
  278. };
  279. 'Rectangle2DInstanceData': {
  280. type: typeof BABYLON.Rectangle2DInstanceData;
  281. };
  282. 'Rectangle2DRenderCache': {
  283. type: typeof BABYLON.Rectangle2DRenderCache;
  284. };
  285. 'Render2DContext': {
  286. type: typeof BABYLON.Render2DContext;
  287. };
  288. 'RenderablePrim2D': {
  289. type: typeof BABYLON.RenderablePrim2D;
  290. };
  291. 'ScreenSpaceCanvas2D': {
  292. type: typeof BABYLON.ScreenSpaceCanvas2D;
  293. };
  294. 'Shape2D': {
  295. type: typeof BABYLON.Shape2D;
  296. };
  297. 'Shape2DInstanceData': {
  298. type: typeof BABYLON.Shape2DInstanceData;
  299. };
  300. 'Sprite2D': {
  301. type: typeof BABYLON.Sprite2D;
  302. };
  303. 'Sprite2DInstanceData': {
  304. type: typeof BABYLON.Sprite2DInstanceData;
  305. };
  306. 'Sprite2DRenderCache': {
  307. type: typeof BABYLON.Sprite2DRenderCache;
  308. };
  309. 'Text2D': {
  310. type: typeof BABYLON.Text2D;
  311. };
  312. 'Text2DInstanceData': {
  313. type: typeof BABYLON.Text2DInstanceData;
  314. };
  315. 'Text2DRenderCache': {
  316. type: typeof BABYLON.Text2DRenderCache;
  317. };
  318. 'WorldSpaceCanvas2D': {
  319. type: typeof BABYLON.WorldSpaceCanvas2D;
  320. };
  321. 'WorldSpaceCanvas2DNode': {
  322. type: typeof BABYLON.WorldSpaceCanvas2DNode;
  323. };
  324. 'PhysicsImpostor': {
  325. type: typeof BABYLON.PhysicsImpostor;
  326. properties: string[];
  327. };
  328. };
  329. }
  330. declare module INSPECTOR {
  331. /**
  332. * Function that add gui objects properties to the variable PROPERTIES
  333. */
  334. function loadGUIProperties(): void;
  335. }
  336. declare module INSPECTOR {
  337. /**
  338. * Represents a html div element.
  339. * The div is built when an instance of BasicElement is created.
  340. */
  341. abstract class BasicElement {
  342. protected _div: HTMLElement;
  343. constructor();
  344. /**
  345. * Returns the div element
  346. */
  347. toHtml(): HTMLElement;
  348. /**
  349. * Build the html element
  350. */
  351. protected _build(): void;
  352. abstract update(data?: any): any;
  353. /** Default dispose method if needed */
  354. dispose(): void;
  355. }
  356. }
  357. declare module INSPECTOR {
  358. abstract class Adapter {
  359. protected _obj: any;
  360. private static _name;
  361. constructor(obj: any);
  362. /** Returns the name displayed in the tree */
  363. abstract id(): string;
  364. /** Returns the type of this object - displayed in the tree */
  365. abstract type(): string;
  366. /** Returns the list of properties to be displayed for this adapter */
  367. abstract getProperties(): Array<PropertyLine>;
  368. /** Returns the actual object behind this adapter */
  369. readonly actualObject: any;
  370. /** Returns true if the given object correspond to this */
  371. correspondsTo(obj: any): boolean;
  372. /** Returns the adapter unique name */
  373. readonly name: string;
  374. /**
  375. * Returns the actual object used for this adapter
  376. */
  377. readonly object: any;
  378. /** Returns the list of tools available for this adapter */
  379. abstract getTools(): Array<AbstractTreeTool>;
  380. }
  381. }
  382. declare module INSPECTOR {
  383. class CameraAdapter extends Adapter implements ICameraPOV {
  384. constructor(obj: BABYLON.Camera);
  385. /** Returns the name displayed in the tree */
  386. id(): string;
  387. /** Returns the type of this object - displayed in the tree */
  388. type(): string;
  389. /** Returns the list of properties to be displayed for this adapter */
  390. getProperties(): Array<PropertyLine>;
  391. getTools(): Array<AbstractTreeTool>;
  392. setPOV(): void;
  393. }
  394. }
  395. declare module INSPECTOR {
  396. class PhysicsImpostorAdapter extends Adapter implements IToolVisible {
  397. private _viewer;
  398. private _isVisible;
  399. constructor(obj: BABYLON.PhysicsImpostor, viewer: BABYLON.Debug.PhysicsViewer);
  400. /** Returns the name displayed in the tree */
  401. id(): string;
  402. /** Returns the type of this object - displayed in the tree */
  403. type(): string;
  404. /** Returns the list of properties to be displayed for this adapter */
  405. getProperties(): Array<PropertyLine>;
  406. getTools(): Array<AbstractTreeTool>;
  407. setVisible(b: boolean): void;
  408. isVisible(): boolean;
  409. }
  410. }
  411. declare module INSPECTOR {
  412. class GUIAdapter extends Adapter implements IToolVisible {
  413. constructor(obj: BABYLON.GUI.Control);
  414. /** Returns the name displayed in the tree */
  415. id(): string;
  416. /** Returns the type of this object - displayed in the tree */
  417. type(): string;
  418. /** Returns the list of properties to be displayed for this adapter */
  419. getProperties(): Array<PropertyLine>;
  420. getTools(): Array<AbstractTreeTool>;
  421. setVisible(b: boolean): void;
  422. isVisible(): boolean;
  423. }
  424. }
  425. declare module INSPECTOR {
  426. class SoundAdapter extends Adapter implements ISoundInteractions {
  427. constructor(obj: BABYLON.Sound);
  428. /** Returns the name displayed in the tree */
  429. id(): string;
  430. /** Returns the type of this object - displayed in the tree */
  431. type(): string;
  432. /** Returns the list of properties to be displayed for this adapter */
  433. getProperties(): Array<PropertyLine>;
  434. getTools(): Array<AbstractTreeTool>;
  435. setPlaying(callback: Function): void;
  436. }
  437. }
  438. declare module INSPECTOR {
  439. class TextureAdapter extends Adapter {
  440. constructor(obj: BABYLON.BaseTexture);
  441. /** Returns the name displayed in the tree */
  442. id(): string;
  443. /** Returns the type of this object - displayed in the tree */
  444. type(): string;
  445. /** Returns the list of properties to be displayed for this adapter */
  446. getProperties(): Array<PropertyLine>;
  447. getTools(): Array<AbstractTreeTool>;
  448. }
  449. }
  450. declare module INSPECTOR {
  451. class LightAdapter extends Adapter implements IToolVisible {
  452. constructor(obj: BABYLON.Light);
  453. /** Returns the name displayed in the tree */
  454. id(): string;
  455. /** Returns the type of this object - displayed in the tree */
  456. type(): string;
  457. /** Returns the list of properties to be displayed for this adapter */
  458. getProperties(): Array<PropertyLine>;
  459. getTools(): Array<AbstractTreeTool>;
  460. setVisible(b: boolean): void;
  461. isVisible(): boolean;
  462. }
  463. }
  464. declare module INSPECTOR {
  465. class MaterialAdapter extends Adapter {
  466. constructor(obj: BABYLON.Material);
  467. /** Returns the name displayed in the tree */
  468. id(): string;
  469. /** Returns the type of this object - displayed in the tree */
  470. type(): string;
  471. /** Returns the list of properties to be displayed for this adapter */
  472. getProperties(): Array<PropertyLine>;
  473. /** No tools for a material adapter */
  474. getTools(): Array<AbstractTreeTool>;
  475. }
  476. }
  477. declare module INSPECTOR {
  478. class MeshAdapter extends Adapter implements IToolVisible, IToolDebug, IToolBoundingBox, IToolInfo {
  479. /** Keep track of the axis of the actual object */
  480. private _axis;
  481. constructor(obj: BABYLON.AbstractMesh);
  482. /** Returns the name displayed in the tree */
  483. id(): string;
  484. /** Returns the type of this object - displayed in the tree */
  485. type(): string;
  486. /** Returns the list of properties to be displayed for this adapter */
  487. getProperties(): Array<PropertyLine>;
  488. getTools(): Array<AbstractTreeTool>;
  489. setVisible(b: boolean): void;
  490. isVisible(): boolean;
  491. isBoxVisible(): boolean;
  492. setBoxVisible(b: boolean): boolean;
  493. debug(b: boolean): void;
  494. /** Returns some information about this mesh */
  495. getInfo(): string;
  496. /** Draw X, Y and Z axis for the actual object if this adapter.
  497. * Should be called only one time as it will fill this._axis
  498. */
  499. private _drawAxis();
  500. }
  501. }
  502. declare module INSPECTOR {
  503. interface SortDirection {
  504. [property: string]: number;
  505. }
  506. class DetailPanel extends BasicElement {
  507. private _headerRow;
  508. private _detailRows;
  509. private _sortDirection;
  510. constructor(dr?: Array<PropertyLine>);
  511. details: Array<PropertyLine>;
  512. protected _build(): void;
  513. /** Updates the HTML of the detail panel */
  514. update(): void;
  515. /** Add all lines in the html div. Does not sort them! */
  516. private _addDetails();
  517. /**
  518. * Sort the details row by comparing the given property of each row
  519. */
  520. private _sortDetails(property, _direction?);
  521. /**
  522. * Removes all data in the detail panel but keep the header row
  523. */
  524. clean(): void;
  525. /** Overrides basicelement.dispose */
  526. dispose(): void;
  527. /**
  528. * Creates the header row : name, value, id
  529. */
  530. private _createHeaderRow();
  531. }
  532. }
  533. declare module INSPECTOR {
  534. /**
  535. * A property is a link between a data (string) and an object.
  536. */
  537. class Property {
  538. /** The property name */
  539. private _property;
  540. /** The obj this property refers to */
  541. private _obj;
  542. constructor(prop: string, obj: any);
  543. readonly name: string;
  544. value: any;
  545. readonly type: string;
  546. obj: any;
  547. }
  548. }
  549. declare module INSPECTOR {
  550. class PropertyFormatter {
  551. /**
  552. * Format the value of the given property of the given object.
  553. */
  554. static format(obj: any, prop: string): string;
  555. }
  556. /**
  557. * A property line represents a line in the detail panel. This line is composed of :
  558. * - a name (the property name)
  559. * - a value if this property is of a type 'simple' : string, number, boolean, color, texture
  560. * - the type of the value if this property is of a complex type (Vector2, Size, ...)
  561. * - a ID if defined (otherwise an empty string is displayed)
  562. * The original object is sent to the value object who will update it at will.
  563. *
  564. * A property line can contain OTHER property line objects in the case of a complex type.
  565. * If this instance has no link to other instances, its type is ALWAYS a simple one (see above).
  566. *
  567. */
  568. class PropertyLine {
  569. private _property;
  570. private _div;
  571. private _valueDiv;
  572. private _children;
  573. private static _SIMPLE_TYPE;
  574. private static _MARGIN_LEFT;
  575. private _level;
  576. /** The list of viewer element displayed at the end of the line (color, texture...) */
  577. private _elements;
  578. /** The property parent of this one. Used to update the value of this property and to retrieve the correct object */
  579. private _parent;
  580. /** The input element to display if this property is 'simple' in order to update it */
  581. private _input;
  582. /** Display input handler (stored to be removed afterwards) */
  583. private _displayInputHandler;
  584. /** Handler used to validate the input by pressing 'enter' */
  585. private _validateInputHandler;
  586. /** Handler used to validate the input by pressing 'esc' */
  587. private _escapeInputHandler;
  588. /** Handler used on focus out */
  589. private _focusOutInputHandler;
  590. /** Handler used to get mouse position */
  591. private _onMouseDownHandler;
  592. private _onMouseDragHandler;
  593. private _onMouseUpHandler;
  594. private _textValue;
  595. /** Save previous Y mouse position */
  596. private _prevY;
  597. /**Save value while slider is on */
  598. private _preValue;
  599. constructor(prop: Property, parent?: PropertyLine, level?: number);
  600. /**
  601. * Init the input element and al its handler :
  602. * - a click in the window remove the input and restore the old property value
  603. * - enters updates the property
  604. */
  605. private _initInput();
  606. /**
  607. * On enter : validates the new value and removes the input
  608. * On escape : removes the input
  609. */
  610. private _validateInput(e);
  611. validateInput(value: any, forceupdate?: boolean): void;
  612. /**
  613. * On escape : removes the input
  614. */
  615. private _escapeInput(e);
  616. /** Removes the input without validating the new value */
  617. private _removeInputWithoutValidating();
  618. /** Replaces the default display with an input */
  619. private _displayInput(e);
  620. /** Retrieve the correct object from its parent.
  621. * If no parent exists, returns the property value.
  622. * This method is used at each update in case the property object is removed from the original object
  623. * (example : mesh.position = new BABYLON.Vector3 ; the original vector3 object is deleted from the mesh).
  624. */
  625. updateObject(): any;
  626. readonly name: string;
  627. readonly value: any;
  628. readonly type: string;
  629. /**
  630. * Creates elements that wil be displayed on a property line, depending on the
  631. * type of the property.
  632. */
  633. private _createElements();
  634. private _displayValueContent();
  635. /** Delete properly this property line.
  636. * Removes itself from the scheduler.
  637. * Dispose all viewer element (color, texture...)
  638. */
  639. dispose(): void;
  640. /** Updates the content of _valueDiv with the value of the property,
  641. * and all HTML element correpsonding to this type.
  642. * Elements are updated as well
  643. */
  644. private _updateValue();
  645. /**
  646. * Update the property division with the new property value.
  647. * If this property is complex, update its child, otherwise update its text content
  648. */
  649. update(): void;
  650. /**
  651. * Returns true if the given instance is a simple type
  652. */
  653. private static _IS_TYPE_SIMPLE(inst);
  654. /**
  655. * Returns true if the type of this property is simple, false otherwise.
  656. * Returns true if the value is null
  657. */
  658. private _isSimple();
  659. toHtml(): HTMLElement;
  660. closeDetails(): void;
  661. /**
  662. * Add sub properties in case of a complex type
  663. */
  664. private _addDetails();
  665. /**
  666. * Refresh mouse position on y axis
  667. * @param e
  668. */
  669. private _onMouseDrag(e);
  670. /**
  671. * Save new value from slider
  672. * @param e
  673. */
  674. private _onMouseUp(e);
  675. /**
  676. * Start record mouse position
  677. * @param e
  678. */
  679. private _onMouseDown(e);
  680. /**
  681. * Create input entry
  682. */
  683. private _checkboxInput();
  684. private _rangeInput();
  685. private _rangeHandler();
  686. private _isSliderType();
  687. private _getSliderProperty();
  688. }
  689. }
  690. declare module INSPECTOR {
  691. /**
  692. * Display a very small div corresponding to the given color
  693. */
  694. class ColorElement extends BasicElement {
  695. constructor(color: BABYLON.Color4 | BABYLON.Color3);
  696. update(color?: BABYLON.Color4 | BABYLON.Color3): void;
  697. private _toRgba(color);
  698. }
  699. }
  700. declare module INSPECTOR {
  701. /**
  702. * Represents a html div element.
  703. * The div is built when an instance of BasicElement is created.
  704. */
  705. class ColorPickerElement extends BasicElement {
  706. protected _input: HTMLInputElement;
  707. private pline;
  708. constructor(color: BABYLON.Color4 | BABYLON.Color3, propertyLine: PropertyLine);
  709. update(color?: BABYLON.Color4 | BABYLON.Color3): void;
  710. private _toRgba(color);
  711. }
  712. }
  713. declare module INSPECTOR {
  714. /**
  715. * Display a very small div. A new canvas is created, with a new Babylon.js scene, containing only the
  716. * cube texture in a cube
  717. */
  718. class CubeTextureElement extends BasicElement {
  719. /** The big div displaying the full image */
  720. private _textureDiv;
  721. private _engine;
  722. protected _scene: BABYLON.Scene;
  723. protected _cube: BABYLON.Mesh;
  724. private _canvas;
  725. protected _textureUrl: string;
  726. private _pause;
  727. /** The texture given as a parameter should be cube. */
  728. constructor(tex: BABYLON.Texture);
  729. update(tex?: BABYLON.Texture): void;
  730. /** Creates the box */
  731. protected _populateScene(): void;
  732. /** Init the babylon engine */
  733. private _initEngine();
  734. private _showViewer(mode);
  735. /** Removes properly the babylon engine */
  736. dispose(): void;
  737. }
  738. }
  739. declare module INSPECTOR {
  740. /**
  741. * Display a very small div. A new canvas is created, with a new Babylon.js scene, containing only the
  742. * cube texture in a cube
  743. */
  744. class HDRCubeTextureElement extends CubeTextureElement {
  745. /** The texture given as a parameter should be cube. */
  746. constructor(tex: BABYLON.Texture);
  747. /** Creates the box */
  748. protected _populateScene(): void;
  749. }
  750. }
  751. declare module INSPECTOR {
  752. /**
  753. * A search bar can be used to filter elements in the tree panel.
  754. * At each keypress on the input, the treepanel will be filtered.
  755. */
  756. class SearchBar extends BasicElement {
  757. private _tab;
  758. private _inputElement;
  759. constructor(tab: PropertyTab);
  760. /** Delete all characters typped in the input element */
  761. reset(): void;
  762. update(): void;
  763. }
  764. }
  765. declare module INSPECTOR {
  766. /**
  767. * Display a very small div corresponding to the given texture. On mouse over, display the full image
  768. */
  769. class TextureElement extends BasicElement {
  770. /** The big div displaying the full image */
  771. private _textureDiv;
  772. constructor(tex: BABYLON.Texture);
  773. update(tex?: BABYLON.Texture): void;
  774. private _showViewer(mode);
  775. }
  776. }
  777. declare module INSPECTOR {
  778. /**
  779. * Creates a tooltip for the parent of the given html element
  780. */
  781. class Tooltip {
  782. /** The tooltip is displayed for this element */
  783. private _elem;
  784. /** The tooltip div */
  785. private _infoDiv;
  786. constructor(elem: HTMLElement, tip: string, attachTo?: HTMLElement);
  787. }
  788. }
  789. declare module INSPECTOR {
  790. class Helpers {
  791. /**
  792. * Returns the type of the given object. First
  793. * uses getClassName. If nothing is returned, used the type of the constructor
  794. */
  795. static GET_TYPE(obj: any): string;
  796. /**
  797. * Check if some properties are defined for the given type.
  798. */
  799. private static _CheckIfTypeExists(type);
  800. /**
  801. * Returns true if the user browser is edge.
  802. */
  803. static IsBrowserEdge(): boolean;
  804. /**
  805. * Returns the name of the type of the given object, where the name
  806. * is in PROPERTIES constant.
  807. * Returns 'Undefined' if no type exists for this object
  808. */
  809. private static _GetTypeFor(obj);
  810. /**
  811. * Returns the name of a function (workaround to get object type for IE11)
  812. */
  813. private static _GetFnName(fn);
  814. /** Send the event which name is given in parameter to the window */
  815. static SEND_EVENT(eventName: string): void;
  816. /** Returns the given number with 2 decimal number max if a decimal part exists */
  817. static Trunc(nb: any): number;
  818. /**
  819. * Useful function used to create a div
  820. */
  821. static CreateDiv(className?: string, parent?: HTMLElement): HTMLElement;
  822. /**
  823. * Useful function used to create a input
  824. */
  825. static CreateInput(className?: string, parent?: HTMLElement): HTMLInputElement;
  826. static CreateElement(element: string, className?: string, parent?: HTMLElement): HTMLElement;
  827. /**
  828. * Removes all children of the given div.
  829. */
  830. static CleanDiv(div: HTMLElement): void;
  831. /**
  832. * Returns the true value of the given CSS Attribute from the given element (in percentage or in pixel, as it was specified in the css)
  833. */
  834. static Css(elem: HTMLElement, cssAttribute: string): string;
  835. static LoadScript(): void;
  836. static IsSystemName(name: string): boolean;
  837. /**
  838. * Return an array of PropertyLine for an obj
  839. * @param obj
  840. */
  841. static GetAllLinesProperties(obj: any): Array<PropertyLine>;
  842. static Capitalize(str: string): string;
  843. }
  844. }
  845. declare module INSPECTOR {
  846. class Scheduler {
  847. private static _instance;
  848. /** The number of the set interval */
  849. private _timer;
  850. /** Is this scheduler in pause ? */
  851. pause: boolean;
  852. /** All properties are refreshed every 250ms */
  853. static REFRESH_TIME: number;
  854. /** The list of data to update */
  855. private _updatableProperties;
  856. constructor();
  857. static getInstance(): Scheduler;
  858. /** Add a property line to be updated every X ms */
  859. add(prop: PropertyLine): void;
  860. /** Removes the given property from the list of properties to update */
  861. remove(prop: PropertyLine): void;
  862. private _update();
  863. }
  864. }
  865. declare module INSPECTOR {
  866. abstract class Tab extends BasicElement {
  867. protected _tabbar: TabBar;
  868. name: string;
  869. protected _isActive: boolean;
  870. protected _panel: HTMLDivElement;
  871. constructor(tabbar: TabBar, name: string);
  872. /** True if the tab is active, false otherwise */
  873. isActive(): boolean;
  874. protected _build(): void;
  875. /** Set this tab as active or not, depending on the current state */
  876. active(b: boolean): void;
  877. update(): void;
  878. /** Creates the tab panel for this tab. */
  879. getPanel(): HTMLElement;
  880. /** Add this in the propertytab with the searchbar */
  881. filter(str: string): void;
  882. /** Dispose properly this tab */
  883. abstract dispose(): any;
  884. /** Select an item in the tree */
  885. select(item: TreeItem): void;
  886. /**
  887. * Returns the total width in pixel of this tab, 0 by default
  888. */
  889. getPixelWidth(): number;
  890. }
  891. }
  892. declare module INSPECTOR {
  893. /**
  894. * A Property tab can creates two panels:
  895. * a tree panel and a detail panel,
  896. * in which properties will be displayed.
  897. * Both panels are separated by a resize bar
  898. */
  899. abstract class PropertyTab extends Tab {
  900. protected _inspector: Inspector;
  901. /** The panel containing a list of items */
  902. protected _treePanel: HTMLElement;
  903. /** The panel containing a list if properties corresponding to an item */
  904. protected _detailsPanel: DetailPanel;
  905. protected _treeItems: Array<TreeItem>;
  906. protected _searchBar: SearchBar;
  907. constructor(tabbar: TabBar, name: string, insp: Inspector);
  908. /** Overrides dispose */
  909. dispose(): void;
  910. update(_items?: Array<TreeItem>): void;
  911. /** Display the details of the given item */
  912. displayDetails(item: TreeItem): void;
  913. /** Select an item in the tree */
  914. select(item: TreeItem): void;
  915. /** Set the given item as active in the tree */
  916. activateNode(item: TreeItem): void;
  917. /** Returns the treeitem corersponding to the given obj, null if not found */
  918. getItemFor(_obj: any): TreeItem;
  919. filter(filter: string): void;
  920. /** Builds the tree panel */
  921. protected abstract _getTree(): Array<TreeItem>;
  922. }
  923. }
  924. declare module INSPECTOR {
  925. class CameraTab extends PropertyTab {
  926. constructor(tabbar: TabBar, inspector: Inspector);
  927. protected _getTree(): Array<TreeItem>;
  928. }
  929. }
  930. declare module INSPECTOR {
  931. class GUITab extends PropertyTab {
  932. constructor(tabbar: TabBar, inspector: Inspector);
  933. protected _getTree(): Array<TreeItem>;
  934. }
  935. }
  936. declare module INSPECTOR {
  937. class PhysicsTab extends PropertyTab {
  938. viewer: BABYLON.Debug.PhysicsViewer;
  939. constructor(tabbar: TabBar, inspector: Inspector);
  940. protected _getTree(): Array<TreeItem>;
  941. }
  942. }
  943. declare module INSPECTOR {
  944. class SoundTab extends PropertyTab {
  945. constructor(tabbar: TabBar, inspector: Inspector);
  946. protected _getTree(): Array<TreeItem>;
  947. }
  948. }
  949. declare module INSPECTOR {
  950. class TextureTab extends Tab {
  951. private _inspector;
  952. /** The panel containing a list of items */
  953. protected _treePanel: HTMLElement;
  954. protected _treeItems: Array<TreeItem>;
  955. private _imagePanel;
  956. constructor(tabbar: TabBar, inspector: Inspector);
  957. dispose(): void;
  958. update(_items?: Array<TreeItem>): void;
  959. private _getTree();
  960. /** Display the details of the given item */
  961. displayDetails(item: TreeItem): void;
  962. /** Select an item in the tree */
  963. select(item: TreeItem): void;
  964. /** Set the given item as active in the tree */
  965. activateNode(item: TreeItem): void;
  966. }
  967. }
  968. declare module INSPECTOR {
  969. class LightTab extends PropertyTab {
  970. constructor(tabbar: TabBar, inspector: Inspector);
  971. protected _getTree(): Array<TreeItem>;
  972. }
  973. }
  974. declare module INSPECTOR {
  975. class MaterialTab extends PropertyTab {
  976. constructor(tabbar: TabBar, inspector: Inspector);
  977. protected _getTree(): Array<TreeItem>;
  978. }
  979. }
  980. declare module INSPECTOR {
  981. class MeshTab extends PropertyTab {
  982. constructor(tabbar: TabBar, inspector: Inspector);
  983. protected _getTree(): Array<TreeItem>;
  984. }
  985. }
  986. declare module INSPECTOR {
  987. class SceneTab extends Tab {
  988. private _inspector;
  989. /** The list of channels/options that can be activated/deactivated */
  990. private _actions;
  991. /** The list of skeleton viewer */
  992. private _skeletonViewers;
  993. /** The detail of the scene */
  994. private _detailsPanel;
  995. constructor(tabbar: TabBar, insp: Inspector);
  996. /** Overrides super.dispose */
  997. dispose(): void;
  998. /** generates a div which correspond to an option that can be activated/deactivated */
  999. private _generateActionLine(name, initValue, action);
  1000. /**
  1001. * Add a click action for all given elements :
  1002. * the clicked element is set as active, all others elements are deactivated
  1003. */
  1004. private _generateRadioAction(arr);
  1005. }
  1006. }
  1007. declare module INSPECTOR {
  1008. /**
  1009. * The console tab will have two features :
  1010. * - hook all console.log call and display them in this panel (and in the browser console as well)
  1011. * - display all Babylon logs (called with Tools.Log...)
  1012. */
  1013. class ConsoleTab extends Tab {
  1014. private _inspector;
  1015. private _consolePanelContent;
  1016. private _bjsPanelContent;
  1017. private _oldConsoleLog;
  1018. private _oldConsoleWarn;
  1019. private _oldConsoleError;
  1020. constructor(tabbar: TabBar, insp: Inspector);
  1021. /** Overrides super.dispose */
  1022. dispose(): void;
  1023. active(b: boolean): void;
  1024. private _message(type, message, caller);
  1025. private _addConsoleLog(...params);
  1026. private _addConsoleWarn(...params);
  1027. private _addConsoleError(...params);
  1028. }
  1029. }
  1030. declare module INSPECTOR {
  1031. class StatsTab extends Tab {
  1032. private _inspector;
  1033. /**
  1034. * Properties in this array will be updated
  1035. * in a render loop - Mostly stats properties
  1036. */
  1037. private _updatableProperties;
  1038. private _scene;
  1039. private _engine;
  1040. private _glInfo;
  1041. private _updateLoopHandler;
  1042. constructor(tabbar: TabBar, insp: Inspector);
  1043. private _createStatLabel(content, parent);
  1044. /** Update each properties of the stats panel */
  1045. private _update();
  1046. dispose(): void;
  1047. active(b: boolean): void;
  1048. }
  1049. }
  1050. declare module INSPECTOR {
  1051. /**
  1052. * A tab bar will contains each view the inspector can have : Canvas2D, Meshes...
  1053. * The default active tab is the first one of the list.
  1054. */
  1055. class TabBar extends BasicElement {
  1056. private _tabs;
  1057. private _inspector;
  1058. /** The tab displaying all meshes */
  1059. private _meshTab;
  1060. /** The toolbar */
  1061. private _toolBar;
  1062. /** The icon displayed at the end of the toolbar displaying a combo box of tabs not displayed */
  1063. private _moreTabsIcon;
  1064. /** The panel displayed when the 'more-tab' icon is selected */
  1065. private _moreTabsPanel;
  1066. /** The list of tab displayed by clicking on the remainingIcon */
  1067. private _invisibleTabs;
  1068. /** The list of tabs visible, displayed in the tab bar */
  1069. private _visibleTabs;
  1070. constructor(inspector: Inspector, initialTab?: number);
  1071. update(): void;
  1072. protected _build(): void;
  1073. /**
  1074. * Add a tab to the 'more-tabs' panel, displayed by clicking on the
  1075. * 'more-tabs' icon
  1076. */
  1077. private _addInvisibleTabToPanel(tab);
  1078. /** Dispose the current tab, set the given tab as active, and refresh the treeview */
  1079. switchTab(tab: Tab): void;
  1080. /** Display the mesh tab.
  1081. * If a parameter is given, the given mesh details are displayed
  1082. */
  1083. switchMeshTab(mesh?: BABYLON.AbstractMesh): void;
  1084. /** Returns the active tab */
  1085. getActiveTab(): Tab;
  1086. getActiveTabIndex(): number;
  1087. readonly inspector: Inspector;
  1088. /**
  1089. * Returns the total width in pixel of the tabbar,
  1090. * that corresponds to the sum of the width of each visible tab + toolbar width
  1091. */
  1092. getPixelWidth(): number;
  1093. /** Display the remaining icon or not depending on the tabbar width.
  1094. * This function should be called each time the inspector width is updated
  1095. */
  1096. updateWidth(): void;
  1097. }
  1098. }
  1099. declare module INSPECTOR {
  1100. abstract class AbstractTool {
  1101. private _elem;
  1102. protected _inspector: Inspector;
  1103. constructor(icon: string, parent: HTMLElement, inspector: Inspector, tooltip: string);
  1104. toHtml(): HTMLElement;
  1105. /**
  1106. * Returns the total width in pixel of this tool, 0 by default
  1107. */
  1108. getPixelWidth(): number;
  1109. /**
  1110. * Updates the icon of this tool with the given string
  1111. */
  1112. protected _updateIcon(icon: string): void;
  1113. abstract action(): any;
  1114. }
  1115. }
  1116. declare module INSPECTOR {
  1117. class PauseScheduleTool extends AbstractTool {
  1118. private _isPause;
  1119. constructor(parent: HTMLElement, inspector: Inspector);
  1120. action(): void;
  1121. }
  1122. }
  1123. declare module INSPECTOR {
  1124. class PickTool extends AbstractTool {
  1125. private _isActive;
  1126. private _pickHandler;
  1127. constructor(parent: HTMLElement, inspector: Inspector);
  1128. action(): void;
  1129. /** Deactivate this tool */
  1130. private _deactivate();
  1131. /** Pick a mesh in the scene */
  1132. private _pickMesh(evt);
  1133. private _updatePointerPosition(evt);
  1134. }
  1135. }
  1136. declare module INSPECTOR {
  1137. class PopupTool extends AbstractTool {
  1138. constructor(parent: HTMLElement, inspector: Inspector);
  1139. action(): void;
  1140. }
  1141. }
  1142. declare module INSPECTOR {
  1143. class RefreshTool extends AbstractTool {
  1144. constructor(parent: HTMLElement, inspector: Inspector);
  1145. action(): void;
  1146. }
  1147. }
  1148. declare module INSPECTOR {
  1149. class LabelTool extends AbstractTool {
  1150. /** True if label are displayed, false otherwise */
  1151. private _isDisplayed;
  1152. private _advancedTexture;
  1153. private _labelInitialized;
  1154. private _scene;
  1155. private _guiLoaded;
  1156. constructor(parent: HTMLElement, inspector: Inspector);
  1157. dispose(): void;
  1158. private _checkGUILoaded();
  1159. private _initializeLabels();
  1160. private _createLabel(mesh);
  1161. private _removeLabel(mesh);
  1162. action(): void;
  1163. }
  1164. }
  1165. declare module INSPECTOR {
  1166. class Toolbar extends BasicElement {
  1167. private _inspector;
  1168. private _tools;
  1169. constructor(inspector: Inspector);
  1170. update(): void;
  1171. protected _build(): void;
  1172. private _addTools();
  1173. /**
  1174. * Returns the total width in pixel of the tabbar,
  1175. * that corresponds to the sum of the width of each tab + toolbar width
  1176. */
  1177. getPixelWidth(): number;
  1178. }
  1179. }
  1180. declare module INSPECTOR {
  1181. /**
  1182. * Removes the inspector panel
  1183. */
  1184. class DisposeTool extends AbstractTool {
  1185. constructor(parent: HTMLElement, inspector: Inspector);
  1186. action(): void;
  1187. }
  1188. }
  1189. declare module INSPECTOR {
  1190. class TreeItem extends BasicElement {
  1191. private _tab;
  1192. private _adapter;
  1193. private _tools;
  1194. children: Array<TreeItem>;
  1195. private _lineContent;
  1196. constructor(tab: Tab, obj: Adapter);
  1197. /** Returns the item ID == its adapter ID */
  1198. readonly id: string;
  1199. /** Add the given item as a child of this one */
  1200. add(child: TreeItem): void;
  1201. /**
  1202. * Returns the original adapter
  1203. */
  1204. readonly adapter: Adapter;
  1205. /**
  1206. * Function used to compare this item to another tree item.
  1207. * Returns the alphabetical sort of the adapter ID
  1208. */
  1209. compareTo(item: TreeItem): number;
  1210. /** Returns true if the given obj correspond to the adapter linked to this tree item */
  1211. correspondsTo(obj: any): boolean;
  1212. /** hide all children of this item */
  1213. fold(): void;
  1214. /** Show all children of this item */
  1215. unfold(): void;
  1216. /** Build the HTML of this item */
  1217. protected _build(): void;
  1218. /**
  1219. * Returns one HTML element (.details) containing all details of this primitive
  1220. */
  1221. getDetails(): Array<PropertyLine>;
  1222. update(): void;
  1223. /**
  1224. * Add an event listener on the item :
  1225. * - one click display details
  1226. */
  1227. protected _addEvent(): void;
  1228. /** Returns true if the node is folded, false otherwise */
  1229. private _isFolded();
  1230. /** Set this item as active (background lighter) in the tree panel */
  1231. active(b: boolean): void;
  1232. getDiv(): HTMLElement;
  1233. }
  1234. }
  1235. declare module INSPECTOR {
  1236. abstract class AbstractTreeTool {
  1237. protected _elem: HTMLElement;
  1238. /** Is the tool enabled ? */
  1239. protected _on: boolean;
  1240. constructor();
  1241. toHtml(): HTMLElement;
  1242. protected _addEvents(): void;
  1243. /**
  1244. * Action launched when clicked on this element
  1245. * Should be overrided
  1246. */
  1247. protected action(): void;
  1248. }
  1249. }
  1250. declare module INSPECTOR {
  1251. /** Any object implementing this interface should
  1252. * provide methods to toggle its bounding box
  1253. */
  1254. interface IToolBoundingBox {
  1255. isBoxVisible: () => boolean;
  1256. setBoxVisible: (b: boolean) => void;
  1257. }
  1258. /**
  1259. * Checkbox to display/hide the primitive
  1260. */
  1261. class BoundingBox extends AbstractTreeTool {
  1262. private _obj;
  1263. constructor(obj: IToolBoundingBox);
  1264. protected action(): void;
  1265. private _check();
  1266. }
  1267. }
  1268. declare module INSPECTOR {
  1269. interface ICameraPOV {
  1270. setPOV: () => void;
  1271. }
  1272. /**
  1273. *
  1274. */
  1275. class CameraPOV extends AbstractTreeTool {
  1276. private cameraPOV;
  1277. constructor(camera: ICameraPOV);
  1278. protected action(): void;
  1279. private _gotoPOV();
  1280. }
  1281. }
  1282. declare module INSPECTOR {
  1283. interface ISoundInteractions {
  1284. setPlaying: (callback: Function) => void;
  1285. }
  1286. /**
  1287. *
  1288. */
  1289. class SoundInteractions extends AbstractTreeTool {
  1290. private playSound;
  1291. private b;
  1292. constructor(playSound: ISoundInteractions);
  1293. protected action(): void;
  1294. private _playSound();
  1295. }
  1296. }
  1297. declare module INSPECTOR {
  1298. /** Any object implementing this interface should
  1299. * provide methods to toggle its visibility
  1300. */
  1301. interface IToolVisible {
  1302. isVisible: () => boolean;
  1303. setVisible: (b: boolean) => void;
  1304. }
  1305. /**
  1306. * Checkbox to display/hide the primitive
  1307. */
  1308. class Checkbox extends AbstractTreeTool {
  1309. private _obj;
  1310. constructor(obj: IToolVisible);
  1311. protected action(): void;
  1312. private _check(dontEnable?);
  1313. }
  1314. }
  1315. declare module INSPECTOR {
  1316. /** Any object implementing this interface should
  1317. * provide methods to toggle a debug area
  1318. */
  1319. interface IToolDebug {
  1320. debug: (b: boolean) => void;
  1321. }
  1322. class DebugArea extends AbstractTreeTool {
  1323. private _obj;
  1324. constructor(obj: IToolDebug);
  1325. protected action(): void;
  1326. }
  1327. }
  1328. declare module INSPECTOR {
  1329. /** Any object implementing this interface should
  1330. * provide methods to retrieve its info
  1331. */
  1332. interface IToolInfo {
  1333. getInfo: () => string;
  1334. }
  1335. /**
  1336. * Checkbox to display/hide the primitive
  1337. */
  1338. class Info extends AbstractTreeTool {
  1339. private _obj;
  1340. private _tooltip;
  1341. constructor(obj: IToolInfo);
  1342. protected action(): void;
  1343. }
  1344. }