babylon.inspector.d.ts 168 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387
  1. /// <reference types="react" />
  2. declare module INSPECTOR {
  3. export class PropertyChangedEvent {
  4. object: any;
  5. property: string;
  6. value: any;
  7. initialValue: any;
  8. allowNullValue?: boolean;
  9. }
  10. }
  11. declare module INSPECTOR {
  12. export class ReplayRecorder {
  13. private _sceneRecorder;
  14. private _isRecording;
  15. get isRecording(): boolean;
  16. cancel(): void;
  17. trackScene(scene: BABYLON.Scene): void;
  18. applyDelta(json: any, scene: BABYLON.Scene): void;
  19. export(): void;
  20. }
  21. }
  22. declare module INSPECTOR {
  23. export class GlobalState {
  24. onSelectionChangedObservable: BABYLON.Observable<any>;
  25. onPropertyChangedObservable: BABYLON.Observable<PropertyChangedEvent>;
  26. onInspectorClosedObservable: BABYLON.Observable<BABYLON.Scene>;
  27. onTabChangedObservable: BABYLON.Observable<number>;
  28. onSelectionRenamedObservable: BABYLON.Observable<void>;
  29. onPluginActivatedObserver: BABYLON.Nullable<BABYLON.Observer<BABYLON.ISceneLoaderPlugin | BABYLON.ISceneLoaderPluginAsync>>;
  30. onNewSceneObservable: BABYLON.Observable<BABYLON.Scene>;
  31. sceneImportDefaults: {
  32. [key: string]: any;
  33. };
  34. validationResults: BABYLON.Nullable<BABYLON.GLTF2.IGLTFValidationResults>;
  35. onValidationResultsUpdatedObservable: BABYLON.Observable<BABYLON.Nullable<BABYLON.GLTF2.IGLTFValidationResults>>;
  36. onExtensionLoadedObservable: BABYLON.Observable<import("babylonjs-loaders/glTF/index").IGLTFLoaderExtension>;
  37. glTFLoaderExtensionDefaults: {
  38. [name: string]: {
  39. [key: string]: any;
  40. };
  41. };
  42. glTFLoaderDefaults: {
  43. [key: string]: any;
  44. };
  45. glTFLoaderExtensions: {
  46. [key: string]: import("babylonjs-loaders/glTF/index").IGLTFLoaderExtension;
  47. };
  48. blockMutationUpdates: boolean;
  49. selectedLineContainerTitles: Array<string>;
  50. selectedLineContainerTitlesNoFocus: Array<string>;
  51. recorder: ReplayRecorder;
  52. private _onlyUseEulers;
  53. get onlyUseEulers(): boolean;
  54. set onlyUseEulers(value: boolean);
  55. private _ignoreBackfacesForPicking;
  56. get ignoreBackfacesForPicking(): boolean;
  57. set ignoreBackfacesForPicking(value: boolean);
  58. init(propertyChangedObservable: BABYLON.Observable<PropertyChangedEvent>): void;
  59. prepareGLTFPlugin(loader: import("babylonjs-loaders/glTF/index").GLTFFileLoader): void;
  60. resetGLTFValidationResults(): void;
  61. lightGizmos: Array<BABYLON.LightGizmo>;
  62. enableLightGizmo(light: BABYLON.Light, enable?: boolean): void;
  63. cameraGizmos: Array<BABYLON.CameraGizmo>;
  64. enableCameraGizmo(camera: BABYLON.Camera, enable?: boolean): void;
  65. }
  66. }
  67. declare module INSPECTOR {
  68. export interface IPaneComponentProps {
  69. title: string;
  70. scene: BABYLON.Scene;
  71. selectedEntity?: any;
  72. onSelectionChangedObservable?: BABYLON.Observable<any>;
  73. onPropertyChangedObservable?: BABYLON.Observable<PropertyChangedEvent>;
  74. globalState: GlobalState;
  75. }
  76. export class PaneComponent extends React.Component<IPaneComponentProps, {
  77. tag: any;
  78. }> {
  79. constructor(props: IPaneComponentProps);
  80. render(): JSX.Element | null;
  81. }
  82. }
  83. declare module INSPECTOR {
  84. interface ITabsComponentProps {
  85. children: any[];
  86. selectedIndex: number;
  87. onSelectedIndexChange: (value: number) => void;
  88. }
  89. export class TabsComponent extends React.Component<ITabsComponentProps> {
  90. constructor(props: ITabsComponentProps);
  91. onSelect(index: number): void;
  92. renderLabel(child: PaneComponent, index: number): JSX.Element;
  93. render(): JSX.Element;
  94. }
  95. }
  96. declare module INSPECTOR {
  97. interface ITextLineComponentProps {
  98. label?: string;
  99. value?: string;
  100. color?: string;
  101. underline?: boolean;
  102. onLink?: () => void;
  103. url?: string;
  104. ignoreValue?: boolean;
  105. additionalClass?: string;
  106. }
  107. export class TextLineComponent extends React.Component<ITextLineComponentProps> {
  108. constructor(props: ITextLineComponentProps);
  109. onLink(): void;
  110. renderContent(): JSX.Element | null;
  111. render(): JSX.Element;
  112. }
  113. }
  114. declare module INSPECTOR {
  115. interface ILineContainerComponentProps {
  116. globalState?: GlobalState;
  117. title: string;
  118. children: any[] | any;
  119. closed?: boolean;
  120. }
  121. export class LineContainerComponent extends React.Component<ILineContainerComponentProps, {
  122. isExpanded: boolean;
  123. isHighlighted: boolean;
  124. }> {
  125. constructor(props: ILineContainerComponentProps);
  126. switchExpandedState(): void;
  127. componentDidMount(): void;
  128. renderHeader(): JSX.Element;
  129. render(): JSX.Element;
  130. }
  131. }
  132. declare module INSPECTOR {
  133. interface IValueLineComponentProps {
  134. label: string;
  135. value: number;
  136. color?: string;
  137. fractionDigits?: number;
  138. units?: string;
  139. }
  140. export class ValueLineComponent extends React.Component<IValueLineComponentProps> {
  141. constructor(props: IValueLineComponentProps);
  142. render(): JSX.Element;
  143. }
  144. }
  145. declare module INSPECTOR {
  146. export interface IBooleanLineComponentProps {
  147. label: string;
  148. value: boolean;
  149. }
  150. export class BooleanLineComponent extends React.Component<IBooleanLineComponentProps> {
  151. constructor(props: IBooleanLineComponentProps);
  152. render(): JSX.Element;
  153. }
  154. }
  155. declare module INSPECTOR {
  156. export class StatisticsTabComponent extends PaneComponent {
  157. private _sceneInstrumentation;
  158. private _engineInstrumentation;
  159. private _timerIntervalId;
  160. constructor(props: IPaneComponentProps);
  161. componentWillUnmount(): void;
  162. render(): JSX.Element | null;
  163. }
  164. }
  165. declare module INSPECTOR {
  166. export interface ICheckBoxLineComponentProps {
  167. label: string;
  168. target?: any;
  169. propertyName?: string;
  170. isSelected?: () => boolean;
  171. onSelect?: (value: boolean) => void;
  172. onValueChanged?: () => void;
  173. onPropertyChangedObservable?: BABYLON.Observable<PropertyChangedEvent>;
  174. }
  175. export class CheckBoxLineComponent extends React.Component<ICheckBoxLineComponentProps, {
  176. isSelected: boolean;
  177. }> {
  178. private static _UniqueIdSeed;
  179. private _uniqueId;
  180. private _localChange;
  181. constructor(props: ICheckBoxLineComponentProps);
  182. shouldComponentUpdate(nextProps: ICheckBoxLineComponentProps, nextState: {
  183. isSelected: boolean;
  184. }): boolean;
  185. onChange(): void;
  186. render(): JSX.Element;
  187. }
  188. }
  189. declare module INSPECTOR {
  190. interface IRenderGridPropertyGridComponentProps {
  191. globalState: GlobalState;
  192. scene: BABYLON.Scene;
  193. }
  194. export class RenderGridPropertyGridComponent extends React.Component<IRenderGridPropertyGridComponentProps, {
  195. isEnabled: boolean;
  196. }> {
  197. private _gridMesh;
  198. constructor(props: IRenderGridPropertyGridComponentProps);
  199. componentDidMount(): void;
  200. addOrRemoveGrid(): void;
  201. render(): JSX.Element;
  202. }
  203. }
  204. declare module INSPECTOR {
  205. export class DebugTabComponent extends PaneComponent {
  206. private _physicsViewersEnabled;
  207. constructor(props: IPaneComponentProps);
  208. switchPhysicsViewers(): void;
  209. render(): JSX.Element | null;
  210. }
  211. }
  212. declare module INSPECTOR {
  213. /**
  214. * Class used to provide lock mechanism
  215. */
  216. export class LockObject {
  217. /**
  218. * Gets or set if the lock is engaged
  219. */
  220. lock: boolean;
  221. }
  222. }
  223. declare module INSPECTOR {
  224. interface IFloatLineComponentProps {
  225. label: string;
  226. target: any;
  227. propertyName: string;
  228. lockObject?: LockObject;
  229. onChange?: (newValue: number) => void;
  230. isInteger?: boolean;
  231. onPropertyChangedObservable?: BABYLON.Observable<PropertyChangedEvent>;
  232. additionalClass?: string;
  233. step?: string;
  234. digits?: number;
  235. useEuler?: boolean;
  236. min?: number;
  237. max?: number;
  238. smallUI?: boolean;
  239. onEnter?: (newValue: number) => void;
  240. }
  241. export class FloatLineComponent extends React.Component<IFloatLineComponentProps, {
  242. value: string;
  243. }> {
  244. private _localChange;
  245. private _store;
  246. constructor(props: IFloatLineComponentProps);
  247. componentWillUnmount(): void;
  248. shouldComponentUpdate(nextProps: IFloatLineComponentProps, nextState: {
  249. value: string;
  250. }): boolean;
  251. raiseOnPropertyChanged(newValue: number, previousValue: number): void;
  252. updateValue(valueString: string): void;
  253. lock(): void;
  254. unlock(): void;
  255. render(): JSX.Element;
  256. }
  257. }
  258. declare module INSPECTOR {
  259. interface ISliderLineComponentProps {
  260. label: string;
  261. target?: any;
  262. propertyName?: string;
  263. minimum: number;
  264. maximum: number;
  265. step: number;
  266. directValue?: number;
  267. useEuler?: boolean;
  268. onChange?: (value: number) => void;
  269. onInput?: (value: number) => void;
  270. onPropertyChangedObservable?: BABYLON.Observable<PropertyChangedEvent>;
  271. decimalCount?: number;
  272. margin?: boolean;
  273. }
  274. export class SliderLineComponent extends React.Component<ISliderLineComponentProps, {
  275. value: number;
  276. }> {
  277. private _localChange;
  278. constructor(props: ISliderLineComponentProps);
  279. shouldComponentUpdate(nextProps: ISliderLineComponentProps, nextState: {
  280. value: number;
  281. }): boolean;
  282. onChange(newValueString: any): void;
  283. onInput(newValueString: any): void;
  284. prepareDataToRead(value: number): number;
  285. render(): JSX.Element;
  286. }
  287. }
  288. declare module INSPECTOR {
  289. export const Null_Value: number;
  290. export class ListLineOption {
  291. label: string;
  292. value: number;
  293. selected?: boolean;
  294. }
  295. export interface IOptionsLineComponentProps {
  296. label: string;
  297. target: any;
  298. propertyName: string;
  299. options: ListLineOption[];
  300. noDirectUpdate?: boolean;
  301. onSelect?: (value: number) => void;
  302. extractValue?: () => number;
  303. onPropertyChangedObservable?: BABYLON.Observable<PropertyChangedEvent>;
  304. allowNullValue?: boolean;
  305. }
  306. export class OptionsLineComponent extends React.Component<IOptionsLineComponentProps, {
  307. value: number;
  308. }> {
  309. private _localChange;
  310. private remapValueIn;
  311. private remapValueOut;
  312. constructor(props: IOptionsLineComponentProps);
  313. shouldComponentUpdate(nextProps: IOptionsLineComponentProps, nextState: {
  314. value: number;
  315. }): boolean;
  316. raiseOnPropertyChanged(newValue: number, previousValue: number): void;
  317. updateValue(valueString: string): void;
  318. render(): JSX.Element;
  319. }
  320. }
  321. declare module INSPECTOR {
  322. interface INumericInputComponentProps {
  323. label: string;
  324. value: number;
  325. step?: number;
  326. onChange: (value: number) => void;
  327. precision?: number;
  328. }
  329. export class NumericInputComponent extends React.Component<INumericInputComponentProps, {
  330. value: string;
  331. }> {
  332. static defaultProps: {
  333. step: number;
  334. };
  335. private _localChange;
  336. constructor(props: INumericInputComponentProps);
  337. shouldComponentUpdate(nextProps: INumericInputComponentProps, nextState: {
  338. value: string;
  339. }): boolean;
  340. updateValue(evt: any): void;
  341. onBlur(): void;
  342. render(): JSX.Element;
  343. }
  344. }
  345. declare module INSPECTOR {
  346. export interface IColorComponentEntryProps {
  347. value: number;
  348. label: string;
  349. max?: number;
  350. min?: number;
  351. onChange: (value: number) => void;
  352. }
  353. export class ColorComponentEntry extends React.Component<IColorComponentEntryProps> {
  354. constructor(props: IColorComponentEntryProps);
  355. updateValue(valueString: string): void;
  356. render(): JSX.Element;
  357. }
  358. }
  359. declare module INSPECTOR {
  360. export interface IHexColorProps {
  361. value: string;
  362. expectedLength: number;
  363. onChange: (value: string) => void;
  364. }
  365. export class HexColor extends React.Component<IHexColorProps, {
  366. hex: string;
  367. }> {
  368. constructor(props: IHexColorProps);
  369. shouldComponentUpdate(nextProps: IHexColorProps, nextState: {
  370. hex: string;
  371. }): boolean;
  372. updateHexValue(valueString: string): void;
  373. render(): JSX.Element;
  374. }
  375. }
  376. declare module INSPECTOR {
  377. /**
  378. * Interface used to specify creation options for color picker
  379. */
  380. export interface IColorPickerProps {
  381. color: BABYLON.Color3 | BABYLON.Color4;
  382. debugMode?: boolean;
  383. onColorChanged?: (color: BABYLON.Color3 | BABYLON.Color4) => void;
  384. }
  385. /**
  386. * Interface used to specify creation options for color picker
  387. */
  388. export interface IColorPickerState {
  389. color: BABYLON.Color3;
  390. alpha: number;
  391. }
  392. /**
  393. * Class used to create a color picker
  394. */
  395. export class BABYLON.GUI.ColorPicker extends React.Component<IColorPickerProps, IColorPickerState> {
  396. private _saturationRef;
  397. private _hueRef;
  398. private _isSaturationPointerDown;
  399. private _isHuePointerDown;
  400. constructor(props: IColorPickerProps);
  401. onSaturationPointerDown(evt: React.PointerEvent<HTMLDivElement>): void;
  402. onSaturationPointerUp(evt: React.PointerEvent<HTMLDivElement>): void;
  403. onSaturationPointerMove(evt: React.PointerEvent<HTMLDivElement>): void;
  404. onHuePointerDown(evt: React.PointerEvent<HTMLDivElement>): void;
  405. onHuePointerUp(evt: React.PointerEvent<HTMLDivElement>): void;
  406. onHuePointerMove(evt: React.PointerEvent<HTMLDivElement>): void;
  407. private _evaluateSaturation;
  408. private _evaluateHue;
  409. componentDidUpdate(): void;
  410. raiseOnColorChanged(): void;
  411. render(): JSX.Element;
  412. }
  413. }
  414. declare module INSPECTOR {
  415. export interface IColorPickerComponentProps {
  416. value: BABYLON.Color4 | BABYLON.Color3;
  417. onColorChanged: (newOne: string) => void;
  418. }
  419. interface IColorPickerComponentState {
  420. pickerEnabled: boolean;
  421. color: BABYLON.Color3 | BABYLON.Color4;
  422. hex: string;
  423. }
  424. export class ColorPickerLineComponent extends React.Component<IColorPickerComponentProps, IColorPickerComponentState> {
  425. private _floatRef;
  426. private _floatHostRef;
  427. constructor(props: IColorPickerComponentProps);
  428. syncPositions(): void;
  429. shouldComponentUpdate(nextProps: IColorPickerComponentProps, nextState: IColorPickerComponentState): boolean;
  430. componentDidUpdate(): void;
  431. componentDidMount(): void;
  432. render(): JSX.Element;
  433. }
  434. }
  435. declare module INSPECTOR {
  436. export interface IColor3LineComponentProps {
  437. label: string;
  438. target: any;
  439. propertyName: string;
  440. onPropertyChangedObservable?: BABYLON.Observable<PropertyChangedEvent>;
  441. isLinear?: boolean;
  442. }
  443. export class Color3LineComponent extends React.Component<IColor3LineComponentProps, {
  444. isExpanded: boolean;
  445. color: BABYLON.Color3;
  446. }> {
  447. private _localChange;
  448. constructor(props: IColor3LineComponentProps);
  449. shouldComponentUpdate(nextProps: IColor3LineComponentProps, nextState: {
  450. color: BABYLON.Color3;
  451. }): boolean;
  452. setPropertyValue(newColor: BABYLON.Color3): void;
  453. onChange(newValue: string): void;
  454. switchExpandState(): void;
  455. raiseOnPropertyChanged(previousValue: BABYLON.Color3): void;
  456. updateStateR(value: number): void;
  457. updateStateG(value: number): void;
  458. updateStateB(value: number): void;
  459. copyToClipboard(): void;
  460. render(): JSX.Element;
  461. }
  462. }
  463. declare module INSPECTOR {
  464. interface IVector3LineComponentProps {
  465. label: string;
  466. target: any;
  467. propertyName: string;
  468. step?: number;
  469. onChange?: (newvalue: BABYLON.Vector3) => void;
  470. useEuler?: boolean;
  471. onPropertyChangedObservable?: BABYLON.Observable<PropertyChangedEvent>;
  472. noSlider?: boolean;
  473. }
  474. export class Vector3LineComponent extends React.Component<IVector3LineComponentProps, {
  475. isExpanded: boolean;
  476. value: BABYLON.Vector3;
  477. }> {
  478. static defaultProps: {
  479. step: number;
  480. };
  481. private _localChange;
  482. constructor(props: IVector3LineComponentProps);
  483. getCurrentValue(): any;
  484. shouldComponentUpdate(nextProps: IVector3LineComponentProps, nextState: {
  485. isExpanded: boolean;
  486. value: BABYLON.Vector3;
  487. }): boolean;
  488. switchExpandState(): void;
  489. raiseOnPropertyChanged(previousValue: BABYLON.Vector3): void;
  490. updateVector3(): void;
  491. updateStateX(value: number): void;
  492. updateStateY(value: number): void;
  493. updateStateZ(value: number): void;
  494. render(): JSX.Element;
  495. }
  496. }
  497. declare module INSPECTOR {
  498. interface IQuaternionLineComponentProps {
  499. label: string;
  500. target: any;
  501. useEuler?: boolean;
  502. propertyName: string;
  503. onPropertyChangedObservable?: BABYLON.Observable<PropertyChangedEvent>;
  504. }
  505. export class QuaternionLineComponent extends React.Component<IQuaternionLineComponentProps, {
  506. isExpanded: boolean;
  507. value: BABYLON.Quaternion;
  508. eulerValue: BABYLON.Vector3;
  509. }> {
  510. private _localChange;
  511. constructor(props: IQuaternionLineComponentProps);
  512. _checkRoundCircle(a: number, b: number): boolean;
  513. shouldComponentUpdate(nextProps: IQuaternionLineComponentProps, nextState: {
  514. isExpanded: boolean;
  515. value: BABYLON.Quaternion;
  516. eulerValue: BABYLON.Vector3;
  517. }): boolean;
  518. switchExpandState(): void;
  519. raiseOnPropertyChanged(currentValue: BABYLON.Quaternion, previousValue: BABYLON.Quaternion): void;
  520. updateQuaternion(): void;
  521. updateStateX(value: number): void;
  522. updateStateY(value: number): void;
  523. updateStateZ(value: number): void;
  524. updateStateW(value: number): void;
  525. updateQuaternionFromEuler(): void;
  526. updateStateEulerX(value: number): void;
  527. updateStateEulerY(value: number): void;
  528. updateStateEulerZ(value: number): void;
  529. render(): JSX.Element;
  530. }
  531. }
  532. declare module INSPECTOR {
  533. interface ITextInputLineComponentProps {
  534. label: string;
  535. lockObject: LockObject;
  536. target?: any;
  537. propertyName?: string;
  538. value?: string;
  539. onChange?: (value: string) => void;
  540. onPropertyChangedObservable?: BABYLON.Observable<PropertyChangedEvent>;
  541. }
  542. export class TextInputLineComponent extends React.Component<ITextInputLineComponentProps, {
  543. value: string;
  544. }> {
  545. private _localChange;
  546. constructor(props: ITextInputLineComponentProps);
  547. componentWillUnmount(): void;
  548. shouldComponentUpdate(nextProps: ITextInputLineComponentProps, nextState: {
  549. value: string;
  550. }): boolean;
  551. raiseOnPropertyChanged(newValue: string, previousValue: string): void;
  552. updateValue(value: string): void;
  553. render(): JSX.Element;
  554. }
  555. }
  556. declare module INSPECTOR {
  557. interface ICustomPropertyGridComponentProps {
  558. globalState: GlobalState;
  559. target: any;
  560. lockObject: LockObject;
  561. onPropertyChangedObservable?: BABYLON.Observable<PropertyChangedEvent>;
  562. }
  563. export class CustomPropertyGridComponent extends React.Component<ICustomPropertyGridComponentProps, {
  564. mode: number;
  565. }> {
  566. constructor(props: ICustomPropertyGridComponentProps);
  567. renderInspectable(inspectable: BABYLON.IInspectable): JSX.Element | null;
  568. render(): JSX.Element | null;
  569. }
  570. }
  571. declare module INSPECTOR {
  572. export interface IButtonLineComponentProps {
  573. label: string;
  574. onClick: () => void;
  575. }
  576. export class ButtonLineComponent extends React.Component<IButtonLineComponentProps> {
  577. constructor(props: IButtonLineComponentProps);
  578. render(): JSX.Element;
  579. }
  580. }
  581. declare module INSPECTOR {
  582. interface IAnimationGridComponentProps {
  583. globalState: GlobalState;
  584. animatable: BABYLON.IAnimatable;
  585. scene: BABYLON.Scene;
  586. lockObject: LockObject;
  587. onPropertyChangedObservable?: BABYLON.Observable<PropertyChangedEvent>;
  588. }
  589. export class AnimationGridComponent extends React.Component<IAnimationGridComponentProps, {
  590. currentFrame: number;
  591. }> {
  592. private _animations;
  593. private _ranges;
  594. private _mainAnimatable;
  595. private _onBeforeRenderObserver;
  596. private _isPlaying;
  597. private timelineRef;
  598. private _animationControl;
  599. constructor(props: IAnimationGridComponentProps);
  600. playOrPause(): void;
  601. componentDidMount(): void;
  602. componentWillUnmount(): void;
  603. onCurrentFrameChange(value: number): void;
  604. onChangeFromOrTo(): void;
  605. render(): JSX.Element;
  606. }
  607. }
  608. declare module INSPECTOR {
  609. interface ICommonMaterialPropertyGridComponentProps {
  610. globalState: GlobalState;
  611. material: BABYLON.Material;
  612. lockObject: LockObject;
  613. onPropertyChangedObservable?: BABYLON.Observable<PropertyChangedEvent>;
  614. }
  615. export class CommonMaterialPropertyGridComponent extends React.Component<ICommonMaterialPropertyGridComponentProps> {
  616. constructor(props: ICommonMaterialPropertyGridComponentProps);
  617. render(): JSX.Element;
  618. }
  619. }
  620. declare module INSPECTOR {
  621. interface IMaterialPropertyGridComponentProps {
  622. globalState: GlobalState;
  623. material: BABYLON.Material;
  624. lockObject: LockObject;
  625. onPropertyChangedObservable?: BABYLON.Observable<PropertyChangedEvent>;
  626. }
  627. export class MaterialPropertyGridComponent extends React.Component<IMaterialPropertyGridComponentProps> {
  628. constructor(props: IMaterialPropertyGridComponentProps);
  629. render(): JSX.Element;
  630. }
  631. }
  632. declare module INSPECTOR {
  633. interface IFileButtonLineComponentProps {
  634. label: string;
  635. onClick: (file: File) => void;
  636. accept: string;
  637. }
  638. export class FileButtonLineComponent extends React.Component<IFileButtonLineComponentProps> {
  639. private static _IDGenerator;
  640. private _id;
  641. private uploadInputRef;
  642. constructor(props: IFileButtonLineComponentProps);
  643. onChange(evt: any): void;
  644. render(): JSX.Element;
  645. }
  646. }
  647. declare module INSPECTOR {
  648. export interface ITextureLinkLineComponentProps {
  649. label: string;
  650. texture: BABYLON.Nullable<BABYLON.BaseTexture>;
  651. material?: BABYLON.Material;
  652. onSelectionChangedObservable?: BABYLON.Observable<any>;
  653. onDebugSelectionChangeObservable?: BABYLON.Observable<TextureLinkLineComponent>;
  654. propertyName?: string;
  655. onTextureCreated?: (texture: BABYLON.BaseTexture) => void;
  656. customDebugAction?: (state: boolean) => void;
  657. onTextureRemoved?: () => void;
  658. }
  659. export class TextureLinkLineComponent extends React.Component<ITextureLinkLineComponentProps, {
  660. isDebugSelected: boolean;
  661. }> {
  662. private _onDebugSelectionChangeObserver;
  663. constructor(props: ITextureLinkLineComponentProps);
  664. componentDidMount(): void;
  665. componentWillUnmount(): void;
  666. debugTexture(): void;
  667. onLink(): void;
  668. updateTexture(file: File): void;
  669. removeTexture(): void;
  670. render(): JSX.Element | null;
  671. }
  672. }
  673. declare module INSPECTOR {
  674. interface IStandardMaterialPropertyGridComponentProps {
  675. globalState: GlobalState;
  676. material: BABYLON.StandardMaterial;
  677. lockObject: LockObject;
  678. onSelectionChangedObservable?: BABYLON.Observable<any>;
  679. onPropertyChangedObservable?: BABYLON.Observable<PropertyChangedEvent>;
  680. }
  681. export class StandardMaterialPropertyGridComponent extends React.Component<IStandardMaterialPropertyGridComponentProps> {
  682. private _onDebugSelectionChangeObservable;
  683. constructor(props: IStandardMaterialPropertyGridComponentProps);
  684. renderTextures(): JSX.Element;
  685. render(): JSX.Element;
  686. }
  687. }
  688. declare module INSPECTOR {
  689. /** @hidden */
  690. export var lodPixelShader: {
  691. name: string;
  692. shader: string;
  693. };
  694. }
  695. declare module INSPECTOR {
  696. /** @hidden */
  697. export var lodCubePixelShader: {
  698. name: string;
  699. shader: string;
  700. };
  701. }
  702. declare module INSPECTOR {
  703. export interface TextureChannelsToDisplay {
  704. R: boolean;
  705. G: boolean;
  706. B: boolean;
  707. A: boolean;
  708. }
  709. export class TextureHelper {
  710. private static _ProcessAsync;
  711. static GetTextureDataAsync(texture: BABYLON.BaseTexture, width: number, height: number, face: number, channels: TextureChannelsToDisplay, globalState?: GlobalState, lod?: number): Promise<Uint8Array>;
  712. }
  713. }
  714. declare module INSPECTOR {
  715. interface ITextureLineComponentProps {
  716. texture: BABYLON.BaseTexture;
  717. width: number;
  718. height: number;
  719. globalState?: GlobalState;
  720. hideChannelSelect?: boolean;
  721. }
  722. export class TextureLineComponent extends React.Component<ITextureLineComponentProps, {
  723. channels: TextureChannelsToDisplay;
  724. face: number;
  725. }> {
  726. private canvasRef;
  727. private static TextureChannelStates;
  728. constructor(props: ITextureLineComponentProps);
  729. shouldComponentUpdate(nextProps: ITextureLineComponentProps, nextState: {
  730. channels: TextureChannelsToDisplay;
  731. face: number;
  732. }): boolean;
  733. componentDidMount(): void;
  734. componentDidUpdate(): void;
  735. updatePreview(): Promise<void>;
  736. render(): JSX.Element;
  737. }
  738. }
  739. declare module INSPECTOR {
  740. interface IPopupComponentProps {
  741. id: string;
  742. title: string;
  743. size: {
  744. width: number;
  745. height: number;
  746. };
  747. onOpen: (window: Window) => void;
  748. onClose: (window: Window) => void;
  749. }
  750. export class PopupComponent extends React.Component<IPopupComponentProps, {
  751. isComponentMounted: boolean;
  752. blockedByBrowser: boolean;
  753. }> {
  754. private _container;
  755. private _window;
  756. private _curveEditorHost;
  757. constructor(props: IPopupComponentProps);
  758. componentDidMount(): void;
  759. openPopup(): void;
  760. componentWillUnmount(): void;
  761. getWindow(): Window | null;
  762. render(): React.ReactPortal | null;
  763. }
  764. }
  765. declare module INSPECTOR {
  766. export interface ITool extends IToolData {
  767. instance: IToolType;
  768. }
  769. interface IToolBarProps {
  770. tools: ITool[];
  771. addTool(url: string): void;
  772. changeTool(toolIndex: number): void;
  773. activeToolIndex: number;
  774. metadata: IMetadata;
  775. setMetadata(data: any): void;
  776. pickerOpen: boolean;
  777. setPickerOpen(open: boolean): void;
  778. pickerRef: React.RefObject<HTMLDivElement>;
  779. hasAlpha: boolean;
  780. }
  781. interface IToolBarState {
  782. toolURL: string;
  783. addOpen: boolean;
  784. }
  785. export class ToolBar extends React.Component<IToolBarProps, IToolBarState> {
  786. constructor(props: IToolBarProps);
  787. computeRGBAColor(): BABYLON.Color4;
  788. shouldComponentUpdate(nextProps: IToolBarProps): boolean;
  789. render(): JSX.Element;
  790. }
  791. }
  792. declare module INSPECTOR {
  793. export interface IChannel {
  794. visible: boolean;
  795. editable: boolean;
  796. name: string;
  797. id: 'R' | 'G' | 'B' | 'A';
  798. icon: any;
  799. }
  800. interface IChannelsBarProps {
  801. channels: IChannel[];
  802. setChannels(channelState: IChannel[]): void;
  803. }
  804. export class ChannelsBar extends React.PureComponent<IChannelsBarProps> {
  805. render(): JSX.Element;
  806. }
  807. }
  808. declare module INSPECTOR {
  809. export const canvasShader: {
  810. path: {
  811. vertexSource: string;
  812. fragmentSource: string;
  813. };
  814. options: {
  815. attributes: string[];
  816. uniforms: string[];
  817. };
  818. };
  819. }
  820. declare module INSPECTOR {
  821. export interface IPixelData {
  822. x?: number;
  823. y?: number;
  824. r?: number;
  825. g?: number;
  826. b?: number;
  827. a?: number;
  828. }
  829. export class TextureCanvasManager {
  830. private _engine;
  831. private _scene;
  832. private _camera;
  833. private _cameraPos;
  834. private _scale;
  835. private _isPanning;
  836. private _mouseX;
  837. private _mouseY;
  838. private _UICanvas;
  839. private _size;
  840. /** The canvas we paint onto using the canvas API */
  841. private _2DCanvas;
  842. /** The canvas we apply post processes to */
  843. private _3DCanvas;
  844. /** The canvas which handles channel filtering */
  845. private _channelsTexture;
  846. private _3DEngine;
  847. private _3DPlane;
  848. private _3DCanvasTexture;
  849. private _3DScene;
  850. private _channels;
  851. private _face;
  852. private _mipLevel;
  853. /** The texture from the original engine that we invoked the editor on */
  854. private _originalTexture;
  855. /** This is a hidden texture which is only responsible for holding the actual texture memory in the original engine */
  856. private _target;
  857. /** The internal texture representation of the original texture */
  858. private _originalInternalTexture;
  859. /** Keeps track of whether we have modified the texture */
  860. private _didEdit;
  861. private _plane;
  862. private _planeMaterial;
  863. /** Tracks which keys are currently pressed */
  864. private _keyMap;
  865. private readonly ZOOM_MOUSE_SPEED;
  866. private readonly ZOOM_KEYBOARD_SPEED;
  867. private readonly ZOOM_IN_KEY;
  868. private readonly ZOOM_OUT_KEY;
  869. private readonly PAN_SPEED;
  870. private readonly PAN_MOUSE_BUTTON;
  871. private readonly MIN_SCALE;
  872. private readonly GRID_SCALE;
  873. private readonly MAX_SCALE;
  874. private readonly SELECT_ALL_KEY;
  875. private readonly SAVE_KEY;
  876. private readonly RESET_KEY;
  877. private readonly DESELECT_KEY;
  878. /** The number of milliseconds between texture updates */
  879. private readonly PUSH_FREQUENCY;
  880. private _tool;
  881. private _setPixelData;
  882. private _setMipLevel;
  883. private _window;
  884. private _metadata;
  885. private _editing3D;
  886. private _onUpdate;
  887. private _setMetadata;
  888. private _imageData;
  889. private _canPush;
  890. private _shouldPush;
  891. private _paintCanvas;
  892. constructor(texture: BABYLON.BaseTexture, window: Window, canvasUI: HTMLCanvasElement, canvas2D: HTMLCanvasElement, canvas3D: HTMLCanvasElement, setPixelData: (pixelData: IPixelData) => void, metadata: IMetadata, onUpdate: () => void, setMetadata: (metadata: any) => void, setMipLevel: (level: number) => void);
  893. updateTexture(): Promise<void>;
  894. private pushTexture;
  895. startPainting(): Promise<CanvasRenderingContext2D>;
  896. updatePainting(): void;
  897. stopPainting(): void;
  898. private updateDisplay;
  899. set channels(channels: IChannel[]);
  900. paintPixelsOnCanvas(pixelData: Uint8Array, canvas: HTMLCanvasElement): void;
  901. grabOriginalTexture(): Promise<Uint8Array>;
  902. getMouseCoordinates(pointerInfo: BABYLON.PointerInfo): BABYLON.Vector2;
  903. get scene(): BABYLON.Scene;
  904. get canvas2D(): HTMLCanvasElement;
  905. get size(): BABYLON.ISize;
  906. set tool(tool: BABYLON.Nullable<ITool>);
  907. get tool(): BABYLON.Nullable<ITool>;
  908. set face(face: number);
  909. set mipLevel(mipLevel: number);
  910. /** Returns the 3D scene used for postprocesses */
  911. get scene3D(): BABYLON.Scene;
  912. set metadata(metadata: IMetadata);
  913. private makePlane;
  914. reset(): void;
  915. resize(newSize: BABYLON.ISize): Promise<void>;
  916. setSize(size: BABYLON.ISize): void;
  917. upload(file: File): void;
  918. saveTexture(): void;
  919. dispose(): void;
  920. }
  921. }
  922. declare module INSPECTOR {
  923. interface IPropertiesBarProps {
  924. texture: BABYLON.BaseTexture;
  925. size: BABYLON.ISize;
  926. saveTexture(): void;
  927. pixelData: IPixelData;
  928. face: number;
  929. setFace(face: number): void;
  930. resetTexture(): void;
  931. resizeTexture(width: number, height: number): void;
  932. uploadTexture(file: File): void;
  933. mipLevel: number;
  934. setMipLevel: (mipLevel: number) => void;
  935. }
  936. interface IPropertiesBarState {
  937. width: number;
  938. height: number;
  939. }
  940. export class PropertiesBar extends React.PureComponent<IPropertiesBarProps, IPropertiesBarState> {
  941. private _resetButton;
  942. private _uploadButton;
  943. private _saveButton;
  944. private _babylonLogo;
  945. private _resizeButton;
  946. private _mipUp;
  947. private _mipDown;
  948. private _faces;
  949. constructor(props: IPropertiesBarProps);
  950. private pixelData;
  951. private getNewDimension;
  952. componentWillUpdate(nextProps: IPropertiesBarProps): void;
  953. render(): JSX.Element;
  954. }
  955. }
  956. declare module INSPECTOR {
  957. interface IBottomBarProps {
  958. texture: BABYLON.BaseTexture;
  959. mipLevel: number;
  960. }
  961. export class BottomBar extends React.PureComponent<IBottomBarProps> {
  962. render(): JSX.Element;
  963. }
  964. }
  965. declare module INSPECTOR {
  966. interface ITextureCanvasComponentProps {
  967. canvasUI: React.RefObject<HTMLCanvasElement>;
  968. canvas2D: React.RefObject<HTMLCanvasElement>;
  969. canvas3D: React.RefObject<HTMLCanvasElement>;
  970. texture: BABYLON.BaseTexture;
  971. }
  972. export class TextureCanvasComponent extends React.Component<ITextureCanvasComponentProps> {
  973. render(): JSX.Element;
  974. }
  975. }
  976. declare module INSPECTOR {
  977. export const Paintbrush: IToolData;
  978. }
  979. declare module INSPECTOR {
  980. export const Eyedropper: IToolData;
  981. }
  982. declare module INSPECTOR {
  983. export const Floodfill: IToolData;
  984. }
  985. declare module INSPECTOR {
  986. export const RectangleSelect: IToolData;
  987. }
  988. declare module INSPECTOR {
  989. const _default: import("babylonjs-inspector/components/actionTabs/tabs/propertyGrids/materials/textures/textureEditorComponent").IToolData[];
  990. export default _default;
  991. }
  992. declare module INSPECTOR {
  993. interface IToolSettingsProps {
  994. tool: ITool | undefined;
  995. }
  996. export class ToolSettings extends React.Component<IToolSettingsProps> {
  997. render(): JSX.Element;
  998. }
  999. }
  1000. declare module INSPECTOR {
  1001. interface ITextureEditorComponentProps {
  1002. texture: BABYLON.BaseTexture;
  1003. url: string;
  1004. window: React.RefObject<PopupComponent>;
  1005. onUpdate: () => void;
  1006. }
  1007. interface ITextureEditorComponentState {
  1008. tools: ITool[];
  1009. activeToolIndex: number;
  1010. metadata: IMetadata;
  1011. channels: IChannel[];
  1012. pixelData: IPixelData;
  1013. face: number;
  1014. mipLevel: number;
  1015. pickerOpen: boolean;
  1016. }
  1017. export interface IToolParameters {
  1018. /** The visible scene in the editor. Useful for adding pointer and keyboard events. */
  1019. scene: BABYLON.Scene;
  1020. /** The 2D canvas which you can sample pixel data from. Tools should not paint directly on this canvas. */
  1021. canvas2D: HTMLCanvasElement;
  1022. /** The 3D scene which tools can add post processes to. */
  1023. scene3D: BABYLON.Scene;
  1024. /** The size of the texture. */
  1025. size: BABYLON.ISize;
  1026. /** Pushes the editor texture back to the original scene. This should be called every time a tool makes any modification to a texture. */
  1027. updateTexture: () => void;
  1028. /** The metadata object which is shared between all tools. Feel free to store any information here. Do not set this directly: instead call setMetadata. */
  1029. metadata: IMetadata;
  1030. /** Call this when you want to mutate the metadata. */
  1031. setMetadata: (data: any) => void;
  1032. /** Returns the texture coordinates under the cursor */
  1033. getMouseCoordinates: (pointerInfo: BABYLON.PointerInfo) => BABYLON.Vector2;
  1034. /** Provides access to the BABYLON namespace */
  1035. BABYLON: any;
  1036. /** Provides a canvas that you can use the canvas API to paint on. */
  1037. startPainting: () => Promise<CanvasRenderingContext2D>;
  1038. /** After you have painted on your canvas, call this method to push the updates back to the texture. */
  1039. updatePainting: () => void;
  1040. /** Call this when you are finished painting. */
  1041. stopPainting: () => void;
  1042. }
  1043. export interface IToolGUIProps {
  1044. instance: IToolType;
  1045. }
  1046. /** An interface representing the definition of a tool */
  1047. export interface IToolData {
  1048. /** Name to display on the toolbar */
  1049. name: string;
  1050. /** A class definition for the tool including setup and cleanup methods */
  1051. type: IToolConstructable;
  1052. /** An SVG icon encoded in Base64 */
  1053. icon: string;
  1054. /** Whether the tool uses postprocesses */
  1055. is3D?: boolean;
  1056. cursor?: string;
  1057. settingsComponent?: React.ComponentType<IToolGUIProps>;
  1058. }
  1059. export interface IToolType {
  1060. /** Called when the tool is selected. */
  1061. setup: () => void;
  1062. /** Called when the tool is deselected. */
  1063. cleanup: () => void;
  1064. /** Optional. Called when the user resets the texture or uploads a new texture. Tools may want to reset their state when this happens. */
  1065. onReset?: () => void;
  1066. }
  1067. /** For constructable types, TS requires that you define a seperate interface which constructs your actual interface */
  1068. interface IToolConstructable {
  1069. new (getParameters: () => IToolParameters): IToolType;
  1070. }
  1071. export interface IMetadata {
  1072. color: string;
  1073. alpha: number;
  1074. select: {
  1075. x1: number;
  1076. y1: number;
  1077. x2: number;
  1078. y2: number;
  1079. };
  1080. [key: string]: any;
  1081. }
  1082. global {
  1083. var _TOOL_DATA_: IToolData;
  1084. }
  1085. export class TextureEditorComponent extends React.Component<ITextureEditorComponentProps, ITextureEditorComponentState> {
  1086. private _textureCanvasManager;
  1087. private _UICanvas;
  1088. private _2DCanvas;
  1089. private _3DCanvas;
  1090. private _pickerRef;
  1091. private _timer;
  1092. private static PREVIEW_UPDATE_DELAY_MS;
  1093. constructor(props: ITextureEditorComponentProps);
  1094. componentDidMount(): void;
  1095. componentDidUpdate(): void;
  1096. componentWillUnmount(): void;
  1097. textureDidUpdate(): void;
  1098. loadToolFromURL(url: string): void;
  1099. addTools(tools: IToolData[]): void;
  1100. getToolParameters(): IToolParameters;
  1101. changeTool(index: number): void;
  1102. setMetadata(newMetadata: any): void;
  1103. setPickerOpen(open: boolean): void;
  1104. onPointerDown(evt: React.PointerEvent): void;
  1105. saveTexture(): void;
  1106. resetTexture(): void;
  1107. resizeTexture(width: number, height: number): void;
  1108. uploadTexture(file: File): void;
  1109. render(): JSX.Element;
  1110. }
  1111. }
  1112. declare module INSPECTOR {
  1113. interface ITexturePropertyGridComponentProps {
  1114. texture: BABYLON.BaseTexture;
  1115. lockObject: LockObject;
  1116. globalState: GlobalState;
  1117. onPropertyChangedObservable?: BABYLON.Observable<PropertyChangedEvent>;
  1118. }
  1119. interface ITexturePropertyGridComponentState {
  1120. isTextureEditorOpen: boolean;
  1121. textureEditing: BABYLON.Nullable<BABYLON.BaseTexture>;
  1122. }
  1123. export class TexturePropertyGridComponent extends React.Component<ITexturePropertyGridComponentProps, ITexturePropertyGridComponentState> {
  1124. private _adtInstrumentation;
  1125. private popoutWindowRef;
  1126. private textureLineRef;
  1127. private _textureInspectorSize;
  1128. constructor(props: ITexturePropertyGridComponentProps);
  1129. componentWillUnmount(): void;
  1130. updateTexture(file: File): void;
  1131. openTextureEditor(): void;
  1132. onOpenTextureEditor(window: Window): void;
  1133. onCloseTextureEditor(callback?: {
  1134. (): void;
  1135. }): void;
  1136. forceRefresh(): void;
  1137. render(): JSX.Element;
  1138. }
  1139. }
  1140. declare module INSPECTOR {
  1141. interface IVector2LineComponentProps {
  1142. label: string;
  1143. target: any;
  1144. propertyName: string;
  1145. step?: number;
  1146. onChange?: (newvalue: BABYLON.Vector2) => void;
  1147. onPropertyChangedObservable?: BABYLON.Observable<PropertyChangedEvent>;
  1148. }
  1149. export class Vector2LineComponent extends React.Component<IVector2LineComponentProps, {
  1150. isExpanded: boolean;
  1151. value: BABYLON.Vector2;
  1152. }> {
  1153. static defaultProps: {
  1154. step: number;
  1155. };
  1156. private _localChange;
  1157. constructor(props: IVector2LineComponentProps);
  1158. shouldComponentUpdate(nextProps: IVector2LineComponentProps, nextState: {
  1159. isExpanded: boolean;
  1160. value: BABYLON.Vector2;
  1161. }): boolean;
  1162. switchExpandState(): void;
  1163. raiseOnPropertyChanged(previousValue: BABYLON.Vector2): void;
  1164. updateStateX(value: number): void;
  1165. updateStateY(value: number): void;
  1166. render(): JSX.Element;
  1167. }
  1168. }
  1169. declare module INSPECTOR {
  1170. interface IPBRMaterialPropertyGridComponentProps {
  1171. globalState: GlobalState;
  1172. material: BABYLON.PBRMaterial;
  1173. lockObject: LockObject;
  1174. onSelectionChangedObservable?: BABYLON.Observable<any>;
  1175. onPropertyChangedObservable?: BABYLON.Observable<PropertyChangedEvent>;
  1176. }
  1177. export class PBRMaterialPropertyGridComponent extends React.Component<IPBRMaterialPropertyGridComponentProps> {
  1178. private _onDebugSelectionChangeObservable;
  1179. constructor(props: IPBRMaterialPropertyGridComponentProps);
  1180. switchAmbientMode(state: boolean): void;
  1181. switchMetallicMode(state: boolean): void;
  1182. switchRoughnessMode(state: boolean): void;
  1183. renderTextures(onDebugSelectionChangeObservable: BABYLON.Observable<TextureLinkLineComponent>): JSX.Element;
  1184. render(): JSX.Element;
  1185. }
  1186. }
  1187. declare module INSPECTOR {
  1188. interface IRadioButtonLineComponentProps {
  1189. onSelectionChangedObservable: BABYLON.Observable<RadioButtonLineComponent>;
  1190. label: string;
  1191. isSelected: () => boolean;
  1192. onSelect: () => void;
  1193. }
  1194. export class RadioButtonLineComponent extends React.Component<IRadioButtonLineComponentProps, {
  1195. isSelected: boolean;
  1196. }> {
  1197. private _onSelectionChangedObserver;
  1198. constructor(props: IRadioButtonLineComponentProps);
  1199. componentDidMount(): void;
  1200. componentWillUnmount(): void;
  1201. onChange(): void;
  1202. render(): JSX.Element;
  1203. }
  1204. }
  1205. declare module INSPECTOR {
  1206. interface IFogPropertyGridComponentProps {
  1207. globalState: GlobalState;
  1208. scene: BABYLON.Scene;
  1209. lockObject: LockObject;
  1210. onPropertyChangedObservable?: BABYLON.Observable<PropertyChangedEvent>;
  1211. }
  1212. export class FogPropertyGridComponent extends React.Component<IFogPropertyGridComponentProps, {
  1213. mode: number;
  1214. }> {
  1215. constructor(props: IFogPropertyGridComponentProps);
  1216. render(): JSX.Element;
  1217. }
  1218. }
  1219. declare module INSPECTOR {
  1220. interface IScenePropertyGridComponentProps {
  1221. globalState: GlobalState;
  1222. scene: BABYLON.Scene;
  1223. lockObject: LockObject;
  1224. onPropertyChangedObservable?: BABYLON.Observable<PropertyChangedEvent>;
  1225. onSelectionChangedObservable?: BABYLON.Observable<any>;
  1226. }
  1227. export class ScenePropertyGridComponent extends React.Component<IScenePropertyGridComponentProps> {
  1228. private _storedEnvironmentTexture;
  1229. private _renderingModeGroupObservable;
  1230. constructor(props: IScenePropertyGridComponentProps);
  1231. setRenderingModes(point: boolean, wireframe: boolean): void;
  1232. switchIBL(): void;
  1233. updateEnvironmentTexture(file: File): void;
  1234. updateGravity(newValue: BABYLON.Vector3): void;
  1235. updateTimeStep(newValue: number): void;
  1236. normalizeScene(): void;
  1237. render(): JSX.Element;
  1238. }
  1239. }
  1240. declare module INSPECTOR {
  1241. interface ICommonLightPropertyGridComponentProps {
  1242. globalState: GlobalState;
  1243. light: BABYLON.Light;
  1244. lockObject: LockObject;
  1245. onPropertyChangedObservable?: BABYLON.Observable<PropertyChangedEvent>;
  1246. }
  1247. export class CommonLightPropertyGridComponent extends React.Component<ICommonLightPropertyGridComponentProps> {
  1248. constructor(props: ICommonLightPropertyGridComponentProps);
  1249. render(): JSX.Element;
  1250. }
  1251. }
  1252. declare module INSPECTOR {
  1253. interface IHemisphericLightPropertyGridComponentProps {
  1254. globalState: GlobalState;
  1255. light: BABYLON.HemisphericLight;
  1256. lockObject: LockObject;
  1257. onPropertyChangedObservable?: BABYLON.Observable<PropertyChangedEvent>;
  1258. }
  1259. export class HemisphericLightPropertyGridComponent extends React.Component<IHemisphericLightPropertyGridComponentProps> {
  1260. constructor(props: IHemisphericLightPropertyGridComponentProps);
  1261. render(): JSX.Element;
  1262. }
  1263. }
  1264. declare module INSPECTOR {
  1265. interface ICommonShadowLightPropertyGridComponentProps {
  1266. globalState: GlobalState;
  1267. light: BABYLON.IShadowLight;
  1268. lockObject: LockObject;
  1269. onPropertyChangedObservable?: BABYLON.Observable<PropertyChangedEvent>;
  1270. }
  1271. export class CommonShadowLightPropertyGridComponent extends React.Component<ICommonShadowLightPropertyGridComponentProps> {
  1272. private _internals;
  1273. constructor(props: ICommonShadowLightPropertyGridComponentProps);
  1274. createShadowGenerator(): void;
  1275. disposeShadowGenerator(): void;
  1276. render(): JSX.Element;
  1277. }
  1278. }
  1279. declare module INSPECTOR {
  1280. interface IPointLightPropertyGridComponentProps {
  1281. globalState: GlobalState;
  1282. light: BABYLON.PointLight;
  1283. lockObject: LockObject;
  1284. onPropertyChangedObservable?: BABYLON.Observable<PropertyChangedEvent>;
  1285. }
  1286. export class PointLightPropertyGridComponent extends React.Component<IPointLightPropertyGridComponentProps> {
  1287. constructor(props: IPointLightPropertyGridComponentProps);
  1288. render(): JSX.Element;
  1289. }
  1290. }
  1291. declare module INSPECTOR {
  1292. interface IHexLineComponentProps {
  1293. label: string;
  1294. target: any;
  1295. propertyName: string;
  1296. lockObject?: LockObject;
  1297. onChange?: (newValue: number) => void;
  1298. isInteger?: boolean;
  1299. replaySourceReplacement?: string;
  1300. onPropertyChangedObservable?: BABYLON.Observable<PropertyChangedEvent>;
  1301. additionalClass?: string;
  1302. step?: string;
  1303. digits?: number;
  1304. useEuler?: boolean;
  1305. min?: number;
  1306. }
  1307. export class HexLineComponent extends React.Component<IHexLineComponentProps, {
  1308. value: string;
  1309. }> {
  1310. private _localChange;
  1311. private _store;
  1312. private _propertyChange;
  1313. constructor(props: IHexLineComponentProps);
  1314. componentWillUnmount(): void;
  1315. shouldComponentUpdate(nextProps: IHexLineComponentProps, nextState: {
  1316. value: string;
  1317. }): boolean;
  1318. raiseOnPropertyChanged(newValue: number, previousValue: number): void;
  1319. convertToHexString(valueString: string): string;
  1320. updateValue(valueString: string, raisePropertyChanged: boolean): void;
  1321. lock(): void;
  1322. unlock(): void;
  1323. render(): JSX.Element;
  1324. }
  1325. }
  1326. declare module INSPECTOR {
  1327. interface ICommonCameraPropertyGridComponentProps {
  1328. globalState: GlobalState;
  1329. camera: BABYLON.Camera;
  1330. lockObject: LockObject;
  1331. onPropertyChangedObservable?: BABYLON.Observable<PropertyChangedEvent>;
  1332. }
  1333. export class CommonCameraPropertyGridComponent extends React.Component<ICommonCameraPropertyGridComponentProps, {
  1334. mode: number;
  1335. }> {
  1336. constructor(props: ICommonCameraPropertyGridComponentProps);
  1337. render(): JSX.Element;
  1338. }
  1339. }
  1340. declare module INSPECTOR {
  1341. interface IFreeCameraPropertyGridComponentProps {
  1342. globalState: GlobalState;
  1343. camera: BABYLON.FreeCamera;
  1344. lockObject: LockObject;
  1345. onPropertyChangedObservable?: BABYLON.Observable<PropertyChangedEvent>;
  1346. }
  1347. export class FreeCameraPropertyGridComponent extends React.Component<IFreeCameraPropertyGridComponentProps> {
  1348. constructor(props: IFreeCameraPropertyGridComponentProps);
  1349. render(): JSX.Element;
  1350. }
  1351. }
  1352. declare module INSPECTOR {
  1353. interface IArcRotateCameraPropertyGridComponentProps {
  1354. globalState: GlobalState;
  1355. camera: BABYLON.ArcRotateCamera;
  1356. lockObject: LockObject;
  1357. onPropertyChangedObservable?: BABYLON.Observable<PropertyChangedEvent>;
  1358. }
  1359. export class ArcRotateCameraPropertyGridComponent extends React.Component<IArcRotateCameraPropertyGridComponentProps> {
  1360. constructor(props: IArcRotateCameraPropertyGridComponentProps);
  1361. render(): JSX.Element;
  1362. }
  1363. }
  1364. declare module INSPECTOR {
  1365. interface IVariantsPropertyGridComponentProps {
  1366. globalState: GlobalState;
  1367. host: any;
  1368. lockObject: LockObject;
  1369. onPropertyChangedObservable?: BABYLON.Observable<PropertyChangedEvent>;
  1370. }
  1371. export class VariantsPropertyGridComponent extends React.Component<IVariantsPropertyGridComponentProps> {
  1372. constructor(props: IVariantsPropertyGridComponentProps);
  1373. private _getVariantsExtension;
  1374. render(): JSX.Element | null;
  1375. }
  1376. }
  1377. declare module INSPECTOR {
  1378. interface IMeshPropertyGridComponentProps {
  1379. globalState: GlobalState;
  1380. mesh: BABYLON.Mesh;
  1381. lockObject: LockObject;
  1382. onSelectionChangedObservable?: BABYLON.Observable<any>;
  1383. onPropertyChangedObservable?: BABYLON.Observable<PropertyChangedEvent>;
  1384. }
  1385. export class MeshPropertyGridComponent extends React.Component<IMeshPropertyGridComponentProps, {
  1386. displayNormals: boolean;
  1387. displayVertexColors: boolean;
  1388. displayBoneWeights: boolean;
  1389. displayBoneIndex: number;
  1390. displaySkeletonMap: boolean;
  1391. }> {
  1392. constructor(props: IMeshPropertyGridComponentProps);
  1393. renderWireframeOver(): void;
  1394. renderNormalVectors(): void;
  1395. displayNormals(): void;
  1396. displayVertexColors(): void;
  1397. displayBoneWeights(): void;
  1398. displaySkeletonMap(): void;
  1399. onBoneDisplayIndexChange(value: number): void;
  1400. onMaterialLink(): void;
  1401. onSourceMeshLink(): void;
  1402. onSkeletonLink(): void;
  1403. convertPhysicsTypeToString(): string;
  1404. render(): JSX.Element;
  1405. }
  1406. }
  1407. declare module INSPECTOR {
  1408. interface ITransformNodePropertyGridComponentProps {
  1409. globalState: GlobalState;
  1410. transformNode: BABYLON.TransformNode;
  1411. lockObject: LockObject;
  1412. onPropertyChangedObservable?: BABYLON.Observable<PropertyChangedEvent>;
  1413. }
  1414. export class TransformNodePropertyGridComponent extends React.Component<ITransformNodePropertyGridComponentProps> {
  1415. constructor(props: ITransformNodePropertyGridComponentProps);
  1416. render(): JSX.Element;
  1417. }
  1418. }
  1419. declare module INSPECTOR {
  1420. interface IBackgroundMaterialPropertyGridComponentProps {
  1421. globalState: GlobalState;
  1422. material: BABYLON.BackgroundMaterial;
  1423. lockObject: LockObject;
  1424. onSelectionChangedObservable?: BABYLON.Observable<any>;
  1425. onPropertyChangedObservable?: BABYLON.Observable<PropertyChangedEvent>;
  1426. }
  1427. export class BackgroundMaterialPropertyGridComponent extends React.Component<IBackgroundMaterialPropertyGridComponentProps> {
  1428. private _onDebugSelectionChangeObservable;
  1429. constructor(props: IBackgroundMaterialPropertyGridComponentProps);
  1430. renderTextures(): JSX.Element;
  1431. render(): JSX.Element;
  1432. }
  1433. }
  1434. declare module INSPECTOR {
  1435. interface ICommonControlPropertyGridComponentProps {
  1436. globalState: GlobalState;
  1437. control: BABYLON.GUI.Control;
  1438. lockObject: LockObject;
  1439. onPropertyChangedObservable?: BABYLON.Observable<PropertyChangedEvent>;
  1440. }
  1441. export class CommonControlPropertyGridComponent extends React.Component<ICommonControlPropertyGridComponentProps> {
  1442. constructor(props: ICommonControlPropertyGridComponentProps);
  1443. renderGridInformation(): JSX.Element | null;
  1444. render(): JSX.Element;
  1445. }
  1446. }
  1447. declare module INSPECTOR {
  1448. interface IControlPropertyGridComponentProps {
  1449. globalState: GlobalState;
  1450. control: BABYLON.GUI.Control;
  1451. lockObject: LockObject;
  1452. onPropertyChangedObservable?: BABYLON.Observable<PropertyChangedEvent>;
  1453. }
  1454. export class ControlPropertyGridComponent extends React.Component<IControlPropertyGridComponentProps> {
  1455. constructor(props: IControlPropertyGridComponentProps);
  1456. render(): JSX.Element;
  1457. }
  1458. }
  1459. declare module INSPECTOR {
  1460. interface ITextBlockPropertyGridComponentProps {
  1461. globalState: GlobalState;
  1462. textBlock: BABYLON.GUI.TextBlock;
  1463. lockObject: LockObject;
  1464. onPropertyChangedObservable?: BABYLON.Observable<PropertyChangedEvent>;
  1465. }
  1466. export class TextBlockPropertyGridComponent extends React.Component<ITextBlockPropertyGridComponentProps> {
  1467. constructor(props: ITextBlockPropertyGridComponentProps);
  1468. render(): JSX.Element;
  1469. }
  1470. }
  1471. declare module INSPECTOR {
  1472. interface IInputTextPropertyGridComponentProps {
  1473. globalState: GlobalState;
  1474. inputText: BABYLON.GUI.InputText;
  1475. lockObject: LockObject;
  1476. onPropertyChangedObservable?: BABYLON.Observable<PropertyChangedEvent>;
  1477. }
  1478. export class InputTextPropertyGridComponent extends React.Component<IInputTextPropertyGridComponentProps> {
  1479. constructor(props: IInputTextPropertyGridComponentProps);
  1480. render(): JSX.Element;
  1481. }
  1482. }
  1483. declare module INSPECTOR {
  1484. interface IColorPickerPropertyGridComponentProps {
  1485. globalState: GlobalState;
  1486. colorPicker: BABYLON.GUI.ColorPicker;
  1487. lockObject: LockObject;
  1488. onPropertyChangedObservable?: BABYLON.Observable<PropertyChangedEvent>;
  1489. }
  1490. export class ColorPickerPropertyGridComponent extends React.Component<IColorPickerPropertyGridComponentProps> {
  1491. constructor(props: IColorPickerPropertyGridComponentProps);
  1492. render(): JSX.Element;
  1493. }
  1494. }
  1495. declare module INSPECTOR {
  1496. interface IAnimationGroupGridComponentProps {
  1497. globalState: GlobalState;
  1498. animationGroup: BABYLON.AnimationGroup;
  1499. scene: BABYLON.Scene;
  1500. lockObject: LockObject;
  1501. onPropertyChangedObservable?: BABYLON.Observable<PropertyChangedEvent>;
  1502. }
  1503. export class AnimationGroupGridComponent extends React.Component<IAnimationGroupGridComponentProps, {
  1504. playButtonText: string;
  1505. currentFrame: number;
  1506. }> {
  1507. private _onAnimationGroupPlayObserver;
  1508. private _onAnimationGroupPauseObserver;
  1509. private _onBeforeRenderObserver;
  1510. private timelineRef;
  1511. constructor(props: IAnimationGroupGridComponentProps);
  1512. disconnect(animationGroup: BABYLON.AnimationGroup): void;
  1513. connect(animationGroup: BABYLON.AnimationGroup): void;
  1514. updateCurrentFrame(animationGroup: BABYLON.AnimationGroup): void;
  1515. shouldComponentUpdate(nextProps: IAnimationGroupGridComponentProps): boolean;
  1516. componentWillUnmount(): void;
  1517. playOrPause(): void;
  1518. onCurrentFrameChange(value: number): void;
  1519. render(): JSX.Element;
  1520. }
  1521. }
  1522. declare module INSPECTOR {
  1523. interface IImagePropertyGridComponentProps {
  1524. globalState: GlobalState;
  1525. image: BABYLON.GUI.Image;
  1526. lockObject: LockObject;
  1527. onPropertyChangedObservable?: BABYLON.Observable<PropertyChangedEvent>;
  1528. }
  1529. export class ImagePropertyGridComponent extends React.Component<IImagePropertyGridComponentProps> {
  1530. constructor(props: IImagePropertyGridComponentProps);
  1531. render(): JSX.Element;
  1532. }
  1533. }
  1534. declare module INSPECTOR {
  1535. interface ISliderPropertyGridComponentProps {
  1536. globalState: GlobalState;
  1537. slider: BABYLON.GUI.Slider;
  1538. lockObject: LockObject;
  1539. onPropertyChangedObservable?: BABYLON.Observable<PropertyChangedEvent>;
  1540. }
  1541. export class SliderPropertyGridComponent extends React.Component<ISliderPropertyGridComponentProps> {
  1542. constructor(props: ISliderPropertyGridComponentProps);
  1543. render(): JSX.Element;
  1544. }
  1545. }
  1546. declare module INSPECTOR {
  1547. interface IImageBasedSliderPropertyGridComponentProps {
  1548. globalState: GlobalState;
  1549. imageBasedSlider: BABYLON.GUI.ImageBasedSlider;
  1550. lockObject: LockObject;
  1551. onPropertyChangedObservable?: BABYLON.Observable<PropertyChangedEvent>;
  1552. }
  1553. export class ImageBasedSliderPropertyGridComponent extends React.Component<IImageBasedSliderPropertyGridComponentProps> {
  1554. constructor(props: IImageBasedSliderPropertyGridComponentProps);
  1555. render(): JSX.Element;
  1556. }
  1557. }
  1558. declare module INSPECTOR {
  1559. interface IRectanglePropertyGridComponentProps {
  1560. globalState: GlobalState;
  1561. rectangle: BABYLON.GUI.Rectangle;
  1562. lockObject: LockObject;
  1563. onPropertyChangedObservable?: BABYLON.Observable<PropertyChangedEvent>;
  1564. }
  1565. export class RectanglePropertyGridComponent extends React.Component<IRectanglePropertyGridComponentProps> {
  1566. constructor(props: IRectanglePropertyGridComponentProps);
  1567. render(): JSX.Element;
  1568. }
  1569. }
  1570. declare module INSPECTOR {
  1571. interface IEllipsePropertyGridComponentProps {
  1572. globalState: GlobalState;
  1573. ellipse: BABYLON.GUI.Ellipse;
  1574. lockObject: LockObject;
  1575. onPropertyChangedObservable?: BABYLON.Observable<PropertyChangedEvent>;
  1576. }
  1577. export class EllipsePropertyGridComponent extends React.Component<IEllipsePropertyGridComponentProps> {
  1578. constructor(props: IEllipsePropertyGridComponentProps);
  1579. render(): JSX.Element;
  1580. }
  1581. }
  1582. declare module INSPECTOR {
  1583. interface ICheckboxPropertyGridComponentProps {
  1584. globalState: GlobalState;
  1585. checkbox: BABYLON.GUI.Checkbox;
  1586. lockObject: LockObject;
  1587. onPropertyChangedObservable?: BABYLON.Observable<PropertyChangedEvent>;
  1588. }
  1589. export class CheckboxPropertyGridComponent extends React.Component<ICheckboxPropertyGridComponentProps> {
  1590. constructor(props: ICheckboxPropertyGridComponentProps);
  1591. render(): JSX.Element;
  1592. }
  1593. }
  1594. declare module INSPECTOR {
  1595. interface IRadioButtonPropertyGridComponentProps {
  1596. globalState: GlobalState;
  1597. radioButton: BABYLON.GUI.RadioButton;
  1598. lockObject: LockObject;
  1599. onPropertyChangedObservable?: BABYLON.Observable<PropertyChangedEvent>;
  1600. }
  1601. export class RadioButtonPropertyGridComponent extends React.Component<IRadioButtonPropertyGridComponentProps> {
  1602. constructor(props: IRadioButtonPropertyGridComponentProps);
  1603. render(): JSX.Element;
  1604. }
  1605. }
  1606. declare module INSPECTOR {
  1607. interface ILinePropertyGridComponentProps {
  1608. globalState: GlobalState;
  1609. line: BABYLON.GUI.Line;
  1610. lockObject: LockObject;
  1611. onPropertyChangedObservable?: BABYLON.Observable<PropertyChangedEvent>;
  1612. }
  1613. export class LinePropertyGridComponent extends React.Component<ILinePropertyGridComponentProps> {
  1614. constructor(props: ILinePropertyGridComponentProps);
  1615. onDashChange(value: string): void;
  1616. render(): JSX.Element;
  1617. }
  1618. }
  1619. declare module INSPECTOR {
  1620. interface IScrollViewerPropertyGridComponentProps {
  1621. globalState: GlobalState;
  1622. scrollViewer: BABYLON.GUI.ScrollViewer;
  1623. lockObject: LockObject;
  1624. onPropertyChangedObservable?: BABYLON.Observable<PropertyChangedEvent>;
  1625. }
  1626. export class ScrollViewerPropertyGridComponent extends React.Component<IScrollViewerPropertyGridComponentProps> {
  1627. constructor(props: IScrollViewerPropertyGridComponentProps);
  1628. render(): JSX.Element;
  1629. }
  1630. }
  1631. declare module INSPECTOR {
  1632. interface IGridPropertyGridComponentProps {
  1633. globalState: GlobalState;
  1634. grid: BABYLON.GUI.Grid;
  1635. lockObject: LockObject;
  1636. onPropertyChangedObservable?: BABYLON.Observable<PropertyChangedEvent>;
  1637. }
  1638. export class GridPropertyGridComponent extends React.Component<IGridPropertyGridComponentProps> {
  1639. constructor(props: IGridPropertyGridComponentProps);
  1640. renderRows(): JSX.Element[];
  1641. renderColumns(): JSX.Element[];
  1642. render(): JSX.Element;
  1643. }
  1644. }
  1645. declare module INSPECTOR {
  1646. interface IPBRMetallicRoughnessMaterialPropertyGridComponentProps {
  1647. globalState: GlobalState;
  1648. material: BABYLON.PBRMetallicRoughnessMaterial;
  1649. lockObject: LockObject;
  1650. onSelectionChangedObservable?: BABYLON.Observable<any>;
  1651. onPropertyChangedObservable?: BABYLON.Observable<PropertyChangedEvent>;
  1652. }
  1653. export class PBRMetallicRoughnessMaterialPropertyGridComponent extends React.Component<IPBRMetallicRoughnessMaterialPropertyGridComponentProps> {
  1654. private _onDebugSelectionChangeObservable;
  1655. constructor(props: IPBRMetallicRoughnessMaterialPropertyGridComponentProps);
  1656. renderTextures(): JSX.Element;
  1657. render(): JSX.Element;
  1658. }
  1659. }
  1660. declare module INSPECTOR {
  1661. interface IPBRSpecularGlossinessMaterialPropertyGridComponentProps {
  1662. globalState: GlobalState;
  1663. material: BABYLON.PBRSpecularGlossinessMaterial;
  1664. lockObject: LockObject;
  1665. onSelectionChangedObservable?: BABYLON.Observable<any>;
  1666. onPropertyChangedObservable?: BABYLON.Observable<PropertyChangedEvent>;
  1667. }
  1668. export class PBRSpecularGlossinessMaterialPropertyGridComponent extends React.Component<IPBRSpecularGlossinessMaterialPropertyGridComponentProps> {
  1669. private _onDebugSelectionChangeObservable;
  1670. constructor(props: IPBRSpecularGlossinessMaterialPropertyGridComponentProps);
  1671. renderTextures(): JSX.Element;
  1672. render(): JSX.Element;
  1673. }
  1674. }
  1675. declare module INSPECTOR {
  1676. interface IStackPanelPropertyGridComponentProps {
  1677. globalState: GlobalState;
  1678. stackPanel: BABYLON.GUI.StackPanel;
  1679. lockObject: LockObject;
  1680. onPropertyChangedObservable?: BABYLON.Observable<PropertyChangedEvent>;
  1681. }
  1682. export class StackPanelPropertyGridComponent extends React.Component<IStackPanelPropertyGridComponentProps> {
  1683. constructor(props: IStackPanelPropertyGridComponentProps);
  1684. render(): JSX.Element;
  1685. }
  1686. }
  1687. declare module INSPECTOR {
  1688. interface ICommonPostProcessPropertyGridComponentProps {
  1689. globalState: GlobalState;
  1690. postProcess: BABYLON.PostProcess;
  1691. lockObject: LockObject;
  1692. onPropertyChangedObservable?: BABYLON.Observable<PropertyChangedEvent>;
  1693. }
  1694. export class CommonPostProcessPropertyGridComponent extends React.Component<ICommonPostProcessPropertyGridComponentProps> {
  1695. constructor(props: ICommonPostProcessPropertyGridComponentProps);
  1696. render(): JSX.Element;
  1697. }
  1698. }
  1699. declare module INSPECTOR {
  1700. interface IPostProcessPropertyGridComponentProps {
  1701. globalState: GlobalState;
  1702. postProcess: BABYLON.PostProcess;
  1703. lockObject: LockObject;
  1704. onPropertyChangedObservable?: BABYLON.Observable<PropertyChangedEvent>;
  1705. }
  1706. export class PostProcessPropertyGridComponent extends React.Component<IPostProcessPropertyGridComponentProps> {
  1707. constructor(props: IPostProcessPropertyGridComponentProps);
  1708. edit(): void;
  1709. render(): JSX.Element;
  1710. }
  1711. }
  1712. declare module INSPECTOR {
  1713. interface ICommonRenderingPipelinePropertyGridComponentProps {
  1714. globalState: GlobalState;
  1715. renderPipeline: BABYLON.PostProcessRenderPipeline;
  1716. lockObject: LockObject;
  1717. onPropertyChangedObservable?: BABYLON.Observable<PropertyChangedEvent>;
  1718. }
  1719. export class CommonRenderingPipelinePropertyGridComponent extends React.Component<ICommonRenderingPipelinePropertyGridComponentProps> {
  1720. constructor(props: ICommonRenderingPipelinePropertyGridComponentProps);
  1721. render(): JSX.Element;
  1722. }
  1723. }
  1724. declare module INSPECTOR {
  1725. interface IRenderingPipelinePropertyGridComponentProps {
  1726. globalState: GlobalState;
  1727. renderPipeline: BABYLON.PostProcessRenderPipeline;
  1728. lockObject: LockObject;
  1729. onPropertyChangedObservable?: BABYLON.Observable<PropertyChangedEvent>;
  1730. }
  1731. export class RenderingPipelinePropertyGridComponent extends React.Component<IRenderingPipelinePropertyGridComponentProps> {
  1732. constructor(props: IRenderingPipelinePropertyGridComponentProps);
  1733. render(): JSX.Element;
  1734. }
  1735. }
  1736. declare module INSPECTOR {
  1737. interface IDefaultRenderingPipelinePropertyGridComponentProps {
  1738. globalState: GlobalState;
  1739. renderPipeline: BABYLON.DefaultRenderingPipeline;
  1740. lockObject: LockObject;
  1741. onPropertyChangedObservable?: BABYLON.Observable<PropertyChangedEvent>;
  1742. }
  1743. export class DefaultRenderingPipelinePropertyGridComponent extends React.Component<IDefaultRenderingPipelinePropertyGridComponentProps> {
  1744. constructor(props: IDefaultRenderingPipelinePropertyGridComponentProps);
  1745. render(): JSX.Element;
  1746. }
  1747. }
  1748. declare module INSPECTOR {
  1749. interface ISSAORenderingPipelinePropertyGridComponentProps {
  1750. globalState: GlobalState;
  1751. renderPipeline: BABYLON.SSAORenderingPipeline;
  1752. lockObject: LockObject;
  1753. onPropertyChangedObservable?: BABYLON.Observable<PropertyChangedEvent>;
  1754. }
  1755. export class SSAORenderingPipelinePropertyGridComponent extends React.Component<ISSAORenderingPipelinePropertyGridComponentProps> {
  1756. constructor(props: ISSAORenderingPipelinePropertyGridComponentProps);
  1757. render(): JSX.Element;
  1758. }
  1759. }
  1760. declare module INSPECTOR {
  1761. interface ISSAO2RenderingPipelinePropertyGridComponentProps {
  1762. globalState: GlobalState;
  1763. renderPipeline: BABYLON.SSAO2RenderingPipeline;
  1764. lockObject: LockObject;
  1765. onPropertyChangedObservable?: BABYLON.Observable<PropertyChangedEvent>;
  1766. }
  1767. export class SSAO2RenderingPipelinePropertyGridComponent extends React.Component<ISSAO2RenderingPipelinePropertyGridComponentProps> {
  1768. constructor(props: ISSAO2RenderingPipelinePropertyGridComponentProps);
  1769. render(): JSX.Element;
  1770. }
  1771. }
  1772. declare module INSPECTOR {
  1773. interface ISkeletonPropertyGridComponentProps {
  1774. globalState: GlobalState;
  1775. skeleton: BABYLON.Skeleton;
  1776. lockObject: LockObject;
  1777. onPropertyChangedObservable?: BABYLON.Observable<PropertyChangedEvent>;
  1778. }
  1779. export class SkeletonPropertyGridComponent extends React.Component<ISkeletonPropertyGridComponentProps> {
  1780. private _skeletonViewersEnabled;
  1781. private _skeletonViewerDisplayOptions;
  1782. private _skeletonViewers;
  1783. constructor(props: ISkeletonPropertyGridComponentProps);
  1784. switchSkeletonViewers(): void;
  1785. checkSkeletonViewerState(props: ISkeletonPropertyGridComponentProps): void;
  1786. changeDisplayMode(): void;
  1787. changeDisplayOptions(option: string, value: number): void;
  1788. shouldComponentUpdate(nextProps: ISkeletonPropertyGridComponentProps): boolean;
  1789. onOverrideMeshLink(): void;
  1790. render(): JSX.Element;
  1791. }
  1792. }
  1793. declare module INSPECTOR {
  1794. interface IBonePropertyGridComponentProps {
  1795. globalState: GlobalState;
  1796. bone: BABYLON.Bone;
  1797. lockObject: LockObject;
  1798. onPropertyChangedObservable?: BABYLON.Observable<PropertyChangedEvent>;
  1799. }
  1800. export class BonePropertyGridComponent extends React.Component<IBonePropertyGridComponentProps> {
  1801. constructor(props: IBonePropertyGridComponentProps);
  1802. onTransformNodeLink(): void;
  1803. render(): JSX.Element;
  1804. }
  1805. }
  1806. declare module INSPECTOR {
  1807. interface IDirectionalLightPropertyGridComponentProps {
  1808. globalState: GlobalState;
  1809. light: BABYLON.DirectionalLight;
  1810. lockObject: LockObject;
  1811. onPropertyChangedObservable?: BABYLON.Observable<PropertyChangedEvent>;
  1812. }
  1813. export class DirectionalLightPropertyGridComponent extends React.Component<IDirectionalLightPropertyGridComponentProps> {
  1814. constructor(props: IDirectionalLightPropertyGridComponentProps);
  1815. render(): JSX.Element;
  1816. }
  1817. }
  1818. declare module INSPECTOR {
  1819. interface ISpotLightPropertyGridComponentProps {
  1820. globalState: GlobalState;
  1821. light: BABYLON.SpotLight;
  1822. lockObject: LockObject;
  1823. onPropertyChangedObservable?: BABYLON.Observable<PropertyChangedEvent>;
  1824. }
  1825. export class SpotLightPropertyGridComponent extends React.Component<ISpotLightPropertyGridComponentProps> {
  1826. constructor(props: ISpotLightPropertyGridComponentProps);
  1827. render(): JSX.Element;
  1828. }
  1829. }
  1830. declare module INSPECTOR {
  1831. interface ILenstRenderingPipelinePropertyGridComponentProps {
  1832. globalState: GlobalState;
  1833. renderPipeline: BABYLON.LensRenderingPipeline;
  1834. lockObject: LockObject;
  1835. onPropertyChangedObservable?: BABYLON.Observable<PropertyChangedEvent>;
  1836. }
  1837. export class LensRenderingPipelinePropertyGridComponent extends React.Component<ILenstRenderingPipelinePropertyGridComponentProps> {
  1838. constructor(props: ILenstRenderingPipelinePropertyGridComponentProps);
  1839. render(): JSX.Element;
  1840. }
  1841. }
  1842. declare module INSPECTOR {
  1843. interface IVector4LineComponentProps {
  1844. label: string;
  1845. target: any;
  1846. propertyName: string;
  1847. step?: number;
  1848. onChange?: (newvalue: BABYLON.Vector4) => void;
  1849. useEuler?: boolean;
  1850. onPropertyChangedObservable?: BABYLON.Observable<PropertyChangedEvent>;
  1851. }
  1852. export class Vector4LineComponent extends React.Component<IVector4LineComponentProps, {
  1853. isExpanded: boolean;
  1854. value: BABYLON.Vector4;
  1855. }> {
  1856. static defaultProps: {
  1857. step: number;
  1858. };
  1859. private _localChange;
  1860. constructor(props: IVector4LineComponentProps);
  1861. getCurrentValue(): any;
  1862. shouldComponentUpdate(nextProps: IVector4LineComponentProps, nextState: {
  1863. isExpanded: boolean;
  1864. value: BABYLON.Vector4;
  1865. }): boolean;
  1866. switchExpandState(): void;
  1867. raiseOnPropertyChanged(previousValue: BABYLON.Vector4): void;
  1868. updateVector4(): void;
  1869. updateStateX(value: number): void;
  1870. updateStateY(value: number): void;
  1871. updateStateZ(value: number): void;
  1872. updateStateW(value: number): void;
  1873. render(): JSX.Element;
  1874. }
  1875. }
  1876. declare module INSPECTOR {
  1877. export interface IColor4LineComponentProps {
  1878. label: string;
  1879. target: any;
  1880. propertyName: string;
  1881. onPropertyChangedObservable?: BABYLON.Observable<PropertyChangedEvent>;
  1882. onChange?: () => void;
  1883. isLinear?: boolean;
  1884. }
  1885. export class Color4LineComponent extends React.Component<IColor4LineComponentProps, {
  1886. isExpanded: boolean;
  1887. color: BABYLON.Color4;
  1888. }> {
  1889. private _localChange;
  1890. constructor(props: IColor4LineComponentProps);
  1891. shouldComponentUpdate(nextProps: IColor4LineComponentProps, nextState: {
  1892. color: BABYLON.Color4;
  1893. }): boolean;
  1894. setPropertyValue(newColor: BABYLON.Color4): void;
  1895. onChange(newValue: string): void;
  1896. switchExpandState(): void;
  1897. raiseOnPropertyChanged(previousValue: BABYLON.Color4): void;
  1898. updateStateR(value: number): void;
  1899. updateStateG(value: number): void;
  1900. updateStateB(value: number): void;
  1901. updateStateA(value: number): void;
  1902. copyToClipboard(): void;
  1903. render(): JSX.Element;
  1904. }
  1905. }
  1906. declare module INSPECTOR {
  1907. interface IGradientStepComponentProps {
  1908. globalState: GlobalState;
  1909. step: BABYLON.GradientBlockColorStep;
  1910. lineIndex: number;
  1911. onDelete: () => void;
  1912. onUpdateStep: () => void;
  1913. onCheckForReOrder: () => void;
  1914. onCopy?: () => void;
  1915. }
  1916. export class GradientStepComponent extends React.Component<IGradientStepComponentProps, {
  1917. gradient: number;
  1918. }> {
  1919. constructor(props: IGradientStepComponentProps);
  1920. updateColor(color: string): void;
  1921. updateStep(gradient: number): void;
  1922. onPointerUp(): void;
  1923. render(): JSX.Element;
  1924. }
  1925. }
  1926. declare module INSPECTOR {
  1927. export interface IPropertyComponentProps {
  1928. globalState: GlobalState;
  1929. block: BABYLON.NodeMaterialBlock;
  1930. }
  1931. }
  1932. declare module INSPECTOR {
  1933. export class GradientPropertyTabComponent extends React.Component<IPropertyComponentProps> {
  1934. private _gradientBlock;
  1935. constructor(props: IPropertyComponentProps);
  1936. forceRebuild(): void;
  1937. deleteStep(step: BABYLON.GradientBlockColorStep): void;
  1938. copyStep(step: BABYLON.GradientBlockColorStep): void;
  1939. addNewStep(): void;
  1940. checkForReOrder(): void;
  1941. render(): JSX.Element;
  1942. }
  1943. }
  1944. declare module INSPECTOR {
  1945. interface INodeMaterialPropertyGridComponentProps {
  1946. globalState: GlobalState;
  1947. material: BABYLON.NodeMaterial;
  1948. lockObject: LockObject;
  1949. onSelectionChangedObservable?: BABYLON.Observable<any>;
  1950. onPropertyChangedObservable?: BABYLON.Observable<PropertyChangedEvent>;
  1951. }
  1952. export class NodeMaterialPropertyGridComponent extends React.Component<INodeMaterialPropertyGridComponentProps> {
  1953. private _onDebugSelectionChangeObservable;
  1954. constructor(props: INodeMaterialPropertyGridComponentProps);
  1955. edit(): void;
  1956. renderTextures(): JSX.Element | null;
  1957. renderInputBlock(block: BABYLON.InputBlock): JSX.Element | null;
  1958. renderInputValues(): JSX.Element;
  1959. render(): JSX.Element;
  1960. }
  1961. }
  1962. declare module INSPECTOR {
  1963. interface IMultiMaterialPropertyGridComponentProps {
  1964. globalState: GlobalState;
  1965. material: BABYLON.MultiMaterial;
  1966. lockObject: LockObject;
  1967. onSelectionChangedObservable?: BABYLON.Observable<any>;
  1968. onPropertyChangedObservable?: BABYLON.Observable<PropertyChangedEvent>;
  1969. }
  1970. export class MultiMaterialPropertyGridComponent extends React.Component<IMultiMaterialPropertyGridComponentProps> {
  1971. constructor(props: IMultiMaterialPropertyGridComponentProps);
  1972. onMaterialLink(mat: BABYLON.Material): void;
  1973. renderChildMaterial(): JSX.Element;
  1974. render(): JSX.Element;
  1975. }
  1976. }
  1977. declare module INSPECTOR {
  1978. interface IBoxEmitterGridComponentProps {
  1979. globalState: GlobalState;
  1980. emitter: BABYLON.BoxParticleEmitter;
  1981. onPropertyChangedObservable?: BABYLON.Observable<PropertyChangedEvent>;
  1982. }
  1983. export class BoxEmitterGridComponent extends React.Component<IBoxEmitterGridComponentProps> {
  1984. constructor(props: IBoxEmitterGridComponentProps);
  1985. render(): JSX.Element;
  1986. }
  1987. }
  1988. declare module INSPECTOR {
  1989. interface IConeEmitterGridComponentProps {
  1990. globalState: GlobalState;
  1991. emitter: BABYLON.ConeParticleEmitter;
  1992. onSelectionChangedObservable?: BABYLON.Observable<any>;
  1993. onPropertyChangedObservable?: BABYLON.Observable<PropertyChangedEvent>;
  1994. }
  1995. export class ConeEmitterGridComponent extends React.Component<IConeEmitterGridComponentProps> {
  1996. constructor(props: IConeEmitterGridComponentProps);
  1997. render(): JSX.Element;
  1998. }
  1999. }
  2000. declare module INSPECTOR {
  2001. interface ICylinderEmitterGridComponentProps {
  2002. globalState: GlobalState;
  2003. emitter: BABYLON.CylinderParticleEmitter;
  2004. lockObject: LockObject;
  2005. onPropertyChangedObservable?: BABYLON.Observable<PropertyChangedEvent>;
  2006. }
  2007. export class CylinderEmitterGridComponent extends React.Component<ICylinderEmitterGridComponentProps> {
  2008. constructor(props: ICylinderEmitterGridComponentProps);
  2009. render(): JSX.Element;
  2010. }
  2011. }
  2012. declare module INSPECTOR {
  2013. interface IHemisphericEmitterGridComponentProps {
  2014. globalState: GlobalState;
  2015. emitter: BABYLON.HemisphericParticleEmitter;
  2016. lockObject: LockObject;
  2017. onPropertyChangedObservable?: BABYLON.Observable<PropertyChangedEvent>;
  2018. }
  2019. export class HemisphericEmitterGridComponent extends React.Component<IHemisphericEmitterGridComponentProps> {
  2020. constructor(props: IHemisphericEmitterGridComponentProps);
  2021. render(): JSX.Element;
  2022. }
  2023. }
  2024. declare module INSPECTOR {
  2025. interface IPointEmitterGridComponentProps {
  2026. globalState: GlobalState;
  2027. emitter: BABYLON.PointParticleEmitter;
  2028. lockObject: LockObject;
  2029. onPropertyChangedObservable?: BABYLON.Observable<PropertyChangedEvent>;
  2030. }
  2031. export class PointEmitterGridComponent extends React.Component<IPointEmitterGridComponentProps> {
  2032. constructor(props: IPointEmitterGridComponentProps);
  2033. render(): JSX.Element;
  2034. }
  2035. }
  2036. declare module INSPECTOR {
  2037. interface ISphereEmitterGridComponentProps {
  2038. globalState: GlobalState;
  2039. emitter: BABYLON.SphereParticleEmitter;
  2040. lockObject: LockObject;
  2041. onPropertyChangedObservable?: BABYLON.Observable<PropertyChangedEvent>;
  2042. }
  2043. export class SphereEmitterGridComponent extends React.Component<ISphereEmitterGridComponentProps> {
  2044. constructor(props: ISphereEmitterGridComponentProps);
  2045. render(): JSX.Element;
  2046. }
  2047. }
  2048. declare module INSPECTOR {
  2049. interface IMeshPickerComponentProps {
  2050. globalState: GlobalState;
  2051. target: any;
  2052. property: string;
  2053. scene: BABYLON.Scene;
  2054. label: string;
  2055. onPropertyChangedObservable?: BABYLON.Observable<PropertyChangedEvent>;
  2056. }
  2057. export class MeshPickerComponent extends React.Component<IMeshPickerComponentProps> {
  2058. constructor(props: IMeshPickerComponentProps);
  2059. render(): JSX.Element;
  2060. }
  2061. }
  2062. declare module INSPECTOR {
  2063. interface IMeshEmitterGridComponentProps {
  2064. globalState: GlobalState;
  2065. emitter: BABYLON.MeshParticleEmitter;
  2066. scene: BABYLON.Scene;
  2067. lockObject: LockObject;
  2068. onSelectionChangedObservable?: BABYLON.Observable<any>;
  2069. onPropertyChangedObservable?: BABYLON.Observable<PropertyChangedEvent>;
  2070. }
  2071. export class MeshEmitterGridComponent extends React.Component<IMeshEmitterGridComponentProps> {
  2072. constructor(props: IMeshEmitterGridComponentProps);
  2073. render(): JSX.Element;
  2074. }
  2075. }
  2076. declare module INSPECTOR {
  2077. interface IFactorGradientStepGridComponent {
  2078. globalState: GlobalState;
  2079. gradient: BABYLON.FactorGradient;
  2080. lockObject: LockObject;
  2081. lineIndex: number;
  2082. onDelete: () => void;
  2083. onUpdateGradient: () => void;
  2084. onCheckForReOrder: () => void;
  2085. host: BABYLON.IParticleSystem;
  2086. codeRecorderPropertyName: string;
  2087. }
  2088. export class FactorGradientStepGridComponent extends React.Component<IFactorGradientStepGridComponent, {
  2089. gradient: number;
  2090. factor1: string;
  2091. factor2?: string;
  2092. }> {
  2093. constructor(props: IFactorGradientStepGridComponent);
  2094. shouldComponentUpdate(nextProps: IFactorGradientStepGridComponent, nextState: {
  2095. gradient: number;
  2096. factor1: string;
  2097. factor2?: string;
  2098. }): boolean;
  2099. updateFactor1(valueString: string): void;
  2100. updateFactor2(valueString: string): void;
  2101. updateGradient(gradient: number): void;
  2102. onPointerUp(): void;
  2103. lock(): void;
  2104. unlock(): void;
  2105. render(): JSX.Element;
  2106. }
  2107. }
  2108. declare module INSPECTOR {
  2109. interface IColorGradientStepGridComponent {
  2110. globalState: GlobalState;
  2111. gradient: BABYLON.ColorGradient | BABYLON.Color3Gradient;
  2112. lockObject: LockObject;
  2113. lineIndex: number;
  2114. isColor3: boolean;
  2115. onDelete: () => void;
  2116. onUpdateGradient: () => void;
  2117. onCheckForReOrder: () => void;
  2118. host: BABYLON.IParticleSystem;
  2119. codeRecorderPropertyName: string;
  2120. }
  2121. export class ColorGradientStepGridComponent extends React.Component<IColorGradientStepGridComponent, {
  2122. gradient: number;
  2123. }> {
  2124. constructor(props: IColorGradientStepGridComponent);
  2125. updateColor1(color: string): void;
  2126. updateColor2(color: string): void;
  2127. updateGradient(gradient: number): void;
  2128. onPointerUp(): void;
  2129. lock(): void;
  2130. unlock(): void;
  2131. render(): JSX.Element;
  2132. }
  2133. }
  2134. declare module INSPECTOR {
  2135. interface ILinkButtonComponentProps {
  2136. label: string;
  2137. buttonLabel: string;
  2138. url?: string;
  2139. onClick: () => void;
  2140. onIconClick?: () => void;
  2141. }
  2142. export class LinkButtonComponent extends React.Component<ILinkButtonComponentProps> {
  2143. constructor(props: ILinkButtonComponentProps);
  2144. onLink(): void;
  2145. render(): JSX.Element;
  2146. }
  2147. }
  2148. declare module INSPECTOR {
  2149. export enum GradientGridMode {
  2150. Factor = 0,
  2151. BABYLON.Color3 = 1,
  2152. BABYLON.Color4 = 2
  2153. }
  2154. interface IValueGradientGridComponent {
  2155. globalState: GlobalState;
  2156. label: string;
  2157. gradients: BABYLON.Nullable<Array<BABYLON.IValueGradient>>;
  2158. lockObject: LockObject;
  2159. docLink?: string;
  2160. mode: GradientGridMode;
  2161. host: BABYLON.IParticleSystem;
  2162. codeRecorderPropertyName: string;
  2163. onCreateRequired: () => void;
  2164. }
  2165. export class ValueGradientGridComponent extends React.Component<IValueGradientGridComponent> {
  2166. constructor(props: IValueGradientGridComponent);
  2167. deleteStep(step: BABYLON.IValueGradient): void;
  2168. addNewStep(): void;
  2169. checkForReOrder(): void;
  2170. updateAndSync(): void;
  2171. render(): JSX.Element;
  2172. }
  2173. }
  2174. declare module INSPECTOR {
  2175. interface IParticleSystemPropertyGridComponentProps {
  2176. globalState: GlobalState;
  2177. system: BABYLON.IParticleSystem;
  2178. lockObject: LockObject;
  2179. onSelectionChangedObservable?: BABYLON.Observable<any>;
  2180. onPropertyChangedObservable?: BABYLON.Observable<PropertyChangedEvent>;
  2181. }
  2182. export class ParticleSystemPropertyGridComponent extends React.Component<IParticleSystemPropertyGridComponentProps> {
  2183. private _snippetUrl;
  2184. constructor(props: IParticleSystemPropertyGridComponentProps);
  2185. renderEmitter(): JSX.Element | null;
  2186. raiseOnPropertyChanged(property: string, newValue: any, previousValue: any): void;
  2187. renderControls(): JSX.Element;
  2188. saveToFile(): void;
  2189. loadFromFile(file: File): void;
  2190. loadFromSnippet(): void;
  2191. saveToSnippet(): void;
  2192. render(): JSX.Element;
  2193. }
  2194. }
  2195. declare module INSPECTOR {
  2196. interface ISpriteManagerPropertyGridComponentProps {
  2197. globalState: GlobalState;
  2198. spriteManager: BABYLON.SpriteManager;
  2199. lockObject: LockObject;
  2200. onSelectionChangedObservable?: BABYLON.Observable<any>;
  2201. onPropertyChangedObservable?: BABYLON.Observable<PropertyChangedEvent>;
  2202. }
  2203. export class SpriteManagerPropertyGridComponent extends React.Component<ISpriteManagerPropertyGridComponentProps> {
  2204. private _snippetUrl;
  2205. constructor(props: ISpriteManagerPropertyGridComponentProps);
  2206. addNewSprite(): void;
  2207. disposeManager(): void;
  2208. saveToFile(): void;
  2209. loadFromFile(file: File): void;
  2210. loadFromSnippet(): void;
  2211. saveToSnippet(): void;
  2212. render(): JSX.Element;
  2213. }
  2214. }
  2215. declare module INSPECTOR {
  2216. interface ISpritePropertyGridComponentProps {
  2217. globalState: GlobalState;
  2218. sprite: BABYLON.Sprite;
  2219. lockObject: LockObject;
  2220. onPropertyChangedObservable?: BABYLON.Observable<PropertyChangedEvent>;
  2221. onSelectionChangedObservable?: BABYLON.Observable<any>;
  2222. }
  2223. export class SpritePropertyGridComponent extends React.Component<ISpritePropertyGridComponentProps> {
  2224. private canvasRef;
  2225. private imageData;
  2226. private cachedCellIndex;
  2227. constructor(props: ISpritePropertyGridComponentProps);
  2228. onManagerLink(): void;
  2229. switchPlayStopState(): void;
  2230. disposeSprite(): void;
  2231. componentDidMount(): void;
  2232. componentDidUpdate(): void;
  2233. shouldComponentUpdate(nextProps: ISpritePropertyGridComponentProps): boolean;
  2234. updatePreview(): void;
  2235. render(): JSX.Element;
  2236. }
  2237. }
  2238. declare module INSPECTOR {
  2239. interface ITargetedAnimationGridComponentProps {
  2240. globalState: GlobalState;
  2241. targetedAnimation: BABYLON.TargetedAnimation;
  2242. scene: BABYLON.Scene;
  2243. lockObject: LockObject;
  2244. onSelectionChangedObservable?: BABYLON.Observable<any>;
  2245. onPropertyChangedObservable?: BABYLON.Observable<PropertyChangedEvent>;
  2246. }
  2247. export class TargetedAnimationGridComponent extends React.Component<ITargetedAnimationGridComponentProps> {
  2248. private _animationGroup;
  2249. constructor(props: ITargetedAnimationGridComponentProps);
  2250. playOrPause: () => void;
  2251. deleteAnimation: () => void;
  2252. render(): JSX.Element;
  2253. }
  2254. }
  2255. declare module INSPECTOR {
  2256. interface IFollowCameraPropertyGridComponentProps {
  2257. globalState: GlobalState;
  2258. camera: BABYLON.FollowCamera;
  2259. lockObject: LockObject;
  2260. onPropertyChangedObservable?: BABYLON.Observable<PropertyChangedEvent>;
  2261. }
  2262. export class FollowCameraPropertyGridComponent extends React.Component<IFollowCameraPropertyGridComponentProps> {
  2263. constructor(props: IFollowCameraPropertyGridComponentProps);
  2264. render(): JSX.Element;
  2265. }
  2266. }
  2267. declare module INSPECTOR {
  2268. interface ISoundPropertyGridComponentProps {
  2269. globalState: GlobalState;
  2270. sound: BABYLON.Sound;
  2271. extensibilityGroups?: BABYLON.IExplorerExtensibilityGroup[];
  2272. lockObject: LockObject;
  2273. onPropertyChangedObservable?: BABYLON.Observable<PropertyChangedEvent>;
  2274. }
  2275. export class SoundPropertyGridComponent extends React.Component<ISoundPropertyGridComponentProps> {
  2276. constructor(props: ISoundPropertyGridComponentProps);
  2277. render(): JSX.Element;
  2278. }
  2279. }
  2280. declare module INSPECTOR {
  2281. export class PropertyGridTabComponent extends PaneComponent {
  2282. private _timerIntervalId;
  2283. private _lockObject;
  2284. constructor(props: IPaneComponentProps);
  2285. timerRefresh(): void;
  2286. componentDidMount(): void;
  2287. componentWillUnmount(): void;
  2288. render(): JSX.Element | null;
  2289. }
  2290. }
  2291. declare module INSPECTOR {
  2292. export interface IHeaderComponentProps {
  2293. title: string;
  2294. handleBack?: boolean;
  2295. noExpand?: boolean;
  2296. noClose?: boolean;
  2297. noCommands?: boolean;
  2298. onPopup: () => void;
  2299. onClose: () => void;
  2300. onSelectionChangedObservable?: BABYLON.Observable<any>;
  2301. }
  2302. export class HeaderComponent extends React.Component<IHeaderComponentProps, {
  2303. isBackVisible: boolean;
  2304. }> {
  2305. private _backStack;
  2306. private _onSelectionChangeObserver;
  2307. constructor(props: IHeaderComponentProps);
  2308. componentDidMount(): void;
  2309. componentWillUnmount(): void;
  2310. goBack(): void;
  2311. renderLogo(): JSX.Element | null;
  2312. render(): JSX.Element;
  2313. }
  2314. }
  2315. declare module INSPECTOR {
  2316. interface IMessageLineComponentProps {
  2317. text: string;
  2318. color?: string;
  2319. }
  2320. export class MessageLineComponent extends React.Component<IMessageLineComponentProps> {
  2321. constructor(props: IMessageLineComponentProps);
  2322. render(): JSX.Element;
  2323. }
  2324. }
  2325. declare module INSPECTOR {
  2326. interface IGLTFComponentProps {
  2327. scene: BABYLON.Scene;
  2328. globalState: GlobalState;
  2329. }
  2330. export class GLTFComponent extends React.Component<IGLTFComponentProps> {
  2331. private _onValidationResultsUpdatedObserver;
  2332. openValidationDetails(): void;
  2333. prepareText(singularForm: string, count: number): string;
  2334. componentDidMount(): void;
  2335. componentWillUnmount(): void;
  2336. renderValidation(): JSX.Element | null;
  2337. render(): JSX.Element;
  2338. }
  2339. }
  2340. declare module INSPECTOR {
  2341. interface IFileMultipleButtonLineComponentProps {
  2342. label: string;
  2343. onClick: (event: any) => void;
  2344. accept: string;
  2345. }
  2346. export class FileMultipleButtonLineComponent extends React.Component<IFileMultipleButtonLineComponentProps> {
  2347. private static _IDGenerator;
  2348. private _id;
  2349. private uploadInputRef;
  2350. constructor(props: IFileMultipleButtonLineComponentProps);
  2351. onChange(evt: any): void;
  2352. render(): JSX.Element;
  2353. }
  2354. }
  2355. declare module INSPECTOR {
  2356. interface IIndentedTextLineComponentProps {
  2357. value?: string;
  2358. color?: string;
  2359. underline?: boolean;
  2360. onLink?: () => void;
  2361. url?: string;
  2362. additionalClass?: string;
  2363. }
  2364. export class IndentedTextLineComponent extends React.Component<IIndentedTextLineComponentProps> {
  2365. constructor(props: IIndentedTextLineComponentProps);
  2366. onLink(): void;
  2367. renderContent(): JSX.Element;
  2368. render(): JSX.Element;
  2369. }
  2370. }
  2371. declare module INSPECTOR {
  2372. export class ToolsTabComponent extends PaneComponent {
  2373. private _videoRecorder;
  2374. private _screenShotSize;
  2375. private _gifOptions;
  2376. private _useWidthHeight;
  2377. private _isExporting;
  2378. private _gifWorkerBlob;
  2379. private _gifRecorder;
  2380. private _previousRenderingScale;
  2381. private _crunchingGIF;
  2382. constructor(props: IPaneComponentProps);
  2383. componentDidMount(): void;
  2384. componentWillUnmount(): void;
  2385. captureScreenshot(): void;
  2386. captureRender(): void;
  2387. recordVideo(): void;
  2388. recordGIFInternal(): void;
  2389. recordGIF(): void;
  2390. importAnimations(event: any): void;
  2391. shouldExport(node: BABYLON.Node): boolean;
  2392. exportGLTF(): void;
  2393. exportBabylon(): void;
  2394. createEnvTexture(): void;
  2395. exportReplay(): void;
  2396. startRecording(): void;
  2397. applyDelta(file: File): void;
  2398. render(): JSX.Element | null;
  2399. }
  2400. }
  2401. declare module INSPECTOR {
  2402. export class SettingsTabComponent extends PaneComponent {
  2403. constructor(props: IPaneComponentProps);
  2404. render(): JSX.Element;
  2405. }
  2406. }
  2407. declare module INSPECTOR {
  2408. interface IActionTabsComponentProps {
  2409. scene?: BABYLON.Scene;
  2410. noCommands?: boolean;
  2411. noHeader?: boolean;
  2412. noExpand?: boolean;
  2413. noClose?: boolean;
  2414. popupMode?: boolean;
  2415. onPopup?: () => void;
  2416. onClose?: () => void;
  2417. globalState?: GlobalState;
  2418. initialTab?: BABYLON.DebugLayerTab;
  2419. }
  2420. export class ActionTabsComponent extends React.Component<IActionTabsComponentProps, {
  2421. selectedEntity: any;
  2422. selectedIndex: number;
  2423. }> {
  2424. private _onSelectionChangeObserver;
  2425. private _onTabChangedObserver;
  2426. private _once;
  2427. constructor(props: IActionTabsComponentProps);
  2428. componentDidMount(): void;
  2429. componentWillUnmount(): void;
  2430. changeSelectedTab(index: number): void;
  2431. renderContent(): JSX.Element | null;
  2432. onClose(): void;
  2433. onPopup(): void;
  2434. render(): JSX.Element;
  2435. }
  2436. }
  2437. declare module INSPECTOR {
  2438. interface ITreeItemLabelComponentProps {
  2439. label: string;
  2440. onClick?: () => void;
  2441. color: string;
  2442. }
  2443. export class TreeItemLabelComponent extends React.Component<ITreeItemLabelComponentProps> {
  2444. constructor(props: ITreeItemLabelComponentProps);
  2445. onClick(): void;
  2446. render(): JSX.Element;
  2447. }
  2448. }
  2449. declare module INSPECTOR {
  2450. interface IExtensionsComponentProps {
  2451. target: any;
  2452. extensibilityGroups?: BABYLON.IExplorerExtensibilityGroup[];
  2453. }
  2454. export class ExtensionsComponent extends React.Component<IExtensionsComponentProps, {
  2455. popupVisible: boolean;
  2456. }> {
  2457. private _popup;
  2458. private extensionRef;
  2459. constructor(props: IExtensionsComponentProps);
  2460. showPopup(): void;
  2461. componentDidMount(): void;
  2462. componentDidUpdate(): void;
  2463. render(): JSX.Element | null;
  2464. }
  2465. }
  2466. declare module INSPECTOR {
  2467. interface IMeshTreeItemComponentProps {
  2468. mesh: BABYLON.AbstractMesh;
  2469. extensibilityGroups?: BABYLON.IExplorerExtensibilityGroup[];
  2470. onClick: () => void;
  2471. globalState: GlobalState;
  2472. }
  2473. export class MeshTreeItemComponent extends React.Component<IMeshTreeItemComponentProps, {
  2474. isBoundingBoxEnabled: boolean;
  2475. isVisible: boolean;
  2476. }> {
  2477. constructor(props: IMeshTreeItemComponentProps);
  2478. showBoundingBox(): void;
  2479. switchVisibility(): void;
  2480. render(): JSX.Element;
  2481. }
  2482. }
  2483. declare module INSPECTOR {
  2484. interface ICameraTreeItemComponentProps {
  2485. camera: BABYLON.Camera;
  2486. extensibilityGroups?: BABYLON.IExplorerExtensibilityGroup[];
  2487. onClick: () => void;
  2488. globalState: GlobalState;
  2489. }
  2490. export class CameraTreeItemComponent extends React.Component<ICameraTreeItemComponentProps, {
  2491. isActive: boolean;
  2492. isGizmoEnabled: boolean;
  2493. }> {
  2494. private _onBeforeRenderObserver;
  2495. constructor(props: ICameraTreeItemComponentProps);
  2496. setActive(): void;
  2497. componentDidMount(): void;
  2498. componentWillUnmount(): void;
  2499. toggleGizmo(): void;
  2500. render(): JSX.Element;
  2501. }
  2502. }
  2503. declare module INSPECTOR {
  2504. interface ILightTreeItemComponentProps {
  2505. light: BABYLON.Light;
  2506. extensibilityGroups?: BABYLON.IExplorerExtensibilityGroup[];
  2507. onClick: () => void;
  2508. globalState: GlobalState;
  2509. }
  2510. export class LightTreeItemComponent extends React.Component<ILightTreeItemComponentProps, {
  2511. isEnabled: boolean;
  2512. isGizmoEnabled: boolean;
  2513. }> {
  2514. constructor(props: ILightTreeItemComponentProps);
  2515. switchIsEnabled(): void;
  2516. toggleGizmo(): void;
  2517. render(): JSX.Element;
  2518. }
  2519. }
  2520. declare module INSPECTOR {
  2521. interface IMaterialTreeItemComponentProps {
  2522. material: BABYLON.Material | BABYLON.NodeMaterial;
  2523. extensibilityGroups?: BABYLON.IExplorerExtensibilityGroup[];
  2524. onClick: () => void;
  2525. }
  2526. export class MaterialTreeItemComponent extends React.Component<IMaterialTreeItemComponentProps> {
  2527. constructor(props: IMaterialTreeItemComponentProps);
  2528. render(): JSX.Element;
  2529. }
  2530. }
  2531. declare module INSPECTOR {
  2532. interface ITextureTreeItemComponentProps {
  2533. texture: BABYLON.Texture;
  2534. extensibilityGroups?: BABYLON.IExplorerExtensibilityGroup[];
  2535. onClick: () => void;
  2536. }
  2537. export class TextureTreeItemComponent extends React.Component<ITextureTreeItemComponentProps> {
  2538. constructor(props: ITextureTreeItemComponentProps);
  2539. render(): JSX.Element;
  2540. }
  2541. }
  2542. declare module INSPECTOR {
  2543. interface ITransformNodeItemComponentProps {
  2544. transformNode: BABYLON.TransformNode;
  2545. extensibilityGroups?: BABYLON.IExplorerExtensibilityGroup[];
  2546. onClick: () => void;
  2547. }
  2548. export class TransformNodeItemComponent extends React.Component<ITransformNodeItemComponentProps> {
  2549. constructor(props: ITransformNodeItemComponentProps);
  2550. render(): JSX.Element;
  2551. }
  2552. }
  2553. declare module INSPECTOR {
  2554. interface IControlTreeItemComponentProps {
  2555. control: BABYLON.GUI.Control;
  2556. extensibilityGroups?: BABYLON.IExplorerExtensibilityGroup[];
  2557. onClick: () => void;
  2558. }
  2559. export class ControlTreeItemComponent extends React.Component<IControlTreeItemComponentProps, {
  2560. isActive: boolean;
  2561. isVisible: boolean;
  2562. }> {
  2563. constructor(props: IControlTreeItemComponentProps);
  2564. highlight(): void;
  2565. switchVisibility(): void;
  2566. render(): JSX.Element;
  2567. }
  2568. }
  2569. declare module INSPECTOR {
  2570. interface IAdvancedDynamicTextureTreeItemComponentProps {
  2571. texture: BABYLON.GUI.AdvancedDynamicTexture;
  2572. extensibilityGroups?: BABYLON.IExplorerExtensibilityGroup[];
  2573. onSelectionChangedObservable?: BABYLON.Observable<any>;
  2574. onClick: () => void;
  2575. }
  2576. export class AdvancedDynamicTextureTreeItemComponent extends React.Component<IAdvancedDynamicTextureTreeItemComponentProps, {
  2577. isInPickingMode: boolean;
  2578. }> {
  2579. private _onControlPickedObserver;
  2580. constructor(props: IAdvancedDynamicTextureTreeItemComponentProps);
  2581. componentWillUnmount(): void;
  2582. onPickingMode(): void;
  2583. render(): JSX.Element;
  2584. }
  2585. }
  2586. declare module INSPECTOR {
  2587. interface IAnimationGroupItemComponentProps {
  2588. animationGroup: BABYLON.AnimationGroup;
  2589. extensibilityGroups?: BABYLON.IExplorerExtensibilityGroup[];
  2590. onClick: () => void;
  2591. }
  2592. export class AnimationGroupItemComponent extends React.Component<IAnimationGroupItemComponentProps> {
  2593. constructor(props: IAnimationGroupItemComponentProps);
  2594. render(): JSX.Element;
  2595. }
  2596. }
  2597. declare module INSPECTOR {
  2598. interface IPostProcessItemComponentProps {
  2599. postProcess: BABYLON.PostProcess;
  2600. extensibilityGroups?: BABYLON.IExplorerExtensibilityGroup[];
  2601. onClick: () => void;
  2602. }
  2603. export class PostProcessItemComponent extends React.Component<IPostProcessItemComponentProps> {
  2604. constructor(props: IPostProcessItemComponentProps);
  2605. render(): JSX.Element;
  2606. }
  2607. }
  2608. declare module INSPECTOR {
  2609. interface IRenderPipelineItemComponenttProps {
  2610. renderPipeline: BABYLON.PostProcessRenderPipeline;
  2611. extensibilityGroups?: BABYLON.IExplorerExtensibilityGroup[];
  2612. onClick: () => void;
  2613. }
  2614. export class RenderingPipelineItemComponent extends React.Component<IRenderPipelineItemComponenttProps> {
  2615. constructor(props: IRenderPipelineItemComponenttProps);
  2616. render(): JSX.Element;
  2617. }
  2618. }
  2619. declare module INSPECTOR {
  2620. interface ISkeletonTreeItemComponentProps {
  2621. skeleton: BABYLON.Skeleton;
  2622. extensibilityGroups?: BABYLON.IExplorerExtensibilityGroup[];
  2623. onClick: () => void;
  2624. }
  2625. export class SkeletonTreeItemComponent extends React.Component<ISkeletonTreeItemComponentProps> {
  2626. constructor(props: ISkeletonTreeItemComponentProps);
  2627. render(): JSX.Element;
  2628. }
  2629. }
  2630. declare module INSPECTOR {
  2631. interface IBoneTreeItemComponenttProps {
  2632. bone: BABYLON.Bone;
  2633. extensibilityGroups?: BABYLON.IExplorerExtensibilityGroup[];
  2634. onClick: () => void;
  2635. }
  2636. export class BoneTreeItemComponent extends React.Component<IBoneTreeItemComponenttProps> {
  2637. constructor(props: IBoneTreeItemComponenttProps);
  2638. render(): JSX.Element;
  2639. }
  2640. }
  2641. declare module INSPECTOR {
  2642. interface IParticleSystemTreeItemComponentProps {
  2643. system: BABYLON.IParticleSystem;
  2644. extensibilityGroups?: BABYLON.IExplorerExtensibilityGroup[];
  2645. onClick: () => void;
  2646. }
  2647. export class ParticleSystemTreeItemComponent extends React.Component<IParticleSystemTreeItemComponentProps> {
  2648. constructor(props: IParticleSystemTreeItemComponentProps);
  2649. render(): JSX.Element;
  2650. }
  2651. }
  2652. declare module INSPECTOR {
  2653. interface ISpriteManagerTreeItemComponentProps {
  2654. spriteManager: BABYLON.SpriteManager;
  2655. extensibilityGroups?: BABYLON.IExplorerExtensibilityGroup[];
  2656. onClick: () => void;
  2657. }
  2658. export class SpriteManagerTreeItemComponent extends React.Component<ISpriteManagerTreeItemComponentProps> {
  2659. constructor(props: ISpriteManagerTreeItemComponentProps);
  2660. render(): JSX.Element;
  2661. }
  2662. }
  2663. declare module INSPECTOR {
  2664. interface ISpriteTreeItemComponentProps {
  2665. sprite: BABYLON.Sprite;
  2666. extensibilityGroups?: BABYLON.IExplorerExtensibilityGroup[];
  2667. onClick: () => void;
  2668. }
  2669. export class SpriteTreeItemComponent extends React.Component<ISpriteTreeItemComponentProps> {
  2670. constructor(props: ISpriteTreeItemComponentProps);
  2671. render(): JSX.Element;
  2672. }
  2673. }
  2674. declare module INSPECTOR {
  2675. interface ITargetedAnimationItemComponentProps {
  2676. targetedAnimation: BABYLON.TargetedAnimation;
  2677. extensibilityGroups?: BABYLON.IExplorerExtensibilityGroup[];
  2678. onClick: () => void;
  2679. }
  2680. export class TargetedAnimationItemComponent extends React.Component<ITargetedAnimationItemComponentProps> {
  2681. constructor(props: ITargetedAnimationItemComponentProps);
  2682. render(): JSX.Element;
  2683. }
  2684. }
  2685. declare module INSPECTOR {
  2686. interface ISoundTreeItemComponentProps {
  2687. sound: BABYLON.Sound;
  2688. extensibilityGroups?: BABYLON.IExplorerExtensibilityGroup[];
  2689. onClick: () => void;
  2690. }
  2691. export class SoundTreeItemComponent extends React.Component<ISoundTreeItemComponentProps> {
  2692. constructor(props: ISoundTreeItemComponentProps);
  2693. render(): JSX.Element;
  2694. }
  2695. }
  2696. declare module INSPECTOR {
  2697. interface ITreeItemSpecializedComponentProps {
  2698. label: string;
  2699. entity?: any;
  2700. extensibilityGroups?: BABYLON.IExplorerExtensibilityGroup[];
  2701. globalState: GlobalState;
  2702. onClick?: () => void;
  2703. }
  2704. export class TreeItemSpecializedComponent extends React.Component<ITreeItemSpecializedComponentProps> {
  2705. constructor(props: ITreeItemSpecializedComponentProps);
  2706. onClick(): void;
  2707. render(): JSX.Element;
  2708. }
  2709. }
  2710. declare module INSPECTOR {
  2711. export class Tools {
  2712. static LookForItem(item: any, selectedEntity: any): boolean;
  2713. private static _RecursiveRemoveHiddenMeshesAndHoistChildren;
  2714. static SortAndFilter(parent: any, items: any[]): any[];
  2715. }
  2716. }
  2717. declare module INSPECTOR {
  2718. export interface ITreeItemSelectableComponentProps {
  2719. entity: any;
  2720. selectedEntity?: any;
  2721. mustExpand?: boolean;
  2722. offset: number;
  2723. globalState: GlobalState;
  2724. extensibilityGroups?: BABYLON.IExplorerExtensibilityGroup[];
  2725. filter: BABYLON.Nullable<string>;
  2726. }
  2727. export class TreeItemSelectableComponent extends React.Component<ITreeItemSelectableComponentProps, {
  2728. isExpanded: boolean;
  2729. isSelected: boolean;
  2730. }> {
  2731. private _wasSelected;
  2732. constructor(props: ITreeItemSelectableComponentProps);
  2733. switchExpandedState(): void;
  2734. shouldComponentUpdate(nextProps: ITreeItemSelectableComponentProps, nextState: {
  2735. isExpanded: boolean;
  2736. isSelected: boolean;
  2737. }): boolean;
  2738. scrollIntoView(): void;
  2739. componentDidMount(): void;
  2740. componentDidUpdate(): void;
  2741. onSelect(): void;
  2742. renderChildren(): JSX.Element[] | null;
  2743. render(): JSX.Element | null;
  2744. }
  2745. }
  2746. declare module INSPECTOR {
  2747. export interface ITreeItemComponentProps {
  2748. items?: BABYLON.Nullable<any[]>;
  2749. label: string;
  2750. offset: number;
  2751. filter: BABYLON.Nullable<string>;
  2752. forceSubitems?: boolean;
  2753. globalState: GlobalState;
  2754. entity?: any;
  2755. selectedEntity: any;
  2756. extensibilityGroups?: BABYLON.IExplorerExtensibilityGroup[];
  2757. contextMenuItems?: {
  2758. label: string;
  2759. action: () => void;
  2760. }[];
  2761. }
  2762. export class TreeItemComponent extends React.Component<ITreeItemComponentProps, {
  2763. isExpanded: boolean;
  2764. mustExpand: boolean;
  2765. }> {
  2766. static _ContextMenuUniqueIdGenerator: number;
  2767. constructor(props: ITreeItemComponentProps);
  2768. switchExpandedState(): void;
  2769. shouldComponentUpdate(nextProps: ITreeItemComponentProps, nextState: {
  2770. isExpanded: boolean;
  2771. }): boolean;
  2772. expandAll(expand: boolean): void;
  2773. renderContextMenu(): JSX.Element | null;
  2774. render(): JSX.Element;
  2775. }
  2776. }
  2777. declare module INSPECTOR {
  2778. interface ISceneTreeItemComponentProps {
  2779. scene: BABYLON.Scene;
  2780. onRefresh: () => void;
  2781. selectedEntity?: any;
  2782. extensibilityGroups?: BABYLON.IExplorerExtensibilityGroup[];
  2783. onSelectionChangedObservable?: BABYLON.Observable<any>;
  2784. globalState: GlobalState;
  2785. }
  2786. export class SceneTreeItemComponent extends React.Component<ISceneTreeItemComponentProps, {
  2787. isSelected: boolean;
  2788. isInPickingMode: boolean;
  2789. gizmoMode: number;
  2790. }> {
  2791. private _gizmoLayerOnPointerObserver;
  2792. private _onPointerObserver;
  2793. private _onSelectionChangeObserver;
  2794. private _selectedEntity;
  2795. private _posDragEnd;
  2796. private _scaleDragEnd;
  2797. private _rotateDragEnd;
  2798. constructor(props: ISceneTreeItemComponentProps);
  2799. shouldComponentUpdate(nextProps: ISceneTreeItemComponentProps, nextState: {
  2800. isSelected: boolean;
  2801. isInPickingMode: boolean;
  2802. }): boolean;
  2803. componentDidMount(): void;
  2804. componentWillUnmount(): void;
  2805. onSelect(): void;
  2806. onPickingMode(): void;
  2807. setGizmoMode(mode: number): void;
  2808. render(): JSX.Element;
  2809. }
  2810. }
  2811. declare module INSPECTOR {
  2812. interface ISceneExplorerFilterComponentProps {
  2813. onFilter: (filter: string) => void;
  2814. }
  2815. export class SceneExplorerFilterComponent extends React.Component<ISceneExplorerFilterComponentProps> {
  2816. constructor(props: ISceneExplorerFilterComponentProps);
  2817. render(): JSX.Element;
  2818. }
  2819. interface ISceneExplorerComponentProps {
  2820. scene: BABYLON.Scene;
  2821. noCommands?: boolean;
  2822. noHeader?: boolean;
  2823. noExpand?: boolean;
  2824. noClose?: boolean;
  2825. extensibilityGroups?: BABYLON.IExplorerExtensibilityGroup[];
  2826. globalState: GlobalState;
  2827. popupMode?: boolean;
  2828. onPopup?: () => void;
  2829. onClose?: () => void;
  2830. }
  2831. export class SceneExplorerComponent extends React.Component<ISceneExplorerComponentProps, {
  2832. filter: BABYLON.Nullable<string>;
  2833. selectedEntity: any;
  2834. scene: BABYLON.Scene;
  2835. }> {
  2836. private _onSelectionChangeObserver;
  2837. private _onSelectionRenamedObserver;
  2838. private _onNewSceneAddedObserver;
  2839. private _onNewSceneObserver;
  2840. private sceneExplorerRef;
  2841. private _once;
  2842. private _hooked;
  2843. private sceneMutationFunc;
  2844. constructor(props: ISceneExplorerComponentProps);
  2845. processMutation(): void;
  2846. componentDidMount(): void;
  2847. componentWillUnmount(): void;
  2848. filterContent(filter: string): void;
  2849. findSiblings(parent: any, items: any[], target: any, goNext: boolean, data: {
  2850. previousOne?: any;
  2851. found?: boolean;
  2852. }): boolean;
  2853. processKeys(keyEvent: React.KeyboardEvent<HTMLDivElement>): void;
  2854. renderContent(): JSX.Element | null;
  2855. onClose(): void;
  2856. onPopup(): void;
  2857. render(): JSX.Element;
  2858. }
  2859. }
  2860. declare module INSPECTOR {
  2861. interface IEmbedHostComponentProps {
  2862. scene: BABYLON.Scene;
  2863. globalState: GlobalState;
  2864. popupMode: boolean;
  2865. noClose?: boolean;
  2866. noExpand?: boolean;
  2867. onClose: () => void;
  2868. onPopup: () => void;
  2869. extensibilityGroups?: BABYLON.IExplorerExtensibilityGroup[];
  2870. initialTab?: BABYLON.DebugLayerTab;
  2871. }
  2872. export class EmbedHostComponent extends React.Component<IEmbedHostComponentProps> {
  2873. private _once;
  2874. private splitRef;
  2875. private topPartRef;
  2876. private bottomPartRef;
  2877. constructor(props: IEmbedHostComponentProps);
  2878. componentDidMount(): void;
  2879. renderContent(): JSX.Element;
  2880. render(): JSX.Element;
  2881. }
  2882. }
  2883. declare module INSPECTOR {
  2884. export class Inspector {
  2885. private static _SceneExplorerHost;
  2886. private static _ActionTabsHost;
  2887. private static _EmbedHost;
  2888. private static _NewCanvasContainer;
  2889. private static _SceneExplorerWindow;
  2890. private static _ActionTabsWindow;
  2891. private static _EmbedHostWindow;
  2892. private static _Scene;
  2893. private static _OpenedPane;
  2894. private static _OnBeforeRenderObserver;
  2895. static OnSelectionChangeObservable: BABYLON.Observable<any>;
  2896. static OnPropertyChangedObservable: BABYLON.Observable<PropertyChangedEvent>;
  2897. private static _GlobalState;
  2898. static MarkLineContainerTitleForHighlighting(title: string): void;
  2899. static MarkMultipleLineContainerTitlesForHighlighting(titles: string[]): void;
  2900. private static _CopyStyles;
  2901. private static _CreateSceneExplorer;
  2902. private static _CreateActionTabs;
  2903. private static _CreateEmbedHost;
  2904. static _CreatePopup(title: string, windowVariableName: string, width?: number, height?: number, lateBinding?: boolean): HTMLDivElement | null;
  2905. static get IsVisible(): boolean;
  2906. static EarlyAttachToLoader(): void;
  2907. static Show(scene: BABYLON.Scene, userOptions: Partial<BABYLON.IInspectorOptions>): void;
  2908. static _SetNewScene(scene: BABYLON.Scene): void;
  2909. static _CreateCanvasContainer(parentControl: HTMLElement): void;
  2910. private static _DestroyCanvasContainer;
  2911. private static _Cleanup;
  2912. private static _RemoveElementFromDOM;
  2913. static Hide(): void;
  2914. }
  2915. }
  2916. declare module INSPECTOR {
  2917. export interface IIconButtonLineComponentProps {
  2918. icon: string;
  2919. onClick: () => void;
  2920. tooltip: string;
  2921. active?: boolean;
  2922. }
  2923. export class IconButtonLineComponent extends React.Component<IIconButtonLineComponentProps> {
  2924. constructor(props: IIconButtonLineComponentProps);
  2925. render(): JSX.Element;
  2926. }
  2927. }
  2928. declare module INSPECTOR {
  2929. interface IAddAnimationProps {
  2930. isOpen: boolean;
  2931. close: () => void;
  2932. entity: BABYLON.IAnimatable;
  2933. onPropertyChangedObservable?: BABYLON.Observable<PropertyChangedEvent>;
  2934. setNotificationMessage: (message: string) => void;
  2935. finishedUpdate: () => void;
  2936. addedNewAnimation: (animation: BABYLON.Animation) => void;
  2937. fps: number;
  2938. selectedToUpdate?: BABYLON.Animation | undefined;
  2939. }
  2940. /**
  2941. * Controls the creation of a new animation.
  2942. * @property {boolean} isOpen controls if the add animation pannel is open or closed in the editor controls;
  2943. * @property {()=>void} close sends the message to close this panel setting isOpen to false;
  2944. * @property {IAnimatable} entity is the animation object to add the animation to;
  2945. * @property {Observable<PropertyChangedEvent>} onPropertyChangedObservable is the registered observable
  2946. * @property {(message: string) => void} setNotificationMessage sends the message string to display errors on the message box
  2947. * @property {() => void} finishedUpdate tells the parent component the update on the animation collection has completed
  2948. * @property { (animation: BABYLON.Animation) => void} addedNewAnimation sends the animation to the editor to process how its is rendered
  2949. * @property {number} fps Frames per second of the animation.
  2950. * @property {Animation | undefined} selectedToUpdate the selected animation so we can update the renderer curve.
  2951. */
  2952. export class AddAnimation extends React.Component<IAddAnimationProps, {
  2953. animationName: string;
  2954. animationTargetProperty: string;
  2955. animationType: number;
  2956. loopMode: number;
  2957. animationTargetPath: string;
  2958. isUpdating: boolean;
  2959. }> {
  2960. constructor(props: IAddAnimationProps);
  2961. setInitialState(editingAnimation?: BABYLON.Animation): {
  2962. animationName: string;
  2963. animationTargetPath: string;
  2964. animationType: number;
  2965. loopMode: number;
  2966. animationTargetProperty: string;
  2967. isUpdating: boolean;
  2968. };
  2969. /**
  2970. * We decide wether the animation will be added or edited
  2971. * @param prevProps Previous props.
  2972. * @param prevState Previous state.
  2973. */
  2974. componentDidUpdate(prevProps: IAddAnimationProps, prevState: any): void;
  2975. /**
  2976. * Updates the animation with the correct properties
  2977. * Updates its name, loopmode and targetProperty.
  2978. * This allows the edition of the animation in the curve editor.
  2979. * We can only update these props for the animation.
  2980. * Keyframes of course are updated on the curve editor.
  2981. */
  2982. updateAnimation: () => void;
  2983. /**
  2984. * Returns the animation type as string
  2985. * @param type Type of animation so we return a string.
  2986. */
  2987. getTypeAsString(type: number): "Size" | "Color4" | "Vector3" | "Float" | "Quaternion" | "Vector2" | "Color3";
  2988. /**
  2989. * Process the creation of a new animation.
  2990. * We verify is the property to animate is present on the object
  2991. * We verify if the property derives from a correct class *type of animation to add an animation
  2992. * At the end we create an empty animation named animation.
  2993. * The animation keys array is set to empty so we can add keyframes in the editor.
  2994. * We return the animation to the curve editor and update the entity animation collection
  2995. */
  2996. addAnimation: () => void;
  2997. raiseOnPropertyChanged(newValue: BABYLON.Animation[], previousValue: BABYLON.Animation[]): void;
  2998. raiseOnPropertyUpdated(newValue: string | number | undefined, previousValue: string | number, property: string): void;
  2999. handlePathChange: (event: React.ChangeEvent<HTMLInputElement>) => void;
  3000. handleNameChange: (event: React.ChangeEvent<HTMLInputElement>) => void;
  3001. handleTypeChange: (event: React.ChangeEvent<HTMLSelectElement>) => void;
  3002. handlePropertyChange: (event: React.ChangeEvent<HTMLInputElement>) => void;
  3003. handleLoopModeChange: (event: React.ChangeEvent<HTMLSelectElement>) => void;
  3004. render(): JSX.Element;
  3005. }
  3006. }
  3007. declare module INSPECTOR {
  3008. interface IAnchorSvgPointProps {
  3009. control: BABYLON.Vector2;
  3010. anchor: BABYLON.Vector2;
  3011. active: boolean;
  3012. type: string;
  3013. index: string;
  3014. selected: boolean;
  3015. selectControlPoint: (id: string) => void;
  3016. framesInCanvasView: {
  3017. from: number;
  3018. to: number;
  3019. };
  3020. }
  3021. /**
  3022. * Renders the control point to a keyframe.
  3023. * Each keyframe has left and right control points to control de tangent of the curve
  3024. * This controls the inTangent and outTangent values for the keyframe in the animation.
  3025. * @property {Vector2} control is the control point to control de curve tangent
  3026. * @property {Vector2} anchor represents the Keyframe point which acts origin point.
  3027. * @property {boolen} active tells the component if the control point is currently active
  3028. * @property {string} type (left/right) if the control will be the left or right control point
  3029. * @property {boolean} selected if the control point is currently selected. If selected we can move the control point and will become active
  3030. * @property {(id: string) => void;} selectControlPoint sends the id of the control point to the parent component to tell if it is selected
  3031. * @property {{ from: number; to: number }} framesInCanvasView controls from/to which keyframe should the control point can expand and control de curve
  3032. * The frames in canvas tells us how many frames are currently visible in the canvas and therefore control the width of the line between the control and anchor point
  3033. */
  3034. export class AnchorSvgPoint extends React.Component<IAnchorSvgPointProps, {
  3035. visiblePoint: BABYLON.Vector2;
  3036. }> {
  3037. constructor(props: IAnchorSvgPointProps);
  3038. componentDidUpdate(prevProps: IAnchorSvgPointProps, prevState: any): void;
  3039. select: () => void;
  3040. /**
  3041. * Controls where should we render the visible point (representing the control point)
  3042. * The visible control point differs from the control point for UX reasons. The control point
  3043. * expands beyond the visible canvas.
  3044. */
  3045. setVisiblePoint(): BABYLON.Vector2;
  3046. render(): JSX.Element;
  3047. }
  3048. }
  3049. declare module INSPECTOR {
  3050. export interface IKeyframeSvgPoint {
  3051. keyframePoint: BABYLON.Vector2;
  3052. rightControlPoint: BABYLON.Vector2 | null;
  3053. leftControlPoint: BABYLON.Vector2 | null;
  3054. id: string;
  3055. selected: boolean;
  3056. isLeftActive: boolean;
  3057. isRightActive: boolean;
  3058. curveId?: ICurveMetaData;
  3059. }
  3060. export interface ICurveMetaData {
  3061. id: number;
  3062. animationName: string;
  3063. property: string;
  3064. }
  3065. interface IKeyframeSvgPointProps {
  3066. keyframePoint: BABYLON.Vector2;
  3067. leftControlPoint: BABYLON.Vector2 | null;
  3068. rightControlPoint: BABYLON.Vector2 | null;
  3069. id: string;
  3070. selected: boolean;
  3071. selectKeyframe: (id: string, multiselect: boolean) => void;
  3072. selectedControlPoint: (type: string, id: string) => void;
  3073. isLeftActive: boolean;
  3074. isRightActive: boolean;
  3075. framesInCanvasView: {
  3076. from: number;
  3077. to: number;
  3078. };
  3079. }
  3080. /**
  3081. * Renders the Keyframe as an SVG Element for the Canvas component.
  3082. * Holds the two control points to generate the proper curve.
  3083. */
  3084. export class KeyframeSvgPoint extends React.Component<IKeyframeSvgPointProps> {
  3085. constructor(props: IKeyframeSvgPointProps);
  3086. /**
  3087. * Select a keyframe. If the control key is pressed, multiselect keyframes
  3088. * @param e Mouse event
  3089. */
  3090. select: (e: React.MouseEvent<SVGImageElement>) => void;
  3091. /**
  3092. * Send the ID of the selected keyframe
  3093. * @param type Type of selected keyframe
  3094. */
  3095. selectedControlPointId: (type: string) => void;
  3096. render(): JSX.Element;
  3097. }
  3098. }
  3099. declare module INSPECTOR {
  3100. interface ISvgDraggableAreaProps {
  3101. keyframeSvgPoints: IKeyframeSvgPoint[];
  3102. updatePosition: (updatedKeyframe: IKeyframeSvgPoint, id: string) => void;
  3103. scale: number;
  3104. viewBoxScale: number;
  3105. deselectKeyframes: () => void;
  3106. removeSelectedKeyframes: (points: IKeyframeSvgPoint[]) => void;
  3107. panningY: (panningY: number) => void;
  3108. panningX: (panningX: number) => void;
  3109. setCurrentFrame: (direction: number) => void;
  3110. positionCanvas?: BABYLON.Vector2;
  3111. repositionCanvas?: boolean;
  3112. canvasPositionEnded: () => void;
  3113. resetActionableKeyframe: () => void;
  3114. framesInCanvasView: {
  3115. from: number;
  3116. to: number;
  3117. };
  3118. framesResized: number;
  3119. }
  3120. /**
  3121. * The SvgDraggableArea is a wrapper for SVG Canvas the interaction
  3122. *
  3123. * Here we control the drag and key behavior for the SVG components.
  3124. */
  3125. export class SvgDraggableArea extends React.Component<ISvgDraggableAreaProps, {
  3126. panX: number;
  3127. panY: number;
  3128. }> {
  3129. private _active;
  3130. private _isCurrentPointControl;
  3131. private _currentPointId;
  3132. private _draggableArea;
  3133. private _panStart;
  3134. private _panStop;
  3135. private _playheadDrag;
  3136. private _playheadSelected;
  3137. private _movedX;
  3138. private _movedY;
  3139. private _isControlKeyPress;
  3140. readonly _dragBuffer: number;
  3141. readonly _draggingMultiplier: number;
  3142. constructor(props: ISvgDraggableAreaProps);
  3143. /**
  3144. * Listen to key events to be able to drag and set the correct canvas client width
  3145. */
  3146. componentDidMount(): void;
  3147. /**
  3148. * Makes sure the canvas has resposition correctly
  3149. * @param prevProps previous props
  3150. */
  3151. componentDidUpdate(prevProps: ISvgDraggableAreaProps): void;
  3152. /**
  3153. * Identify the type of target of the mouse event
  3154. * @param e SVG Mouse Event
  3155. */
  3156. dragStart: (e: React.MouseEvent<SVGSVGElement, MouseEvent>) => void;
  3157. /**
  3158. * Handle dragging
  3159. * @param e SVG Mouse Event
  3160. */
  3161. drag: (e: React.MouseEvent<SVGSVGElement, MouseEvent>) => void;
  3162. /**
  3163. * Resets the dragging state
  3164. * @param e Drag event
  3165. */
  3166. dragEnd: (e: React.MouseEvent<SVGSVGElement, MouseEvent>) => void;
  3167. /**
  3168. * Gets the current position of the mouse in a SVG Canvas
  3169. * @param e Mouse event
  3170. */
  3171. getMousePosition: (e: React.MouseEvent<SVGSVGElement, MouseEvent>) => BABYLON.Vector2 | undefined;
  3172. /**
  3173. * Handles the canvas panning direction and sets the X and Y values to move the
  3174. * SVG canvas
  3175. */
  3176. panDirection(): void;
  3177. /**
  3178. * Allows dragging
  3179. * @param e Keyboard event
  3180. */
  3181. keyDown(e: KeyboardEvent): void;
  3182. /**
  3183. * Allows multiple selection
  3184. * @param e Keyboard event
  3185. */
  3186. keyUp(e: KeyboardEvent): void;
  3187. /**
  3188. * Focus on the SVG canvas
  3189. * @param e Mouse event
  3190. */
  3191. focus: (e: React.MouseEvent<SVGSVGElement>) => void;
  3192. /**
  3193. * Is the control point active or not
  3194. */
  3195. isNotControlPointActive(): boolean;
  3196. render(): JSX.Element;
  3197. }
  3198. }
  3199. declare module INSPECTOR {
  3200. interface IControlsProps {
  3201. keyframes: BABYLON.IAnimationKey[] | null;
  3202. selected: BABYLON.IAnimationKey | null;
  3203. currentFrame: number;
  3204. onCurrentFrameChange: (frame: number) => void;
  3205. repositionCanvas: (keyframe: BABYLON.IAnimationKey) => void;
  3206. playPause: (direction: number) => void;
  3207. isPlaying: boolean;
  3208. scrollable: React.RefObject<HTMLDivElement>;
  3209. }
  3210. /**
  3211. * The playback controls for the animation editor
  3212. */
  3213. export class Controls extends React.Component<IControlsProps, {
  3214. selected: BABYLON.IAnimationKey;
  3215. playingType: string;
  3216. }> {
  3217. readonly _sizeOfKeyframe: number;
  3218. constructor(props: IControlsProps);
  3219. playBackwards: () => void;
  3220. play: () => void;
  3221. pause: () => void;
  3222. /**
  3223. * Set animation to initial keyframe
  3224. */
  3225. moveToAnimationStart: () => void;
  3226. /**
  3227. * Set animation to the last keyframe
  3228. */
  3229. moveToAnimationEnd: () => void;
  3230. /** Move to next keyframe */
  3231. nextKeyframe: () => void;
  3232. /** Move to previous keyframe */
  3233. previousKeyframe: () => void;
  3234. render(): JSX.Element;
  3235. }
  3236. }
  3237. declare module INSPECTOR {
  3238. interface ITimelineProps {
  3239. keyframes: BABYLON.IAnimationKey[] | null;
  3240. selected: BABYLON.IAnimationKey | null;
  3241. currentFrame: number;
  3242. onCurrentFrameChange: (frame: number) => void;
  3243. onAnimationLimitChange: (limit: number) => void;
  3244. dragKeyframe: (frame: number, index: number) => void;
  3245. playPause: (direction: number) => void;
  3246. isPlaying: boolean;
  3247. animationLimit: number;
  3248. fps: number;
  3249. repositionCanvas: (keyframe: BABYLON.IAnimationKey) => void;
  3250. resizeWindowProportion: number;
  3251. }
  3252. interface ITimelineState {
  3253. selected: BABYLON.IAnimationKey;
  3254. activeKeyframe: number | null;
  3255. start: number;
  3256. end: number;
  3257. scrollWidth: number | undefined;
  3258. selectionLength: number[];
  3259. limitValue: number;
  3260. }
  3261. /**
  3262. * The Timeline for the curve editor
  3263. *
  3264. * Has a scrollbar that can be resized and move to left and right.
  3265. * The timeline does not affect the Canvas but only the frame container.
  3266. */
  3267. export class Timeline extends React.Component<ITimelineProps, ITimelineState> {
  3268. private _scrollable;
  3269. private _scrollbarHandle;
  3270. private _scrollContainer;
  3271. private _inputAnimationLimit;
  3272. private _direction;
  3273. private _scrolling;
  3274. private _shiftX;
  3275. private _active;
  3276. readonly _marginScrollbar: number;
  3277. constructor(props: ITimelineProps);
  3278. /** Listen to keyup events and set the initial lenght of the scrollbar */
  3279. componentDidMount(): void;
  3280. /** Recalculate the scrollwidth if a window resize happens */
  3281. componentDidUpdate(prevProps: ITimelineProps): void;
  3282. /** Remove key event listener */
  3283. componentWillUnmount(): void;
  3284. /**
  3285. * Set component state if enter key is pressed
  3286. * @param event enter key event
  3287. */
  3288. isEnterKeyUp(event: KeyboardEvent): void;
  3289. /**
  3290. * Detect blur event
  3291. * @param event Blur event
  3292. */
  3293. onInputBlur(event: React.FocusEvent<HTMLInputElement>): void;
  3294. /** Set component state (scrollbar width, position, and start and end) */
  3295. setControlState(): void;
  3296. /**
  3297. * Set scrollwidth on the timeline
  3298. * @param {number} start Frame from which the scrollbar should begin.
  3299. * @param {number} end Last frame for the timeline.
  3300. */
  3301. calculateScrollWidth(start: number, end: number): number | undefined;
  3302. /**
  3303. * Play animation backwards
  3304. * @param event Mouse event
  3305. */
  3306. playBackwards(event: React.MouseEvent<HTMLDivElement>): void;
  3307. /**
  3308. * Play animation
  3309. * @param event Mouse event
  3310. */
  3311. play(event: React.MouseEvent<HTMLDivElement>): void;
  3312. /**
  3313. * Pause the animation
  3314. * @param event Mouse event
  3315. */
  3316. pause(event: React.MouseEvent<HTMLDivElement>): void;
  3317. /**
  3318. * Set the selected frame
  3319. * @param event Mouse event
  3320. */
  3321. setCurrentFrame: (event: React.MouseEvent<HTMLDivElement>) => void;
  3322. /**
  3323. * Handles the change of number of frames available in the timeline.
  3324. */
  3325. handleLimitChange(event: React.ChangeEvent<HTMLInputElement>): void;
  3326. /**
  3327. * Starts the scrollbar dragging
  3328. * @param e Mouse event on SVG Element
  3329. */
  3330. dragStart: (e: React.MouseEvent<SVGSVGElement, MouseEvent>) => void;
  3331. /**
  3332. * Update the canvas visible frames while dragging
  3333. * @param e Mouse event
  3334. */
  3335. drag: (e: React.MouseEvent<SVGSVGElement, MouseEvent>) => void;
  3336. /**
  3337. * Check if the frame is being used as a Keyframe by the animation
  3338. * @param frame number of frame
  3339. * @param direction frame increment or decrement
  3340. */
  3341. isFrameBeingUsed(frame: number, direction: number): number | false;
  3342. /**
  3343. * Reset drag state
  3344. * @param e Mouse event on SVG Element
  3345. */
  3346. dragEnd: (e: React.MouseEvent<SVGSVGElement, MouseEvent>) => void;
  3347. /**
  3348. * Change position of the scrollbar
  3349. * @param e Mouse event
  3350. */
  3351. scrollDragStart: (e: React.MouseEvent<HTMLDivElement, MouseEvent>) => void;
  3352. /**
  3353. * Change size of scrollbar
  3354. * @param e Mouse event
  3355. */
  3356. scrollDrag: (e: React.MouseEvent<HTMLDivElement, MouseEvent>) => void;
  3357. /**
  3358. * Reset scroll drag
  3359. * @param e Mouse event
  3360. */
  3361. scrollDragEnd: (e: React.MouseEvent<HTMLDivElement, MouseEvent>) => void;
  3362. /**
  3363. * Sets the start, end and selection length of the scrollbar. This will control the width and
  3364. * height of the scrollbar as well as the number of frames available
  3365. * @param {number} pageX Controls the X axis of the scrollbar movement.
  3366. */
  3367. moveScrollbar(pageX: number): void;
  3368. /**
  3369. * Controls the resizing of the scrollbar from the right handle
  3370. * @param {number} clientX how much mouse has moved
  3371. */
  3372. resizeScrollbarRight(clientX: number): void;
  3373. /**
  3374. * Controls the resizing of the scrollbar from the left handle
  3375. * @param {number} clientX how much mouse has moved
  3376. */
  3377. resizeScrollbarLeft(clientX: number): void;
  3378. /**
  3379. * Returns array with the expected length between two numbers
  3380. * @param start initial visible frame
  3381. * @param stop last visible frame
  3382. */
  3383. range(start: number, end: number): number[];
  3384. /**
  3385. * Get the animation keyframe
  3386. * @param frame Frame
  3387. */
  3388. getKeyframe(frame: number): false | BABYLON.IAnimationKey | undefined;
  3389. /**
  3390. * Get the current animation keyframe
  3391. * @param frame Frame
  3392. */
  3393. getCurrentFrame(frame: number): boolean;
  3394. dragDomFalse: () => boolean;
  3395. render(): JSX.Element;
  3396. }
  3397. }
  3398. declare module INSPECTOR {
  3399. interface IPlayheadProps {
  3400. message: string;
  3401. open: boolean;
  3402. close: () => void;
  3403. }
  3404. /**
  3405. * Renders the notification for the user
  3406. */
  3407. export class Notification extends React.Component<IPlayheadProps> {
  3408. constructor(props: IPlayheadProps);
  3409. render(): JSX.Element;
  3410. }
  3411. }
  3412. declare module INSPECTOR {
  3413. interface IGraphActionsBarProps {
  3414. addKeyframe: () => void;
  3415. removeKeyframe: () => void;
  3416. frameSelectedKeyframes: () => void;
  3417. handleValueChange: (e: React.ChangeEvent<HTMLInputElement>) => void;
  3418. handleFrameChange: (e: React.ChangeEvent<HTMLInputElement>) => void;
  3419. flatTangent: () => void;
  3420. brokeTangents: () => void;
  3421. setLerpToActiveControlPoint: () => void;
  3422. brokenMode: boolean;
  3423. lerpMode: boolean;
  3424. actionableKeyframe: IActionableKeyFrame;
  3425. title: string;
  3426. enabled: boolean;
  3427. setKeyframeValue: (actionableKeyframe: IActionableKeyFrame) => void;
  3428. frameRange: {
  3429. min: number | undefined;
  3430. max: number | undefined;
  3431. };
  3432. }
  3433. /**
  3434. * Has the buttons and actions for the Canvas Graph.
  3435. * Handles input change and actions (flat, broken mode, set linear control points)
  3436. */
  3437. export class GraphActionsBar extends React.Component<IGraphActionsBarProps, {
  3438. frame: string;
  3439. value: string;
  3440. min: number | undefined;
  3441. max: number | undefined;
  3442. }> {
  3443. private _frameInput;
  3444. private _valueInput;
  3445. constructor(props: IGraphActionsBarProps);
  3446. /**
  3447. * Listen to keyup changes to handle if the input event has ended or change
  3448. */
  3449. componentDidMount(): void;
  3450. /**
  3451. * Set the changing state of frame, value and range of the actionablekeyframe
  3452. * @param prevProps previous props
  3453. * @param prevState previous state
  3454. */
  3455. componentDidUpdate(prevProps: IGraphActionsBarProps, prevState: any): void;
  3456. /**
  3457. * Returns the frame and value for the keyframe
  3458. * @param keyframe The keyframe to update
  3459. */
  3460. selectedKeyframeChanged(keyframe: IActionableKeyFrame): {
  3461. frame: string;
  3462. value: string;
  3463. };
  3464. /**
  3465. * Remove listeners
  3466. */
  3467. componentWillUnmount(): void;
  3468. /**
  3469. * Trigger the change on the keyframe
  3470. * @param event Enter keyevent
  3471. */
  3472. isEnterKeyUp(event: KeyboardEvent): void;
  3473. /**
  3474. * Trigger the chnage on the keyframe on blur
  3475. * @param event Focus event
  3476. */
  3477. onBlur: (event: React.FocusEvent<HTMLInputElement>) => void;
  3478. /**
  3479. * Gets the keyframe frame
  3480. */
  3481. getFrame(): string | number;
  3482. /**
  3483. * Gets the keyframe value
  3484. */
  3485. getValue(): string | number;
  3486. /**
  3487. * Set keyframe value state
  3488. * @param e Input event
  3489. */
  3490. handleValueChange: (e: React.ChangeEvent<HTMLInputElement>) => void;
  3491. /**
  3492. * Set the keyframe frame state
  3493. * @param e Input event
  3494. */
  3495. handleFrameChange: (e: React.ChangeEvent<HTMLInputElement>) => void;
  3496. render(): JSX.Element;
  3497. }
  3498. }
  3499. declare module INSPECTOR {
  3500. interface IAnimationListTreeProps {
  3501. isTargetedAnimation: boolean;
  3502. entity: BABYLON.IAnimatable | BABYLON.TargetedAnimation;
  3503. selected: BABYLON.Animation | null;
  3504. onPropertyChangedObservable?: BABYLON.Observable<PropertyChangedEvent>;
  3505. selectAnimation: (selected: BABYLON.Animation, coordinate?: SelectedCoordinate) => void;
  3506. empty: () => void;
  3507. editAnimation: (selected: BABYLON.Animation) => void;
  3508. deselectAnimation: () => void;
  3509. }
  3510. interface Item {
  3511. index: number;
  3512. name: string;
  3513. property: string;
  3514. selected: boolean;
  3515. open: boolean;
  3516. }
  3517. export enum SelectedCoordinate {
  3518. x = 0,
  3519. y = 1,
  3520. z = 2,
  3521. w = 3,
  3522. r = 0,
  3523. g = 1,
  3524. b = 2,
  3525. a = 3,
  3526. width = 0,
  3527. height = 1
  3528. }
  3529. interface ItemCoordinate {
  3530. id: string;
  3531. color: string;
  3532. coordinate: SelectedCoordinate;
  3533. }
  3534. /**
  3535. * Renders a list of current animations.
  3536. */
  3537. export class AnimationListTree extends React.Component<IAnimationListTreeProps, {
  3538. selectedCoordinate: SelectedCoordinate;
  3539. selectedAnimation: number;
  3540. animationList: Item[] | null;
  3541. animations: BABYLON.Nullable<BABYLON.Animation[]> | BABYLON.Animation;
  3542. }> {
  3543. constructor(props: IAnimationListTreeProps);
  3544. /**
  3545. * Set the animation list if has changed properties
  3546. * @param prevProps previous properties
  3547. */
  3548. componentDidUpdate(prevProps: IAnimationListTreeProps): void;
  3549. /**
  3550. * Delete animation from list
  3551. */
  3552. deleteAnimation: () => void;
  3553. /**
  3554. * Update the animations collection
  3555. * @param newValue new animation list
  3556. * @param previousValue previous animation list
  3557. */
  3558. raiseOnPropertyChanged(newValue: BABYLON.Animation[], previousValue: BABYLON.Animation[]): void;
  3559. /**
  3560. * Renders the animation list
  3561. */
  3562. generateList(): Item[] | null;
  3563. /**
  3564. * Open or closes the animation to show its coordinate animations
  3565. * @param index BABYLON.Animation index
  3566. */
  3567. toggleProperty(index: number): void;
  3568. /**
  3569. * Select the animation to render
  3570. * @param animation Selected animation
  3571. * @param coordinate Selected coordinate (x, y, z)
  3572. * @param index Index
  3573. */
  3574. setSelectedCoordinate(animation: BABYLON.Animation, coordinate: SelectedCoordinate, index: number): void;
  3575. /**
  3576. * Renders the coordinate belonging to an animation
  3577. * @param i Index
  3578. * @param animation Selected animation
  3579. * @param coordinate Coordinate name
  3580. * @param color Color identifier
  3581. * @param selectedCoordinate Selected coordinate (x, y, z)
  3582. */
  3583. coordinateItem(i: number, animation: BABYLON.Animation, coordinate: string, color: string, selectedCoordinate: SelectedCoordinate): JSX.Element;
  3584. /**
  3585. * Render animation
  3586. * @param animation selected animations
  3587. * @param i index
  3588. * @param childrenElements its coordinate (x,y,z) animations
  3589. */
  3590. typeAnimationItem(animation: BABYLON.Animation, i: number, childrenElements: ItemCoordinate[]): JSX.Element;
  3591. /**
  3592. * Render animation item
  3593. * @param animation Selected aniamtion
  3594. * @param i index
  3595. */
  3596. setListItem(animation: BABYLON.Animation, i: number): JSX.Element | null;
  3597. render(): JSX.Element;
  3598. }
  3599. }
  3600. declare module INSPECTOR {
  3601. interface ILoadSnippetProps {
  3602. animations: BABYLON.Animation[];
  3603. onPropertyChangedObservable?: BABYLON.Observable<PropertyChangedEvent>;
  3604. lockObject: LockObject;
  3605. globalState: GlobalState;
  3606. snippetServer: string;
  3607. setSnippetId: (id: string) => void;
  3608. entity: BABYLON.IAnimatable | BABYLON.TargetedAnimation;
  3609. setNotificationMessage: (message: string) => void;
  3610. animationsLoaded: (numberOfAnimations: number) => void;
  3611. }
  3612. /**
  3613. * Loads animation locally or from the Babylon.js Snippet Server
  3614. */
  3615. export class LoadSnippet extends React.Component<ILoadSnippetProps, {
  3616. snippetId: string;
  3617. }> {
  3618. private _serverAddress;
  3619. constructor(props: ILoadSnippetProps);
  3620. /**
  3621. * Set the animations snippet id
  3622. * @param value Snippet ID
  3623. */
  3624. change: (value: string) => void;
  3625. /**
  3626. * Select a local file to load animations
  3627. * @param file File name
  3628. */
  3629. loadFromFile: (file: File) => void;
  3630. /**
  3631. * Load animations from server identified with a snippet id
  3632. */
  3633. loadFromSnippet: () => void;
  3634. render(): JSX.Element;
  3635. }
  3636. }
  3637. declare module INSPECTOR {
  3638. interface ISaveSnippetProps {
  3639. animations: BABYLON.Nullable<BABYLON.Animation[]>;
  3640. onPropertyChangedObservable?: BABYLON.Observable<PropertyChangedEvent>;
  3641. lockObject: LockObject;
  3642. globalState: GlobalState;
  3643. snippetServer: string;
  3644. snippetId: string;
  3645. }
  3646. export interface Snippet {
  3647. url: string;
  3648. id: string;
  3649. }
  3650. interface SelectedAnimation {
  3651. id: string;
  3652. name: string;
  3653. index: number;
  3654. selected: boolean;
  3655. }
  3656. /**
  3657. * Saves the animation snippet to the Babylon.js site or downloads the animation file locally
  3658. */
  3659. export class SaveSnippet extends React.Component<ISaveSnippetProps, {
  3660. selectedAnimations: SelectedAnimation[];
  3661. }> {
  3662. constructor(props: ISaveSnippetProps);
  3663. /**
  3664. * Set the selected animations to save
  3665. * @param e Input event
  3666. */
  3667. handleCheckboxChange: (e: React.ChangeEvent<HTMLInputElement>) => void;
  3668. /**
  3669. * Stringify the selected animation
  3670. */
  3671. stringifySelectedAnimations(): string;
  3672. /**
  3673. * Save the selected animations to a local file
  3674. */
  3675. saveToFile: () => void;
  3676. /**
  3677. * Save the selected animations if a snippet ID is set
  3678. */
  3679. saveToSnippet: () => void;
  3680. render(): JSX.Element;
  3681. }
  3682. }
  3683. declare module INSPECTOR {
  3684. interface IEditorControlsProps {
  3685. isTargetedAnimation: boolean;
  3686. entity: BABYLON.IAnimatable | BABYLON.TargetedAnimation;
  3687. selected: BABYLON.Animation | null;
  3688. lockObject: LockObject;
  3689. onPropertyChangedObservable?: BABYLON.Observable<PropertyChangedEvent>;
  3690. setNotificationMessage: (message: string) => void;
  3691. selectAnimation: (selected: BABYLON.Animation, axis?: SelectedCoordinate) => void;
  3692. setFps: (fps: number) => void;
  3693. setIsLooping: () => void;
  3694. globalState: GlobalState;
  3695. snippetServer: string;
  3696. deselectAnimation: () => void;
  3697. fps: number;
  3698. }
  3699. interface IEditorControlsState {
  3700. isAnimationTabOpen: boolean;
  3701. isEditTabOpen: boolean;
  3702. isLoadTabOpen: boolean;
  3703. isSaveTabOpen: boolean;
  3704. isLoopActive: boolean;
  3705. animationsCount: number;
  3706. framesPerSecond: number;
  3707. snippetId: string;
  3708. selected: BABYLON.Animation | undefined;
  3709. }
  3710. /**
  3711. * Renders the Curve Editor controls to create, save, remove, load and edit animations
  3712. */
  3713. export class EditorControls extends React.Component<IEditorControlsProps, IEditorControlsState> {
  3714. constructor(props: IEditorControlsProps);
  3715. /**
  3716. * Makes sure the frames per second receive the updated prop
  3717. * @param prevProps previous properties
  3718. */
  3719. componentDidUpdate(prevProps: IEditorControlsProps): void;
  3720. /**
  3721. * Add the nimation, recounts the list and opens the correct tab
  3722. * @param animation The recently empty created animation
  3723. */
  3724. onAnimationAdded: (animation: BABYLON.Animation) => void;
  3725. /**
  3726. * Set state when the animations list has finished updated
  3727. */
  3728. finishedUpdate: () => void;
  3729. recountAnimations(): number;
  3730. /**
  3731. * Toggles loop
  3732. */
  3733. changeLoopBehavior: () => void;
  3734. /**
  3735. * This avoids using lambda functions in JSX
  3736. */
  3737. handleFirstTab: () => void;
  3738. handleSecondTab: () => void;
  3739. handleThirdTab: () => void;
  3740. handleFourthTab: () => void;
  3741. handleTabs(tab: number): void;
  3742. handleChangeFps: (fps: number) => void;
  3743. /**
  3744. * Cleans the list when has been emptied
  3745. */
  3746. onEmptiedList: () => void;
  3747. /**
  3748. * When animations have been reloaded update tabs
  3749. */
  3750. animationsLoaded: (numberOfAnimations: number) => void;
  3751. /**
  3752. * The currently selected animation to edit it
  3753. * @param selected Selected animation
  3754. */
  3755. editAnimation: (selected: BABYLON.Animation) => void;
  3756. setSnippetId: (id: string) => void;
  3757. /**
  3758. * Marks animation tab closed and hides the tab
  3759. */
  3760. onCloseAddAnimation: () => void;
  3761. render(): JSX.Element;
  3762. }
  3763. }
  3764. declare module INSPECTOR {
  3765. interface ISwitchButtonProps {
  3766. /** Current scale */
  3767. current: CurveScale;
  3768. /** On click change of scale */
  3769. action?: (event: CurveScale) => void;
  3770. }
  3771. /**
  3772. * Displays the current scale
  3773. */
  3774. export class ScaleLabel extends React.Component<ISwitchButtonProps, {
  3775. current: CurveScale;
  3776. }> {
  3777. constructor(props: ISwitchButtonProps);
  3778. renderLabel(scale: CurveScale): "" | "DEG" | "FLT" | "INT" | "RAD";
  3779. onClickHandle: () => void;
  3780. render(): JSX.Element;
  3781. }
  3782. }
  3783. declare module INSPECTOR {
  3784. interface IAnimationCurveEditorComponentProps {
  3785. playOrPause?: () => void;
  3786. scene: BABYLON.Scene;
  3787. entity: BABYLON.IAnimatable | BABYLON.TargetedAnimation;
  3788. lockObject: LockObject;
  3789. globalState: GlobalState;
  3790. }
  3791. /**
  3792. * Represent an Axis of the canvas. This help us control the frame/panning
  3793. */
  3794. interface ICanvasAxis {
  3795. value: number;
  3796. label: number;
  3797. }
  3798. /**
  3799. * This help us identify the type of scaling on the selected animated property
  3800. */
  3801. export enum CurveScale {
  3802. float = 0,
  3803. radians = 1,
  3804. degrees = 2,
  3805. integers = 3,
  3806. default = 4
  3807. }
  3808. /**
  3809. * This represents the visible selected keyframe in the canvas. If the keyframe is selected
  3810. * we should be able to edit the frame and value.
  3811. */
  3812. export interface IActionableKeyFrame {
  3813. frame?: number | string;
  3814. value?: any;
  3815. }
  3816. /**
  3817. * Each curve is an SVG Path. This Interface give us its properties to render on the canvas.
  3818. */
  3819. interface ICurveData {
  3820. pathData: string;
  3821. pathLength: number;
  3822. domCurve: React.RefObject<SVGPathElement>;
  3823. color: string;
  3824. id: string;
  3825. }
  3826. /**
  3827. * The curve editor state
  3828. */
  3829. interface IAnimationCurveEditorComponentState {
  3830. /** If the editor is opened or closed */
  3831. isOpen: boolean;
  3832. /** The currently selected animation from which the curves will render */
  3833. selected: BABYLON.Animation | null;
  3834. /** A list of keyframes to be rendered as SVG Elements in the curve */
  3835. svgKeyframes: IKeyframeSvgPoint[] | undefined;
  3836. /** The current frame in which the playhead is positioned */
  3837. currentFrame: number;
  3838. /** The current value in which the playhead is positioned */
  3839. currentValue: number;
  3840. /** The number of frame in which the current canvas is divided. The helps to render the frames in the graph editor */
  3841. frameAxisLength: ICanvasAxis[];
  3842. /** The number of values in which the current canvas is divided. The helps to render the frames in the graph editor. The current scale decides how these values are rendered*/
  3843. valueAxisLength: ICanvasAxis[];
  3844. /** If the selected keyframe should be treated as a flat tangent curve */
  3845. isFlatTangentMode: boolean;
  3846. /** If the tangent mode is active */
  3847. isTangentMode: boolean;
  3848. /** If the control points are broken or not */
  3849. isBrokenMode: boolean;
  3850. /** If selected keyframe should render its selected control point to be linear or not */
  3851. lerpMode: boolean;
  3852. /** The scale of the canvas */
  3853. scale: number;
  3854. /** The offset of the playhead to position itself on the canvas */
  3855. playheadOffset: number;
  3856. /** The error or warning message to display */
  3857. notification: string;
  3858. /** The current selected point in the SVG curve */
  3859. currentPoint: SVGPoint | undefined;
  3860. /** The start position of the playhead */
  3861. playheadPos: number;
  3862. /** If the animation is playing or not */
  3863. isPlaying: boolean;
  3864. /** The selected curve represented with an array of curves */
  3865. selectedPathData: ICurveData[] | undefined;
  3866. /** The currently selected coordinate of a complex property (i.e. x, y, z) */
  3867. selectedCoordinate: number;
  3868. /** The number of frames available in the canvas timeline*/
  3869. animationLimit: number;
  3870. /** The currently animation frames per second */
  3871. fps: number;
  3872. /** If the animation is set to loop or not while animation is playing */
  3873. isLooping: boolean;
  3874. /** The amount of vertical panning the user has moved the canvas */
  3875. panningY: number;
  3876. /** The amount of horizontal panning the user has moved the canvas */
  3877. panningX: number;
  3878. /** If the canvas has finished repositioned itself */
  3879. repositionCanvas: boolean;
  3880. /** The current selected keyframe on which we can perform actions (update frame and value) */
  3881. actionableKeyframe: IActionableKeyFrame;
  3882. /** The current value scale */
  3883. valueScaleType: CurveScale;
  3884. /** The amount scale to update valyes */
  3885. valueScale: number;
  3886. /** The canvas proportion width */
  3887. canvasLength: number;
  3888. /** The last frame to be created. */
  3889. lastKeyframeCreated: BABYLON.Nullable<string>;
  3890. /** The canvas scale width */
  3891. canvasWidthScale: number;
  3892. /** How the resize of the canvas will change the value axis */
  3893. valuesPositionResize: number;
  3894. /** How many frames are currently visible in the canvas */
  3895. framesInCanvasView: {
  3896. from: number;
  3897. to: number;
  3898. };
  3899. /** Limits the maximum frame from which a keyframe can move in the curve. So it wont overlap the curve*/
  3900. maxFrame: number | undefined;
  3901. /** Limits the minimum frame from which a keyframe can move in the curve. So it wont overlap the curve*/
  3902. minFrame: number | undefined;
  3903. /** How many frames have been increased or reduced on a windows resize event */
  3904. framesResized: number;
  3905. }
  3906. /**
  3907. * BABYLON.Animation curve Editor Component
  3908. * This component allows the use to create animations visualy from the Babylon.js playground.
  3909. * The principal features for the curve editor are:
  3910. * 1. Create animations for the selected entity properties.
  3911. * 2. Edit the animations a selected entity has.
  3912. * 3. You can load and save animations locally and from the snippet server.
  3913. * 4. After creating an animation you need to add keyframes.
  3914. * 5. You can update the frame and value of each frame.
  3915. * @property {() => void} playOrPause is the event to stop or inititate the animation on the playground scene
  3916. * @property {Scene} scene is the scene object from the playground
  3917. * @property {IAnimatable | BABYLON.TargetedAnimation} entity represents the selected entity which will be the animations target
  3918. * @property {LockObject} lockObject the inherited object to lock for modification with the BABYLON.Observable pattern
  3919. * @property {GlobalState} globalState the playground globalstate
  3920. * Check the IAnimationCurveEditorComponentState for state functionality
  3921. */
  3922. export class AnimationCurveEditorComponent extends React.Component<IAnimationCurveEditorComponentProps, IAnimationCurveEditorComponentState> {
  3923. readonly _entityName: string;
  3924. private _snippetUrl;
  3925. private _heightScale;
  3926. private _scaleFactor;
  3927. private _currentScale;
  3928. private _pixelFrameUnit;
  3929. private _svgKeyframes;
  3930. private _isPlaying;
  3931. private _graphCanvas;
  3932. private _editor;
  3933. private _editorWindow;
  3934. private _resizeId;
  3935. private _svgCanvas;
  3936. private _isTargetedAnimation;
  3937. private _resizedTimeline;
  3938. private _onBeforeRenderObserver;
  3939. private _mainAnimatable;
  3940. constructor(props: IAnimationCurveEditorComponentProps);
  3941. componentDidMount(): void;
  3942. /**
  3943. * Connects scene frame with curve editor animation
  3944. * @param prevProps previous Props
  3945. * @param prevState previous State
  3946. */
  3947. componentDidUpdate(prevProps: IAnimationCurveEditorComponentProps, prevState: any): void;
  3948. /**
  3949. * Clean up observer and listeners
  3950. */
  3951. componentWillUnmount(): void;
  3952. /**
  3953. * Set the frame on the animation
  3954. * @param value number of frame to move animation
  3955. */
  3956. onCurrentFrameChangeScene(value: number): void;
  3957. /**
  3958. * Notifications
  3959. * To add notification we set the state and clear to make the notification bar hide.
  3960. */
  3961. clearNotification: () => void;
  3962. /**
  3963. * Zoom and Scroll
  3964. * This section handles zoom and scroll
  3965. * of the graph area.
  3966. */
  3967. zoom: (e: React.WheelEvent<HTMLDivElement>) => void;
  3968. /**
  3969. * Returns Array with labels and values for Frame axis in Canvas
  3970. */
  3971. setFrameAxis(currentLength: number): {
  3972. value: number;
  3973. label: number;
  3974. }[];
  3975. /**
  3976. * Returns Array with labels, lines and values for Value axis in Canvas
  3977. */
  3978. setValueLines(): {
  3979. value: number;
  3980. label: string;
  3981. }[];
  3982. /**
  3983. * Creates a string id from animation name and the keyframe index
  3984. * @param animationName Name of animation
  3985. * @param keyframeIndex Index of keyframe
  3986. */
  3987. encodeCurveId(animationName: string, keyframeIndex: number): string;
  3988. /**
  3989. * Returns the animation keyframe index and the animation selected coordinate (x, y, z)
  3990. * @param id curve id created with index and coordinate of animation
  3991. */
  3992. decodeCurveId(id: string): {
  3993. order: number;
  3994. coordinate: number;
  3995. };
  3996. /**
  3997. * Returns the value from a keyframe
  3998. * @param id curve id
  3999. */
  4000. getKeyframeValueFromAnimation(id: string): {
  4001. frame: number;
  4002. value: number;
  4003. } | undefined;
  4004. /**
  4005. * Keyframe Manipulation
  4006. * This section handles events from SvgDraggableArea.
  4007. * @param id selected keyframe id
  4008. * @param multiselect if we are multiselecting keyframes
  4009. */
  4010. selectKeyframe: (id: string, multiselect: boolean) => void;
  4011. /**
  4012. * Determine if two control points are collinear (flat tangent)
  4013. * @param kf keyframe point
  4014. */
  4015. hasCollinearPoints: (kf: IKeyframeSvgPoint | undefined) => boolean;
  4016. /**
  4017. * Returns the previous and next keyframe from a selected frame.
  4018. * @param frame index of keyframe
  4019. */
  4020. getPreviousAndNextKeyframe: (frame: number) => {
  4021. prev: number | undefined;
  4022. next: number | undefined;
  4023. };
  4024. /**
  4025. * Selects a keyframe in animation based on its Id
  4026. * @param id keyframe id
  4027. * @param actionableKeyframe selected keyframe
  4028. */
  4029. selectKeyframeFromId: (id: string, actionableKeyframe: IActionableKeyFrame) => void;
  4030. /**
  4031. * Resets the current selected keyframe as an updatable pairs by Graph BABYLON.GUI.Control Bar
  4032. */
  4033. resetActionableKeyframe: () => void;
  4034. /**
  4035. * Sets the selected control point.
  4036. * @param type left or right control point
  4037. * @param id id of selected svg keyframe
  4038. */
  4039. selectedControlPoint: (type: string, id: string) => void;
  4040. /**
  4041. * Sets the selected control point.
  4042. */
  4043. deselectKeyframes: () => void;
  4044. /**
  4045. * Update the BABYLON.Animation Key values based on its type
  4046. * @param dataType Type of animated property
  4047. * @param newValue New value of animated property
  4048. * @param coordinate The selected property coordinate to animate (i.e. x, y, z)
  4049. */
  4050. updateValuePerCoordinate(dataType: number, value: number | BABYLON.Vector2 | BABYLON.Vector3 | BABYLON.Color3 | BABYLON.Color4 | BABYLON.Size | BABYLON.Quaternion, newValue: number, coordinate?: number): number | BABYLON.Vector3 | BABYLON.Quaternion | BABYLON.Color3 | BABYLON.Color4 | BABYLON.Vector2 | BABYLON.Size;
  4051. /**
  4052. * BABYLON.Animation should always have a keyframe at Frame Zero
  4053. * @param keys BABYLON.Animation key collection
  4054. */
  4055. forceFrameZeroToExist(keys: BABYLON.IAnimationKey[]): void;
  4056. /**
  4057. * Renders SVG points with dragging of the curve
  4058. * @param updatedSvgKeyFrame selected keyframe to update
  4059. * @param id curve id where the keyframe is localted
  4060. */
  4061. renderPoints: (updatedSvgKeyFrame: IKeyframeSvgPoint, id: string) => void;
  4062. /**
  4063. * Updates the left control point on render points
  4064. * @param updatedSvgKeyFrame selected svg keyframe
  4065. * @param key animation key to update
  4066. * @param dataType type of animation
  4067. * @param coordinate coordinate to change its value (x, y, or z)
  4068. */
  4069. updateLeftControlPoint(updatedSvgKeyFrame: IKeyframeSvgPoint, key: BABYLON.IAnimationKey, dataType: number, coordinate: number): void;
  4070. /**
  4071. * Updates the right control point on render points
  4072. * @param updatedSvgKeyFrame selected svg keyframe
  4073. * @param key animation key to update
  4074. * @param dataType type of animation
  4075. * @param coordinate coordinate to change its value (x, y, or z)
  4076. */
  4077. updateRightControlPoint(updatedSvgKeyFrame: IKeyframeSvgPoint, key: BABYLON.IAnimationKey, dataType: number, coordinate: number): void;
  4078. /**
  4079. * Get the current BABYLON.GUI.Control Point weight (how far the X value is multiplied)
  4080. * @param updatedSvgKeyFrame svg keyframe from which to calculate the distance to control point
  4081. */
  4082. getControlPointWeight(updatedSvgKeyFrame: IKeyframeSvgPoint): number;
  4083. /**
  4084. * Handles a Frame selection change
  4085. * @event event input event to change frame value
  4086. */
  4087. handleFrameChange: (event: React.ChangeEvent<HTMLInputElement>) => void;
  4088. /**
  4089. * Handles how a value change on a selected frame
  4090. * @event event input event to change the value of the keyframe
  4091. */
  4092. handleValueChange: (event: React.ChangeEvent<HTMLInputElement>) => void;
  4093. /**
  4094. * Set the Keyframe from input control in Graph BABYLON.GUI.Control Bar
  4095. * @param actionableKeyframe selected keyframe
  4096. */
  4097. setKeyframeValueFromInput: (actionableKeyframe: IActionableKeyFrame) => void;
  4098. /**
  4099. * Sets the SVG Keyframe value
  4100. * Finds the selected svg keyframe and passes the correct value to the correct animated keyframe.
  4101. */
  4102. setKeyframeValue: () => void;
  4103. /**
  4104. * Set the flat tangent to the current selected control points.
  4105. * get the selected control point and updates its tangent to flat the tangent
  4106. */
  4107. setFlatTangent: () => void;
  4108. /**
  4109. * Sets Broken mode of lines
  4110. * Broken mode enables control points not to be connected on drag
  4111. */
  4112. setBrokenMode: () => void;
  4113. /**
  4114. * Sets a control point to be a linear interpolation with its Keyframe
  4115. * If left or right control point is selected, sets the Tangent value to match the next keyframe and become linear
  4116. */
  4117. setLerpToActiveControlPoint: () => void;
  4118. /**
  4119. * Adds a new keyframe to the curve on canvas click
  4120. */
  4121. addKeyframeClick: () => void;
  4122. /**
  4123. * Remove keyframe on click
  4124. */
  4125. removeKeyframeClick: () => void;
  4126. /**
  4127. * Remove the selected keyframes
  4128. * @param points the selected keyframes to remove
  4129. */
  4130. removeKeyframes: (points: IKeyframeSvgPoint[]) => void;
  4131. /**
  4132. * Adds a keyframe
  4133. * @event event Mouse click event to generate new keyframe
  4134. */
  4135. addKeyFrame(event: React.MouseEvent<SVGSVGElement>): void;
  4136. /**
  4137. * Curve Rendering Functions
  4138. * This section handles how to render curves.
  4139. * @param point point in canvas
  4140. * @param index index of svg
  4141. */
  4142. setKeyframePointLinear(point: BABYLON.Vector2, index: number): void;
  4143. /**
  4144. * Flats the tangents of the selected keyframes
  4145. * @param keyframes Selected keyframes to flat its tangents
  4146. * @param dataType Type of animated property
  4147. */
  4148. flatTangents(keyframes: BABYLON.IAnimationKey[], dataType: number): BABYLON.IAnimationKey[];
  4149. /**
  4150. * Return a Keyframe zero value depending on Type
  4151. * @param dataType Type of animated property
  4152. */
  4153. returnZero(dataType: number): 0 | BABYLON.Vector3 | BABYLON.Quaternion | BABYLON.Color3 | BABYLON.Color4 | BABYLON.Vector2 | BABYLON.Size;
  4154. /**
  4155. * Return the keyframe value as an array depending on type
  4156. * @param valueType type of animated property
  4157. * @param value the value of the property
  4158. */
  4159. getValueAsArray(valueType: number, value: number | BABYLON.Vector2 | BABYLON.Vector3 | BABYLON.Color3 | BABYLON.Color4 | BABYLON.Size | BABYLON.Quaternion): number[];
  4160. /**
  4161. * Sets the keyframe value as an array depending on type
  4162. * @param valueType type of animated property
  4163. * @param arrayValue array to place the correct value
  4164. */
  4165. setValueAsType(valueType: number, arrayValue: number[]): number | BABYLON.Vector3 | BABYLON.Quaternion | BABYLON.Color3 | BABYLON.Color4 | BABYLON.Vector2 | BABYLON.Size;
  4166. /**
  4167. * Returns the SVG Path Data to render the curve
  4168. * @param animation The animation object from where to get its keyframes
  4169. */
  4170. getPathData(animation: BABYLON.Animation | null): ICurveData[] | undefined;
  4171. /**
  4172. * Gets the selected animation properties
  4173. * @param animation BABYLON.Animation
  4174. */
  4175. getAnimationData(animation: BABYLON.Animation): {
  4176. loopMode: number | undefined;
  4177. name: string;
  4178. blendingSpeed: number;
  4179. targetPropertyPath: string[];
  4180. targetProperty: string;
  4181. framesPerSecond: number;
  4182. highestFrame: number;
  4183. usesTangents: boolean;
  4184. easingType: string | undefined;
  4185. easingMode: number | undefined;
  4186. valueType: number;
  4187. };
  4188. /**
  4189. * Calculate the correct tangents to be linear
  4190. * @param keyframes the animation keyframes
  4191. */
  4192. calculateLinearTangents(keyframes: BABYLON.IAnimationKey[]): BABYLON.IAnimationKey[];
  4193. /**
  4194. * Calculates the proper linear tangents if there is no tangents defined
  4195. * Before calculation of svg path we need to calculate the proper tangents
  4196. * @param keyframes the animation keyframes
  4197. * @param data initial svg path
  4198. * @param middle the middle of the canvas to draw the curve
  4199. * @param type type of animation
  4200. * @param coordinate (x, y, z) value
  4201. * @param animationName The animation name to generate the curve id
  4202. */
  4203. curvePathWithoutTangents(keyframes: BABYLON.IAnimationKey[], data: string, middle: number, type: number, coordinate: number, animationName: string): string;
  4204. /**
  4205. * Calculates the curve data and control points for animation
  4206. * @param keyframes the animation keyframes
  4207. * @param data initial svg path
  4208. * @param middle the middle of the canvas to draw the curve
  4209. * @param type type of animation
  4210. * @param coordinate (x, y, z) value
  4211. * @param animationName The animation name to generate the curve id
  4212. */
  4213. curvePathWithTangents(keyframes: BABYLON.IAnimationKey[], data: string, middle: number, type: number, coordinate: number, animationName: string): string;
  4214. /**
  4215. * Calculates a curve path from predefined easing function
  4216. * @param keyframes animation keyframes
  4217. * @param data the initial svg path
  4218. * @param middle the center of the canvas
  4219. * @param easingFunction the easing function to calculate the curve from (easing function should generate the correct curve)
  4220. */
  4221. curvePath(keyframes: BABYLON.IAnimationKey[], data: string, middle: number, easingFunction: BABYLON.EasingFunction): string;
  4222. /**
  4223. * Sets the proper SVG Keyframe points
  4224. * @param controlPoints array of points to generate the svg keyframe collection
  4225. * @param index index of the animation
  4226. * @param keyframesCount How many keyframes should we process
  4227. */
  4228. setKeyframePoint(controlPoints: BABYLON.Vector2[], index: number, keyframesCount: number): void;
  4229. /**
  4230. * Creates curve based on interpolated points
  4231. * @param p0 starting point of curve
  4232. * @param p1 first control point
  4233. * @param u distance between p0 and p3 as percentage to affect p1
  4234. * @param p2 second control point
  4235. * @param v distance between p0 and p3 as percentage to affect p2
  4236. * @param p3 finish point of curve
  4237. */
  4238. interpolateControlPoints(p0: BABYLON.Vector2, p1: BABYLON.Vector2, u: number, p2: BABYLON.Vector2, v: number, p3: BABYLON.Vector2): BABYLON.Vector2[] | undefined;
  4239. /**
  4240. * Deselects the current animations
  4241. */
  4242. deselectAnimation: () => void;
  4243. /**
  4244. * Remove all curves from canvas
  4245. */
  4246. cleanCanvas: () => void;
  4247. /**
  4248. * Selects the animation and renders the curve
  4249. * @param animation the animation to select and render as curve
  4250. * @param coordinate the property coordinate (x, y, z) to represent as curve
  4251. */
  4252. selectAnimation: (animation: BABYLON.Animation, coordinate?: SelectedCoordinate | undefined) => void;
  4253. /**
  4254. * Set the state for the last selected keyframe
  4255. */
  4256. postSelectionEvents: () => void;
  4257. /**
  4258. * Set main animatable to play or pause the animation
  4259. */
  4260. setMainAnimatable(): void;
  4261. /**
  4262. * Check if animation is playing
  4263. */
  4264. isAnimationPlaying(): boolean;
  4265. /**
  4266. * Stops the current playing animation
  4267. */
  4268. stopAnimation(): void;
  4269. /**
  4270. * Set if animation is looping and stops animation after it
  4271. */
  4272. setIsLooping: () => void;
  4273. setFramesPerSecond: (fps: number) => void;
  4274. /**
  4275. * Check if the animation has easing predefined
  4276. */
  4277. analyzeAnimationForLerp(animation: BABYLON.Animation | null): boolean;
  4278. /**
  4279. * Change the current frame in the canvas and timeline
  4280. * @param frame value to update on canvas and timeline
  4281. */
  4282. changeCurrentFrame: (frame: number) => void;
  4283. /**
  4284. * Calculate the value of the selected frame in curve
  4285. * @param frame the frame to calculate its current value on the curve
  4286. */
  4287. calculateCurrentPointInCurve: (frame: number) => number | undefined;
  4288. /**
  4289. * Center the position the canvas depending on Keyframe value and frame
  4290. * @param keyframe the keyframe to set as middle point
  4291. */
  4292. setCanvasPosition: (keyframe: BABYLON.IAnimationKey) => void;
  4293. /**
  4294. * Sets the current frame
  4295. * @param frame the value to set the frame
  4296. */
  4297. setCurrentFrame: (frame: number) => void;
  4298. /**
  4299. * Change the timeline animation frame limit
  4300. */
  4301. changeAnimationLimit: (limit: number) => void;
  4302. /**
  4303. * Update the frame in the selected Keyframe
  4304. */
  4305. updateFrameInKeyFrame: (frame: number, index: number) => void;
  4306. /**
  4307. * Plays or pauses the animation
  4308. * @param direction 0 stops the animation, 1 starts the animation, -1 plays animation backwards
  4309. */
  4310. playPause: (direction: number) => void;
  4311. /**
  4312. * Set the frame to selected position on canvas
  4313. * @event e click event on the SVG canvas
  4314. */
  4315. moveFrameTo(e: React.MouseEvent<SVGRectElement, MouseEvent>): void;
  4316. /**
  4317. * Register the observables for the state
  4318. */
  4319. registerObs(): void;
  4320. /**
  4321. * Checks if the current frame macthes the parameter
  4322. * @param frame The frame to check
  4323. */
  4324. isCurrentFrame(frame: number): boolean;
  4325. /**
  4326. * Set the Vertical Panning State
  4327. * @param panningY the vertical panning value
  4328. */
  4329. setPanningY: (panningY: number) => void;
  4330. /**
  4331. * Set the Vertical Panning State
  4332. * @param panningX the horizontal panning value
  4333. */
  4334. setPanningX: (panningX: number) => void;
  4335. /**
  4336. * Set state when canvas has been respositioned
  4337. */
  4338. canvasPositionEnded: () => void;
  4339. /**
  4340. *
  4341. * @param message The message to display in the notification bar
  4342. */
  4343. setNotificationMessage: (message: string) => void;
  4344. /**
  4345. * Zoom or frame the selected keyframes in the available canvas space
  4346. */
  4347. frameSelectedKeyframes: () => void;
  4348. /**
  4349. * Handle the frames quantity and scale on Window resize width
  4350. */
  4351. onWindowResizeWidth: () => void;
  4352. /**
  4353. * Set the state of frames Resized on window resize event
  4354. * @param framesResized how many frame have been added or removed on resize
  4355. */
  4356. onWindowEndResize: (framesResized: number) => void;
  4357. /** Resizes the width of the timeline */
  4358. onTimelineResize: () => void;
  4359. render(): JSX.Element;
  4360. }
  4361. }
  4362. declare module INSPECTOR {
  4363. interface IPlayheadProps {
  4364. frame: number;
  4365. offset: number;
  4366. onCurrentFrameChange: (frame: number) => void;
  4367. }
  4368. /**
  4369. * Renders the Playhead
  4370. */
  4371. export class Playhead extends React.Component<IPlayheadProps> {
  4372. private _direction;
  4373. private _active;
  4374. constructor(props: IPlayheadProps);
  4375. dragStart(e: React.TouchEvent<HTMLDivElement>): void;
  4376. dragStart(e: React.MouseEvent<HTMLDivElement, MouseEvent>): void;
  4377. drag(e: React.TouchEvent<HTMLDivElement>): void;
  4378. drag(e: React.MouseEvent<HTMLDivElement, MouseEvent>): void;
  4379. dragEnd(e: React.TouchEvent<HTMLDivElement>): void;
  4380. dragEnd(e: React.MouseEvent<HTMLDivElement, MouseEvent>): void;
  4381. calculateMove(): string;
  4382. render(): JSX.Element;
  4383. }
  4384. }
  4385. declare module INSPECTOR {
  4386. export const Contrast: IToolData;
  4387. }