babylon.inspector.module.d.ts 85 KB

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