babylon.inspector.module.d.ts 85 KB

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