babylon.inspector.d.ts 46 KB

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