babylon.inspector.module.d.ts 91 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373
  1. /*BabylonJS Inspector*/
  2. // Dependencies for this module:
  3. // ../../../../Tools/Gulp/babylonjs
  4. declare module 'babylonjs-inspector' {
  5. export * from 'babylonjs-inspector/adapters';
  6. export * from 'babylonjs-inspector/details';
  7. export * from 'babylonjs-inspector/gui';
  8. export * from 'babylonjs-inspector/helpers';
  9. export * from 'babylonjs-inspector/scheduler';
  10. export * from 'babylonjs-inspector/tabs';
  11. export * from 'babylonjs-inspector/tools';
  12. export * from 'babylonjs-inspector/tree';
  13. export * from 'babylonjs-inspector/treetools';
  14. export * from 'babylonjs-inspector/Inspector';
  15. export * from 'babylonjs-inspector/properties';
  16. export * from 'babylonjs-inspector/properties_gui';
  17. }
  18. declare module 'babylonjs-inspector/adapters' {
  19. export * from 'babylonjs-inspector/adapters/Adapter';
  20. export * from 'babylonjs-inspector/adapters/CameraAdapter';
  21. export * from 'babylonjs-inspector/adapters/GUIAdapter';
  22. export * from 'babylonjs-inspector/adapters/LightAdapter';
  23. export * from 'babylonjs-inspector/adapters/MaterialAdapter';
  24. export * from 'babylonjs-inspector/adapters/MeshAdapter';
  25. export * from 'babylonjs-inspector/adapters/PhysicsImpostorAdapter';
  26. export * from 'babylonjs-inspector/adapters/SoundAdapter';
  27. export * from 'babylonjs-inspector/adapters/TextureAdapter';
  28. }
  29. declare module 'babylonjs-inspector/details' {
  30. export * from 'babylonjs-inspector/details/DetailPanel';
  31. export * from 'babylonjs-inspector/details/Property';
  32. export * from 'babylonjs-inspector/details/PropertyLine';
  33. }
  34. declare module 'babylonjs-inspector/gui' {
  35. export * from 'babylonjs-inspector/gui/BasicElement';
  36. export * from 'babylonjs-inspector/gui/ColorElement';
  37. export * from 'babylonjs-inspector/gui/ColorPickerElement';
  38. export * from 'babylonjs-inspector/gui/CubeTextureElement';
  39. export * from 'babylonjs-inspector/gui/HDRCubeTextureElement';
  40. export * from 'babylonjs-inspector/gui/SearchBar';
  41. export * from 'babylonjs-inspector/gui/TextureElement';
  42. export * from 'babylonjs-inspector/gui/Tooltip';
  43. }
  44. declare module 'babylonjs-inspector/helpers' {
  45. export * from 'babylonjs-inspector/helpers/Helpers';
  46. }
  47. declare module 'babylonjs-inspector/scheduler' {
  48. export * from 'babylonjs-inspector/scheduler/Scheduler';
  49. }
  50. declare module 'babylonjs-inspector/tabs' {
  51. export * from 'babylonjs-inspector/tabs/CameraTab';
  52. export * from 'babylonjs-inspector/tabs/ConsoleTab';
  53. export * from 'babylonjs-inspector/tabs/GLTFTab';
  54. export * from 'babylonjs-inspector/tabs/GUITab';
  55. export * from 'babylonjs-inspector/tabs/LightTab';
  56. export * from 'babylonjs-inspector/tabs/MaterialTab';
  57. export * from 'babylonjs-inspector/tabs/MeshTab';
  58. export * from 'babylonjs-inspector/tabs/PhysicsTab';
  59. export * from 'babylonjs-inspector/tabs/PropertyTab';
  60. export * from 'babylonjs-inspector/tabs/SceneTab';
  61. export * from 'babylonjs-inspector/tabs/SoundTab';
  62. export * from 'babylonjs-inspector/tabs/StatsTab';
  63. export * from 'babylonjs-inspector/tabs/Tab';
  64. export * from 'babylonjs-inspector/tabs/TabBar';
  65. export * from 'babylonjs-inspector/tabs/TextureTab';
  66. export * from 'babylonjs-inspector/tabs/ToolsTab';
  67. }
  68. declare module 'babylonjs-inspector/tools' {
  69. export * from 'babylonjs-inspector/tools/AbstractTool';
  70. export * from 'babylonjs-inspector/tools/DisposeTool';
  71. export * from 'babylonjs-inspector/tools/FullscreenTool';
  72. export * from 'babylonjs-inspector/tools/LabelTool';
  73. export * from 'babylonjs-inspector/tools/PauseScheduleTool';
  74. export * from 'babylonjs-inspector/tools/PickTool';
  75. export * from 'babylonjs-inspector/tools/PopupTool';
  76. export * from 'babylonjs-inspector/tools/RefreshTool';
  77. export * from 'babylonjs-inspector/tools/Toolbar';
  78. }
  79. declare module 'babylonjs-inspector/tree' {
  80. export * from 'babylonjs-inspector/tree/TreeItem';
  81. }
  82. declare module 'babylonjs-inspector/treetools' {
  83. export * from 'babylonjs-inspector/treetools/AbstractTreeTool';
  84. export * from 'babylonjs-inspector/treetools/BoundingBox';
  85. export * from 'babylonjs-inspector/treetools/CameraPOV';
  86. export * from 'babylonjs-inspector/treetools/Checkbox';
  87. export * from 'babylonjs-inspector/treetools/DebugArea';
  88. export * from 'babylonjs-inspector/treetools/Info';
  89. export * from 'babylonjs-inspector/treetools/SoundInteractions';
  90. }
  91. declare module 'babylonjs-inspector/Inspector' {
  92. import { AbstractMesh, Nullable, Scene, Observable } from "babylonjs";
  93. export class Inspector {
  94. /** The HTML document relative to this inspector (the window or the popup depending on its mode) */
  95. static DOCUMENT: HTMLDocument;
  96. /** The HTML window. In popup mode, it's the popup itself. Otherwise, it's the current tab */
  97. static WINDOW: Window;
  98. onGUILoaded: Observable<any>;
  99. static GUIObject: any;
  100. /** The inspector is created with the given engine.
  101. * If the parameter 'popup' is false, the inspector is created as a right panel on the main window.
  102. * If the parameter 'popup' is true, the inspector is created in another popup.
  103. */
  104. constructor(scene: Scene, popup?: boolean, initialTab?: number | string, parentElement?: Nullable<HTMLElement>, newColors?: {
  105. backgroundColor?: string;
  106. backgroundColorLighter?: string;
  107. backgroundColorLighter2?: string;
  108. backgroundColorLighter3?: string;
  109. color?: string;
  110. colorTop?: string;
  111. colorBot?: string;
  112. });
  113. readonly scene: Scene;
  114. readonly popupMode: boolean;
  115. /**
  116. * Filter the list of item present in the tree.
  117. * All item returned should have the given filter contained in the item id.
  118. */
  119. filterItem(filter: string): void;
  120. /** Display the mesh tab on the given object */
  121. displayObjectDetails(mesh: AbstractMesh): void;
  122. /** Clean the whole tree of item and rebuilds it */
  123. refresh(): void;
  124. /** Remove the inspector panel when it's built as a right panel:
  125. * remove the right panel and remove the wrapper
  126. */
  127. dispose(): void;
  128. /** Open the inspector in a new popup
  129. * Set 'firstTime' to true if there is no inspector created beforehands
  130. */
  131. openPopup(firstTime?: boolean): void;
  132. getActiveTabIndex(): number;
  133. }
  134. }
  135. declare module 'babylonjs-inspector/properties' {
  136. import { Vector2, Vector3, Color3, Color4, Quaternion, Size, Texture, RenderTargetTexture, DynamicTexture, BaseTexture, CubeTexture, HDRCubeTexture, Sound, ArcRotateCamera, FreeCamera, Scene, TransformNode, AbstractMesh, Mesh, StandardMaterial, PBRMaterial, PhysicsImpostor, ImageProcessingConfiguration, ColorCurves } from "babylonjs";
  137. export const PROPERTIES: {
  138. /** Format the given object :
  139. * If a format function exists, returns the result of this function.
  140. * If this function doesn't exists, return the object type instead
  141. */
  142. format: (obj: any) => any;
  143. 'type_not_defined': {
  144. properties: any[];
  145. format: () => string;
  146. };
  147. 'Vector2': {
  148. type: typeof Vector2;
  149. format: (vec: Vector2) => string;
  150. };
  151. 'Vector3': {
  152. type: typeof Vector3;
  153. format: (vec: Vector3) => string;
  154. };
  155. 'Color3': {
  156. type: typeof Color3;
  157. format: (color: Color3) => string;
  158. slider: {
  159. r: {
  160. min: number;
  161. max: number;
  162. step: number;
  163. };
  164. g: {
  165. min: number;
  166. max: number;
  167. step: number;
  168. };
  169. b: {
  170. min: number;
  171. max: number;
  172. step: number;
  173. };
  174. };
  175. };
  176. 'Color4': {
  177. type: typeof Color4;
  178. format: (color: Color4) => string;
  179. slider: {
  180. r: {
  181. min: number;
  182. max: number;
  183. step: number;
  184. };
  185. g: {
  186. min: number;
  187. max: number;
  188. step: number;
  189. };
  190. b: {
  191. min: number;
  192. max: number;
  193. step: number;
  194. };
  195. };
  196. };
  197. 'Quaternion': {
  198. type: typeof Quaternion;
  199. };
  200. 'Size': {
  201. type: typeof Size;
  202. format: (size: Size) => string;
  203. };
  204. 'Texture': {
  205. type: typeof Texture;
  206. format: (tex: Texture) => string;
  207. };
  208. 'RenderTargetTexture': {
  209. type: typeof RenderTargetTexture;
  210. };
  211. 'DynamicTexture': {
  212. type: typeof DynamicTexture;
  213. };
  214. 'BaseTexture': {
  215. type: typeof BaseTexture;
  216. };
  217. 'CubeTexture': {
  218. type: typeof CubeTexture;
  219. };
  220. 'HDRCubeTexture': {
  221. type: typeof HDRCubeTexture;
  222. };
  223. 'Sound': {
  224. type: typeof Sound;
  225. };
  226. 'ArcRotateCamera': {
  227. type: typeof ArcRotateCamera;
  228. slider: {
  229. alpha: {
  230. min: number;
  231. max: number;
  232. step: number;
  233. };
  234. beta: {
  235. min: number;
  236. max: number;
  237. step: number;
  238. };
  239. fov: {
  240. min: number;
  241. max: number;
  242. step: number;
  243. };
  244. };
  245. };
  246. 'FreeCamera': {
  247. type: typeof FreeCamera;
  248. slider: {
  249. fov: {
  250. min: number;
  251. max: number;
  252. step: number;
  253. };
  254. };
  255. };
  256. 'Scene': {
  257. type: typeof Scene;
  258. };
  259. 'TransformNode': {
  260. type: typeof TransformNode;
  261. format: (m: TransformNode) => string;
  262. };
  263. 'AbstractMesh': {
  264. type: typeof AbstractMesh;
  265. format: (m: AbstractMesh) => string;
  266. };
  267. 'Mesh': {
  268. type: typeof Mesh;
  269. format: (m: Mesh) => string;
  270. slider: {
  271. visibility: {
  272. min: number;
  273. max: number;
  274. step: number;
  275. };
  276. };
  277. };
  278. 'StandardMaterial': {
  279. type: typeof StandardMaterial;
  280. format: (mat: StandardMaterial) => string;
  281. slider: {
  282. alpha: {
  283. min: number;
  284. max: number;
  285. step: number;
  286. };
  287. };
  288. };
  289. 'PBRMaterial': {
  290. type: typeof PBRMaterial;
  291. slider: {
  292. alpha: {
  293. min: number;
  294. max: number;
  295. step: number;
  296. };
  297. };
  298. };
  299. 'PhysicsImpostor': {
  300. type: typeof PhysicsImpostor;
  301. };
  302. 'ImageProcessingConfiguration': {
  303. type: typeof ImageProcessingConfiguration;
  304. };
  305. 'ColorCurves': {
  306. type: typeof ColorCurves;
  307. };
  308. };
  309. }
  310. declare module 'babylonjs-inspector/properties_gui' {
  311. export type GUITyping = any;
  312. export let guiLoaded: boolean;
  313. /**
  314. * Function that add gui objects properties to the variable PROPERTIES
  315. */
  316. export function loadGUIProperties(GUI: GUITyping): void;
  317. }
  318. declare module 'babylonjs-inspector/adapters/Adapter' {
  319. import { PropertyLine } from "babylonjs-inspector/details/PropertyLine";
  320. import { AbstractTreeTool } from "babylonjs-inspector/treetools/AbstractTreeTool";
  321. export abstract class Adapter {
  322. protected _obj: any;
  323. constructor(obj: any);
  324. /** Returns the name displayed in the tree */
  325. abstract id(): string;
  326. /** Returns the type of this object - displayed in the tree */
  327. abstract type(): string;
  328. /** Returns the list of properties to be displayed for this adapter */
  329. abstract getProperties(): Array<PropertyLine>;
  330. /** Returns true if the given object correspond to this */
  331. correspondsTo(obj: any): boolean;
  332. /** Returns the adapter unique name */
  333. readonly name: string;
  334. /**
  335. * Returns the actual object used for this adapter
  336. */
  337. readonly object: any;
  338. /** Returns the list of tools available for this adapter */
  339. abstract getTools(): Array<AbstractTreeTool>;
  340. }
  341. }
  342. declare module 'babylonjs-inspector/adapters/CameraAdapter' {
  343. import { Camera } from "babylonjs";
  344. import { AbstractTreeTool } from "babylonjs-inspector/treetools/AbstractTreeTool";
  345. import { PropertyLine } from "babylonjs-inspector/details/PropertyLine";
  346. import { ICameraPOV } from "babylonjs-inspector/treetools/CameraPOV";
  347. import { Adapter } from "babylonjs-inspector/adapters/Adapter";
  348. export class CameraAdapter extends Adapter implements ICameraPOV {
  349. constructor(obj: Camera);
  350. /** Returns the name displayed in the tree */
  351. id(): string;
  352. /** Returns the type of this object - displayed in the tree */
  353. type(): string;
  354. /** Returns the list of properties to be displayed for this adapter */
  355. getProperties(): Array<PropertyLine>;
  356. getTools(): Array<AbstractTreeTool>;
  357. setPOV(): void;
  358. getCurrentActiveCamera(): string;
  359. }
  360. }
  361. declare module 'babylonjs-inspector/adapters/GUIAdapter' {
  362. import { PropertyLine } from "babylonjs-inspector/details/PropertyLine";
  363. import { AbstractTreeTool } from "babylonjs-inspector/treetools/AbstractTreeTool";
  364. import { IToolVisible } from "babylonjs-inspector/treetools/Checkbox";
  365. import { Adapter } from "babylonjs-inspector/adapters/Adapter";
  366. export class GUIAdapter extends Adapter implements IToolVisible {
  367. constructor(obj: any);
  368. /** Returns the name displayed in the tree */
  369. id(): string;
  370. /** Returns the type of this object - displayed in the tree */
  371. type(): string;
  372. /** Returns the list of properties to be displayed for this adapter */
  373. getProperties(): Array<PropertyLine>;
  374. getTools(): Array<AbstractTreeTool>;
  375. setVisible(b: boolean): void;
  376. isVisible(): boolean;
  377. }
  378. }
  379. declare module 'babylonjs-inspector/adapters/LightAdapter' {
  380. import { PropertyLine } from "babylonjs-inspector/details/PropertyLine";
  381. import { AbstractTreeTool } from "babylonjs-inspector/treetools/AbstractTreeTool";
  382. import { IToolVisible } from "babylonjs-inspector/treetools/Checkbox";
  383. import { Adapter } from "babylonjs-inspector/adapters/Adapter";
  384. export class LightAdapter extends Adapter implements IToolVisible {
  385. constructor(obj: BABYLON.Light);
  386. /** Returns the name displayed in the tree */
  387. id(): string;
  388. /** Returns the type of this object - displayed in the tree */
  389. type(): string;
  390. /** Returns the list of properties to be displayed for this adapter */
  391. getProperties(): Array<PropertyLine>;
  392. getTools(): Array<AbstractTreeTool>;
  393. setVisible(b: boolean): void;
  394. isVisible(): boolean;
  395. }
  396. }
  397. declare module 'babylonjs-inspector/adapters/MaterialAdapter' {
  398. import { Material } from "babylonjs";
  399. import { PropertyLine } from "babylonjs-inspector/details/PropertyLine";
  400. import { AbstractTreeTool } from "babylonjs-inspector/treetools/AbstractTreeTool";
  401. import { Adapter } from "babylonjs-inspector/adapters/Adapter";
  402. export class MaterialAdapter extends Adapter {
  403. constructor(obj: Material);
  404. /** Returns the name displayed in the tree */
  405. id(): string;
  406. /** Returns the type of this object - displayed in the tree */
  407. type(): string;
  408. /** Returns the list of properties to be displayed for this adapter */
  409. getProperties(): Array<PropertyLine>;
  410. /** No tools for a material adapter */
  411. getTools(): Array<AbstractTreeTool>;
  412. }
  413. }
  414. declare module 'babylonjs-inspector/adapters/MeshAdapter' {
  415. import { Node } from "babylonjs";
  416. import { PropertyLine } from "babylonjs-inspector/details/PropertyLine";
  417. import { AbstractTreeTool } from "babylonjs-inspector/treetools/AbstractTreeTool";
  418. import { IToolBoundingBox } from "babylonjs-inspector/treetools/BoundingBox";
  419. import { IToolVisible } from "babylonjs-inspector/treetools/Checkbox";
  420. import { IToolDebug } from "babylonjs-inspector/treetools/DebugArea";
  421. import { IToolInfo } from "babylonjs-inspector/treetools/Info";
  422. import { Adapter } from "babylonjs-inspector/adapters/Adapter";
  423. export class MeshAdapter extends Adapter implements IToolVisible, IToolDebug, IToolBoundingBox, IToolInfo {
  424. constructor(mesh: Node);
  425. /** Returns the name displayed in the tree */
  426. id(): string;
  427. /** Returns the type of this object - displayed in the tree */
  428. type(): string;
  429. /** Returns the list of properties to be displayed for this adapter */
  430. getProperties(): Array<PropertyLine>;
  431. getTools(): Array<AbstractTreeTool>;
  432. setVisible(b: boolean): void;
  433. isVisible(): boolean;
  434. isBoxVisible(): boolean;
  435. setBoxVisible(b: boolean): boolean;
  436. debug(enable: boolean): void;
  437. /** Returns some information about this mesh */
  438. getInfo(): string;
  439. }
  440. }
  441. declare module 'babylonjs-inspector/adapters/PhysicsImpostorAdapter' {
  442. import { PhysicsImpostor } from "babylonjs";
  443. import { PropertyLine } from "babylonjs-inspector/details/PropertyLine";
  444. import { AbstractTreeTool } from "babylonjs-inspector/treetools/AbstractTreeTool";
  445. import { IToolVisible } from "babylonjs-inspector/treetools/Checkbox";
  446. import { Adapter } from "babylonjs-inspector/adapters/Adapter";
  447. export class PhysicsImpostorAdapter extends Adapter implements IToolVisible {
  448. constructor(obj: PhysicsImpostor, viewer: any);
  449. /** Returns the name displayed in the tree */
  450. id(): string;
  451. /** Returns the type of this object - displayed in the tree */
  452. type(): string;
  453. /** Returns the list of properties to be displayed for this adapter */
  454. getProperties(): Array<PropertyLine>;
  455. getTools(): Array<AbstractTreeTool>;
  456. setVisible(b: boolean): void;
  457. isVisible(): boolean;
  458. }
  459. }
  460. declare module 'babylonjs-inspector/adapters/SoundAdapter' {
  461. import { Sound } from "babylonjs";
  462. import { PropertyLine } from "babylonjs-inspector/details/PropertyLine";
  463. import { AbstractTreeTool } from "babylonjs-inspector/treetools/AbstractTreeTool";
  464. import { ISoundInteractions } from "babylonjs-inspector/treetools/SoundInteractions";
  465. import { Adapter } from "babylonjs-inspector/adapters/Adapter";
  466. export class SoundAdapter extends Adapter implements ISoundInteractions {
  467. constructor(obj: Sound);
  468. /** Returns the name displayed in the tree */
  469. id(): string;
  470. /** Returns the type of this object - displayed in the tree */
  471. type(): string;
  472. /** Returns the list of properties to be displayed for this adapter */
  473. getProperties(): Array<PropertyLine>;
  474. getTools(): Array<AbstractTreeTool>;
  475. setPlaying(callback: Function): void;
  476. }
  477. }
  478. declare module 'babylonjs-inspector/adapters/TextureAdapter' {
  479. import { Adapter } from "babylonjs-inspector/adapters/Adapter";
  480. import { BaseTexture } from "babylonjs";
  481. import { PropertyLine } from "babylonjs-inspector/details/PropertyLine";
  482. import { AbstractTreeTool } from "babylonjs-inspector/treetools/AbstractTreeTool";
  483. export class TextureAdapter extends Adapter {
  484. constructor(obj: BaseTexture);
  485. /** Returns the name displayed in the tree */
  486. id(): string;
  487. /** Returns the type of this object - displayed in the tree */
  488. type(): string;
  489. /** Returns the list of properties to be displayed for this adapter */
  490. getProperties(): Array<PropertyLine>;
  491. getTools(): Array<AbstractTreeTool>;
  492. }
  493. }
  494. declare module 'babylonjs-inspector/details/DetailPanel' {
  495. import { BasicElement } from "babylonjs-inspector/gui/BasicElement";
  496. import { PropertyLine } from "babylonjs-inspector/details/PropertyLine";
  497. export interface SortDirection {
  498. [property: string]: number;
  499. }
  500. export class DetailPanel extends BasicElement {
  501. constructor(dr?: Array<PropertyLine>);
  502. details: Array<PropertyLine>;
  503. protected _build(): void;
  504. /** Updates the HTML of the detail panel */
  505. update(_items?: Array<PropertyLine>): void;
  506. /** Search an element by name */
  507. searchByName(searchName: string): void;
  508. /**
  509. * Removes all data in the detail panel but keep the header row
  510. */
  511. clean(): void;
  512. /**
  513. * Clean the rows only
  514. */
  515. cleanRow(): void;
  516. /** Overrides basicelement.dispose */
  517. dispose(): void;
  518. }
  519. }
  520. declare module 'babylonjs-inspector/details/Property' {
  521. /**
  522. * A property is a link between a data (string) and an object.
  523. */
  524. export class Property {
  525. constructor(prop: string, obj: any, parentObj?: any);
  526. readonly name: string;
  527. value: any;
  528. readonly type: string;
  529. obj: any;
  530. }
  531. }
  532. declare module 'babylonjs-inspector/details/PropertyLine' {
  533. import { Nullable } from "babylonjs";
  534. import { Property } from "babylonjs-inspector/details/Property";
  535. export class PropertyFormatter {
  536. /**
  537. * Format the value of the given property of the given object.
  538. */
  539. static format(obj: any, prop: string): string;
  540. }
  541. /**
  542. * A property line represents a line in the detail panel. This line is composed of :
  543. * - a name (the property name)
  544. * - a value if this property is of a type 'simple' : string, number, boolean, color, texture
  545. * - the type of the value if this property is of a complex type (Vector2, Size, ...)
  546. * - a ID if defined (otherwise an empty string is displayed)
  547. * The original object is sent to the value object who will update it at will.
  548. *
  549. * A property line can contain OTHER property line objects in the case of a complex type.
  550. * If this instance has no link to other instances, its type is ALWAYS a simple one (see above).
  551. *
  552. */
  553. export class PropertyLine {
  554. constructor(prop: Property, parent?: Nullable<PropertyLine>, level?: number);
  555. validateInput(value: any, forceupdate?: boolean): void;
  556. /** Retrieve the correct object from its parent.
  557. * If no parent exists, returns the property value.
  558. * This method is used at each update in case the property object is removed from the original object
  559. * (example : mesh.position = new Vector3 ; the original vector3 object is deleted from the mesh).
  560. */
  561. updateObject(): any;
  562. readonly name: string;
  563. readonly value: any;
  564. readonly type: string;
  565. /** Delete properly this property line.
  566. * Removes itself from the scheduler.
  567. * Dispose all viewer element (color, texture...)
  568. */
  569. dispose(): void;
  570. /**
  571. * Update the property division with the new property value.
  572. * If this property is complex, update its child, otherwise update its text content
  573. */
  574. update(): void;
  575. toHtml(): HTMLElement;
  576. closeDetails(): void;
  577. }
  578. }
  579. declare module 'babylonjs-inspector/gui/BasicElement' {
  580. /**
  581. * Represents a html div element.
  582. * The div is built when an instance of BasicElement is created.
  583. */
  584. export abstract class BasicElement {
  585. protected _div: HTMLDivElement;
  586. constructor();
  587. /**
  588. * Returns the div element
  589. */
  590. toHtml(): HTMLDivElement;
  591. /**
  592. * Build the html element
  593. */
  594. protected _build(): void;
  595. abstract update(data?: any): void;
  596. /** Default dispose method if needed */
  597. dispose(): void;
  598. }
  599. }
  600. declare module 'babylonjs-inspector/gui/ColorElement' {
  601. import { Color3, Color4 } from "babylonjs";
  602. import { BasicElement } from "babylonjs-inspector/gui/BasicElement";
  603. /**
  604. * Display a very small div corresponding to the given color
  605. */
  606. export class ColorElement extends BasicElement {
  607. constructor(color: Color4 | Color3);
  608. update(color?: Color4 | Color3): void;
  609. }
  610. }
  611. declare module 'babylonjs-inspector/gui/ColorPickerElement' {
  612. import { Color3, Color4 } from "babylonjs";
  613. import { PropertyLine } from "babylonjs-inspector/details/PropertyLine";
  614. import { BasicElement } from "babylonjs-inspector/gui/BasicElement";
  615. /**
  616. * Represents a html div element.
  617. * The div is built when an instance of BasicElement is created.
  618. */
  619. export class ColorPickerElement extends BasicElement {
  620. protected _input: HTMLInputElement;
  621. constructor(color: Color4 | Color3, propertyLine: PropertyLine);
  622. update(color?: Color4 | Color3): void;
  623. }
  624. }
  625. declare module 'babylonjs-inspector/gui/CubeTextureElement' {
  626. import { Mesh, Scene, Texture } from "babylonjs";
  627. import { BasicElement } from "babylonjs-inspector/gui/BasicElement";
  628. /**
  629. * Display a very small div. A new canvas is created, with a new js scene, containing only the
  630. * cube texture in a cube
  631. */
  632. export class CubeTextureElement extends BasicElement {
  633. protected _scene: Scene;
  634. protected _cube: Mesh;
  635. protected _textureUrl: string;
  636. /** The texture given as a parameter should be cube. */
  637. constructor(tex: Texture);
  638. update(tex?: Texture): void;
  639. /** Creates the box */
  640. protected _populateScene(): void;
  641. /** Removes properly the babylon engine */
  642. dispose(): void;
  643. }
  644. }
  645. declare module 'babylonjs-inspector/gui/HDRCubeTextureElement' {
  646. import { Texture } from "babylonjs";
  647. import { CubeTextureElement } from "babylonjs-inspector/gui/CubeTextureElement";
  648. /**
  649. * Display a very small div. A new canvas is created, with a new js scene, containing only the
  650. * cube texture in a cube
  651. */
  652. export class HDRCubeTextureElement extends CubeTextureElement {
  653. /** The texture given as a parameter should be cube. */
  654. constructor(tex: Texture);
  655. /** Creates the box */
  656. protected _populateScene(): void;
  657. }
  658. }
  659. declare module 'babylonjs-inspector/gui/SearchBar' {
  660. import { DetailPanel } from "babylonjs-inspector/details/DetailPanel";
  661. import { PropertyTab } from "babylonjs-inspector/tabs/PropertyTab";
  662. import { BasicElement } from "babylonjs-inspector/gui/BasicElement";
  663. /**
  664. * A search bar can be used to filter elements in the tree panel.
  665. * At each keypress on the input, the treepanel will be filtered.
  666. */
  667. export class SearchBar extends BasicElement {
  668. constructor(tab: PropertyTab);
  669. /** Delete all characters typped in the input element */
  670. reset(): void;
  671. update(): void;
  672. }
  673. export class SearchBarDetails extends BasicElement {
  674. constructor(tab: DetailPanel);
  675. /** Delete all characters typped in the input element */
  676. reset(): void;
  677. update(): void;
  678. }
  679. }
  680. declare module 'babylonjs-inspector/gui/TextureElement' {
  681. import { Texture } from "babylonjs";
  682. import { BasicElement } from "babylonjs-inspector/gui/BasicElement";
  683. /**
  684. * Display a very small div corresponding to the given texture. On mouse over, display the full image
  685. */
  686. export class TextureElement extends BasicElement {
  687. constructor(tex: Texture);
  688. update(tex?: Texture): void;
  689. }
  690. }
  691. declare module 'babylonjs-inspector/gui/Tooltip' {
  692. import { Nullable } from "babylonjs";
  693. /**
  694. * Creates a tooltip for the parent of the given html element
  695. */
  696. export class Tooltip {
  697. constructor(elem: HTMLElement, tip: string, attachTo?: Nullable<HTMLElement>);
  698. }
  699. }
  700. declare module 'babylonjs-inspector/helpers/Helpers' {
  701. import { Nullable } from "babylonjs";
  702. import { PropertyLine } from "babylonjs-inspector/details/PropertyLine";
  703. export class Helpers {
  704. /**
  705. * Returns the type of the given object. First
  706. * uses getClassName. If nothing is returned, used the type of the constructor
  707. */
  708. static GET_TYPE(obj: any): string;
  709. /**
  710. * Returns true if the user browser is edge.
  711. */
  712. static IsBrowserEdge(): boolean;
  713. /**
  714. * Returns true if the user browser is IE.
  715. */
  716. static IsBrowserIE(): boolean;
  717. /** Send the event which name is given in parameter to the window */
  718. static SEND_EVENT(eventName: string): void;
  719. /** Returns the given number with 2 decimal number max if a decimal part exists */
  720. static Trunc(nb: number): number;
  721. /**
  722. * Useful function used to create a div
  723. */
  724. static CreateDiv(className?: Nullable<string>, parent?: HTMLElement, tooltip?: string): HTMLDivElement;
  725. /**
  726. * Useful function used to create a input
  727. */
  728. static CreateInput(className?: string, parent?: HTMLElement, tooltip?: string): HTMLInputElement;
  729. static CreateElement(element: string, className?: Nullable<string>, parent?: HTMLElement, tooltip?: string): HTMLElement;
  730. /**
  731. * Removes all children of the given div.
  732. */
  733. static CleanDiv(div: HTMLElement): void;
  734. /**
  735. * 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)
  736. */
  737. static Css(elem: HTMLElement, cssAttribute: string): string;
  738. static LoadScript(): void;
  739. static IsSystemName(name: string): boolean;
  740. /**
  741. * Return an array of PropertyLine for an obj
  742. * @param obj
  743. */
  744. static GetAllLinesProperties(obj: any): Array<PropertyLine>;
  745. /**
  746. * Returns an array of string corresponding to tjhe list of properties of the object to be displayed
  747. * @param obj
  748. */
  749. static GetAllLinesPropertiesAsString(obj: any, dontTakeThis?: Array<string>): Array<string>;
  750. static Capitalize(str: string): string;
  751. }
  752. }
  753. declare module 'babylonjs-inspector/scheduler/Scheduler' {
  754. import { PropertyLine } from "babylonjs-inspector/details/PropertyLine";
  755. export class Scheduler {
  756. /** Is this scheduler in pause ? */
  757. pause: boolean;
  758. /** All properties are refreshed every 250ms */
  759. static REFRESH_TIME: number;
  760. constructor();
  761. static getInstance(): Scheduler;
  762. /** Add a property line to be updated every X ms */
  763. add(prop: PropertyLine): void;
  764. /** Removes the given property from the list of properties to update */
  765. remove(prop: PropertyLine): void;
  766. dispose(): void;
  767. }
  768. }
  769. declare module 'babylonjs-inspector/tabs/CameraTab' {
  770. import { Inspector } from "babylonjs-inspector/Inspector";
  771. import { TreeItem } from "babylonjs-inspector/tree/TreeItem";
  772. import { PropertyTab } from "babylonjs-inspector/tabs/PropertyTab";
  773. import { TabBar } from "babylonjs-inspector/tabs/TabBar";
  774. export class CameraTab extends PropertyTab {
  775. constructor(tabbar: TabBar, inspector: Inspector);
  776. protected _getTree(): Array<TreeItem>;
  777. }
  778. }
  779. declare module 'babylonjs-inspector/tabs/ConsoleTab' {
  780. import { Inspector } from "babylonjs-inspector/Inspector";
  781. import { Tab } from "babylonjs-inspector/tabs/Tab";
  782. import { TabBar } from "babylonjs-inspector/tabs/TabBar";
  783. /**
  784. * The console tab will have two features :
  785. * - hook all console.log call and display them in this panel (and in the browser console as well)
  786. * - display all Babylon logs (called with Tools.Log...)
  787. */
  788. export class ConsoleTab extends Tab {
  789. constructor(tabbar: TabBar, insp: Inspector);
  790. /** Overrides super.dispose */
  791. dispose(): void;
  792. active(b: boolean): void;
  793. }
  794. }
  795. declare module 'babylonjs-inspector/tabs/GLTFTab' {
  796. import { Inspector } from "babylonjs-inspector/Inspector";
  797. import { Tab } from "babylonjs-inspector/tabs/Tab";
  798. import { TabBar } from "babylonjs-inspector/tabs/TabBar";
  799. export class GLTFTab extends Tab {
  800. static readonly IsSupported: boolean;
  801. /** @hidden */
  802. static _Initialize(): void;
  803. constructor(tabbar: TabBar, inspector: Inspector);
  804. dispose(): void;
  805. /** @hidden */
  806. static _GetLoaderDefaultsAsync(): Promise<any>;
  807. }
  808. }
  809. declare module 'babylonjs-inspector/tabs/GUITab' {
  810. import { Inspector } from "babylonjs-inspector/Inspector";
  811. import { TreeItem } from "babylonjs-inspector/tree/TreeItem";
  812. import { PropertyTab } from "babylonjs-inspector/tabs/PropertyTab";
  813. import { TabBar } from "babylonjs-inspector/tabs/TabBar";
  814. export class GUITab extends PropertyTab {
  815. constructor(tabbar: TabBar, inspector: Inspector);
  816. protected _getTree(): Array<TreeItem>;
  817. }
  818. }
  819. declare module 'babylonjs-inspector/tabs/LightTab' {
  820. import { Inspector } from "babylonjs-inspector/Inspector";
  821. import { TreeItem } from "babylonjs-inspector/tree/TreeItem";
  822. import { PropertyTab } from "babylonjs-inspector/tabs/PropertyTab";
  823. import { TabBar } from "babylonjs-inspector/tabs/TabBar";
  824. export class LightTab extends PropertyTab {
  825. constructor(tabbar: TabBar, inspector: Inspector);
  826. protected _getTree(): Array<TreeItem>;
  827. }
  828. }
  829. declare module 'babylonjs-inspector/tabs/MaterialTab' {
  830. import { Inspector } from "babylonjs-inspector/Inspector";
  831. import { TreeItem } from "babylonjs-inspector/tree/TreeItem";
  832. import { PropertyTab } from "babylonjs-inspector/tabs/PropertyTab";
  833. import { TabBar } from "babylonjs-inspector/tabs/TabBar";
  834. export class MaterialTab extends PropertyTab {
  835. constructor(tabbar: TabBar, inspector: Inspector);
  836. protected _getTree(): Array<TreeItem>;
  837. }
  838. }
  839. declare module 'babylonjs-inspector/tabs/MeshTab' {
  840. import { Inspector } from "babylonjs-inspector/Inspector";
  841. import { TreeItem } from "babylonjs-inspector/tree/TreeItem";
  842. import { PropertyTab } from "babylonjs-inspector/tabs/PropertyTab";
  843. import { TabBar } from "babylonjs-inspector/tabs/TabBar";
  844. export class MeshTab extends PropertyTab {
  845. constructor(tabbar: TabBar, inspector: Inspector);
  846. protected _getTree(): Array<TreeItem>;
  847. }
  848. }
  849. declare module 'babylonjs-inspector/tabs/PhysicsTab' {
  850. import { Inspector } from "babylonjs-inspector/Inspector";
  851. import { TreeItem } from "babylonjs-inspector/tree/TreeItem";
  852. import { PropertyTab } from "babylonjs-inspector/tabs/PropertyTab";
  853. import { TabBar } from "babylonjs-inspector/tabs/TabBar";
  854. export class PhysicsTab extends PropertyTab {
  855. viewer: any;
  856. constructor(tabbar: TabBar, inspector: Inspector);
  857. protected _getTree(): Array<TreeItem>;
  858. }
  859. }
  860. declare module 'babylonjs-inspector/tabs/PropertyTab' {
  861. import { Nullable } from "babylonjs";
  862. import { DetailPanel } from "babylonjs-inspector/details/DetailPanel";
  863. import { SearchBar } from "babylonjs-inspector/gui/SearchBar";
  864. import { Inspector } from "babylonjs-inspector/Inspector";
  865. import { TreeItem } from "babylonjs-inspector/tree/TreeItem";
  866. import { Tab } from "babylonjs-inspector/tabs/Tab";
  867. import { TabBar } from "babylonjs-inspector/tabs/TabBar";
  868. /**
  869. * A Property tab can creates two panels:
  870. * a tree panel and a detail panel,
  871. * in which properties will be displayed.
  872. * Both panels are separated by a resize bar
  873. */
  874. export abstract class PropertyTab extends Tab {
  875. protected _inspector: Inspector;
  876. /** The panel containing a list of items */
  877. protected _treePanel: HTMLDivElement;
  878. /** The panel containing a list if properties corresponding to an item */
  879. protected _detailsPanel: DetailPanel;
  880. protected _treeItems: Array<TreeItem>;
  881. protected _searchBar: SearchBar;
  882. constructor(tabbar: TabBar, name: string, insp: Inspector);
  883. /** Overrides dispose */
  884. dispose(): void;
  885. update(_items?: Array<TreeItem>): void;
  886. /** Display the details of the given item */
  887. displayDetails(item: TreeItem): void;
  888. /** Select an item in the tree */
  889. select(item: TreeItem): void;
  890. /** Set the given item as active in the tree */
  891. activateNode(item: TreeItem): void;
  892. /** Returns the treeitem corersponding to the given obj, null if not found */
  893. getItemFor(_obj: any): Nullable<TreeItem>;
  894. filter(filter: string): void;
  895. /** Builds the tree panel */
  896. protected abstract _getTree(): Array<TreeItem>;
  897. }
  898. }
  899. declare module 'babylonjs-inspector/tabs/SceneTab' {
  900. import { Inspector } from "babylonjs-inspector/Inspector";
  901. import { Tab } from "babylonjs-inspector/tabs/Tab";
  902. import { TabBar } from "babylonjs-inspector/tabs/TabBar";
  903. export class SceneTab extends Tab {
  904. constructor(tabbar: TabBar, insp: Inspector);
  905. /** Overrides super.dispose */
  906. dispose(): void;
  907. }
  908. }
  909. declare module 'babylonjs-inspector/tabs/SoundTab' {
  910. import { Inspector } from "babylonjs-inspector/Inspector";
  911. import { TreeItem } from "babylonjs-inspector/tree/TreeItem";
  912. import { PropertyTab } from "babylonjs-inspector/tabs/PropertyTab";
  913. import { TabBar } from "babylonjs-inspector/tabs/TabBar";
  914. export class SoundTab extends PropertyTab {
  915. constructor(tabbar: TabBar, inspector: Inspector);
  916. protected _getTree(): Array<TreeItem>;
  917. }
  918. }
  919. declare module 'babylonjs-inspector/tabs/StatsTab' {
  920. import { Inspector } from "babylonjs-inspector/Inspector";
  921. import { Tab } from "babylonjs-inspector/tabs/Tab";
  922. import { TabBar } from "babylonjs-inspector/tabs/TabBar";
  923. export class StatsTab extends Tab {
  924. constructor(tabbar: TabBar, insp: Inspector);
  925. dispose(): void;
  926. active(b: boolean): void;
  927. }
  928. }
  929. declare module 'babylonjs-inspector/tabs/Tab' {
  930. import { BasicElement } from "babylonjs-inspector/gui/BasicElement";
  931. import { TreeItem } from "babylonjs-inspector/tree/TreeItem";
  932. import { TabBar } from "babylonjs-inspector/tabs/TabBar";
  933. export abstract class Tab extends BasicElement {
  934. protected _tabbar: TabBar;
  935. name: string;
  936. protected _isActive: boolean;
  937. protected _panel: HTMLDivElement;
  938. constructor(tabbar: TabBar, name: string);
  939. /** True if the tab is active, false otherwise */
  940. isActive(): boolean;
  941. protected _build(): void;
  942. /** Set this tab as active or not, depending on the current state */
  943. active(b: boolean): void;
  944. update(): void;
  945. /** Creates the tab panel for this tab. */
  946. getPanel(): HTMLElement;
  947. /** Add this in the propertytab with the searchbar */
  948. filter(str: string): void;
  949. /** Dispose properly this tab */
  950. abstract dispose(): void;
  951. /** Select an item in the tree */
  952. select(item: TreeItem): void;
  953. /**
  954. * Returns the total width in pixel of this tab, 0 by default
  955. */
  956. getPixelWidth(): number;
  957. }
  958. }
  959. declare module 'babylonjs-inspector/tabs/TabBar' {
  960. import { AbstractMesh, Nullable } from "babylonjs";
  961. import { BasicElement } from "babylonjs-inspector/gui/BasicElement";
  962. import { Inspector } from "babylonjs-inspector/Inspector";
  963. import { Tab } from "babylonjs-inspector/tabs/Tab";
  964. /**
  965. * A tab bar will contains each view the inspector can have : Canvas2D, Meshes...
  966. * The default active tab is the first one of the list.
  967. */
  968. export class TabBar extends BasicElement {
  969. constructor(inspector: Inspector, initialTab?: number | string);
  970. update(): void;
  971. protected _build(): void;
  972. /** Dispose the current tab, set the given tab as active, and refresh the treeview */
  973. switchTab(tab: Tab): void;
  974. /** Display the mesh tab.
  975. * If a parameter is given, the given mesh details are displayed
  976. */
  977. switchMeshTab(mesh?: AbstractMesh): void;
  978. /** Returns the active tab */
  979. getActiveTab(): Nullable<Tab>;
  980. getActiveTabIndex(): number;
  981. getTabIndex(name: string): number;
  982. readonly inspector: Inspector;
  983. /**
  984. * Returns the total width in pixel of the tabbar,
  985. * that corresponds to the sum of the width of each visible tab + toolbar width
  986. */
  987. getPixelWidth(): number;
  988. /** Display the remaining icon or not depending on the tabbar width.
  989. * This function should be called each time the inspector width is updated
  990. */
  991. updateWidth(): void;
  992. }
  993. }
  994. declare module 'babylonjs-inspector/tabs/TextureTab' {
  995. import { TextureAdapter } from "babylonjs-inspector/adapters/TextureAdapter";
  996. import { Inspector } from "babylonjs-inspector/Inspector";
  997. import { TreeItem } from "babylonjs-inspector/tree/TreeItem";
  998. import { Tab } from "babylonjs-inspector/tabs/Tab";
  999. import { TabBar } from "babylonjs-inspector/tabs/TabBar";
  1000. export class TextureTab extends Tab {
  1001. static DDSPreview: DDSPreview;
  1002. /** The panel containing a list of items */
  1003. protected _treePanel: HTMLElement;
  1004. protected _treeItems: Array<TreeItem>;
  1005. constructor(tabbar: TabBar, inspector: Inspector);
  1006. dispose(): void;
  1007. update(_items?: Array<TreeItem>): void;
  1008. /** Display the details of the given item */
  1009. displayDetails(item: TreeItem): void;
  1010. /** Select an item in the tree */
  1011. select(item: TreeItem): void;
  1012. /** Set the given item as active in the tree */
  1013. activateNode(item: TreeItem): void;
  1014. }
  1015. class DDSPreview {
  1016. canvas: HTMLCanvasElement | null;
  1017. constructor(AdapterItem: TextureAdapter);
  1018. insertPreview(AdapterItem: TextureAdapter): void;
  1019. dispose(): void;
  1020. }
  1021. export {};
  1022. }
  1023. declare module 'babylonjs-inspector/tabs/ToolsTab' {
  1024. import { Inspector } from "babylonjs-inspector/Inspector";
  1025. import { Tab } from "babylonjs-inspector/tabs/Tab";
  1026. import { TabBar } from "babylonjs-inspector/tabs/TabBar";
  1027. export class ToolsTab extends Tab {
  1028. constructor(tabbar: TabBar, insp: Inspector);
  1029. dispose(): void;
  1030. }
  1031. }
  1032. declare module 'babylonjs-inspector/tools/AbstractTool' {
  1033. import { Inspector } from "babylonjs-inspector/Inspector";
  1034. export abstract class AbstractTool {
  1035. protected _inspector: Inspector;
  1036. constructor(iconSet: string, icon: string, parent: HTMLElement, inspector: Inspector, tooltip: string);
  1037. toHtml(): HTMLElement;
  1038. /**
  1039. * Returns the total width in pixel of this tool, 0 by default
  1040. */
  1041. getPixelWidth(): number;
  1042. /**
  1043. * Updates the icon of this tool with the given string
  1044. */
  1045. protected _updateIcon(icon: string): void;
  1046. abstract action(): void;
  1047. }
  1048. }
  1049. declare module 'babylonjs-inspector/tools/DisposeTool' {
  1050. import { AbstractTool } from "babylonjs-inspector/tools/AbstractTool";
  1051. import { Inspector } from "babylonjs-inspector/Inspector";
  1052. /**
  1053. * Removes the inspector panel
  1054. */
  1055. export class DisposeTool extends AbstractTool {
  1056. constructor(parent: HTMLElement, inspector: Inspector);
  1057. action(): void;
  1058. }
  1059. }
  1060. declare module 'babylonjs-inspector/tools/FullscreenTool' {
  1061. import { AbstractTool } from "babylonjs-inspector/tools/AbstractTool";
  1062. import { Inspector } from "babylonjs-inspector/Inspector";
  1063. export class FullscreenTool extends AbstractTool {
  1064. constructor(parent: HTMLElement, inspector: Inspector);
  1065. action(): void;
  1066. }
  1067. }
  1068. declare module 'babylonjs-inspector/tools/LabelTool' {
  1069. import { Inspector } from "babylonjs-inspector/Inspector";
  1070. import { AbstractTool } from "babylonjs-inspector/tools/AbstractTool";
  1071. export class LabelTool extends AbstractTool {
  1072. constructor(parent: HTMLElement, inspector: Inspector);
  1073. dispose(): void;
  1074. action(): void;
  1075. }
  1076. }
  1077. declare module 'babylonjs-inspector/tools/PauseScheduleTool' {
  1078. import { Inspector } from "babylonjs-inspector/Inspector";
  1079. import { AbstractTool } from "babylonjs-inspector/tools/AbstractTool";
  1080. export class PauseScheduleTool extends AbstractTool {
  1081. constructor(parent: HTMLElement, inspector: Inspector);
  1082. action(): void;
  1083. }
  1084. }
  1085. declare module 'babylonjs-inspector/tools/PickTool' {
  1086. import { Inspector } from "babylonjs-inspector/Inspector";
  1087. import { AbstractTool } from "babylonjs-inspector/tools/AbstractTool";
  1088. export class PickTool extends AbstractTool {
  1089. constructor(parent: HTMLElement, inspector: Inspector);
  1090. action(): void;
  1091. }
  1092. }
  1093. declare module 'babylonjs-inspector/tools/PopupTool' {
  1094. import { Inspector } from "babylonjs-inspector/Inspector";
  1095. import { AbstractTool } from "babylonjs-inspector/tools/AbstractTool";
  1096. export class PopupTool extends AbstractTool {
  1097. constructor(parent: HTMLElement, inspector: Inspector);
  1098. action(): void;
  1099. }
  1100. }
  1101. declare module 'babylonjs-inspector/tools/RefreshTool' {
  1102. import { Inspector } from "babylonjs-inspector/Inspector";
  1103. import { AbstractTool } from "babylonjs-inspector/tools/AbstractTool";
  1104. export class RefreshTool extends AbstractTool {
  1105. constructor(parent: HTMLElement, inspector: Inspector);
  1106. action(): void;
  1107. }
  1108. }
  1109. declare module 'babylonjs-inspector/tools/Toolbar' {
  1110. import { BasicElement } from "babylonjs-inspector/gui/BasicElement";
  1111. import { Inspector } from "babylonjs-inspector/Inspector";
  1112. export class Toolbar extends BasicElement {
  1113. constructor(inspector: Inspector);
  1114. update(): void;
  1115. protected _build(): void;
  1116. /**
  1117. * Returns the total width in pixel of the tabbar,
  1118. * that corresponds to the sum of the width of each tab + toolbar width
  1119. */
  1120. getPixelWidth(): number;
  1121. }
  1122. }
  1123. declare module 'babylonjs-inspector/tree/TreeItem' {
  1124. import { BasicElement } from "babylonjs-inspector/gui/BasicElement";
  1125. import { Tab } from "babylonjs-inspector/tabs/Tab";
  1126. import { Adapter } from "babylonjs-inspector/adapters/Adapter";
  1127. import { PropertyLine } from "babylonjs-inspector/details/PropertyLine";
  1128. export class TreeItem extends BasicElement {
  1129. children: Array<TreeItem>;
  1130. constructor(tab: Tab, obj: Adapter);
  1131. /** Returns the item ID == its adapter ID */
  1132. readonly id: string;
  1133. /** Add the given item as a child of this one */
  1134. add(child: TreeItem): void;
  1135. /**
  1136. * Returns the original adapter
  1137. */
  1138. readonly adapter: Adapter;
  1139. /**
  1140. * Function used to compare this item to another tree item.
  1141. * Returns the alphabetical sort of the adapter ID
  1142. */
  1143. compareTo(item: TreeItem): number;
  1144. /** Returns true if the given obj correspond to the adapter linked to this tree item */
  1145. correspondsTo(obj: any): boolean;
  1146. /** hide all children of this item */
  1147. fold(): void;
  1148. /** Show all children of this item */
  1149. unfold(): void;
  1150. /** Build the HTML of this item */
  1151. protected _build(): void;
  1152. /**
  1153. * Returns one HTML element (.details) containing all details of this primitive
  1154. */
  1155. getDetails(): Array<PropertyLine>;
  1156. update(): void;
  1157. /**
  1158. * Add an event listener on the item :
  1159. * - one click display details
  1160. */
  1161. protected _addEvent(): void;
  1162. /** Set this item as active (background lighter) in the tree panel */
  1163. active(b: boolean): void;
  1164. getDiv(): HTMLDivElement;
  1165. }
  1166. }
  1167. declare module 'babylonjs-inspector/treetools/AbstractTreeTool' {
  1168. export abstract class AbstractTreeTool {
  1169. protected _elem: HTMLElement;
  1170. /** Is the tool enabled ? */
  1171. protected _on: boolean;
  1172. constructor();
  1173. toHtml(): HTMLElement;
  1174. protected _addEvents(): void;
  1175. /**
  1176. * Action launched when clicked on this element
  1177. * Should be overrided
  1178. */
  1179. protected action(): void;
  1180. }
  1181. }
  1182. declare module 'babylonjs-inspector/treetools/BoundingBox' {
  1183. import { AbstractTreeTool } from "babylonjs-inspector/treetools/AbstractTreeTool";
  1184. /** Any object implementing this interface should
  1185. * provide methods to toggle its bounding box
  1186. */
  1187. export interface IToolBoundingBox {
  1188. isBoxVisible: () => boolean;
  1189. setBoxVisible: (b: boolean) => void;
  1190. }
  1191. /**
  1192. * Checkbox to display/hide the primitive
  1193. */
  1194. export class BoundingBox extends AbstractTreeTool {
  1195. constructor(obj: IToolBoundingBox);
  1196. protected action(): void;
  1197. }
  1198. }
  1199. declare module 'babylonjs-inspector/treetools/CameraPOV' {
  1200. import { AbstractTreeTool } from "babylonjs-inspector/treetools/AbstractTreeTool";
  1201. export interface ICameraPOV {
  1202. setPOV: () => void;
  1203. getCurrentActiveCamera: () => string;
  1204. id: () => string;
  1205. }
  1206. /**
  1207. *
  1208. */
  1209. export class CameraPOV extends AbstractTreeTool {
  1210. constructor(camera: ICameraPOV);
  1211. protected action(): void;
  1212. }
  1213. }
  1214. declare module 'babylonjs-inspector/treetools/Checkbox' {
  1215. import { AbstractTreeTool } from "babylonjs-inspector/treetools/AbstractTreeTool";
  1216. /** Any object implementing this interface should
  1217. * provide methods to toggle its visibility
  1218. */
  1219. export interface IToolVisible {
  1220. isVisible: () => boolean;
  1221. setVisible: (b: boolean) => void;
  1222. }
  1223. /**
  1224. * Checkbox to display/hide the primitive
  1225. */
  1226. export class Checkbox extends AbstractTreeTool {
  1227. constructor(obj: IToolVisible);
  1228. protected action(): void;
  1229. }
  1230. }
  1231. declare module 'babylonjs-inspector/treetools/DebugArea' {
  1232. import { AbstractTreeTool } from "babylonjs-inspector/treetools/AbstractTreeTool";
  1233. /** Any object implementing this interface should
  1234. * provide methods to toggle a debug area
  1235. */
  1236. export interface IToolDebug {
  1237. debug: (b: boolean) => void;
  1238. }
  1239. export class DebugArea extends AbstractTreeTool {
  1240. constructor(obj: IToolDebug);
  1241. protected action(): void;
  1242. }
  1243. }
  1244. declare module 'babylonjs-inspector/treetools/Info' {
  1245. import { AbstractTreeTool } from "babylonjs-inspector/treetools/AbstractTreeTool";
  1246. /** Any object implementing this interface should
  1247. * provide methods to retrieve its info
  1248. */
  1249. export interface IToolInfo {
  1250. getInfo: () => string;
  1251. }
  1252. /**
  1253. * Checkbox to display/hide the primitive
  1254. */
  1255. export class Info extends AbstractTreeTool {
  1256. constructor(obj: IToolInfo);
  1257. protected action(): void;
  1258. }
  1259. }
  1260. declare module 'babylonjs-inspector/treetools/SoundInteractions' {
  1261. import { AbstractTreeTool } from "babylonjs-inspector/treetools/AbstractTreeTool";
  1262. export interface ISoundInteractions {
  1263. setPlaying: (callback: Function) => void;
  1264. }
  1265. /**
  1266. *
  1267. */
  1268. export class SoundInteractions extends AbstractTreeTool {
  1269. constructor(playSound: ISoundInteractions);
  1270. protected action(): void;
  1271. }
  1272. }
  1273. /*BabylonJS Inspector*/
  1274. // Dependencies for this module:
  1275. // ../../../../Tools/Gulp/babylonjs
  1276. declare module INSPECTOR {
  1277. export class Inspector {
  1278. /** The HTML document relative to this inspector (the window or the popup depending on its mode) */
  1279. static DOCUMENT: HTMLDocument;
  1280. /** The HTML window. In popup mode, it's the popup itself. Otherwise, it's the current tab */
  1281. static WINDOW: Window;
  1282. onGUILoaded: BABYLON.Observable<any>;
  1283. static GUIObject: any;
  1284. /** The inspector is created with the given engine.
  1285. * If the parameter 'popup' is false, the inspector is created as a right panel on the main window.
  1286. * If the parameter 'popup' is true, the inspector is created in another popup.
  1287. */
  1288. constructor(scene: BABYLON.Scene, popup?: boolean, initialTab?: number | string, parentElement?: BABYLON.Nullable<HTMLElement>, newColors?: {
  1289. backgroundColor?: string;
  1290. backgroundColorLighter?: string;
  1291. backgroundColorLighter2?: string;
  1292. backgroundColorLighter3?: string;
  1293. color?: string;
  1294. colorTop?: string;
  1295. colorBot?: string;
  1296. });
  1297. readonly scene: BABYLON.Scene;
  1298. readonly popupMode: boolean;
  1299. /**
  1300. * Filter the list of item present in the tree.
  1301. * All item returned should have the given filter contained in the item id.
  1302. */
  1303. filterItem(filter: string): void;
  1304. /** Display the mesh tab on the given object */
  1305. displayObjectDetails(mesh: BABYLON.AbstractMesh): void;
  1306. /** Clean the whole tree of item and rebuilds it */
  1307. refresh(): void;
  1308. /** Remove the inspector panel when it's built as a right panel:
  1309. * remove the right panel and remove the wrapper
  1310. */
  1311. dispose(): void;
  1312. /** Open the inspector in a new popup
  1313. * Set 'firstTime' to true if there is no inspector created beforehands
  1314. */
  1315. openPopup(firstTime?: boolean): void;
  1316. getActiveTabIndex(): number;
  1317. }
  1318. }
  1319. declare module INSPECTOR {
  1320. export const PROPERTIES: {
  1321. /** Format the given object :
  1322. * If a format function exists, returns the result of this function.
  1323. * If this function doesn't exists, return the object type instead
  1324. */
  1325. format: (obj: any) => any;
  1326. 'type_not_defined': {
  1327. properties: any[];
  1328. format: () => string;
  1329. };
  1330. 'Vector2': {
  1331. type: typeof BABYLON.Vector2;
  1332. format: (vec: BABYLON.Vector2) => string;
  1333. };
  1334. 'Vector3': {
  1335. type: typeof BABYLON.Vector3;
  1336. format: (vec: BABYLON.Vector3) => string;
  1337. };
  1338. 'Color3': {
  1339. type: typeof BABYLON.Color3;
  1340. format: (color: BABYLON.Color3) => string;
  1341. slider: {
  1342. r: {
  1343. min: number;
  1344. max: number;
  1345. step: number;
  1346. };
  1347. g: {
  1348. min: number;
  1349. max: number;
  1350. step: number;
  1351. };
  1352. b: {
  1353. min: number;
  1354. max: number;
  1355. step: number;
  1356. };
  1357. };
  1358. };
  1359. 'Color4': {
  1360. type: typeof BABYLON.Color4;
  1361. format: (color: BABYLON.Color4) => string;
  1362. slider: {
  1363. r: {
  1364. min: number;
  1365. max: number;
  1366. step: number;
  1367. };
  1368. g: {
  1369. min: number;
  1370. max: number;
  1371. step: number;
  1372. };
  1373. b: {
  1374. min: number;
  1375. max: number;
  1376. step: number;
  1377. };
  1378. };
  1379. };
  1380. 'Quaternion': {
  1381. type: typeof BABYLON.Quaternion;
  1382. };
  1383. 'Size': {
  1384. type: typeof BABYLON.Size;
  1385. format: (size: BABYLON.Size) => string;
  1386. };
  1387. 'Texture': {
  1388. type: typeof BABYLON.Texture;
  1389. format: (tex: BABYLON.Texture) => string;
  1390. };
  1391. 'RenderTargetTexture': {
  1392. type: typeof BABYLON.RenderTargetTexture;
  1393. };
  1394. 'DynamicTexture': {
  1395. type: typeof BABYLON.DynamicTexture;
  1396. };
  1397. 'BaseTexture': {
  1398. type: typeof BABYLON.BaseTexture;
  1399. };
  1400. 'CubeTexture': {
  1401. type: typeof BABYLON.CubeTexture;
  1402. };
  1403. 'HDRCubeTexture': {
  1404. type: typeof BABYLON.HDRCubeTexture;
  1405. };
  1406. 'Sound': {
  1407. type: typeof BABYLON.Sound;
  1408. };
  1409. 'ArcRotateCamera': {
  1410. type: typeof BABYLON.ArcRotateCamera;
  1411. slider: {
  1412. alpha: {
  1413. min: number;
  1414. max: number;
  1415. step: number;
  1416. };
  1417. beta: {
  1418. min: number;
  1419. max: number;
  1420. step: number;
  1421. };
  1422. fov: {
  1423. min: number;
  1424. max: number;
  1425. step: number;
  1426. };
  1427. };
  1428. };
  1429. 'FreeCamera': {
  1430. type: typeof BABYLON.FreeCamera;
  1431. slider: {
  1432. fov: {
  1433. min: number;
  1434. max: number;
  1435. step: number;
  1436. };
  1437. };
  1438. };
  1439. 'Scene': {
  1440. type: typeof BABYLON.Scene;
  1441. };
  1442. 'TransformNode': {
  1443. type: typeof BABYLON.TransformNode;
  1444. format: (m: BABYLON.TransformNode) => string;
  1445. };
  1446. 'AbstractMesh': {
  1447. type: typeof BABYLON.AbstractMesh;
  1448. format: (m: BABYLON.AbstractMesh) => string;
  1449. };
  1450. 'Mesh': {
  1451. type: typeof BABYLON.Mesh;
  1452. format: (m: BABYLON.Mesh) => string;
  1453. slider: {
  1454. visibility: {
  1455. min: number;
  1456. max: number;
  1457. step: number;
  1458. };
  1459. };
  1460. };
  1461. 'StandardMaterial': {
  1462. type: typeof BABYLON.StandardMaterial;
  1463. format: (mat: BABYLON.StandardMaterial) => string;
  1464. slider: {
  1465. alpha: {
  1466. min: number;
  1467. max: number;
  1468. step: number;
  1469. };
  1470. };
  1471. };
  1472. 'PBRMaterial': {
  1473. type: typeof BABYLON.PBRMaterial;
  1474. slider: {
  1475. alpha: {
  1476. min: number;
  1477. max: number;
  1478. step: number;
  1479. };
  1480. };
  1481. };
  1482. 'PhysicsImpostor': {
  1483. type: typeof BABYLON.PhysicsImpostor;
  1484. };
  1485. 'ImageProcessingConfiguration': {
  1486. type: typeof BABYLON.ImageProcessingConfiguration;
  1487. };
  1488. 'ColorCurves': {
  1489. type: typeof BABYLON.ColorCurves;
  1490. };
  1491. };
  1492. }
  1493. declare module INSPECTOR {
  1494. export type GUITyping = any;
  1495. export let guiLoaded: boolean;
  1496. /**
  1497. * Function that add gui objects properties to the variable PROPERTIES
  1498. */
  1499. export function loadGUIProperties(GUI: GUITyping): void;
  1500. }
  1501. declare module INSPECTOR {
  1502. export abstract class Adapter {
  1503. protected _obj: any;
  1504. constructor(obj: any);
  1505. /** Returns the name displayed in the tree */
  1506. abstract id(): string;
  1507. /** Returns the type of this object - displayed in the tree */
  1508. abstract type(): string;
  1509. /** Returns the list of properties to be displayed for this adapter */
  1510. abstract getProperties(): Array<PropertyLine>;
  1511. /** Returns true if the given object correspond to this */
  1512. correspondsTo(obj: any): boolean;
  1513. /** Returns the adapter unique name */
  1514. readonly name: string;
  1515. /**
  1516. * Returns the actual object used for this adapter
  1517. */
  1518. readonly object: any;
  1519. /** Returns the list of tools available for this adapter */
  1520. abstract getTools(): Array<AbstractTreeTool>;
  1521. }
  1522. }
  1523. declare module INSPECTOR {
  1524. export class CameraAdapter extends Adapter implements ICameraPOV {
  1525. constructor(obj: BABYLON.Camera);
  1526. /** Returns the name displayed in the tree */
  1527. id(): string;
  1528. /** Returns the type of this object - displayed in the tree */
  1529. type(): string;
  1530. /** Returns the list of properties to be displayed for this adapter */
  1531. getProperties(): Array<PropertyLine>;
  1532. getTools(): Array<AbstractTreeTool>;
  1533. setPOV(): void;
  1534. getCurrentActiveCamera(): string;
  1535. }
  1536. }
  1537. declare module INSPECTOR {
  1538. export class GUIAdapter extends Adapter implements IToolVisible {
  1539. constructor(obj: any);
  1540. /** Returns the name displayed in the tree */
  1541. id(): string;
  1542. /** Returns the type of this object - displayed in the tree */
  1543. type(): string;
  1544. /** Returns the list of properties to be displayed for this adapter */
  1545. getProperties(): Array<PropertyLine>;
  1546. getTools(): Array<AbstractTreeTool>;
  1547. setVisible(b: boolean): void;
  1548. isVisible(): boolean;
  1549. }
  1550. }
  1551. declare module INSPECTOR {
  1552. export class LightAdapter extends Adapter implements IToolVisible {
  1553. constructor(obj: BABYLON.Light);
  1554. /** Returns the name displayed in the tree */
  1555. id(): string;
  1556. /** Returns the type of this object - displayed in the tree */
  1557. type(): string;
  1558. /** Returns the list of properties to be displayed for this adapter */
  1559. getProperties(): Array<PropertyLine>;
  1560. getTools(): Array<AbstractTreeTool>;
  1561. setVisible(b: boolean): void;
  1562. isVisible(): boolean;
  1563. }
  1564. }
  1565. declare module INSPECTOR {
  1566. export class MaterialAdapter extends Adapter {
  1567. constructor(obj: BABYLON.Material);
  1568. /** Returns the name displayed in the tree */
  1569. id(): string;
  1570. /** Returns the type of this object - displayed in the tree */
  1571. type(): string;
  1572. /** Returns the list of properties to be displayed for this adapter */
  1573. getProperties(): Array<PropertyLine>;
  1574. /** No tools for a material adapter */
  1575. getTools(): Array<AbstractTreeTool>;
  1576. }
  1577. }
  1578. declare module INSPECTOR {
  1579. export class MeshAdapter extends Adapter implements IToolVisible, IToolDebug, IToolBoundingBox, IToolInfo {
  1580. constructor(mesh: BABYLON.Node);
  1581. /** Returns the name displayed in the tree */
  1582. id(): string;
  1583. /** Returns the type of this object - displayed in the tree */
  1584. type(): string;
  1585. /** Returns the list of properties to be displayed for this adapter */
  1586. getProperties(): Array<PropertyLine>;
  1587. getTools(): Array<AbstractTreeTool>;
  1588. setVisible(b: boolean): void;
  1589. isVisible(): boolean;
  1590. isBoxVisible(): boolean;
  1591. setBoxVisible(b: boolean): boolean;
  1592. debug(enable: boolean): void;
  1593. /** Returns some information about this mesh */
  1594. getInfo(): string;
  1595. }
  1596. }
  1597. declare module INSPECTOR {
  1598. export class PhysicsImpostorAdapter extends Adapter implements IToolVisible {
  1599. constructor(obj: BABYLON.PhysicsImpostor, viewer: any);
  1600. /** Returns the name displayed in the tree */
  1601. id(): string;
  1602. /** Returns the type of this object - displayed in the tree */
  1603. type(): string;
  1604. /** Returns the list of properties to be displayed for this adapter */
  1605. getProperties(): Array<PropertyLine>;
  1606. getTools(): Array<AbstractTreeTool>;
  1607. setVisible(b: boolean): void;
  1608. isVisible(): boolean;
  1609. }
  1610. }
  1611. declare module INSPECTOR {
  1612. export class SoundAdapter extends Adapter implements ISoundInteractions {
  1613. constructor(obj: BABYLON.Sound);
  1614. /** Returns the name displayed in the tree */
  1615. id(): string;
  1616. /** Returns the type of this object - displayed in the tree */
  1617. type(): string;
  1618. /** Returns the list of properties to be displayed for this adapter */
  1619. getProperties(): Array<PropertyLine>;
  1620. getTools(): Array<AbstractTreeTool>;
  1621. setPlaying(callback: Function): void;
  1622. }
  1623. }
  1624. declare module INSPECTOR {
  1625. export class TextureAdapter extends Adapter {
  1626. constructor(obj: BABYLON.BaseTexture);
  1627. /** Returns the name displayed in the tree */
  1628. id(): string;
  1629. /** Returns the type of this object - displayed in the tree */
  1630. type(): string;
  1631. /** Returns the list of properties to be displayed for this adapter */
  1632. getProperties(): Array<PropertyLine>;
  1633. getTools(): Array<AbstractTreeTool>;
  1634. }
  1635. }
  1636. declare module INSPECTOR {
  1637. export interface SortDirection {
  1638. [property: string]: number;
  1639. }
  1640. export class DetailPanel extends BasicElement {
  1641. constructor(dr?: Array<PropertyLine>);
  1642. details: Array<PropertyLine>;
  1643. protected _build(): void;
  1644. /** Updates the HTML of the detail panel */
  1645. update(_items?: Array<PropertyLine>): void;
  1646. /** Search an element by name */
  1647. searchByName(searchName: string): void;
  1648. /**
  1649. * Removes all data in the detail panel but keep the header row
  1650. */
  1651. clean(): void;
  1652. /**
  1653. * Clean the rows only
  1654. */
  1655. cleanRow(): void;
  1656. /** Overrides basicelement.dispose */
  1657. dispose(): void;
  1658. }
  1659. }
  1660. declare module INSPECTOR {
  1661. /**
  1662. * A property is a link between a data (string) and an object.
  1663. */
  1664. export class Property {
  1665. constructor(prop: string, obj: any, parentObj?: any);
  1666. readonly name: string;
  1667. value: any;
  1668. readonly type: string;
  1669. obj: any;
  1670. }
  1671. }
  1672. declare module INSPECTOR {
  1673. export class PropertyFormatter {
  1674. /**
  1675. * Format the value of the given property of the given object.
  1676. */
  1677. static format(obj: any, prop: string): string;
  1678. }
  1679. /**
  1680. * A property line represents a line in the detail panel. This line is composed of :
  1681. * - a name (the property name)
  1682. * - a value if this property is of a type 'simple' : string, number, boolean, color, texture
  1683. * - the type of the value if this property is of a complex type (Vector2, BABYLON.Size, ...)
  1684. * - a ID if defined (otherwise an empty string is displayed)
  1685. * The original object is sent to the value object who will update it at will.
  1686. *
  1687. * A property line can contain OTHER property line objects in the case of a complex type.
  1688. * If this instance has no link to other instances, its type is ALWAYS a simple one (see above).
  1689. *
  1690. */
  1691. export class PropertyLine {
  1692. constructor(prop: Property, parent?: BABYLON.Nullable<PropertyLine>, level?: number);
  1693. validateInput(value: any, forceupdate?: boolean): void;
  1694. /** Retrieve the correct object from its parent.
  1695. * If no parent exists, returns the property value.
  1696. * This method is used at each update in case the property object is removed from the original object
  1697. * (example : mesh.position = new BABYLON.Vector3 ; the original vector3 object is deleted from the mesh).
  1698. */
  1699. updateObject(): any;
  1700. readonly name: string;
  1701. readonly value: any;
  1702. readonly type: string;
  1703. /** Delete properly this property line.
  1704. * Removes itself from the scheduler.
  1705. * Dispose all viewer element (color, texture...)
  1706. */
  1707. dispose(): void;
  1708. /**
  1709. * Update the property division with the new property value.
  1710. * If this property is complex, update its child, otherwise update its text content
  1711. */
  1712. update(): void;
  1713. toHtml(): HTMLElement;
  1714. closeDetails(): void;
  1715. }
  1716. }
  1717. declare module INSPECTOR {
  1718. /**
  1719. * Represents a html div element.
  1720. * The div is built when an instance of BasicElement is created.
  1721. */
  1722. export abstract class BasicElement {
  1723. protected _div: HTMLDivElement;
  1724. constructor();
  1725. /**
  1726. * Returns the div element
  1727. */
  1728. toHtml(): HTMLDivElement;
  1729. /**
  1730. * Build the html element
  1731. */
  1732. protected _build(): void;
  1733. abstract update(data?: any): void;
  1734. /** Default dispose method if needed */
  1735. dispose(): void;
  1736. }
  1737. }
  1738. declare module INSPECTOR {
  1739. /**
  1740. * Display a very small div corresponding to the given color
  1741. */
  1742. export class ColorElement extends BasicElement {
  1743. constructor(color: BABYLON.Color4 | BABYLON.Color3);
  1744. update(color?: BABYLON.Color4 | BABYLON.Color3): void;
  1745. }
  1746. }
  1747. declare module INSPECTOR {
  1748. /**
  1749. * Represents a html div element.
  1750. * The div is built when an instance of BasicElement is created.
  1751. */
  1752. export class ColorPickerElement extends BasicElement {
  1753. protected _input: HTMLInputElement;
  1754. constructor(color: BABYLON.Color4 | BABYLON.Color3, propertyLine: PropertyLine);
  1755. update(color?: BABYLON.Color4 | BABYLON.Color3): void;
  1756. }
  1757. }
  1758. declare module INSPECTOR {
  1759. /**
  1760. * Display a very small div. A new canvas is created, with a new js scene, containing only the
  1761. * cube texture in a cube
  1762. */
  1763. export class CubeTextureElement extends BasicElement {
  1764. protected _scene: BABYLON.Scene;
  1765. protected _cube: BABYLON.Mesh;
  1766. protected _textureUrl: string;
  1767. /** The texture given as a parameter should be cube. */
  1768. constructor(tex: BABYLON.Texture);
  1769. update(tex?: BABYLON.Texture): void;
  1770. /** Creates the box */
  1771. protected _populateScene(): void;
  1772. /** Removes properly the babylon engine */
  1773. dispose(): void;
  1774. }
  1775. }
  1776. declare module INSPECTOR {
  1777. /**
  1778. * Display a very small div. A new canvas is created, with a new js scene, containing only the
  1779. * cube texture in a cube
  1780. */
  1781. export class HDRCubeTextureElement extends CubeTextureElement {
  1782. /** The texture given as a parameter should be cube. */
  1783. constructor(tex: BABYLON.Texture);
  1784. /** Creates the box */
  1785. protected _populateScene(): void;
  1786. }
  1787. }
  1788. declare module INSPECTOR {
  1789. /**
  1790. * A search bar can be used to filter elements in the tree panel.
  1791. * At each keypress on the input, the treepanel will be filtered.
  1792. */
  1793. export class SearchBar extends BasicElement {
  1794. constructor(tab: PropertyTab);
  1795. /** Delete all characters typped in the input element */
  1796. reset(): void;
  1797. update(): void;
  1798. }
  1799. export class SearchBarDetails extends BasicElement {
  1800. constructor(tab: DetailPanel);
  1801. /** Delete all characters typped in the input element */
  1802. reset(): void;
  1803. update(): void;
  1804. }
  1805. }
  1806. declare module INSPECTOR {
  1807. /**
  1808. * Display a very small div corresponding to the given texture. On mouse over, display the full image
  1809. */
  1810. export class TextureElement extends BasicElement {
  1811. constructor(tex: BABYLON.Texture);
  1812. update(tex?: BABYLON.Texture): void;
  1813. }
  1814. }
  1815. declare module INSPECTOR {
  1816. /**
  1817. * Creates a tooltip for the parent of the given html element
  1818. */
  1819. export class Tooltip {
  1820. constructor(elem: HTMLElement, tip: string, attachTo?: BABYLON.Nullable<HTMLElement>);
  1821. }
  1822. }
  1823. declare module INSPECTOR {
  1824. export class Helpers {
  1825. /**
  1826. * Returns the type of the given object. First
  1827. * uses getClassName. If nothing is returned, used the type of the constructor
  1828. */
  1829. static GET_TYPE(obj: any): string;
  1830. /**
  1831. * Returns true if the user browser is edge.
  1832. */
  1833. static IsBrowserEdge(): boolean;
  1834. /**
  1835. * Returns true if the user browser is IE.
  1836. */
  1837. static IsBrowserIE(): boolean;
  1838. /** Send the event which name is given in parameter to the window */
  1839. static SEND_EVENT(eventName: string): void;
  1840. /** Returns the given number with 2 decimal number max if a decimal part exists */
  1841. static Trunc(nb: number): number;
  1842. /**
  1843. * Useful function used to create a div
  1844. */
  1845. static CreateDiv(className?: BABYLON.Nullable<string>, parent?: HTMLElement, tooltip?: string): HTMLDivElement;
  1846. /**
  1847. * Useful function used to create a input
  1848. */
  1849. static CreateInput(className?: string, parent?: HTMLElement, tooltip?: string): HTMLInputElement;
  1850. static CreateElement(element: string, className?: BABYLON.Nullable<string>, parent?: HTMLElement, tooltip?: string): HTMLElement;
  1851. /**
  1852. * Removes all children of the given div.
  1853. */
  1854. static CleanDiv(div: HTMLElement): void;
  1855. /**
  1856. * 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)
  1857. */
  1858. static Css(elem: HTMLElement, cssAttribute: string): string;
  1859. static LoadScript(): void;
  1860. static IsSystemName(name: string): boolean;
  1861. /**
  1862. * Return an array of PropertyLine for an obj
  1863. * @param obj
  1864. */
  1865. static GetAllLinesProperties(obj: any): Array<PropertyLine>;
  1866. /**
  1867. * Returns an array of string corresponding to tjhe list of properties of the object to be displayed
  1868. * @param obj
  1869. */
  1870. static GetAllLinesPropertiesAsString(obj: any, dontTakeThis?: Array<string>): Array<string>;
  1871. static Capitalize(str: string): string;
  1872. }
  1873. }
  1874. declare module INSPECTOR {
  1875. export class Scheduler {
  1876. /** Is this scheduler in pause ? */
  1877. pause: boolean;
  1878. /** All properties are refreshed every 250ms */
  1879. static REFRESH_TIME: number;
  1880. constructor();
  1881. static getInstance(): Scheduler;
  1882. /** Add a property line to be updated every X ms */
  1883. add(prop: PropertyLine): void;
  1884. /** Removes the given property from the list of properties to update */
  1885. remove(prop: PropertyLine): void;
  1886. dispose(): void;
  1887. }
  1888. }
  1889. declare module INSPECTOR {
  1890. export class CameraTab extends PropertyTab {
  1891. constructor(tabbar: TabBar, inspector: Inspector);
  1892. protected _getTree(): Array<TreeItem>;
  1893. }
  1894. }
  1895. declare module INSPECTOR {
  1896. /**
  1897. * The console tab will have two features :
  1898. * - hook all console.log call and display them in this panel (and in the browser console as well)
  1899. * - display all Babylon logs (called with Tools.Log...)
  1900. */
  1901. export class ConsoleTab extends Tab {
  1902. constructor(tabbar: TabBar, insp: Inspector);
  1903. /** Overrides super.dispose */
  1904. dispose(): void;
  1905. active(b: boolean): void;
  1906. }
  1907. }
  1908. declare module INSPECTOR {
  1909. export class GLTFTab extends Tab {
  1910. static readonly IsSupported: boolean;
  1911. /** @hidden */
  1912. static _Initialize(): void;
  1913. constructor(tabbar: TabBar, inspector: Inspector);
  1914. dispose(): void;
  1915. /** @hidden */
  1916. static _GetLoaderDefaultsAsync(): Promise<any>;
  1917. }
  1918. }
  1919. declare module INSPECTOR {
  1920. export class GUITab extends PropertyTab {
  1921. constructor(tabbar: TabBar, inspector: Inspector);
  1922. protected _getTree(): Array<TreeItem>;
  1923. }
  1924. }
  1925. declare module INSPECTOR {
  1926. export class LightTab extends PropertyTab {
  1927. constructor(tabbar: TabBar, inspector: Inspector);
  1928. protected _getTree(): Array<TreeItem>;
  1929. }
  1930. }
  1931. declare module INSPECTOR {
  1932. export class MaterialTab extends PropertyTab {
  1933. constructor(tabbar: TabBar, inspector: Inspector);
  1934. protected _getTree(): Array<TreeItem>;
  1935. }
  1936. }
  1937. declare module INSPECTOR {
  1938. export class MeshTab extends PropertyTab {
  1939. constructor(tabbar: TabBar, inspector: Inspector);
  1940. protected _getTree(): Array<TreeItem>;
  1941. }
  1942. }
  1943. declare module INSPECTOR {
  1944. export class PhysicsTab extends PropertyTab {
  1945. viewer: any;
  1946. constructor(tabbar: TabBar, inspector: Inspector);
  1947. protected _getTree(): Array<TreeItem>;
  1948. }
  1949. }
  1950. declare module INSPECTOR {
  1951. /**
  1952. * A Property tab can creates two panels:
  1953. * a tree panel and a detail panel,
  1954. * in which properties will be displayed.
  1955. * Both panels are separated by a resize bar
  1956. */
  1957. export abstract class PropertyTab extends Tab {
  1958. protected _inspector: Inspector;
  1959. /** The panel containing a list of items */
  1960. protected _treePanel: HTMLDivElement;
  1961. /** The panel containing a list if properties corresponding to an item */
  1962. protected _detailsPanel: DetailPanel;
  1963. protected _treeItems: Array<TreeItem>;
  1964. protected _searchBar: SearchBar;
  1965. constructor(tabbar: TabBar, name: string, insp: Inspector);
  1966. /** Overrides dispose */
  1967. dispose(): void;
  1968. update(_items?: Array<TreeItem>): void;
  1969. /** Display the details of the given item */
  1970. displayDetails(item: TreeItem): void;
  1971. /** Select an item in the tree */
  1972. select(item: TreeItem): void;
  1973. /** Set the given item as active in the tree */
  1974. activateNode(item: TreeItem): void;
  1975. /** Returns the treeitem corersponding to the given obj, null if not found */
  1976. getItemFor(_obj: any): BABYLON.Nullable<TreeItem>;
  1977. filter(filter: string): void;
  1978. /** Builds the tree panel */
  1979. protected abstract _getTree(): Array<TreeItem>;
  1980. }
  1981. }
  1982. declare module INSPECTOR {
  1983. export class SceneTab extends Tab {
  1984. constructor(tabbar: TabBar, insp: Inspector);
  1985. /** Overrides super.dispose */
  1986. dispose(): void;
  1987. }
  1988. }
  1989. declare module INSPECTOR {
  1990. export class SoundTab extends PropertyTab {
  1991. constructor(tabbar: TabBar, inspector: Inspector);
  1992. protected _getTree(): Array<TreeItem>;
  1993. }
  1994. }
  1995. declare module INSPECTOR {
  1996. export class StatsTab extends Tab {
  1997. constructor(tabbar: TabBar, insp: Inspector);
  1998. dispose(): void;
  1999. active(b: boolean): void;
  2000. }
  2001. }
  2002. declare module INSPECTOR {
  2003. export abstract class Tab extends BasicElement {
  2004. protected _tabbar: TabBar;
  2005. name: string;
  2006. protected _isActive: boolean;
  2007. protected _panel: HTMLDivElement;
  2008. constructor(tabbar: TabBar, name: string);
  2009. /** True if the tab is active, false otherwise */
  2010. isActive(): boolean;
  2011. protected _build(): void;
  2012. /** Set this tab as active or not, depending on the current state */
  2013. active(b: boolean): void;
  2014. update(): void;
  2015. /** Creates the tab panel for this tab. */
  2016. getPanel(): HTMLElement;
  2017. /** Add this in the propertytab with the searchbar */
  2018. filter(str: string): void;
  2019. /** Dispose properly this tab */
  2020. abstract dispose(): void;
  2021. /** Select an item in the tree */
  2022. select(item: TreeItem): void;
  2023. /**
  2024. * Returns the total width in pixel of this tab, 0 by default
  2025. */
  2026. getPixelWidth(): number;
  2027. }
  2028. }
  2029. declare module INSPECTOR {
  2030. /**
  2031. * A tab bar will contains each view the inspector can have : Canvas2D, Meshes...
  2032. * The default active tab is the first one of the list.
  2033. */
  2034. export class TabBar extends BasicElement {
  2035. constructor(inspector: Inspector, initialTab?: number | string);
  2036. update(): void;
  2037. protected _build(): void;
  2038. /** Dispose the current tab, set the given tab as active, and refresh the treeview */
  2039. switchTab(tab: Tab): void;
  2040. /** Display the mesh tab.
  2041. * If a parameter is given, the given mesh details are displayed
  2042. */
  2043. switchMeshTab(mesh?: BABYLON.AbstractMesh): void;
  2044. /** Returns the active tab */
  2045. getActiveTab(): BABYLON.Nullable<Tab>;
  2046. getActiveTabIndex(): number;
  2047. getTabIndex(name: string): number;
  2048. readonly inspector: Inspector;
  2049. /**
  2050. * Returns the total width in pixel of the tabbar,
  2051. * that corresponds to the sum of the width of each visible tab + toolbar width
  2052. */
  2053. getPixelWidth(): number;
  2054. /** Display the remaining icon or not depending on the tabbar width.
  2055. * This function should be called each time the inspector width is updated
  2056. */
  2057. updateWidth(): void;
  2058. }
  2059. }
  2060. declare module INSPECTOR {
  2061. export class TextureTab extends Tab {
  2062. static DDSPreview: DDSPreview;
  2063. /** The panel containing a list of items */
  2064. protected _treePanel: HTMLElement;
  2065. protected _treeItems: Array<TreeItem>;
  2066. constructor(tabbar: TabBar, inspector: Inspector);
  2067. dispose(): void;
  2068. update(_items?: Array<TreeItem>): void;
  2069. /** Display the details of the given item */
  2070. displayDetails(item: TreeItem): void;
  2071. /** Select an item in the tree */
  2072. select(item: TreeItem): void;
  2073. /** Set the given item as active in the tree */
  2074. activateNode(item: TreeItem): void;
  2075. }
  2076. class DDSPreview {
  2077. canvas: HTMLCanvasElement | null;
  2078. constructor(AdapterItem: TextureAdapter);
  2079. insertPreview(AdapterItem: TextureAdapter): void;
  2080. dispose(): void;
  2081. }
  2082. }
  2083. declare module INSPECTOR {
  2084. export class ToolsTab extends Tab {
  2085. constructor(tabbar: TabBar, insp: Inspector);
  2086. dispose(): void;
  2087. }
  2088. }
  2089. declare module INSPECTOR {
  2090. export abstract class AbstractTool {
  2091. protected _inspector: Inspector;
  2092. constructor(iconSet: string, icon: string, parent: HTMLElement, inspector: Inspector, tooltip: string);
  2093. toHtml(): HTMLElement;
  2094. /**
  2095. * Returns the total width in pixel of this tool, 0 by default
  2096. */
  2097. getPixelWidth(): number;
  2098. /**
  2099. * Updates the icon of this tool with the given string
  2100. */
  2101. protected _updateIcon(icon: string): void;
  2102. abstract action(): void;
  2103. }
  2104. }
  2105. declare module INSPECTOR {
  2106. /**
  2107. * Removes the inspector panel
  2108. */
  2109. export class DisposeTool extends AbstractTool {
  2110. constructor(parent: HTMLElement, inspector: Inspector);
  2111. action(): void;
  2112. }
  2113. }
  2114. declare module INSPECTOR {
  2115. export class FullscreenTool extends AbstractTool {
  2116. constructor(parent: HTMLElement, inspector: Inspector);
  2117. action(): void;
  2118. }
  2119. }
  2120. declare module INSPECTOR {
  2121. export class LabelTool extends AbstractTool {
  2122. constructor(parent: HTMLElement, inspector: Inspector);
  2123. dispose(): void;
  2124. action(): void;
  2125. }
  2126. }
  2127. declare module INSPECTOR {
  2128. export class PauseScheduleTool extends AbstractTool {
  2129. constructor(parent: HTMLElement, inspector: Inspector);
  2130. action(): void;
  2131. }
  2132. }
  2133. declare module INSPECTOR {
  2134. export class PickTool extends AbstractTool {
  2135. constructor(parent: HTMLElement, inspector: Inspector);
  2136. action(): void;
  2137. }
  2138. }
  2139. declare module INSPECTOR {
  2140. export class PopupTool extends AbstractTool {
  2141. constructor(parent: HTMLElement, inspector: Inspector);
  2142. action(): void;
  2143. }
  2144. }
  2145. declare module INSPECTOR {
  2146. export class RefreshTool extends AbstractTool {
  2147. constructor(parent: HTMLElement, inspector: Inspector);
  2148. action(): void;
  2149. }
  2150. }
  2151. declare module INSPECTOR {
  2152. export class Toolbar extends BasicElement {
  2153. constructor(inspector: Inspector);
  2154. update(): void;
  2155. protected _build(): void;
  2156. /**
  2157. * Returns the total width in pixel of the tabbar,
  2158. * that corresponds to the sum of the width of each tab + toolbar width
  2159. */
  2160. getPixelWidth(): number;
  2161. }
  2162. }
  2163. declare module INSPECTOR {
  2164. export class TreeItem extends BasicElement {
  2165. children: Array<TreeItem>;
  2166. constructor(tab: Tab, obj: Adapter);
  2167. /** Returns the item ID == its adapter ID */
  2168. readonly id: string;
  2169. /** Add the given item as a child of this one */
  2170. add(child: TreeItem): void;
  2171. /**
  2172. * Returns the original adapter
  2173. */
  2174. readonly adapter: Adapter;
  2175. /**
  2176. * Function used to compare this item to another tree item.
  2177. * Returns the alphabetical sort of the adapter ID
  2178. */
  2179. compareTo(item: TreeItem): number;
  2180. /** Returns true if the given obj correspond to the adapter linked to this tree item */
  2181. correspondsTo(obj: any): boolean;
  2182. /** hide all children of this item */
  2183. fold(): void;
  2184. /** Show all children of this item */
  2185. unfold(): void;
  2186. /** Build the HTML of this item */
  2187. protected _build(): void;
  2188. /**
  2189. * Returns one HTML element (.details) containing all details of this primitive
  2190. */
  2191. getDetails(): Array<PropertyLine>;
  2192. update(): void;
  2193. /**
  2194. * Add an event listener on the item :
  2195. * - one click display details
  2196. */
  2197. protected _addEvent(): void;
  2198. /** Set this item as active (background lighter) in the tree panel */
  2199. active(b: boolean): void;
  2200. getDiv(): HTMLDivElement;
  2201. }
  2202. }
  2203. declare module INSPECTOR {
  2204. export abstract class AbstractTreeTool {
  2205. protected _elem: HTMLElement;
  2206. /** Is the tool enabled ? */
  2207. protected _on: boolean;
  2208. constructor();
  2209. toHtml(): HTMLElement;
  2210. protected _addEvents(): void;
  2211. /**
  2212. * Action launched when clicked on this element
  2213. * Should be overrided
  2214. */
  2215. protected action(): void;
  2216. }
  2217. }
  2218. declare module INSPECTOR {
  2219. /** Any object implementing this interface should
  2220. * provide methods to toggle its bounding box
  2221. */
  2222. export interface IToolBoundingBox {
  2223. isBoxVisible: () => boolean;
  2224. setBoxVisible: (b: boolean) => void;
  2225. }
  2226. /**
  2227. * Checkbox to display/hide the primitive
  2228. */
  2229. export class BoundingBox extends AbstractTreeTool {
  2230. constructor(obj: IToolBoundingBox);
  2231. protected action(): void;
  2232. }
  2233. }
  2234. declare module INSPECTOR {
  2235. export interface ICameraPOV {
  2236. setPOV: () => void;
  2237. getCurrentActiveCamera: () => string;
  2238. id: () => string;
  2239. }
  2240. /**
  2241. *
  2242. */
  2243. export class CameraPOV extends AbstractTreeTool {
  2244. constructor(camera: ICameraPOV);
  2245. protected action(): void;
  2246. }
  2247. }
  2248. declare module INSPECTOR {
  2249. /** Any object implementing this interface should
  2250. * provide methods to toggle its visibility
  2251. */
  2252. export interface IToolVisible {
  2253. isVisible: () => boolean;
  2254. setVisible: (b: boolean) => void;
  2255. }
  2256. /**
  2257. * Checkbox to display/hide the primitive
  2258. */
  2259. export class Checkbox extends AbstractTreeTool {
  2260. constructor(obj: IToolVisible);
  2261. protected action(): void;
  2262. }
  2263. }
  2264. declare module INSPECTOR {
  2265. /** Any object implementing this interface should
  2266. * provide methods to toggle a debug area
  2267. */
  2268. export interface IToolDebug {
  2269. debug: (b: boolean) => void;
  2270. }
  2271. export class DebugArea extends AbstractTreeTool {
  2272. constructor(obj: IToolDebug);
  2273. protected action(): void;
  2274. }
  2275. }
  2276. declare module INSPECTOR {
  2277. /** Any object implementing this interface should
  2278. * provide methods to retrieve its info
  2279. */
  2280. export interface IToolInfo {
  2281. getInfo: () => string;
  2282. }
  2283. /**
  2284. * Checkbox to display/hide the primitive
  2285. */
  2286. export class Info extends AbstractTreeTool {
  2287. constructor(obj: IToolInfo);
  2288. protected action(): void;
  2289. }
  2290. }
  2291. declare module INSPECTOR {
  2292. export interface ISoundInteractions {
  2293. setPlaying: (callback: Function) => void;
  2294. }
  2295. /**
  2296. *
  2297. */
  2298. export class SoundInteractions extends AbstractTreeTool {
  2299. constructor(playSound: ISoundInteractions);
  2300. protected action(): void;
  2301. }
  2302. }