babylon.inspector.d.ts 169 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400
  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. renderTextures(onDebugSelectionChangeObservable: BABYLON.Observable<TextureLinkLineComponent>): JSX.Element;
  1182. render(): JSX.Element;
  1183. }
  1184. }
  1185. declare module INSPECTOR {
  1186. interface IRadioButtonLineComponentProps {
  1187. onSelectionChangedObservable: BABYLON.Observable<RadioButtonLineComponent>;
  1188. label: string;
  1189. isSelected: () => boolean;
  1190. onSelect: () => void;
  1191. }
  1192. export class RadioButtonLineComponent extends React.Component<IRadioButtonLineComponentProps, {
  1193. isSelected: boolean;
  1194. }> {
  1195. private _onSelectionChangedObserver;
  1196. constructor(props: IRadioButtonLineComponentProps);
  1197. componentDidMount(): void;
  1198. componentWillUnmount(): void;
  1199. onChange(): void;
  1200. render(): JSX.Element;
  1201. }
  1202. }
  1203. declare module INSPECTOR {
  1204. interface IFogPropertyGridComponentProps {
  1205. globalState: GlobalState;
  1206. scene: BABYLON.Scene;
  1207. lockObject: LockObject;
  1208. onPropertyChangedObservable?: BABYLON.Observable<PropertyChangedEvent>;
  1209. }
  1210. export class FogPropertyGridComponent extends React.Component<IFogPropertyGridComponentProps, {
  1211. mode: number;
  1212. }> {
  1213. constructor(props: IFogPropertyGridComponentProps);
  1214. render(): JSX.Element;
  1215. }
  1216. }
  1217. declare module INSPECTOR {
  1218. interface IScenePropertyGridComponentProps {
  1219. globalState: GlobalState;
  1220. scene: BABYLON.Scene;
  1221. lockObject: LockObject;
  1222. onPropertyChangedObservable?: BABYLON.Observable<PropertyChangedEvent>;
  1223. onSelectionChangedObservable?: BABYLON.Observable<any>;
  1224. }
  1225. export class ScenePropertyGridComponent extends React.Component<IScenePropertyGridComponentProps> {
  1226. private _storedEnvironmentTexture;
  1227. private _renderingModeGroupObservable;
  1228. constructor(props: IScenePropertyGridComponentProps);
  1229. setRenderingModes(point: boolean, wireframe: boolean): void;
  1230. switchIBL(): void;
  1231. updateEnvironmentTexture(file: File): void;
  1232. updateGravity(newValue: BABYLON.Vector3): void;
  1233. updateTimeStep(newValue: number): void;
  1234. normalizeScene(): void;
  1235. render(): JSX.Element;
  1236. }
  1237. }
  1238. declare module INSPECTOR {
  1239. interface ICommonLightPropertyGridComponentProps {
  1240. globalState: GlobalState;
  1241. light: BABYLON.Light;
  1242. lockObject: LockObject;
  1243. onPropertyChangedObservable?: BABYLON.Observable<PropertyChangedEvent>;
  1244. }
  1245. export class CommonLightPropertyGridComponent extends React.Component<ICommonLightPropertyGridComponentProps> {
  1246. constructor(props: ICommonLightPropertyGridComponentProps);
  1247. render(): JSX.Element;
  1248. }
  1249. }
  1250. declare module INSPECTOR {
  1251. interface IHemisphericLightPropertyGridComponentProps {
  1252. globalState: GlobalState;
  1253. light: BABYLON.HemisphericLight;
  1254. lockObject: LockObject;
  1255. onPropertyChangedObservable?: BABYLON.Observable<PropertyChangedEvent>;
  1256. }
  1257. export class HemisphericLightPropertyGridComponent extends React.Component<IHemisphericLightPropertyGridComponentProps> {
  1258. constructor(props: IHemisphericLightPropertyGridComponentProps);
  1259. render(): JSX.Element;
  1260. }
  1261. }
  1262. declare module INSPECTOR {
  1263. interface ICommonShadowLightPropertyGridComponentProps {
  1264. globalState: GlobalState;
  1265. light: BABYLON.IShadowLight;
  1266. lockObject: LockObject;
  1267. onPropertyChangedObservable?: BABYLON.Observable<PropertyChangedEvent>;
  1268. }
  1269. export class CommonShadowLightPropertyGridComponent extends React.Component<ICommonShadowLightPropertyGridComponentProps> {
  1270. private _internals;
  1271. constructor(props: ICommonShadowLightPropertyGridComponentProps);
  1272. createShadowGenerator(): void;
  1273. disposeShadowGenerator(): void;
  1274. render(): JSX.Element;
  1275. }
  1276. }
  1277. declare module INSPECTOR {
  1278. interface IPointLightPropertyGridComponentProps {
  1279. globalState: GlobalState;
  1280. light: BABYLON.PointLight;
  1281. lockObject: LockObject;
  1282. onPropertyChangedObservable?: BABYLON.Observable<PropertyChangedEvent>;
  1283. }
  1284. export class PointLightPropertyGridComponent extends React.Component<IPointLightPropertyGridComponentProps> {
  1285. constructor(props: IPointLightPropertyGridComponentProps);
  1286. render(): JSX.Element;
  1287. }
  1288. }
  1289. declare module INSPECTOR {
  1290. interface IHexLineComponentProps {
  1291. label: string;
  1292. target: any;
  1293. propertyName: string;
  1294. lockObject?: LockObject;
  1295. onChange?: (newValue: number) => void;
  1296. isInteger?: boolean;
  1297. replaySourceReplacement?: string;
  1298. onPropertyChangedObservable?: BABYLON.Observable<PropertyChangedEvent>;
  1299. additionalClass?: string;
  1300. step?: string;
  1301. digits?: number;
  1302. useEuler?: boolean;
  1303. min?: number;
  1304. }
  1305. export class HexLineComponent extends React.Component<IHexLineComponentProps, {
  1306. value: string;
  1307. }> {
  1308. private _localChange;
  1309. private _store;
  1310. private _propertyChange;
  1311. constructor(props: IHexLineComponentProps);
  1312. componentWillUnmount(): void;
  1313. shouldComponentUpdate(nextProps: IHexLineComponentProps, nextState: {
  1314. value: string;
  1315. }): boolean;
  1316. raiseOnPropertyChanged(newValue: number, previousValue: number): void;
  1317. convertToHexString(valueString: string): string;
  1318. updateValue(valueString: string, raisePropertyChanged: boolean): void;
  1319. lock(): void;
  1320. unlock(): void;
  1321. render(): JSX.Element;
  1322. }
  1323. }
  1324. declare module INSPECTOR {
  1325. interface ICommonCameraPropertyGridComponentProps {
  1326. globalState: GlobalState;
  1327. camera: BABYLON.Camera;
  1328. lockObject: LockObject;
  1329. onPropertyChangedObservable?: BABYLON.Observable<PropertyChangedEvent>;
  1330. }
  1331. export class CommonCameraPropertyGridComponent extends React.Component<ICommonCameraPropertyGridComponentProps, {
  1332. mode: number;
  1333. }> {
  1334. constructor(props: ICommonCameraPropertyGridComponentProps);
  1335. render(): JSX.Element;
  1336. }
  1337. }
  1338. declare module INSPECTOR {
  1339. interface IFreeCameraPropertyGridComponentProps {
  1340. globalState: GlobalState;
  1341. camera: BABYLON.FreeCamera;
  1342. lockObject: LockObject;
  1343. onPropertyChangedObservable?: BABYLON.Observable<PropertyChangedEvent>;
  1344. }
  1345. export class FreeCameraPropertyGridComponent extends React.Component<IFreeCameraPropertyGridComponentProps> {
  1346. constructor(props: IFreeCameraPropertyGridComponentProps);
  1347. render(): JSX.Element;
  1348. }
  1349. }
  1350. declare module INSPECTOR {
  1351. interface IArcRotateCameraPropertyGridComponentProps {
  1352. globalState: GlobalState;
  1353. camera: BABYLON.ArcRotateCamera;
  1354. lockObject: LockObject;
  1355. onPropertyChangedObservable?: BABYLON.Observable<PropertyChangedEvent>;
  1356. }
  1357. export class ArcRotateCameraPropertyGridComponent extends React.Component<IArcRotateCameraPropertyGridComponentProps> {
  1358. constructor(props: IArcRotateCameraPropertyGridComponentProps);
  1359. render(): JSX.Element;
  1360. }
  1361. }
  1362. declare module INSPECTOR {
  1363. interface IIndentedTextLineComponentProps {
  1364. value?: string;
  1365. color?: string;
  1366. underline?: boolean;
  1367. onLink?: () => void;
  1368. url?: string;
  1369. additionalClass?: string;
  1370. }
  1371. export class IndentedTextLineComponent extends React.Component<IIndentedTextLineComponentProps> {
  1372. constructor(props: IIndentedTextLineComponentProps);
  1373. onLink(): void;
  1374. renderContent(): JSX.Element;
  1375. render(): JSX.Element;
  1376. }
  1377. }
  1378. declare module INSPECTOR {
  1379. interface ICommonPropertyGridComponentProps {
  1380. globalState: GlobalState;
  1381. host: {
  1382. metadata: any;
  1383. };
  1384. lockObject: LockObject;
  1385. onPropertyChangedObservable?: BABYLON.Observable<PropertyChangedEvent>;
  1386. }
  1387. export class CommonPropertyGridComponent extends React.Component<ICommonPropertyGridComponentProps> {
  1388. constructor(props: ICommonPropertyGridComponentProps);
  1389. renderLevel(jsonObject: any): JSX.Element[];
  1390. render(): JSX.Element | null;
  1391. }
  1392. }
  1393. declare module INSPECTOR {
  1394. interface IVariantsPropertyGridComponentProps {
  1395. globalState: GlobalState;
  1396. host: any;
  1397. lockObject: LockObject;
  1398. onPropertyChangedObservable?: BABYLON.Observable<PropertyChangedEvent>;
  1399. }
  1400. export class VariantsPropertyGridComponent extends React.Component<IVariantsPropertyGridComponentProps> {
  1401. constructor(props: IVariantsPropertyGridComponentProps);
  1402. private _getVariantsExtension;
  1403. render(): JSX.Element | null;
  1404. }
  1405. }
  1406. declare module INSPECTOR {
  1407. interface IMeshPropertyGridComponentProps {
  1408. globalState: GlobalState;
  1409. mesh: BABYLON.Mesh;
  1410. lockObject: LockObject;
  1411. onSelectionChangedObservable?: BABYLON.Observable<any>;
  1412. onPropertyChangedObservable?: BABYLON.Observable<PropertyChangedEvent>;
  1413. }
  1414. export class MeshPropertyGridComponent extends React.Component<IMeshPropertyGridComponentProps, {
  1415. displayNormals: boolean;
  1416. displayVertexColors: boolean;
  1417. displayBoneWeights: boolean;
  1418. displayBoneIndex: number;
  1419. displaySkeletonMap: boolean;
  1420. }> {
  1421. constructor(props: IMeshPropertyGridComponentProps);
  1422. renderWireframeOver(): void;
  1423. renderNormalVectors(): void;
  1424. displayNormals(): void;
  1425. displayVertexColors(): void;
  1426. displayBoneWeights(): void;
  1427. displaySkeletonMap(): void;
  1428. onBoneDisplayIndexChange(value: number): void;
  1429. onMaterialLink(): void;
  1430. onSourceMeshLink(): void;
  1431. onSkeletonLink(): void;
  1432. convertPhysicsTypeToString(): string;
  1433. render(): JSX.Element;
  1434. }
  1435. }
  1436. declare module INSPECTOR {
  1437. interface ITransformNodePropertyGridComponentProps {
  1438. globalState: GlobalState;
  1439. transformNode: BABYLON.TransformNode;
  1440. lockObject: LockObject;
  1441. onPropertyChangedObservable?: BABYLON.Observable<PropertyChangedEvent>;
  1442. }
  1443. export class TransformNodePropertyGridComponent extends React.Component<ITransformNodePropertyGridComponentProps> {
  1444. constructor(props: ITransformNodePropertyGridComponentProps);
  1445. render(): JSX.Element;
  1446. }
  1447. }
  1448. declare module INSPECTOR {
  1449. interface IBackgroundMaterialPropertyGridComponentProps {
  1450. globalState: GlobalState;
  1451. material: BABYLON.BackgroundMaterial;
  1452. lockObject: LockObject;
  1453. onSelectionChangedObservable?: BABYLON.Observable<any>;
  1454. onPropertyChangedObservable?: BABYLON.Observable<PropertyChangedEvent>;
  1455. }
  1456. export class BackgroundMaterialPropertyGridComponent extends React.Component<IBackgroundMaterialPropertyGridComponentProps> {
  1457. private _onDebugSelectionChangeObservable;
  1458. constructor(props: IBackgroundMaterialPropertyGridComponentProps);
  1459. renderTextures(): JSX.Element;
  1460. render(): JSX.Element;
  1461. }
  1462. }
  1463. declare module INSPECTOR {
  1464. interface ICommonControlPropertyGridComponentProps {
  1465. globalState: GlobalState;
  1466. control: BABYLON.GUI.Control;
  1467. lockObject: LockObject;
  1468. onPropertyChangedObservable?: BABYLON.Observable<PropertyChangedEvent>;
  1469. }
  1470. export class CommonControlPropertyGridComponent extends React.Component<ICommonControlPropertyGridComponentProps> {
  1471. constructor(props: ICommonControlPropertyGridComponentProps);
  1472. renderGridInformation(): JSX.Element | null;
  1473. render(): JSX.Element;
  1474. }
  1475. }
  1476. declare module INSPECTOR {
  1477. interface IControlPropertyGridComponentProps {
  1478. globalState: GlobalState;
  1479. control: BABYLON.GUI.Control;
  1480. lockObject: LockObject;
  1481. onPropertyChangedObservable?: BABYLON.Observable<PropertyChangedEvent>;
  1482. }
  1483. export class ControlPropertyGridComponent extends React.Component<IControlPropertyGridComponentProps> {
  1484. constructor(props: IControlPropertyGridComponentProps);
  1485. render(): JSX.Element;
  1486. }
  1487. }
  1488. declare module INSPECTOR {
  1489. interface ITextBlockPropertyGridComponentProps {
  1490. globalState: GlobalState;
  1491. textBlock: BABYLON.GUI.TextBlock;
  1492. lockObject: LockObject;
  1493. onPropertyChangedObservable?: BABYLON.Observable<PropertyChangedEvent>;
  1494. }
  1495. export class TextBlockPropertyGridComponent extends React.Component<ITextBlockPropertyGridComponentProps> {
  1496. constructor(props: ITextBlockPropertyGridComponentProps);
  1497. render(): JSX.Element;
  1498. }
  1499. }
  1500. declare module INSPECTOR {
  1501. interface IInputTextPropertyGridComponentProps {
  1502. globalState: GlobalState;
  1503. inputText: BABYLON.GUI.InputText;
  1504. lockObject: LockObject;
  1505. onPropertyChangedObservable?: BABYLON.Observable<PropertyChangedEvent>;
  1506. }
  1507. export class InputTextPropertyGridComponent extends React.Component<IInputTextPropertyGridComponentProps> {
  1508. constructor(props: IInputTextPropertyGridComponentProps);
  1509. render(): JSX.Element;
  1510. }
  1511. }
  1512. declare module INSPECTOR {
  1513. interface IColorPickerPropertyGridComponentProps {
  1514. globalState: GlobalState;
  1515. colorPicker: BABYLON.GUI.ColorPicker;
  1516. lockObject: LockObject;
  1517. onPropertyChangedObservable?: BABYLON.Observable<PropertyChangedEvent>;
  1518. }
  1519. export class ColorPickerPropertyGridComponent extends React.Component<IColorPickerPropertyGridComponentProps> {
  1520. constructor(props: IColorPickerPropertyGridComponentProps);
  1521. render(): JSX.Element;
  1522. }
  1523. }
  1524. declare module INSPECTOR {
  1525. interface IAnimationGroupGridComponentProps {
  1526. globalState: GlobalState;
  1527. animationGroup: BABYLON.AnimationGroup;
  1528. scene: BABYLON.Scene;
  1529. lockObject: LockObject;
  1530. onPropertyChangedObservable?: BABYLON.Observable<PropertyChangedEvent>;
  1531. }
  1532. export class AnimationGroupGridComponent extends React.Component<IAnimationGroupGridComponentProps, {
  1533. playButtonText: string;
  1534. currentFrame: number;
  1535. }> {
  1536. private _onAnimationGroupPlayObserver;
  1537. private _onAnimationGroupPauseObserver;
  1538. private _onBeforeRenderObserver;
  1539. private timelineRef;
  1540. constructor(props: IAnimationGroupGridComponentProps);
  1541. disconnect(animationGroup: BABYLON.AnimationGroup): void;
  1542. connect(animationGroup: BABYLON.AnimationGroup): void;
  1543. updateCurrentFrame(animationGroup: BABYLON.AnimationGroup): void;
  1544. shouldComponentUpdate(nextProps: IAnimationGroupGridComponentProps): boolean;
  1545. componentWillUnmount(): void;
  1546. playOrPause(): void;
  1547. onCurrentFrameChange(value: number): void;
  1548. render(): JSX.Element;
  1549. }
  1550. }
  1551. declare module INSPECTOR {
  1552. interface IImagePropertyGridComponentProps {
  1553. globalState: GlobalState;
  1554. image: BABYLON.GUI.Image;
  1555. lockObject: LockObject;
  1556. onPropertyChangedObservable?: BABYLON.Observable<PropertyChangedEvent>;
  1557. }
  1558. export class ImagePropertyGridComponent extends React.Component<IImagePropertyGridComponentProps> {
  1559. constructor(props: IImagePropertyGridComponentProps);
  1560. render(): JSX.Element;
  1561. }
  1562. }
  1563. declare module INSPECTOR {
  1564. interface ISliderPropertyGridComponentProps {
  1565. globalState: GlobalState;
  1566. slider: BABYLON.GUI.Slider;
  1567. lockObject: LockObject;
  1568. onPropertyChangedObservable?: BABYLON.Observable<PropertyChangedEvent>;
  1569. }
  1570. export class SliderPropertyGridComponent extends React.Component<ISliderPropertyGridComponentProps> {
  1571. constructor(props: ISliderPropertyGridComponentProps);
  1572. render(): JSX.Element;
  1573. }
  1574. }
  1575. declare module INSPECTOR {
  1576. interface IImageBasedSliderPropertyGridComponentProps {
  1577. globalState: GlobalState;
  1578. imageBasedSlider: BABYLON.GUI.ImageBasedSlider;
  1579. lockObject: LockObject;
  1580. onPropertyChangedObservable?: BABYLON.Observable<PropertyChangedEvent>;
  1581. }
  1582. export class ImageBasedSliderPropertyGridComponent extends React.Component<IImageBasedSliderPropertyGridComponentProps> {
  1583. constructor(props: IImageBasedSliderPropertyGridComponentProps);
  1584. render(): JSX.Element;
  1585. }
  1586. }
  1587. declare module INSPECTOR {
  1588. interface IRectanglePropertyGridComponentProps {
  1589. globalState: GlobalState;
  1590. rectangle: BABYLON.GUI.Rectangle;
  1591. lockObject: LockObject;
  1592. onPropertyChangedObservable?: BABYLON.Observable<PropertyChangedEvent>;
  1593. }
  1594. export class RectanglePropertyGridComponent extends React.Component<IRectanglePropertyGridComponentProps> {
  1595. constructor(props: IRectanglePropertyGridComponentProps);
  1596. render(): JSX.Element;
  1597. }
  1598. }
  1599. declare module INSPECTOR {
  1600. interface IEllipsePropertyGridComponentProps {
  1601. globalState: GlobalState;
  1602. ellipse: BABYLON.GUI.Ellipse;
  1603. lockObject: LockObject;
  1604. onPropertyChangedObservable?: BABYLON.Observable<PropertyChangedEvent>;
  1605. }
  1606. export class EllipsePropertyGridComponent extends React.Component<IEllipsePropertyGridComponentProps> {
  1607. constructor(props: IEllipsePropertyGridComponentProps);
  1608. render(): JSX.Element;
  1609. }
  1610. }
  1611. declare module INSPECTOR {
  1612. interface ICheckboxPropertyGridComponentProps {
  1613. globalState: GlobalState;
  1614. checkbox: BABYLON.GUI.Checkbox;
  1615. lockObject: LockObject;
  1616. onPropertyChangedObservable?: BABYLON.Observable<PropertyChangedEvent>;
  1617. }
  1618. export class CheckboxPropertyGridComponent extends React.Component<ICheckboxPropertyGridComponentProps> {
  1619. constructor(props: ICheckboxPropertyGridComponentProps);
  1620. render(): JSX.Element;
  1621. }
  1622. }
  1623. declare module INSPECTOR {
  1624. interface IRadioButtonPropertyGridComponentProps {
  1625. globalState: GlobalState;
  1626. radioButton: BABYLON.GUI.RadioButton;
  1627. lockObject: LockObject;
  1628. onPropertyChangedObservable?: BABYLON.Observable<PropertyChangedEvent>;
  1629. }
  1630. export class RadioButtonPropertyGridComponent extends React.Component<IRadioButtonPropertyGridComponentProps> {
  1631. constructor(props: IRadioButtonPropertyGridComponentProps);
  1632. render(): JSX.Element;
  1633. }
  1634. }
  1635. declare module INSPECTOR {
  1636. interface ILinePropertyGridComponentProps {
  1637. globalState: GlobalState;
  1638. line: BABYLON.GUI.Line;
  1639. lockObject: LockObject;
  1640. onPropertyChangedObservable?: BABYLON.Observable<PropertyChangedEvent>;
  1641. }
  1642. export class LinePropertyGridComponent extends React.Component<ILinePropertyGridComponentProps> {
  1643. constructor(props: ILinePropertyGridComponentProps);
  1644. onDashChange(value: string): void;
  1645. render(): JSX.Element;
  1646. }
  1647. }
  1648. declare module INSPECTOR {
  1649. interface IScrollViewerPropertyGridComponentProps {
  1650. globalState: GlobalState;
  1651. scrollViewer: BABYLON.GUI.ScrollViewer;
  1652. lockObject: LockObject;
  1653. onPropertyChangedObservable?: BABYLON.Observable<PropertyChangedEvent>;
  1654. }
  1655. export class ScrollViewerPropertyGridComponent extends React.Component<IScrollViewerPropertyGridComponentProps> {
  1656. constructor(props: IScrollViewerPropertyGridComponentProps);
  1657. render(): JSX.Element;
  1658. }
  1659. }
  1660. declare module INSPECTOR {
  1661. interface IGridPropertyGridComponentProps {
  1662. globalState: GlobalState;
  1663. grid: BABYLON.GUI.Grid;
  1664. lockObject: LockObject;
  1665. onPropertyChangedObservable?: BABYLON.Observable<PropertyChangedEvent>;
  1666. }
  1667. export class GridPropertyGridComponent extends React.Component<IGridPropertyGridComponentProps> {
  1668. constructor(props: IGridPropertyGridComponentProps);
  1669. renderRows(): JSX.Element[];
  1670. renderColumns(): JSX.Element[];
  1671. render(): JSX.Element;
  1672. }
  1673. }
  1674. declare module INSPECTOR {
  1675. interface IPBRMetallicRoughnessMaterialPropertyGridComponentProps {
  1676. globalState: GlobalState;
  1677. material: BABYLON.PBRMetallicRoughnessMaterial;
  1678. lockObject: LockObject;
  1679. onSelectionChangedObservable?: BABYLON.Observable<any>;
  1680. onPropertyChangedObservable?: BABYLON.Observable<PropertyChangedEvent>;
  1681. }
  1682. export class PBRMetallicRoughnessMaterialPropertyGridComponent extends React.Component<IPBRMetallicRoughnessMaterialPropertyGridComponentProps> {
  1683. private _onDebugSelectionChangeObservable;
  1684. constructor(props: IPBRMetallicRoughnessMaterialPropertyGridComponentProps);
  1685. renderTextures(): JSX.Element;
  1686. render(): JSX.Element;
  1687. }
  1688. }
  1689. declare module INSPECTOR {
  1690. interface IPBRSpecularGlossinessMaterialPropertyGridComponentProps {
  1691. globalState: GlobalState;
  1692. material: BABYLON.PBRSpecularGlossinessMaterial;
  1693. lockObject: LockObject;
  1694. onSelectionChangedObservable?: BABYLON.Observable<any>;
  1695. onPropertyChangedObservable?: BABYLON.Observable<PropertyChangedEvent>;
  1696. }
  1697. export class PBRSpecularGlossinessMaterialPropertyGridComponent extends React.Component<IPBRSpecularGlossinessMaterialPropertyGridComponentProps> {
  1698. private _onDebugSelectionChangeObservable;
  1699. constructor(props: IPBRSpecularGlossinessMaterialPropertyGridComponentProps);
  1700. renderTextures(): JSX.Element;
  1701. render(): JSX.Element;
  1702. }
  1703. }
  1704. declare module INSPECTOR {
  1705. interface IStackPanelPropertyGridComponentProps {
  1706. globalState: GlobalState;
  1707. stackPanel: BABYLON.GUI.StackPanel;
  1708. lockObject: LockObject;
  1709. onPropertyChangedObservable?: BABYLON.Observable<PropertyChangedEvent>;
  1710. }
  1711. export class StackPanelPropertyGridComponent extends React.Component<IStackPanelPropertyGridComponentProps> {
  1712. constructor(props: IStackPanelPropertyGridComponentProps);
  1713. render(): JSX.Element;
  1714. }
  1715. }
  1716. declare module INSPECTOR {
  1717. interface ICommonPostProcessPropertyGridComponentProps {
  1718. globalState: GlobalState;
  1719. postProcess: BABYLON.PostProcess;
  1720. lockObject: LockObject;
  1721. onPropertyChangedObservable?: BABYLON.Observable<PropertyChangedEvent>;
  1722. }
  1723. export class CommonPostProcessPropertyGridComponent extends React.Component<ICommonPostProcessPropertyGridComponentProps> {
  1724. constructor(props: ICommonPostProcessPropertyGridComponentProps);
  1725. render(): JSX.Element;
  1726. }
  1727. }
  1728. declare module INSPECTOR {
  1729. interface IPostProcessPropertyGridComponentProps {
  1730. globalState: GlobalState;
  1731. postProcess: BABYLON.PostProcess;
  1732. lockObject: LockObject;
  1733. onPropertyChangedObservable?: BABYLON.Observable<PropertyChangedEvent>;
  1734. }
  1735. export class PostProcessPropertyGridComponent extends React.Component<IPostProcessPropertyGridComponentProps> {
  1736. constructor(props: IPostProcessPropertyGridComponentProps);
  1737. edit(): void;
  1738. render(): JSX.Element;
  1739. }
  1740. }
  1741. declare module INSPECTOR {
  1742. interface ICommonRenderingPipelinePropertyGridComponentProps {
  1743. globalState: GlobalState;
  1744. renderPipeline: BABYLON.PostProcessRenderPipeline;
  1745. lockObject: LockObject;
  1746. onPropertyChangedObservable?: BABYLON.Observable<PropertyChangedEvent>;
  1747. }
  1748. export class CommonRenderingPipelinePropertyGridComponent extends React.Component<ICommonRenderingPipelinePropertyGridComponentProps> {
  1749. constructor(props: ICommonRenderingPipelinePropertyGridComponentProps);
  1750. render(): JSX.Element;
  1751. }
  1752. }
  1753. declare module INSPECTOR {
  1754. interface IRenderingPipelinePropertyGridComponentProps {
  1755. globalState: GlobalState;
  1756. renderPipeline: BABYLON.PostProcessRenderPipeline;
  1757. lockObject: LockObject;
  1758. onPropertyChangedObservable?: BABYLON.Observable<PropertyChangedEvent>;
  1759. }
  1760. export class RenderingPipelinePropertyGridComponent extends React.Component<IRenderingPipelinePropertyGridComponentProps> {
  1761. constructor(props: IRenderingPipelinePropertyGridComponentProps);
  1762. render(): JSX.Element;
  1763. }
  1764. }
  1765. declare module INSPECTOR {
  1766. interface IDefaultRenderingPipelinePropertyGridComponentProps {
  1767. globalState: GlobalState;
  1768. renderPipeline: BABYLON.DefaultRenderingPipeline;
  1769. lockObject: LockObject;
  1770. onPropertyChangedObservable?: BABYLON.Observable<PropertyChangedEvent>;
  1771. }
  1772. export class DefaultRenderingPipelinePropertyGridComponent extends React.Component<IDefaultRenderingPipelinePropertyGridComponentProps> {
  1773. constructor(props: IDefaultRenderingPipelinePropertyGridComponentProps);
  1774. render(): JSX.Element;
  1775. }
  1776. }
  1777. declare module INSPECTOR {
  1778. interface ISSAORenderingPipelinePropertyGridComponentProps {
  1779. globalState: GlobalState;
  1780. renderPipeline: BABYLON.SSAORenderingPipeline;
  1781. lockObject: LockObject;
  1782. onPropertyChangedObservable?: BABYLON.Observable<PropertyChangedEvent>;
  1783. }
  1784. export class SSAORenderingPipelinePropertyGridComponent extends React.Component<ISSAORenderingPipelinePropertyGridComponentProps> {
  1785. constructor(props: ISSAORenderingPipelinePropertyGridComponentProps);
  1786. render(): JSX.Element;
  1787. }
  1788. }
  1789. declare module INSPECTOR {
  1790. interface ISSAO2RenderingPipelinePropertyGridComponentProps {
  1791. globalState: GlobalState;
  1792. renderPipeline: BABYLON.SSAO2RenderingPipeline;
  1793. lockObject: LockObject;
  1794. onPropertyChangedObservable?: BABYLON.Observable<PropertyChangedEvent>;
  1795. }
  1796. export class SSAO2RenderingPipelinePropertyGridComponent extends React.Component<ISSAO2RenderingPipelinePropertyGridComponentProps> {
  1797. constructor(props: ISSAO2RenderingPipelinePropertyGridComponentProps);
  1798. render(): JSX.Element;
  1799. }
  1800. }
  1801. declare module INSPECTOR {
  1802. interface ISkeletonPropertyGridComponentProps {
  1803. globalState: GlobalState;
  1804. skeleton: BABYLON.Skeleton;
  1805. lockObject: LockObject;
  1806. onPropertyChangedObservable?: BABYLON.Observable<PropertyChangedEvent>;
  1807. }
  1808. export class SkeletonPropertyGridComponent extends React.Component<ISkeletonPropertyGridComponentProps> {
  1809. private _skeletonViewersEnabled;
  1810. private _skeletonViewerDisplayOptions;
  1811. private _skeletonViewers;
  1812. constructor(props: ISkeletonPropertyGridComponentProps);
  1813. switchSkeletonViewers(): void;
  1814. checkSkeletonViewerState(props: ISkeletonPropertyGridComponentProps): void;
  1815. changeDisplayMode(): void;
  1816. changeDisplayOptions(option: string, value: number): void;
  1817. shouldComponentUpdate(nextProps: ISkeletonPropertyGridComponentProps): boolean;
  1818. onOverrideMeshLink(): void;
  1819. render(): JSX.Element;
  1820. }
  1821. }
  1822. declare module INSPECTOR {
  1823. interface IBonePropertyGridComponentProps {
  1824. globalState: GlobalState;
  1825. bone: BABYLON.Bone;
  1826. lockObject: LockObject;
  1827. onPropertyChangedObservable?: BABYLON.Observable<PropertyChangedEvent>;
  1828. }
  1829. export class BonePropertyGridComponent extends React.Component<IBonePropertyGridComponentProps> {
  1830. constructor(props: IBonePropertyGridComponentProps);
  1831. onTransformNodeLink(): void;
  1832. render(): JSX.Element;
  1833. }
  1834. }
  1835. declare module INSPECTOR {
  1836. interface IDirectionalLightPropertyGridComponentProps {
  1837. globalState: GlobalState;
  1838. light: BABYLON.DirectionalLight;
  1839. lockObject: LockObject;
  1840. onPropertyChangedObservable?: BABYLON.Observable<PropertyChangedEvent>;
  1841. }
  1842. export class DirectionalLightPropertyGridComponent extends React.Component<IDirectionalLightPropertyGridComponentProps> {
  1843. constructor(props: IDirectionalLightPropertyGridComponentProps);
  1844. render(): JSX.Element;
  1845. }
  1846. }
  1847. declare module INSPECTOR {
  1848. interface ISpotLightPropertyGridComponentProps {
  1849. globalState: GlobalState;
  1850. light: BABYLON.SpotLight;
  1851. lockObject: LockObject;
  1852. onPropertyChangedObservable?: BABYLON.Observable<PropertyChangedEvent>;
  1853. }
  1854. export class SpotLightPropertyGridComponent extends React.Component<ISpotLightPropertyGridComponentProps> {
  1855. constructor(props: ISpotLightPropertyGridComponentProps);
  1856. render(): JSX.Element;
  1857. }
  1858. }
  1859. declare module INSPECTOR {
  1860. interface ILenstRenderingPipelinePropertyGridComponentProps {
  1861. globalState: GlobalState;
  1862. renderPipeline: BABYLON.LensRenderingPipeline;
  1863. lockObject: LockObject;
  1864. onPropertyChangedObservable?: BABYLON.Observable<PropertyChangedEvent>;
  1865. }
  1866. export class LensRenderingPipelinePropertyGridComponent extends React.Component<ILenstRenderingPipelinePropertyGridComponentProps> {
  1867. constructor(props: ILenstRenderingPipelinePropertyGridComponentProps);
  1868. render(): JSX.Element;
  1869. }
  1870. }
  1871. declare module INSPECTOR {
  1872. interface IVector4LineComponentProps {
  1873. label: string;
  1874. target: any;
  1875. propertyName: string;
  1876. step?: number;
  1877. onChange?: (newvalue: BABYLON.Vector4) => void;
  1878. useEuler?: boolean;
  1879. onPropertyChangedObservable?: BABYLON.Observable<PropertyChangedEvent>;
  1880. }
  1881. export class Vector4LineComponent extends React.Component<IVector4LineComponentProps, {
  1882. isExpanded: boolean;
  1883. value: BABYLON.Vector4;
  1884. }> {
  1885. static defaultProps: {
  1886. step: number;
  1887. };
  1888. private _localChange;
  1889. constructor(props: IVector4LineComponentProps);
  1890. getCurrentValue(): any;
  1891. shouldComponentUpdate(nextProps: IVector4LineComponentProps, nextState: {
  1892. isExpanded: boolean;
  1893. value: BABYLON.Vector4;
  1894. }): boolean;
  1895. switchExpandState(): void;
  1896. raiseOnPropertyChanged(previousValue: BABYLON.Vector4): void;
  1897. updateVector4(): void;
  1898. updateStateX(value: number): void;
  1899. updateStateY(value: number): void;
  1900. updateStateZ(value: number): void;
  1901. updateStateW(value: number): void;
  1902. render(): JSX.Element;
  1903. }
  1904. }
  1905. declare module INSPECTOR {
  1906. export interface IColor4LineComponentProps {
  1907. label: string;
  1908. target: any;
  1909. propertyName: string;
  1910. onPropertyChangedObservable?: BABYLON.Observable<PropertyChangedEvent>;
  1911. onChange?: () => void;
  1912. isLinear?: boolean;
  1913. }
  1914. export class Color4LineComponent extends React.Component<IColor4LineComponentProps, {
  1915. isExpanded: boolean;
  1916. color: BABYLON.Color4;
  1917. }> {
  1918. private _localChange;
  1919. constructor(props: IColor4LineComponentProps);
  1920. shouldComponentUpdate(nextProps: IColor4LineComponentProps, nextState: {
  1921. color: BABYLON.Color4;
  1922. }): boolean;
  1923. setPropertyValue(newColor: BABYLON.Color4): void;
  1924. onChange(newValue: string): void;
  1925. switchExpandState(): void;
  1926. raiseOnPropertyChanged(previousValue: BABYLON.Color4): void;
  1927. updateStateR(value: number): void;
  1928. updateStateG(value: number): void;
  1929. updateStateB(value: number): void;
  1930. updateStateA(value: number): void;
  1931. copyToClipboard(): void;
  1932. render(): JSX.Element;
  1933. }
  1934. }
  1935. declare module INSPECTOR {
  1936. interface IGradientStepComponentProps {
  1937. globalState: GlobalState;
  1938. step: BABYLON.GradientBlockColorStep;
  1939. lineIndex: number;
  1940. onDelete: () => void;
  1941. onUpdateStep: () => void;
  1942. onCheckForReOrder: () => void;
  1943. onCopy?: () => void;
  1944. }
  1945. export class GradientStepComponent extends React.Component<IGradientStepComponentProps, {
  1946. gradient: number;
  1947. }> {
  1948. constructor(props: IGradientStepComponentProps);
  1949. updateColor(color: string): void;
  1950. updateStep(gradient: number): void;
  1951. onPointerUp(): void;
  1952. render(): JSX.Element;
  1953. }
  1954. }
  1955. declare module INSPECTOR {
  1956. export interface IPropertyComponentProps {
  1957. globalState: GlobalState;
  1958. block: BABYLON.NodeMaterialBlock;
  1959. }
  1960. }
  1961. declare module INSPECTOR {
  1962. export class GradientPropertyTabComponent extends React.Component<IPropertyComponentProps> {
  1963. private _gradientBlock;
  1964. constructor(props: IPropertyComponentProps);
  1965. forceRebuild(): void;
  1966. deleteStep(step: BABYLON.GradientBlockColorStep): void;
  1967. copyStep(step: BABYLON.GradientBlockColorStep): void;
  1968. addNewStep(): void;
  1969. checkForReOrder(): void;
  1970. render(): JSX.Element;
  1971. }
  1972. }
  1973. declare module INSPECTOR {
  1974. interface INodeMaterialPropertyGridComponentProps {
  1975. globalState: GlobalState;
  1976. material: BABYLON.NodeMaterial;
  1977. lockObject: LockObject;
  1978. onSelectionChangedObservable?: BABYLON.Observable<any>;
  1979. onPropertyChangedObservable?: BABYLON.Observable<PropertyChangedEvent>;
  1980. }
  1981. export class NodeMaterialPropertyGridComponent extends React.Component<INodeMaterialPropertyGridComponentProps> {
  1982. private _onDebugSelectionChangeObservable;
  1983. constructor(props: INodeMaterialPropertyGridComponentProps);
  1984. edit(): void;
  1985. renderTextures(): JSX.Element | null;
  1986. renderInputBlock(block: BABYLON.InputBlock): JSX.Element | null;
  1987. renderInputValues(): JSX.Element;
  1988. render(): JSX.Element;
  1989. }
  1990. }
  1991. declare module INSPECTOR {
  1992. interface IMultiMaterialPropertyGridComponentProps {
  1993. globalState: GlobalState;
  1994. material: BABYLON.MultiMaterial;
  1995. lockObject: LockObject;
  1996. onSelectionChangedObservable?: BABYLON.Observable<any>;
  1997. onPropertyChangedObservable?: BABYLON.Observable<PropertyChangedEvent>;
  1998. }
  1999. export class MultiMaterialPropertyGridComponent extends React.Component<IMultiMaterialPropertyGridComponentProps> {
  2000. constructor(props: IMultiMaterialPropertyGridComponentProps);
  2001. onMaterialLink(mat: BABYLON.Material): void;
  2002. renderChildMaterial(): JSX.Element;
  2003. render(): JSX.Element;
  2004. }
  2005. }
  2006. declare module INSPECTOR {
  2007. interface IBoxEmitterGridComponentProps {
  2008. globalState: GlobalState;
  2009. emitter: BABYLON.BoxParticleEmitter;
  2010. onPropertyChangedObservable?: BABYLON.Observable<PropertyChangedEvent>;
  2011. }
  2012. export class BoxEmitterGridComponent extends React.Component<IBoxEmitterGridComponentProps> {
  2013. constructor(props: IBoxEmitterGridComponentProps);
  2014. render(): JSX.Element;
  2015. }
  2016. }
  2017. declare module INSPECTOR {
  2018. interface IConeEmitterGridComponentProps {
  2019. globalState: GlobalState;
  2020. emitter: BABYLON.ConeParticleEmitter;
  2021. onSelectionChangedObservable?: BABYLON.Observable<any>;
  2022. onPropertyChangedObservable?: BABYLON.Observable<PropertyChangedEvent>;
  2023. }
  2024. export class ConeEmitterGridComponent extends React.Component<IConeEmitterGridComponentProps> {
  2025. constructor(props: IConeEmitterGridComponentProps);
  2026. render(): JSX.Element;
  2027. }
  2028. }
  2029. declare module INSPECTOR {
  2030. interface ICylinderEmitterGridComponentProps {
  2031. globalState: GlobalState;
  2032. emitter: BABYLON.CylinderParticleEmitter;
  2033. lockObject: LockObject;
  2034. onPropertyChangedObservable?: BABYLON.Observable<PropertyChangedEvent>;
  2035. }
  2036. export class CylinderEmitterGridComponent extends React.Component<ICylinderEmitterGridComponentProps> {
  2037. constructor(props: ICylinderEmitterGridComponentProps);
  2038. render(): JSX.Element;
  2039. }
  2040. }
  2041. declare module INSPECTOR {
  2042. interface IHemisphericEmitterGridComponentProps {
  2043. globalState: GlobalState;
  2044. emitter: BABYLON.HemisphericParticleEmitter;
  2045. lockObject: LockObject;
  2046. onPropertyChangedObservable?: BABYLON.Observable<PropertyChangedEvent>;
  2047. }
  2048. export class HemisphericEmitterGridComponent extends React.Component<IHemisphericEmitterGridComponentProps> {
  2049. constructor(props: IHemisphericEmitterGridComponentProps);
  2050. render(): JSX.Element;
  2051. }
  2052. }
  2053. declare module INSPECTOR {
  2054. interface IPointEmitterGridComponentProps {
  2055. globalState: GlobalState;
  2056. emitter: BABYLON.PointParticleEmitter;
  2057. lockObject: LockObject;
  2058. onPropertyChangedObservable?: BABYLON.Observable<PropertyChangedEvent>;
  2059. }
  2060. export class PointEmitterGridComponent extends React.Component<IPointEmitterGridComponentProps> {
  2061. constructor(props: IPointEmitterGridComponentProps);
  2062. render(): JSX.Element;
  2063. }
  2064. }
  2065. declare module INSPECTOR {
  2066. interface ISphereEmitterGridComponentProps {
  2067. globalState: GlobalState;
  2068. emitter: BABYLON.SphereParticleEmitter;
  2069. lockObject: LockObject;
  2070. onPropertyChangedObservable?: BABYLON.Observable<PropertyChangedEvent>;
  2071. }
  2072. export class SphereEmitterGridComponent extends React.Component<ISphereEmitterGridComponentProps> {
  2073. constructor(props: ISphereEmitterGridComponentProps);
  2074. render(): JSX.Element;
  2075. }
  2076. }
  2077. declare module INSPECTOR {
  2078. interface IMeshPickerComponentProps {
  2079. globalState: GlobalState;
  2080. target: any;
  2081. property: string;
  2082. scene: BABYLON.Scene;
  2083. label: string;
  2084. onPropertyChangedObservable?: BABYLON.Observable<PropertyChangedEvent>;
  2085. }
  2086. export class MeshPickerComponent extends React.Component<IMeshPickerComponentProps> {
  2087. constructor(props: IMeshPickerComponentProps);
  2088. render(): JSX.Element;
  2089. }
  2090. }
  2091. declare module INSPECTOR {
  2092. interface IMeshEmitterGridComponentProps {
  2093. globalState: GlobalState;
  2094. emitter: BABYLON.MeshParticleEmitter;
  2095. scene: BABYLON.Scene;
  2096. lockObject: LockObject;
  2097. onSelectionChangedObservable?: BABYLON.Observable<any>;
  2098. onPropertyChangedObservable?: BABYLON.Observable<PropertyChangedEvent>;
  2099. }
  2100. export class MeshEmitterGridComponent extends React.Component<IMeshEmitterGridComponentProps> {
  2101. constructor(props: IMeshEmitterGridComponentProps);
  2102. render(): JSX.Element;
  2103. }
  2104. }
  2105. declare module INSPECTOR {
  2106. interface IFactorGradientStepGridComponent {
  2107. globalState: GlobalState;
  2108. gradient: BABYLON.FactorGradient;
  2109. lockObject: LockObject;
  2110. lineIndex: number;
  2111. onDelete: () => void;
  2112. onUpdateGradient: () => void;
  2113. onCheckForReOrder: () => void;
  2114. host: BABYLON.IParticleSystem;
  2115. codeRecorderPropertyName: string;
  2116. }
  2117. export class FactorGradientStepGridComponent extends React.Component<IFactorGradientStepGridComponent, {
  2118. gradient: number;
  2119. factor1: string;
  2120. factor2?: string;
  2121. }> {
  2122. constructor(props: IFactorGradientStepGridComponent);
  2123. shouldComponentUpdate(nextProps: IFactorGradientStepGridComponent, nextState: {
  2124. gradient: number;
  2125. factor1: string;
  2126. factor2?: string;
  2127. }): boolean;
  2128. updateFactor1(valueString: string): void;
  2129. updateFactor2(valueString: string): void;
  2130. updateGradient(gradient: number): void;
  2131. onPointerUp(): void;
  2132. lock(): void;
  2133. unlock(): void;
  2134. render(): JSX.Element;
  2135. }
  2136. }
  2137. declare module INSPECTOR {
  2138. interface IColorGradientStepGridComponent {
  2139. globalState: GlobalState;
  2140. gradient: BABYLON.ColorGradient | BABYLON.Color3Gradient;
  2141. lockObject: LockObject;
  2142. lineIndex: number;
  2143. isColor3: boolean;
  2144. onDelete: () => void;
  2145. onUpdateGradient: () => void;
  2146. onCheckForReOrder: () => void;
  2147. host: BABYLON.IParticleSystem;
  2148. codeRecorderPropertyName: string;
  2149. }
  2150. export class ColorGradientStepGridComponent extends React.Component<IColorGradientStepGridComponent, {
  2151. gradient: number;
  2152. }> {
  2153. constructor(props: IColorGradientStepGridComponent);
  2154. updateColor1(color: string): void;
  2155. updateColor2(color: string): void;
  2156. updateGradient(gradient: number): void;
  2157. onPointerUp(): void;
  2158. lock(): void;
  2159. unlock(): void;
  2160. render(): JSX.Element;
  2161. }
  2162. }
  2163. declare module INSPECTOR {
  2164. interface ILinkButtonComponentProps {
  2165. label: string;
  2166. buttonLabel: string;
  2167. url?: string;
  2168. onClick: () => void;
  2169. onIconClick?: () => void;
  2170. }
  2171. export class LinkButtonComponent extends React.Component<ILinkButtonComponentProps> {
  2172. constructor(props: ILinkButtonComponentProps);
  2173. onLink(): void;
  2174. render(): JSX.Element;
  2175. }
  2176. }
  2177. declare module INSPECTOR {
  2178. export enum GradientGridMode {
  2179. Factor = 0,
  2180. BABYLON.Color3 = 1,
  2181. BABYLON.Color4 = 2
  2182. }
  2183. interface IValueGradientGridComponent {
  2184. globalState: GlobalState;
  2185. label: string;
  2186. gradients: BABYLON.Nullable<Array<BABYLON.IValueGradient>>;
  2187. lockObject: LockObject;
  2188. docLink?: string;
  2189. mode: GradientGridMode;
  2190. host: BABYLON.IParticleSystem;
  2191. codeRecorderPropertyName: string;
  2192. onCreateRequired: () => void;
  2193. }
  2194. export class ValueGradientGridComponent extends React.Component<IValueGradientGridComponent> {
  2195. constructor(props: IValueGradientGridComponent);
  2196. deleteStep(step: BABYLON.IValueGradient): void;
  2197. addNewStep(): void;
  2198. checkForReOrder(): void;
  2199. updateAndSync(): void;
  2200. render(): JSX.Element;
  2201. }
  2202. }
  2203. declare module INSPECTOR {
  2204. interface IParticleSystemPropertyGridComponentProps {
  2205. globalState: GlobalState;
  2206. system: BABYLON.IParticleSystem;
  2207. lockObject: LockObject;
  2208. onSelectionChangedObservable?: BABYLON.Observable<any>;
  2209. onPropertyChangedObservable?: BABYLON.Observable<PropertyChangedEvent>;
  2210. }
  2211. export class ParticleSystemPropertyGridComponent extends React.Component<IParticleSystemPropertyGridComponentProps> {
  2212. private _snippetUrl;
  2213. constructor(props: IParticleSystemPropertyGridComponentProps);
  2214. renderEmitter(): JSX.Element | null;
  2215. raiseOnPropertyChanged(property: string, newValue: any, previousValue: any): void;
  2216. renderControls(): JSX.Element;
  2217. saveToFile(): void;
  2218. loadFromFile(file: File): void;
  2219. loadFromSnippet(): void;
  2220. saveToSnippet(): void;
  2221. render(): JSX.Element;
  2222. }
  2223. }
  2224. declare module INSPECTOR {
  2225. interface ISpriteManagerPropertyGridComponentProps {
  2226. globalState: GlobalState;
  2227. spriteManager: BABYLON.SpriteManager;
  2228. lockObject: LockObject;
  2229. onSelectionChangedObservable?: BABYLON.Observable<any>;
  2230. onPropertyChangedObservable?: BABYLON.Observable<PropertyChangedEvent>;
  2231. }
  2232. export class SpriteManagerPropertyGridComponent extends React.Component<ISpriteManagerPropertyGridComponentProps> {
  2233. private _snippetUrl;
  2234. constructor(props: ISpriteManagerPropertyGridComponentProps);
  2235. addNewSprite(): void;
  2236. disposeManager(): void;
  2237. saveToFile(): void;
  2238. loadFromFile(file: File): void;
  2239. loadFromSnippet(): void;
  2240. saveToSnippet(): void;
  2241. render(): JSX.Element;
  2242. }
  2243. }
  2244. declare module INSPECTOR {
  2245. interface ISpritePropertyGridComponentProps {
  2246. globalState: GlobalState;
  2247. sprite: BABYLON.Sprite;
  2248. lockObject: LockObject;
  2249. onPropertyChangedObservable?: BABYLON.Observable<PropertyChangedEvent>;
  2250. onSelectionChangedObservable?: BABYLON.Observable<any>;
  2251. }
  2252. export class SpritePropertyGridComponent extends React.Component<ISpritePropertyGridComponentProps> {
  2253. private canvasRef;
  2254. private imageData;
  2255. private cachedCellIndex;
  2256. constructor(props: ISpritePropertyGridComponentProps);
  2257. onManagerLink(): void;
  2258. switchPlayStopState(): void;
  2259. disposeSprite(): void;
  2260. componentDidMount(): void;
  2261. componentDidUpdate(): void;
  2262. shouldComponentUpdate(nextProps: ISpritePropertyGridComponentProps): boolean;
  2263. updatePreview(): void;
  2264. render(): JSX.Element;
  2265. }
  2266. }
  2267. declare module INSPECTOR {
  2268. interface ITargetedAnimationGridComponentProps {
  2269. globalState: GlobalState;
  2270. targetedAnimation: BABYLON.TargetedAnimation;
  2271. scene: BABYLON.Scene;
  2272. lockObject: LockObject;
  2273. onSelectionChangedObservable?: BABYLON.Observable<any>;
  2274. onPropertyChangedObservable?: BABYLON.Observable<PropertyChangedEvent>;
  2275. }
  2276. export class TargetedAnimationGridComponent extends React.Component<ITargetedAnimationGridComponentProps> {
  2277. private _animationGroup;
  2278. constructor(props: ITargetedAnimationGridComponentProps);
  2279. playOrPause: () => void;
  2280. deleteAnimation: () => void;
  2281. render(): JSX.Element;
  2282. }
  2283. }
  2284. declare module INSPECTOR {
  2285. interface IFollowCameraPropertyGridComponentProps {
  2286. globalState: GlobalState;
  2287. camera: BABYLON.FollowCamera;
  2288. lockObject: LockObject;
  2289. onPropertyChangedObservable?: BABYLON.Observable<PropertyChangedEvent>;
  2290. }
  2291. export class FollowCameraPropertyGridComponent extends React.Component<IFollowCameraPropertyGridComponentProps> {
  2292. constructor(props: IFollowCameraPropertyGridComponentProps);
  2293. render(): JSX.Element;
  2294. }
  2295. }
  2296. declare module INSPECTOR {
  2297. interface ISoundPropertyGridComponentProps {
  2298. globalState: GlobalState;
  2299. sound: BABYLON.Sound;
  2300. extensibilityGroups?: BABYLON.IExplorerExtensibilityGroup[];
  2301. lockObject: LockObject;
  2302. onPropertyChangedObservable?: BABYLON.Observable<PropertyChangedEvent>;
  2303. }
  2304. export class SoundPropertyGridComponent extends React.Component<ISoundPropertyGridComponentProps> {
  2305. constructor(props: ISoundPropertyGridComponentProps);
  2306. render(): JSX.Element;
  2307. }
  2308. }
  2309. declare module INSPECTOR {
  2310. export class PropertyGridTabComponent extends PaneComponent {
  2311. private _timerIntervalId;
  2312. private _lockObject;
  2313. constructor(props: IPaneComponentProps);
  2314. timerRefresh(): void;
  2315. componentDidMount(): void;
  2316. componentWillUnmount(): void;
  2317. render(): JSX.Element | null;
  2318. }
  2319. }
  2320. declare module INSPECTOR {
  2321. export interface IHeaderComponentProps {
  2322. title: string;
  2323. handleBack?: boolean;
  2324. noExpand?: boolean;
  2325. noClose?: boolean;
  2326. noCommands?: boolean;
  2327. onPopup: () => void;
  2328. onClose: () => void;
  2329. onSelectionChangedObservable?: BABYLON.Observable<any>;
  2330. }
  2331. export class HeaderComponent extends React.Component<IHeaderComponentProps, {
  2332. isBackVisible: boolean;
  2333. }> {
  2334. private _backStack;
  2335. private _onSelectionChangeObserver;
  2336. constructor(props: IHeaderComponentProps);
  2337. componentDidMount(): void;
  2338. componentWillUnmount(): void;
  2339. goBack(): void;
  2340. renderLogo(): JSX.Element | null;
  2341. render(): JSX.Element;
  2342. }
  2343. }
  2344. declare module INSPECTOR {
  2345. interface IMessageLineComponentProps {
  2346. text: string;
  2347. color?: string;
  2348. }
  2349. export class MessageLineComponent extends React.Component<IMessageLineComponentProps> {
  2350. constructor(props: IMessageLineComponentProps);
  2351. render(): JSX.Element;
  2352. }
  2353. }
  2354. declare module INSPECTOR {
  2355. interface IGLTFComponentProps {
  2356. scene: BABYLON.Scene;
  2357. globalState: GlobalState;
  2358. }
  2359. export class GLTFComponent extends React.Component<IGLTFComponentProps> {
  2360. private _onValidationResultsUpdatedObserver;
  2361. openValidationDetails(): void;
  2362. prepareText(singularForm: string, count: number): string;
  2363. componentDidMount(): void;
  2364. componentWillUnmount(): void;
  2365. renderValidation(): JSX.Element | null;
  2366. render(): JSX.Element;
  2367. }
  2368. }
  2369. declare module INSPECTOR {
  2370. interface IFileMultipleButtonLineComponentProps {
  2371. label: string;
  2372. onClick: (event: any) => void;
  2373. accept: string;
  2374. }
  2375. export class FileMultipleButtonLineComponent extends React.Component<IFileMultipleButtonLineComponentProps> {
  2376. private static _IDGenerator;
  2377. private _id;
  2378. private uploadInputRef;
  2379. constructor(props: IFileMultipleButtonLineComponentProps);
  2380. onChange(evt: any): void;
  2381. render(): JSX.Element;
  2382. }
  2383. }
  2384. declare module INSPECTOR {
  2385. export class ToolsTabComponent extends PaneComponent {
  2386. private _videoRecorder;
  2387. private _screenShotSize;
  2388. private _gifOptions;
  2389. private _useWidthHeight;
  2390. private _isExporting;
  2391. private _gifWorkerBlob;
  2392. private _gifRecorder;
  2393. private _previousRenderingScale;
  2394. private _crunchingGIF;
  2395. constructor(props: IPaneComponentProps);
  2396. componentDidMount(): void;
  2397. componentWillUnmount(): void;
  2398. captureScreenshot(): void;
  2399. captureRender(): void;
  2400. recordVideo(): void;
  2401. recordGIFInternal(): void;
  2402. recordGIF(): void;
  2403. importAnimations(event: any): void;
  2404. shouldExport(node: BABYLON.Node): boolean;
  2405. exportGLTF(): void;
  2406. exportBabylon(): void;
  2407. createEnvTexture(): void;
  2408. exportReplay(): void;
  2409. startRecording(): void;
  2410. applyDelta(file: File): void;
  2411. render(): JSX.Element | null;
  2412. }
  2413. }
  2414. declare module INSPECTOR {
  2415. export class SettingsTabComponent extends PaneComponent {
  2416. constructor(props: IPaneComponentProps);
  2417. render(): JSX.Element;
  2418. }
  2419. }
  2420. declare module INSPECTOR {
  2421. interface IActionTabsComponentProps {
  2422. scene?: BABYLON.Scene;
  2423. noCommands?: boolean;
  2424. noHeader?: boolean;
  2425. noExpand?: boolean;
  2426. noClose?: boolean;
  2427. popupMode?: boolean;
  2428. onPopup?: () => void;
  2429. onClose?: () => void;
  2430. globalState?: GlobalState;
  2431. initialTab?: BABYLON.DebugLayerTab;
  2432. }
  2433. export class ActionTabsComponent extends React.Component<IActionTabsComponentProps, {
  2434. selectedEntity: any;
  2435. selectedIndex: number;
  2436. }> {
  2437. private _onSelectionChangeObserver;
  2438. private _onTabChangedObserver;
  2439. private _once;
  2440. constructor(props: IActionTabsComponentProps);
  2441. componentDidMount(): void;
  2442. componentWillUnmount(): void;
  2443. changeSelectedTab(index: number): void;
  2444. renderContent(): JSX.Element | null;
  2445. onClose(): void;
  2446. onPopup(): void;
  2447. render(): JSX.Element;
  2448. }
  2449. }
  2450. declare module INSPECTOR {
  2451. interface ITreeItemLabelComponentProps {
  2452. label: string;
  2453. onClick?: () => void;
  2454. color: string;
  2455. }
  2456. export class TreeItemLabelComponent extends React.Component<ITreeItemLabelComponentProps> {
  2457. constructor(props: ITreeItemLabelComponentProps);
  2458. onClick(): void;
  2459. render(): JSX.Element;
  2460. }
  2461. }
  2462. declare module INSPECTOR {
  2463. interface IExtensionsComponentProps {
  2464. target: any;
  2465. extensibilityGroups?: BABYLON.IExplorerExtensibilityGroup[];
  2466. }
  2467. export class ExtensionsComponent extends React.Component<IExtensionsComponentProps, {
  2468. popupVisible: boolean;
  2469. }> {
  2470. private _popup;
  2471. private extensionRef;
  2472. constructor(props: IExtensionsComponentProps);
  2473. showPopup(): void;
  2474. componentDidMount(): void;
  2475. componentDidUpdate(): void;
  2476. render(): JSX.Element | null;
  2477. }
  2478. }
  2479. declare module INSPECTOR {
  2480. interface IMeshTreeItemComponentProps {
  2481. mesh: BABYLON.AbstractMesh;
  2482. extensibilityGroups?: BABYLON.IExplorerExtensibilityGroup[];
  2483. onClick: () => void;
  2484. globalState: GlobalState;
  2485. }
  2486. export class MeshTreeItemComponent extends React.Component<IMeshTreeItemComponentProps, {
  2487. isBoundingBoxEnabled: boolean;
  2488. isVisible: boolean;
  2489. }> {
  2490. constructor(props: IMeshTreeItemComponentProps);
  2491. showBoundingBox(): void;
  2492. switchVisibility(): void;
  2493. render(): JSX.Element;
  2494. }
  2495. }
  2496. declare module INSPECTOR {
  2497. interface ICameraTreeItemComponentProps {
  2498. camera: BABYLON.Camera;
  2499. extensibilityGroups?: BABYLON.IExplorerExtensibilityGroup[];
  2500. onClick: () => void;
  2501. globalState: GlobalState;
  2502. }
  2503. export class CameraTreeItemComponent extends React.Component<ICameraTreeItemComponentProps, {
  2504. isActive: boolean;
  2505. isGizmoEnabled: boolean;
  2506. }> {
  2507. private _onBeforeRenderObserver;
  2508. constructor(props: ICameraTreeItemComponentProps);
  2509. setActive(): void;
  2510. componentDidMount(): void;
  2511. componentWillUnmount(): void;
  2512. toggleGizmo(): void;
  2513. render(): JSX.Element;
  2514. }
  2515. }
  2516. declare module INSPECTOR {
  2517. interface ILightTreeItemComponentProps {
  2518. light: BABYLON.Light;
  2519. extensibilityGroups?: BABYLON.IExplorerExtensibilityGroup[];
  2520. onClick: () => void;
  2521. globalState: GlobalState;
  2522. }
  2523. export class LightTreeItemComponent extends React.Component<ILightTreeItemComponentProps, {
  2524. isEnabled: boolean;
  2525. isGizmoEnabled: boolean;
  2526. }> {
  2527. constructor(props: ILightTreeItemComponentProps);
  2528. switchIsEnabled(): void;
  2529. toggleGizmo(): void;
  2530. render(): JSX.Element;
  2531. }
  2532. }
  2533. declare module INSPECTOR {
  2534. interface IMaterialTreeItemComponentProps {
  2535. material: BABYLON.Material | BABYLON.NodeMaterial;
  2536. extensibilityGroups?: BABYLON.IExplorerExtensibilityGroup[];
  2537. onClick: () => void;
  2538. }
  2539. export class MaterialTreeItemComponent extends React.Component<IMaterialTreeItemComponentProps> {
  2540. constructor(props: IMaterialTreeItemComponentProps);
  2541. render(): JSX.Element;
  2542. }
  2543. }
  2544. declare module INSPECTOR {
  2545. interface ITextureTreeItemComponentProps {
  2546. texture: BABYLON.Texture;
  2547. extensibilityGroups?: BABYLON.IExplorerExtensibilityGroup[];
  2548. onClick: () => void;
  2549. }
  2550. export class TextureTreeItemComponent extends React.Component<ITextureTreeItemComponentProps> {
  2551. constructor(props: ITextureTreeItemComponentProps);
  2552. render(): JSX.Element;
  2553. }
  2554. }
  2555. declare module INSPECTOR {
  2556. interface ITransformNodeItemComponentProps {
  2557. transformNode: BABYLON.TransformNode;
  2558. extensibilityGroups?: BABYLON.IExplorerExtensibilityGroup[];
  2559. onClick: () => void;
  2560. }
  2561. export class TransformNodeItemComponent extends React.Component<ITransformNodeItemComponentProps> {
  2562. constructor(props: ITransformNodeItemComponentProps);
  2563. render(): JSX.Element;
  2564. }
  2565. }
  2566. declare module INSPECTOR {
  2567. interface IControlTreeItemComponentProps {
  2568. control: BABYLON.GUI.Control;
  2569. extensibilityGroups?: BABYLON.IExplorerExtensibilityGroup[];
  2570. onClick: () => void;
  2571. }
  2572. export class ControlTreeItemComponent extends React.Component<IControlTreeItemComponentProps, {
  2573. isActive: boolean;
  2574. isVisible: boolean;
  2575. }> {
  2576. constructor(props: IControlTreeItemComponentProps);
  2577. highlight(): void;
  2578. switchVisibility(): void;
  2579. render(): JSX.Element;
  2580. }
  2581. }
  2582. declare module INSPECTOR {
  2583. interface IAdvancedDynamicTextureTreeItemComponentProps {
  2584. texture: BABYLON.GUI.AdvancedDynamicTexture;
  2585. extensibilityGroups?: BABYLON.IExplorerExtensibilityGroup[];
  2586. onSelectionChangedObservable?: BABYLON.Observable<any>;
  2587. onClick: () => void;
  2588. }
  2589. export class AdvancedDynamicTextureTreeItemComponent extends React.Component<IAdvancedDynamicTextureTreeItemComponentProps, {
  2590. isInPickingMode: boolean;
  2591. }> {
  2592. private _onControlPickedObserver;
  2593. constructor(props: IAdvancedDynamicTextureTreeItemComponentProps);
  2594. componentWillUnmount(): void;
  2595. onPickingMode(): void;
  2596. render(): JSX.Element;
  2597. }
  2598. }
  2599. declare module INSPECTOR {
  2600. interface IAnimationGroupItemComponentProps {
  2601. animationGroup: BABYLON.AnimationGroup;
  2602. extensibilityGroups?: BABYLON.IExplorerExtensibilityGroup[];
  2603. onClick: () => void;
  2604. }
  2605. export class AnimationGroupItemComponent extends React.Component<IAnimationGroupItemComponentProps> {
  2606. constructor(props: IAnimationGroupItemComponentProps);
  2607. render(): JSX.Element;
  2608. }
  2609. }
  2610. declare module INSPECTOR {
  2611. interface IPostProcessItemComponentProps {
  2612. postProcess: BABYLON.PostProcess;
  2613. extensibilityGroups?: BABYLON.IExplorerExtensibilityGroup[];
  2614. onClick: () => void;
  2615. }
  2616. export class PostProcessItemComponent extends React.Component<IPostProcessItemComponentProps> {
  2617. constructor(props: IPostProcessItemComponentProps);
  2618. render(): JSX.Element;
  2619. }
  2620. }
  2621. declare module INSPECTOR {
  2622. interface IRenderPipelineItemComponenttProps {
  2623. renderPipeline: BABYLON.PostProcessRenderPipeline;
  2624. extensibilityGroups?: BABYLON.IExplorerExtensibilityGroup[];
  2625. onClick: () => void;
  2626. }
  2627. export class RenderingPipelineItemComponent extends React.Component<IRenderPipelineItemComponenttProps> {
  2628. constructor(props: IRenderPipelineItemComponenttProps);
  2629. render(): JSX.Element;
  2630. }
  2631. }
  2632. declare module INSPECTOR {
  2633. interface ISkeletonTreeItemComponentProps {
  2634. skeleton: BABYLON.Skeleton;
  2635. extensibilityGroups?: BABYLON.IExplorerExtensibilityGroup[];
  2636. onClick: () => void;
  2637. }
  2638. export class SkeletonTreeItemComponent extends React.Component<ISkeletonTreeItemComponentProps> {
  2639. constructor(props: ISkeletonTreeItemComponentProps);
  2640. render(): JSX.Element;
  2641. }
  2642. }
  2643. declare module INSPECTOR {
  2644. interface IBoneTreeItemComponenttProps {
  2645. bone: BABYLON.Bone;
  2646. extensibilityGroups?: BABYLON.IExplorerExtensibilityGroup[];
  2647. onClick: () => void;
  2648. }
  2649. export class BoneTreeItemComponent extends React.Component<IBoneTreeItemComponenttProps> {
  2650. constructor(props: IBoneTreeItemComponenttProps);
  2651. render(): JSX.Element;
  2652. }
  2653. }
  2654. declare module INSPECTOR {
  2655. interface IParticleSystemTreeItemComponentProps {
  2656. system: BABYLON.IParticleSystem;
  2657. extensibilityGroups?: BABYLON.IExplorerExtensibilityGroup[];
  2658. onClick: () => void;
  2659. }
  2660. export class ParticleSystemTreeItemComponent extends React.Component<IParticleSystemTreeItemComponentProps> {
  2661. constructor(props: IParticleSystemTreeItemComponentProps);
  2662. render(): JSX.Element;
  2663. }
  2664. }
  2665. declare module INSPECTOR {
  2666. interface ISpriteManagerTreeItemComponentProps {
  2667. spriteManager: BABYLON.SpriteManager;
  2668. extensibilityGroups?: BABYLON.IExplorerExtensibilityGroup[];
  2669. onClick: () => void;
  2670. }
  2671. export class SpriteManagerTreeItemComponent extends React.Component<ISpriteManagerTreeItemComponentProps> {
  2672. constructor(props: ISpriteManagerTreeItemComponentProps);
  2673. render(): JSX.Element;
  2674. }
  2675. }
  2676. declare module INSPECTOR {
  2677. interface ISpriteTreeItemComponentProps {
  2678. sprite: BABYLON.Sprite;
  2679. extensibilityGroups?: BABYLON.IExplorerExtensibilityGroup[];
  2680. onClick: () => void;
  2681. }
  2682. export class SpriteTreeItemComponent extends React.Component<ISpriteTreeItemComponentProps> {
  2683. constructor(props: ISpriteTreeItemComponentProps);
  2684. render(): JSX.Element;
  2685. }
  2686. }
  2687. declare module INSPECTOR {
  2688. interface ITargetedAnimationItemComponentProps {
  2689. targetedAnimation: BABYLON.TargetedAnimation;
  2690. extensibilityGroups?: BABYLON.IExplorerExtensibilityGroup[];
  2691. onClick: () => void;
  2692. }
  2693. export class TargetedAnimationItemComponent extends React.Component<ITargetedAnimationItemComponentProps> {
  2694. constructor(props: ITargetedAnimationItemComponentProps);
  2695. render(): JSX.Element;
  2696. }
  2697. }
  2698. declare module INSPECTOR {
  2699. interface ISoundTreeItemComponentProps {
  2700. sound: BABYLON.Sound;
  2701. extensibilityGroups?: BABYLON.IExplorerExtensibilityGroup[];
  2702. onClick: () => void;
  2703. }
  2704. export class SoundTreeItemComponent extends React.Component<ISoundTreeItemComponentProps> {
  2705. constructor(props: ISoundTreeItemComponentProps);
  2706. render(): JSX.Element;
  2707. }
  2708. }
  2709. declare module INSPECTOR {
  2710. interface ITreeItemSpecializedComponentProps {
  2711. label: string;
  2712. entity?: any;
  2713. extensibilityGroups?: BABYLON.IExplorerExtensibilityGroup[];
  2714. globalState: GlobalState;
  2715. onClick?: () => void;
  2716. }
  2717. export class TreeItemSpecializedComponent extends React.Component<ITreeItemSpecializedComponentProps> {
  2718. constructor(props: ITreeItemSpecializedComponentProps);
  2719. onClick(): void;
  2720. render(): JSX.Element;
  2721. }
  2722. }
  2723. declare module INSPECTOR {
  2724. export class Tools {
  2725. static LookForItem(item: any, selectedEntity: any): boolean;
  2726. private static _RecursiveRemoveHiddenMeshesAndHoistChildren;
  2727. static SortAndFilter(parent: any, items: any[]): any[];
  2728. }
  2729. }
  2730. declare module INSPECTOR {
  2731. export interface ITreeItemSelectableComponentProps {
  2732. entity: any;
  2733. selectedEntity?: any;
  2734. mustExpand?: boolean;
  2735. offset: number;
  2736. globalState: GlobalState;
  2737. extensibilityGroups?: BABYLON.IExplorerExtensibilityGroup[];
  2738. filter: BABYLON.Nullable<string>;
  2739. }
  2740. export class TreeItemSelectableComponent extends React.Component<ITreeItemSelectableComponentProps, {
  2741. isExpanded: boolean;
  2742. isSelected: boolean;
  2743. }> {
  2744. private _wasSelected;
  2745. constructor(props: ITreeItemSelectableComponentProps);
  2746. switchExpandedState(): void;
  2747. shouldComponentUpdate(nextProps: ITreeItemSelectableComponentProps, nextState: {
  2748. isExpanded: boolean;
  2749. isSelected: boolean;
  2750. }): boolean;
  2751. scrollIntoView(): void;
  2752. componentDidMount(): void;
  2753. componentDidUpdate(): void;
  2754. onSelect(): void;
  2755. renderChildren(): JSX.Element[] | null;
  2756. render(): JSX.Element | null;
  2757. }
  2758. }
  2759. declare module INSPECTOR {
  2760. export interface ITreeItemComponentProps {
  2761. items?: BABYLON.Nullable<any[]>;
  2762. label: string;
  2763. offset: number;
  2764. filter: BABYLON.Nullable<string>;
  2765. forceSubitems?: boolean;
  2766. globalState: GlobalState;
  2767. entity?: any;
  2768. selectedEntity: any;
  2769. extensibilityGroups?: BABYLON.IExplorerExtensibilityGroup[];
  2770. contextMenuItems?: {
  2771. label: string;
  2772. action: () => void;
  2773. }[];
  2774. }
  2775. export class TreeItemComponent extends React.Component<ITreeItemComponentProps, {
  2776. isExpanded: boolean;
  2777. mustExpand: boolean;
  2778. }> {
  2779. static _ContextMenuUniqueIdGenerator: number;
  2780. constructor(props: ITreeItemComponentProps);
  2781. switchExpandedState(): void;
  2782. shouldComponentUpdate(nextProps: ITreeItemComponentProps, nextState: {
  2783. isExpanded: boolean;
  2784. }): boolean;
  2785. expandAll(expand: boolean): void;
  2786. renderContextMenu(): JSX.Element | null;
  2787. render(): JSX.Element;
  2788. }
  2789. }
  2790. declare module INSPECTOR {
  2791. interface ISceneTreeItemComponentProps {
  2792. scene: BABYLON.Scene;
  2793. onRefresh: () => void;
  2794. selectedEntity?: any;
  2795. extensibilityGroups?: BABYLON.IExplorerExtensibilityGroup[];
  2796. onSelectionChangedObservable?: BABYLON.Observable<any>;
  2797. globalState: GlobalState;
  2798. }
  2799. export class SceneTreeItemComponent extends React.Component<ISceneTreeItemComponentProps, {
  2800. isSelected: boolean;
  2801. isInPickingMode: boolean;
  2802. gizmoMode: number;
  2803. }> {
  2804. private _gizmoLayerOnPointerObserver;
  2805. private _onPointerObserver;
  2806. private _onSelectionChangeObserver;
  2807. private _selectedEntity;
  2808. private _posDragEnd;
  2809. private _scaleDragEnd;
  2810. private _rotateDragEnd;
  2811. constructor(props: ISceneTreeItemComponentProps);
  2812. shouldComponentUpdate(nextProps: ISceneTreeItemComponentProps, nextState: {
  2813. isSelected: boolean;
  2814. isInPickingMode: boolean;
  2815. }): boolean;
  2816. componentDidMount(): void;
  2817. componentWillUnmount(): void;
  2818. onSelect(): void;
  2819. onPickingMode(): void;
  2820. setGizmoMode(mode: number): void;
  2821. render(): JSX.Element;
  2822. }
  2823. }
  2824. declare module INSPECTOR {
  2825. interface ISceneExplorerFilterComponentProps {
  2826. onFilter: (filter: string) => void;
  2827. }
  2828. export class SceneExplorerFilterComponent extends React.Component<ISceneExplorerFilterComponentProps> {
  2829. constructor(props: ISceneExplorerFilterComponentProps);
  2830. render(): JSX.Element;
  2831. }
  2832. interface ISceneExplorerComponentProps {
  2833. scene: BABYLON.Scene;
  2834. noCommands?: boolean;
  2835. noHeader?: boolean;
  2836. noExpand?: boolean;
  2837. noClose?: boolean;
  2838. extensibilityGroups?: BABYLON.IExplorerExtensibilityGroup[];
  2839. globalState: GlobalState;
  2840. popupMode?: boolean;
  2841. onPopup?: () => void;
  2842. onClose?: () => void;
  2843. }
  2844. export class SceneExplorerComponent extends React.Component<ISceneExplorerComponentProps, {
  2845. filter: BABYLON.Nullable<string>;
  2846. selectedEntity: any;
  2847. scene: BABYLON.Scene;
  2848. }> {
  2849. private _onSelectionChangeObserver;
  2850. private _onSelectionRenamedObserver;
  2851. private _onNewSceneAddedObserver;
  2852. private _onNewSceneObserver;
  2853. private sceneExplorerRef;
  2854. private _once;
  2855. private _hooked;
  2856. private sceneMutationFunc;
  2857. constructor(props: ISceneExplorerComponentProps);
  2858. processMutation(): void;
  2859. componentDidMount(): void;
  2860. componentWillUnmount(): void;
  2861. filterContent(filter: string): void;
  2862. findSiblings(parent: any, items: any[], target: any, goNext: boolean, data: {
  2863. previousOne?: any;
  2864. found?: boolean;
  2865. }): boolean;
  2866. processKeys(keyEvent: React.KeyboardEvent<HTMLDivElement>): void;
  2867. renderContent(): JSX.Element | null;
  2868. onClose(): void;
  2869. onPopup(): void;
  2870. render(): JSX.Element;
  2871. }
  2872. }
  2873. declare module INSPECTOR {
  2874. interface IEmbedHostComponentProps {
  2875. scene: BABYLON.Scene;
  2876. globalState: GlobalState;
  2877. popupMode: boolean;
  2878. noClose?: boolean;
  2879. noExpand?: boolean;
  2880. onClose: () => void;
  2881. onPopup: () => void;
  2882. extensibilityGroups?: BABYLON.IExplorerExtensibilityGroup[];
  2883. initialTab?: BABYLON.DebugLayerTab;
  2884. }
  2885. export class EmbedHostComponent extends React.Component<IEmbedHostComponentProps> {
  2886. private _once;
  2887. private splitRef;
  2888. private topPartRef;
  2889. private bottomPartRef;
  2890. constructor(props: IEmbedHostComponentProps);
  2891. componentDidMount(): void;
  2892. renderContent(): JSX.Element;
  2893. render(): JSX.Element;
  2894. }
  2895. }
  2896. declare module INSPECTOR {
  2897. export class Inspector {
  2898. private static _SceneExplorerHost;
  2899. private static _ActionTabsHost;
  2900. private static _EmbedHost;
  2901. private static _NewCanvasContainer;
  2902. private static _SceneExplorerWindow;
  2903. private static _ActionTabsWindow;
  2904. private static _EmbedHostWindow;
  2905. private static _Scene;
  2906. private static _OpenedPane;
  2907. private static _OnBeforeRenderObserver;
  2908. static OnSelectionChangeObservable: BABYLON.Observable<any>;
  2909. static OnPropertyChangedObservable: BABYLON.Observable<PropertyChangedEvent>;
  2910. private static _GlobalState;
  2911. static MarkLineContainerTitleForHighlighting(title: string): void;
  2912. static MarkMultipleLineContainerTitlesForHighlighting(titles: string[]): void;
  2913. private static _CopyStyles;
  2914. private static _CreateSceneExplorer;
  2915. private static _CreateActionTabs;
  2916. private static _CreateEmbedHost;
  2917. static _CreatePopup(title: string, windowVariableName: string, width?: number, height?: number, lateBinding?: boolean): HTMLDivElement | null;
  2918. static get IsVisible(): boolean;
  2919. static EarlyAttachToLoader(): void;
  2920. static Show(scene: BABYLON.Scene, userOptions: Partial<BABYLON.IInspectorOptions>): void;
  2921. static _SetNewScene(scene: BABYLON.Scene): void;
  2922. static _CreateCanvasContainer(parentControl: HTMLElement): void;
  2923. private static _DestroyCanvasContainer;
  2924. private static _Cleanup;
  2925. private static _RemoveElementFromDOM;
  2926. static Hide(): void;
  2927. }
  2928. }
  2929. declare module INSPECTOR {
  2930. interface IAddAnimationProps {
  2931. isOpen: boolean;
  2932. close: () => void;
  2933. entity: BABYLON.IAnimatable;
  2934. onPropertyChangedObservable?: BABYLON.Observable<PropertyChangedEvent>;
  2935. setNotificationMessage: (message: string) => void;
  2936. finishedUpdate: () => void;
  2937. addedNewAnimation: (animation: BABYLON.Animation) => void;
  2938. fps: number;
  2939. selectedToUpdate?: BABYLON.Animation | undefined;
  2940. }
  2941. /**
  2942. * Controls the creation of a new animation.
  2943. * @property {boolean} isOpen controls if the add animation pannel is open or closed in the editor controls;
  2944. * @property {()=>void} close sends the message to close this panel setting isOpen to false;
  2945. * @property {IAnimatable} entity is the animation object to add the animation to;
  2946. * @property {Observable<PropertyChangedEvent>} onPropertyChangedObservable is the registered observable
  2947. * @property {(message: string) => void} setNotificationMessage sends the message string to display errors on the message box
  2948. * @property {() => void} finishedUpdate tells the parent component the update on the animation collection has completed
  2949. * @property { (animation: BABYLON.Animation) => void} addedNewAnimation sends the animation to the editor to process how its is rendered
  2950. * @property {number} fps Frames per second of the animation.
  2951. * @property {Animation | undefined} selectedToUpdate the selected animation so we can update the renderer curve.
  2952. */
  2953. export class AddAnimation extends React.Component<IAddAnimationProps, {
  2954. animationName: string;
  2955. animationTargetProperty: string;
  2956. animationType: number;
  2957. loopMode: number;
  2958. animationTargetPath: string;
  2959. isUpdating: boolean;
  2960. }> {
  2961. constructor(props: IAddAnimationProps);
  2962. setInitialState(editingAnimation?: BABYLON.Animation): {
  2963. animationName: string;
  2964. animationTargetPath: string;
  2965. animationType: number;
  2966. loopMode: number;
  2967. animationTargetProperty: string;
  2968. isUpdating: boolean;
  2969. };
  2970. /**
  2971. * We decide wether the animation will be added or edited
  2972. * @param prevProps Previous props.
  2973. * @param prevState Previous state.
  2974. */
  2975. componentDidUpdate(prevProps: IAddAnimationProps, prevState: any): void;
  2976. /**
  2977. * Updates the animation with the correct properties
  2978. * Updates its name, loopmode and targetProperty.
  2979. * This allows the edition of the animation in the curve editor.
  2980. * We can only update these props for the animation.
  2981. * Keyframes of course are updated on the curve editor.
  2982. */
  2983. updateAnimation: () => void;
  2984. /**
  2985. * Returns the animation type as string
  2986. * @param type Type of animation so we return a string.
  2987. */
  2988. getTypeAsString(type: number): "Size" | "Color4" | "Vector3" | "Float" | "Quaternion" | "Vector2" | "Color3";
  2989. /**
  2990. * Process the creation of a new animation.
  2991. * We verify is the property to animate is present on the object
  2992. * We verify if the property derives from a correct class *type of animation to add an animation
  2993. * At the end we create an empty animation named animation.
  2994. * The animation keys array is set to empty so we can add keyframes in the editor.
  2995. * We return the animation to the curve editor and update the entity animation collection
  2996. */
  2997. addAnimation: () => void;
  2998. raiseOnPropertyChanged(newValue: BABYLON.Animation[], previousValue: BABYLON.Animation[]): void;
  2999. raiseOnPropertyUpdated(newValue: string | number | undefined, previousValue: string | number, property: string): void;
  3000. handlePathChange: (event: React.ChangeEvent<HTMLInputElement>) => void;
  3001. handleNameChange: (event: React.ChangeEvent<HTMLInputElement>) => void;
  3002. handleTypeChange: (event: React.ChangeEvent<HTMLSelectElement>) => void;
  3003. handlePropertyChange: (event: React.ChangeEvent<HTMLInputElement>) => void;
  3004. handleLoopModeChange: (event: React.ChangeEvent<HTMLSelectElement>) => void;
  3005. render(): JSX.Element;
  3006. }
  3007. }
  3008. declare module INSPECTOR {
  3009. interface IAnchorSvgPointProps {
  3010. control: BABYLON.Vector2;
  3011. anchor: BABYLON.Vector2;
  3012. active: boolean;
  3013. type: string;
  3014. index: string;
  3015. selected: boolean;
  3016. selectControlPoint: (id: string) => void;
  3017. framesInCanvasView: {
  3018. from: number;
  3019. to: number;
  3020. };
  3021. }
  3022. /**
  3023. * Renders the control point to a keyframe.
  3024. * Each keyframe has left and right control points to control de tangent of the curve
  3025. * This controls the inTangent and outTangent values for the keyframe in the animation.
  3026. * @property {Vector2} control is the control point to control de curve tangent
  3027. * @property {Vector2} anchor represents the Keyframe point which acts origin point.
  3028. * @property {boolen} active tells the component if the control point is currently active
  3029. * @property {string} type (left/right) if the control will be the left or right control point
  3030. * @property {boolean} selected if the control point is currently selected. If selected we can move the control point and will become active
  3031. * @property {(id: string) => void;} selectControlPoint sends the id of the control point to the parent component to tell if it is selected
  3032. * @property {{ from: number; to: number }} framesInCanvasView controls from/to which keyframe should the control point can expand and control de curve
  3033. * 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
  3034. */
  3035. export class AnchorSvgPoint extends React.Component<IAnchorSvgPointProps, {
  3036. visiblePoint: BABYLON.Vector2;
  3037. }> {
  3038. constructor(props: IAnchorSvgPointProps);
  3039. componentDidUpdate(prevProps: IAnchorSvgPointProps, prevState: any): void;
  3040. select: () => void;
  3041. /**
  3042. * Controls where should we render the visible point (representing the control point)
  3043. * The visible control point differs from the control point for UX reasons. The control point
  3044. * expands beyond the visible canvas.
  3045. */
  3046. setVisiblePoint(): BABYLON.Vector2;
  3047. render(): JSX.Element;
  3048. }
  3049. }
  3050. declare module INSPECTOR {
  3051. export interface IKeyframeSvgPoint {
  3052. keyframePoint: BABYLON.Vector2;
  3053. rightControlPoint: BABYLON.Vector2 | null;
  3054. leftControlPoint: BABYLON.Vector2 | null;
  3055. id: string;
  3056. selected: boolean;
  3057. isLeftActive: boolean;
  3058. isRightActive: boolean;
  3059. curveId?: ICurveMetaData;
  3060. }
  3061. export interface ICurveMetaData {
  3062. id: number;
  3063. animationName: string;
  3064. property: string;
  3065. }
  3066. interface IKeyframeSvgPointProps {
  3067. keyframePoint: BABYLON.Vector2;
  3068. leftControlPoint: BABYLON.Vector2 | null;
  3069. rightControlPoint: BABYLON.Vector2 | null;
  3070. id: string;
  3071. selected: boolean;
  3072. selectKeyframe: (id: string, multiselect: boolean) => void;
  3073. selectedControlPoint: (type: string, id: string) => void;
  3074. isLeftActive: boolean;
  3075. isRightActive: boolean;
  3076. framesInCanvasView: {
  3077. from: number;
  3078. to: number;
  3079. };
  3080. }
  3081. /**
  3082. * Renders the Keyframe as an SVG Element for the Canvas component.
  3083. * Holds the two control points to generate the proper curve.
  3084. */
  3085. export class KeyframeSvgPoint extends React.Component<IKeyframeSvgPointProps> {
  3086. constructor(props: IKeyframeSvgPointProps);
  3087. /**
  3088. * Select a keyframe. If the control key is pressed, multiselect keyframes
  3089. * @param e Mouse event
  3090. */
  3091. select: (e: React.MouseEvent<SVGImageElement>) => void;
  3092. /**
  3093. * Send the ID of the selected keyframe
  3094. * @param type Type of selected keyframe
  3095. */
  3096. selectedControlPointId: (type: string) => void;
  3097. render(): JSX.Element;
  3098. }
  3099. }
  3100. declare module INSPECTOR {
  3101. interface ISvgDraggableAreaProps {
  3102. keyframeSvgPoints: IKeyframeSvgPoint[];
  3103. updatePosition: (updatedKeyframe: IKeyframeSvgPoint, id: string) => void;
  3104. scale: number;
  3105. viewBoxScale: number;
  3106. deselectKeyframes: () => void;
  3107. removeSelectedKeyframes: (points: IKeyframeSvgPoint[]) => void;
  3108. panningY: (panningY: number) => void;
  3109. panningX: (panningX: number) => void;
  3110. setCurrentFrame: (direction: number) => void;
  3111. positionCanvas?: BABYLON.Vector2;
  3112. repositionCanvas?: boolean;
  3113. canvasPositionEnded: () => void;
  3114. resetActionableKeyframe: () => void;
  3115. framesInCanvasView: {
  3116. from: number;
  3117. to: number;
  3118. };
  3119. framesResized: number;
  3120. }
  3121. /**
  3122. * The SvgDraggableArea is a wrapper for SVG Canvas the interaction
  3123. *
  3124. * Here we control the drag and key behavior for the SVG components.
  3125. */
  3126. export class SvgDraggableArea extends React.Component<ISvgDraggableAreaProps, {
  3127. panX: number;
  3128. panY: number;
  3129. }> {
  3130. private _active;
  3131. private _isCurrentPointControl;
  3132. private _currentPointId;
  3133. private _draggableArea;
  3134. private _panStart;
  3135. private _panStop;
  3136. private _playheadDrag;
  3137. private _playheadSelected;
  3138. private _movedX;
  3139. private _movedY;
  3140. private _isControlKeyPress;
  3141. readonly _dragBuffer: number;
  3142. readonly _draggingMultiplier: number;
  3143. constructor(props: ISvgDraggableAreaProps);
  3144. /**
  3145. * Listen to key events to be able to drag and set the correct canvas client width
  3146. */
  3147. componentDidMount(): void;
  3148. /**
  3149. * Makes sure the canvas has resposition correctly
  3150. * @param prevProps previous props
  3151. */
  3152. componentDidUpdate(prevProps: ISvgDraggableAreaProps): void;
  3153. /**
  3154. * Identify the type of target of the mouse event
  3155. * @param e SVG Mouse Event
  3156. */
  3157. dragStart: (e: React.MouseEvent<SVGSVGElement, MouseEvent>) => void;
  3158. /**
  3159. * Handle dragging
  3160. * @param e SVG Mouse Event
  3161. */
  3162. drag: (e: React.MouseEvent<SVGSVGElement, MouseEvent>) => void;
  3163. /**
  3164. * Resets the dragging state
  3165. * @param e Drag event
  3166. */
  3167. dragEnd: (e: React.MouseEvent<SVGSVGElement, MouseEvent>) => void;
  3168. /**
  3169. * Gets the current position of the mouse in a SVG Canvas
  3170. * @param e Mouse event
  3171. */
  3172. getMousePosition: (e: React.MouseEvent<SVGSVGElement, MouseEvent>) => BABYLON.Vector2 | undefined;
  3173. /**
  3174. * Handles the canvas panning direction and sets the X and Y values to move the
  3175. * SVG canvas
  3176. */
  3177. panDirection(): void;
  3178. /**
  3179. * Allows dragging
  3180. * @param e Keyboard event
  3181. */
  3182. keyDown(e: KeyboardEvent): void;
  3183. /**
  3184. * Allows multiple selection
  3185. * @param e Keyboard event
  3186. */
  3187. keyUp(e: KeyboardEvent): void;
  3188. /**
  3189. * Focus on the SVG canvas
  3190. * @param e Mouse event
  3191. */
  3192. focus: (e: React.MouseEvent<SVGSVGElement>) => void;
  3193. /**
  3194. * Is the control point active or not
  3195. */
  3196. isNotControlPointActive(): boolean;
  3197. render(): JSX.Element;
  3198. }
  3199. }
  3200. declare module INSPECTOR {
  3201. export interface IIconButtonLineComponentProps {
  3202. icon: string;
  3203. onClick: () => void;
  3204. tooltip: string;
  3205. active?: boolean;
  3206. }
  3207. export class IconButtonLineComponent extends React.Component<IIconButtonLineComponentProps> {
  3208. constructor(props: IIconButtonLineComponentProps);
  3209. render(): JSX.Element;
  3210. }
  3211. }
  3212. declare module INSPECTOR {
  3213. interface IControlsProps {
  3214. keyframes: BABYLON.IAnimationKey[] | null;
  3215. selected: BABYLON.IAnimationKey | null;
  3216. currentFrame: number;
  3217. onCurrentFrameChange: (frame: number) => void;
  3218. repositionCanvas: (keyframe: BABYLON.IAnimationKey) => void;
  3219. playPause: (direction: number) => void;
  3220. isPlaying: boolean;
  3221. scrollable: React.RefObject<HTMLDivElement>;
  3222. }
  3223. /**
  3224. * The playback controls for the animation editor
  3225. */
  3226. export class Controls extends React.Component<IControlsProps, {
  3227. selected: BABYLON.IAnimationKey;
  3228. playingType: string;
  3229. }> {
  3230. readonly _sizeOfKeyframe: number;
  3231. constructor(props: IControlsProps);
  3232. playBackwards: () => void;
  3233. play: () => void;
  3234. pause: () => void;
  3235. /**
  3236. * Set animation to initial keyframe
  3237. */
  3238. moveToAnimationStart: () => void;
  3239. /**
  3240. * Set animation to the last keyframe
  3241. */
  3242. moveToAnimationEnd: () => void;
  3243. /** Move to next keyframe */
  3244. nextKeyframe: () => void;
  3245. /** Move to previous keyframe */
  3246. previousKeyframe: () => void;
  3247. render(): JSX.Element;
  3248. }
  3249. }
  3250. declare module INSPECTOR {
  3251. interface ITimelineProps {
  3252. keyframes: BABYLON.IAnimationKey[] | null;
  3253. selected: BABYLON.IAnimationKey | null;
  3254. currentFrame: number;
  3255. onCurrentFrameChange: (frame: number) => void;
  3256. onAnimationLimitChange: (limit: number) => void;
  3257. dragKeyframe: (frame: number, index: number) => void;
  3258. playPause: (direction: number) => void;
  3259. isPlaying: boolean;
  3260. animationLimit: number;
  3261. fps: number;
  3262. repositionCanvas: (keyframe: BABYLON.IAnimationKey) => void;
  3263. resizeWindowProportion: number;
  3264. }
  3265. interface ITimelineState {
  3266. selected: BABYLON.IAnimationKey;
  3267. activeKeyframe: number | null;
  3268. start: number;
  3269. end: number;
  3270. scrollWidth: number | undefined;
  3271. selectionLength: number[];
  3272. limitValue: number;
  3273. }
  3274. /**
  3275. * The Timeline for the curve editor
  3276. *
  3277. * Has a scrollbar that can be resized and move to left and right.
  3278. * The timeline does not affect the Canvas but only the frame container.
  3279. */
  3280. export class Timeline extends React.Component<ITimelineProps, ITimelineState> {
  3281. private _scrollable;
  3282. private _scrollbarHandle;
  3283. private _scrollContainer;
  3284. private _inputAnimationLimit;
  3285. private _direction;
  3286. private _scrolling;
  3287. private _shiftX;
  3288. private _active;
  3289. readonly _marginScrollbar: number;
  3290. constructor(props: ITimelineProps);
  3291. /** Listen to keyup events and set the initial lenght of the scrollbar */
  3292. componentDidMount(): void;
  3293. /** Recalculate the scrollwidth if a window resize happens */
  3294. componentDidUpdate(prevProps: ITimelineProps): void;
  3295. /** Remove key event listener */
  3296. componentWillUnmount(): void;
  3297. /**
  3298. * Set component state if enter key is pressed
  3299. * @param event enter key event
  3300. */
  3301. isEnterKeyUp(event: KeyboardEvent): void;
  3302. /**
  3303. * Detect blur event
  3304. * @param event Blur event
  3305. */
  3306. onInputBlur(event: React.FocusEvent<HTMLInputElement>): void;
  3307. /** Set component state (scrollbar width, position, and start and end) */
  3308. setControlState(): void;
  3309. /**
  3310. * Set scrollwidth on the timeline
  3311. * @param {number} start Frame from which the scrollbar should begin.
  3312. * @param {number} end Last frame for the timeline.
  3313. */
  3314. calculateScrollWidth(start: number, end: number): number | undefined;
  3315. /**
  3316. * Play animation backwards
  3317. * @param event Mouse event
  3318. */
  3319. playBackwards(event: React.MouseEvent<HTMLDivElement>): void;
  3320. /**
  3321. * Play animation
  3322. * @param event Mouse event
  3323. */
  3324. play(event: React.MouseEvent<HTMLDivElement>): void;
  3325. /**
  3326. * Pause the animation
  3327. * @param event Mouse event
  3328. */
  3329. pause(event: React.MouseEvent<HTMLDivElement>): void;
  3330. /**
  3331. * Set the selected frame
  3332. * @param event Mouse event
  3333. */
  3334. setCurrentFrame: (event: React.MouseEvent<HTMLDivElement>) => void;
  3335. /**
  3336. * Handles the change of number of frames available in the timeline.
  3337. */
  3338. handleLimitChange(event: React.ChangeEvent<HTMLInputElement>): void;
  3339. /**
  3340. * Starts the scrollbar dragging
  3341. * @param e Mouse event on SVG Element
  3342. */
  3343. dragStart: (e: React.MouseEvent<SVGSVGElement, MouseEvent>) => void;
  3344. /**
  3345. * Update the canvas visible frames while dragging
  3346. * @param e Mouse event
  3347. */
  3348. drag: (e: React.MouseEvent<SVGSVGElement, MouseEvent>) => void;
  3349. /**
  3350. * Check if the frame is being used as a Keyframe by the animation
  3351. * @param frame number of frame
  3352. * @param direction frame increment or decrement
  3353. */
  3354. isFrameBeingUsed(frame: number, direction: number): number | false;
  3355. /**
  3356. * Reset drag state
  3357. * @param e Mouse event on SVG Element
  3358. */
  3359. dragEnd: (e: React.MouseEvent<SVGSVGElement, MouseEvent>) => void;
  3360. /**
  3361. * Change position of the scrollbar
  3362. * @param e Mouse event
  3363. */
  3364. scrollDragStart: (e: React.MouseEvent<HTMLDivElement, MouseEvent>) => void;
  3365. /**
  3366. * Change size of scrollbar
  3367. * @param e Mouse event
  3368. */
  3369. scrollDrag: (e: React.MouseEvent<HTMLDivElement, MouseEvent>) => void;
  3370. /**
  3371. * Reset scroll drag
  3372. * @param e Mouse event
  3373. */
  3374. scrollDragEnd: (e: React.MouseEvent<HTMLDivElement, MouseEvent>) => void;
  3375. /**
  3376. * Sets the start, end and selection length of the scrollbar. This will control the width and
  3377. * height of the scrollbar as well as the number of frames available
  3378. * @param {number} pageX Controls the X axis of the scrollbar movement.
  3379. */
  3380. moveScrollbar(pageX: number): void;
  3381. /**
  3382. * Controls the resizing of the scrollbar from the right handle
  3383. * @param {number} clientX how much mouse has moved
  3384. */
  3385. resizeScrollbarRight(clientX: number): void;
  3386. /**
  3387. * Controls the resizing of the scrollbar from the left handle
  3388. * @param {number} clientX how much mouse has moved
  3389. */
  3390. resizeScrollbarLeft(clientX: number): void;
  3391. /**
  3392. * Returns array with the expected length between two numbers
  3393. * @param start initial visible frame
  3394. * @param stop last visible frame
  3395. */
  3396. range(start: number, end: number): number[];
  3397. /**
  3398. * Get the animation keyframe
  3399. * @param frame Frame
  3400. */
  3401. getKeyframe(frame: number): false | BABYLON.IAnimationKey | undefined;
  3402. /**
  3403. * Get the current animation keyframe
  3404. * @param frame Frame
  3405. */
  3406. getCurrentFrame(frame: number): boolean;
  3407. dragDomFalse: () => boolean;
  3408. render(): JSX.Element;
  3409. }
  3410. }
  3411. declare module INSPECTOR {
  3412. interface IPlayheadProps {
  3413. message: string;
  3414. open: boolean;
  3415. close: () => void;
  3416. }
  3417. /**
  3418. * Renders the notification for the user
  3419. */
  3420. export class Notification extends React.Component<IPlayheadProps> {
  3421. constructor(props: IPlayheadProps);
  3422. render(): JSX.Element;
  3423. }
  3424. }
  3425. declare module INSPECTOR {
  3426. interface IGraphActionsBarProps {
  3427. addKeyframe: () => void;
  3428. removeKeyframe: () => void;
  3429. frameSelectedKeyframes: () => void;
  3430. handleValueChange: (e: React.ChangeEvent<HTMLInputElement>) => void;
  3431. handleFrameChange: (e: React.ChangeEvent<HTMLInputElement>) => void;
  3432. flatTangent: () => void;
  3433. brokeTangents: () => void;
  3434. setLerpToActiveControlPoint: () => void;
  3435. brokenMode: boolean;
  3436. lerpMode: boolean;
  3437. actionableKeyframe: IActionableKeyFrame;
  3438. title: string;
  3439. enabled: boolean;
  3440. setKeyframeValue: (actionableKeyframe: IActionableKeyFrame) => void;
  3441. frameRange: {
  3442. min: number | undefined;
  3443. max: number | undefined;
  3444. };
  3445. }
  3446. /**
  3447. * Has the buttons and actions for the Canvas Graph.
  3448. * Handles input change and actions (flat, broken mode, set linear control points)
  3449. */
  3450. export class GraphActionsBar extends React.Component<IGraphActionsBarProps, {
  3451. frame: string;
  3452. value: string;
  3453. min: number | undefined;
  3454. max: number | undefined;
  3455. }> {
  3456. private _frameInput;
  3457. private _valueInput;
  3458. constructor(props: IGraphActionsBarProps);
  3459. /**
  3460. * Listen to keyup changes to handle if the input event has ended or change
  3461. */
  3462. componentDidMount(): void;
  3463. /**
  3464. * Set the changing state of frame, value and range of the actionablekeyframe
  3465. * @param prevProps previous props
  3466. * @param prevState previous state
  3467. */
  3468. componentDidUpdate(prevProps: IGraphActionsBarProps, prevState: any): void;
  3469. /**
  3470. * Returns the frame and value for the keyframe
  3471. * @param keyframe The keyframe to update
  3472. */
  3473. selectedKeyframeChanged(keyframe: IActionableKeyFrame): {
  3474. frame: string;
  3475. value: string;
  3476. };
  3477. /**
  3478. * Remove listeners
  3479. */
  3480. componentWillUnmount(): void;
  3481. /**
  3482. * Trigger the change on the keyframe
  3483. * @param event Enter keyevent
  3484. */
  3485. isEnterKeyUp(event: KeyboardEvent): void;
  3486. /**
  3487. * Trigger the chnage on the keyframe on blur
  3488. * @param event Focus event
  3489. */
  3490. onBlur: (event: React.FocusEvent<HTMLInputElement>) => void;
  3491. /**
  3492. * Gets the keyframe frame
  3493. */
  3494. getFrame(): string | number;
  3495. /**
  3496. * Gets the keyframe value
  3497. */
  3498. getValue(): string | number;
  3499. /**
  3500. * Set keyframe value state
  3501. * @param e Input event
  3502. */
  3503. handleValueChange: (e: React.ChangeEvent<HTMLInputElement>) => void;
  3504. /**
  3505. * Set the keyframe frame state
  3506. * @param e Input event
  3507. */
  3508. handleFrameChange: (e: React.ChangeEvent<HTMLInputElement>) => void;
  3509. render(): JSX.Element;
  3510. }
  3511. }
  3512. declare module INSPECTOR {
  3513. interface IAnimationListTreeProps {
  3514. isTargetedAnimation: boolean;
  3515. entity: BABYLON.IAnimatable | BABYLON.TargetedAnimation;
  3516. selected: BABYLON.Animation | null;
  3517. onPropertyChangedObservable?: BABYLON.Observable<PropertyChangedEvent>;
  3518. selectAnimation: (selected: BABYLON.Animation, coordinate?: SelectedCoordinate) => void;
  3519. empty: () => void;
  3520. editAnimation: (selected: BABYLON.Animation) => void;
  3521. deselectAnimation: () => void;
  3522. }
  3523. interface Item {
  3524. index: number;
  3525. name: string;
  3526. property: string;
  3527. selected: boolean;
  3528. open: boolean;
  3529. }
  3530. export enum SelectedCoordinate {
  3531. x = 0,
  3532. y = 1,
  3533. z = 2,
  3534. w = 3,
  3535. r = 0,
  3536. g = 1,
  3537. b = 2,
  3538. a = 3,
  3539. width = 0,
  3540. height = 1
  3541. }
  3542. interface ItemCoordinate {
  3543. id: string;
  3544. color: string;
  3545. coordinate: SelectedCoordinate;
  3546. }
  3547. /**
  3548. * Renders a list of current animations.
  3549. */
  3550. export class AnimationListTree extends React.Component<IAnimationListTreeProps, {
  3551. selectedCoordinate: SelectedCoordinate;
  3552. selectedAnimation: number;
  3553. animationList: Item[] | null;
  3554. animations: BABYLON.Nullable<BABYLON.Animation[]> | BABYLON.Animation;
  3555. }> {
  3556. constructor(props: IAnimationListTreeProps);
  3557. /**
  3558. * Set the animation list if has changed properties
  3559. * @param prevProps previous properties
  3560. */
  3561. componentDidUpdate(prevProps: IAnimationListTreeProps): void;
  3562. /**
  3563. * Delete animation from list
  3564. */
  3565. deleteAnimation: () => void;
  3566. /**
  3567. * Update the animations collection
  3568. * @param newValue new animation list
  3569. * @param previousValue previous animation list
  3570. */
  3571. raiseOnPropertyChanged(newValue: BABYLON.Animation[], previousValue: BABYLON.Animation[]): void;
  3572. /**
  3573. * Renders the animation list
  3574. */
  3575. generateList(): Item[] | null;
  3576. /**
  3577. * Open or closes the animation to show its coordinate animations
  3578. * @param index BABYLON.Animation index
  3579. */
  3580. toggleProperty(index: number): void;
  3581. /**
  3582. * Select the animation to render
  3583. * @param animation Selected animation
  3584. * @param coordinate Selected coordinate (x, y, z)
  3585. * @param index Index
  3586. */
  3587. setSelectedCoordinate(animation: BABYLON.Animation, coordinate: SelectedCoordinate, index: number): void;
  3588. /**
  3589. * Renders the coordinate belonging to an animation
  3590. * @param i Index
  3591. * @param animation Selected animation
  3592. * @param coordinate Coordinate name
  3593. * @param color Color identifier
  3594. * @param selectedCoordinate Selected coordinate (x, y, z)
  3595. */
  3596. coordinateItem(i: number, animation: BABYLON.Animation, coordinate: string, color: string, selectedCoordinate: SelectedCoordinate): JSX.Element;
  3597. /**
  3598. * Render animation
  3599. * @param animation selected animations
  3600. * @param i index
  3601. * @param childrenElements its coordinate (x,y,z) animations
  3602. */
  3603. typeAnimationItem(animation: BABYLON.Animation, i: number, childrenElements: ItemCoordinate[]): JSX.Element;
  3604. /**
  3605. * Render animation item
  3606. * @param animation Selected aniamtion
  3607. * @param i index
  3608. */
  3609. setListItem(animation: BABYLON.Animation, i: number): JSX.Element | null;
  3610. render(): JSX.Element;
  3611. }
  3612. }
  3613. declare module INSPECTOR {
  3614. interface ILoadSnippetProps {
  3615. animations: BABYLON.Animation[];
  3616. onPropertyChangedObservable?: BABYLON.Observable<PropertyChangedEvent>;
  3617. lockObject: LockObject;
  3618. globalState: GlobalState;
  3619. snippetServer: string;
  3620. setSnippetId: (id: string) => void;
  3621. entity: BABYLON.IAnimatable | BABYLON.TargetedAnimation;
  3622. setNotificationMessage: (message: string) => void;
  3623. animationsLoaded: (numberOfAnimations: number) => void;
  3624. }
  3625. /**
  3626. * Loads animation locally or from the Babylon.js Snippet Server
  3627. */
  3628. export class LoadSnippet extends React.Component<ILoadSnippetProps, {
  3629. snippetId: string;
  3630. }> {
  3631. private _serverAddress;
  3632. constructor(props: ILoadSnippetProps);
  3633. /**
  3634. * Set the animations snippet id
  3635. * @param value Snippet ID
  3636. */
  3637. change: (value: string) => void;
  3638. /**
  3639. * Select a local file to load animations
  3640. * @param file File name
  3641. */
  3642. loadFromFile: (file: File) => void;
  3643. /**
  3644. * Load animations from server identified with a snippet id
  3645. */
  3646. loadFromSnippet: () => void;
  3647. render(): JSX.Element;
  3648. }
  3649. }
  3650. declare module INSPECTOR {
  3651. interface ISaveSnippetProps {
  3652. animations: BABYLON.Nullable<BABYLON.Animation[]>;
  3653. onPropertyChangedObservable?: BABYLON.Observable<PropertyChangedEvent>;
  3654. lockObject: LockObject;
  3655. globalState: GlobalState;
  3656. snippetServer: string;
  3657. snippetId: string;
  3658. }
  3659. export interface Snippet {
  3660. url: string;
  3661. id: string;
  3662. }
  3663. interface SelectedAnimation {
  3664. id: string;
  3665. name: string;
  3666. index: number;
  3667. selected: boolean;
  3668. }
  3669. /**
  3670. * Saves the animation snippet to the Babylon.js site or downloads the animation file locally
  3671. */
  3672. export class SaveSnippet extends React.Component<ISaveSnippetProps, {
  3673. selectedAnimations: SelectedAnimation[];
  3674. }> {
  3675. constructor(props: ISaveSnippetProps);
  3676. /**
  3677. * Set the selected animations to save
  3678. * @param e Input event
  3679. */
  3680. handleCheckboxChange: (e: React.ChangeEvent<HTMLInputElement>) => void;
  3681. /**
  3682. * Stringify the selected animation
  3683. */
  3684. stringifySelectedAnimations(): string;
  3685. /**
  3686. * Save the selected animations to a local file
  3687. */
  3688. saveToFile: () => void;
  3689. /**
  3690. * Save the selected animations if a snippet ID is set
  3691. */
  3692. saveToSnippet: () => void;
  3693. render(): JSX.Element;
  3694. }
  3695. }
  3696. declare module INSPECTOR {
  3697. interface IEditorControlsProps {
  3698. isTargetedAnimation: boolean;
  3699. entity: BABYLON.IAnimatable | BABYLON.TargetedAnimation;
  3700. selected: BABYLON.Animation | null;
  3701. lockObject: LockObject;
  3702. onPropertyChangedObservable?: BABYLON.Observable<PropertyChangedEvent>;
  3703. setNotificationMessage: (message: string) => void;
  3704. selectAnimation: (selected: BABYLON.Animation, axis?: SelectedCoordinate) => void;
  3705. setFps: (fps: number) => void;
  3706. setIsLooping: () => void;
  3707. globalState: GlobalState;
  3708. snippetServer: string;
  3709. deselectAnimation: () => void;
  3710. fps: number;
  3711. }
  3712. interface IEditorControlsState {
  3713. isAnimationTabOpen: boolean;
  3714. isEditTabOpen: boolean;
  3715. isLoadTabOpen: boolean;
  3716. isSaveTabOpen: boolean;
  3717. isLoopActive: boolean;
  3718. animationsCount: number;
  3719. framesPerSecond: number;
  3720. snippetId: string;
  3721. selected: BABYLON.Animation | undefined;
  3722. }
  3723. /**
  3724. * Renders the Curve Editor controls to create, save, remove, load and edit animations
  3725. */
  3726. export class EditorControls extends React.Component<IEditorControlsProps, IEditorControlsState> {
  3727. constructor(props: IEditorControlsProps);
  3728. /**
  3729. * Makes sure the frames per second receive the updated prop
  3730. * @param prevProps previous properties
  3731. */
  3732. componentDidUpdate(prevProps: IEditorControlsProps): void;
  3733. /**
  3734. * Add the nimation, recounts the list and opens the correct tab
  3735. * @param animation The recently empty created animation
  3736. */
  3737. onAnimationAdded: (animation: BABYLON.Animation) => void;
  3738. /**
  3739. * Set state when the animations list has finished updated
  3740. */
  3741. finishedUpdate: () => void;
  3742. recountAnimations(): number;
  3743. /**
  3744. * Toggles loop
  3745. */
  3746. changeLoopBehavior: () => void;
  3747. /**
  3748. * This avoids using lambda functions in JSX
  3749. */
  3750. handleFirstTab: () => void;
  3751. handleSecondTab: () => void;
  3752. handleThirdTab: () => void;
  3753. handleFourthTab: () => void;
  3754. handleTabs(tab: number): void;
  3755. handleChangeFps: (fps: number) => void;
  3756. /**
  3757. * Cleans the list when has been emptied
  3758. */
  3759. onEmptiedList: () => void;
  3760. /**
  3761. * When animations have been reloaded update tabs
  3762. */
  3763. animationsLoaded: (numberOfAnimations: number) => void;
  3764. /**
  3765. * The currently selected animation to edit it
  3766. * @param selected Selected animation
  3767. */
  3768. editAnimation: (selected: BABYLON.Animation) => void;
  3769. setSnippetId: (id: string) => void;
  3770. /**
  3771. * Marks animation tab closed and hides the tab
  3772. */
  3773. onCloseAddAnimation: () => void;
  3774. render(): JSX.Element;
  3775. }
  3776. }
  3777. declare module INSPECTOR {
  3778. interface ISwitchButtonProps {
  3779. /** Current scale */
  3780. current: CurveScale;
  3781. /** On click change of scale */
  3782. action?: (event: CurveScale) => void;
  3783. }
  3784. /**
  3785. * Displays the current scale
  3786. */
  3787. export class ScaleLabel extends React.Component<ISwitchButtonProps, {
  3788. current: CurveScale;
  3789. }> {
  3790. constructor(props: ISwitchButtonProps);
  3791. renderLabel(scale: CurveScale): "" | "DEG" | "FLT" | "INT" | "RAD";
  3792. onClickHandle: () => void;
  3793. render(): JSX.Element;
  3794. }
  3795. }
  3796. declare module INSPECTOR {
  3797. interface IAnimationCurveEditorComponentProps {
  3798. playOrPause?: () => void;
  3799. scene: BABYLON.Scene;
  3800. entity: BABYLON.IAnimatable | BABYLON.TargetedAnimation;
  3801. lockObject: LockObject;
  3802. globalState: GlobalState;
  3803. }
  3804. /**
  3805. * Represent an Axis of the canvas. This help us control the frame/panning
  3806. */
  3807. interface ICanvasAxis {
  3808. value: number;
  3809. label: number;
  3810. }
  3811. /**
  3812. * This help us identify the type of scaling on the selected animated property
  3813. */
  3814. export enum CurveScale {
  3815. float = 0,
  3816. radians = 1,
  3817. degrees = 2,
  3818. integers = 3,
  3819. default = 4
  3820. }
  3821. /**
  3822. * This represents the visible selected keyframe in the canvas. If the keyframe is selected
  3823. * we should be able to edit the frame and value.
  3824. */
  3825. export interface IActionableKeyFrame {
  3826. frame?: number | string;
  3827. value?: any;
  3828. }
  3829. /**
  3830. * Each curve is an SVG Path. This Interface give us its properties to render on the canvas.
  3831. */
  3832. interface ICurveData {
  3833. pathData: string;
  3834. pathLength: number;
  3835. domCurve: React.RefObject<SVGPathElement>;
  3836. color: string;
  3837. id: string;
  3838. }
  3839. /**
  3840. * The curve editor state
  3841. */
  3842. interface IAnimationCurveEditorComponentState {
  3843. /** If the editor is opened or closed */
  3844. isOpen: boolean;
  3845. /** The currently selected animation from which the curves will render */
  3846. selected: BABYLON.Animation | null;
  3847. /** A list of keyframes to be rendered as SVG Elements in the curve */
  3848. svgKeyframes: IKeyframeSvgPoint[] | undefined;
  3849. /** The current frame in which the playhead is positioned */
  3850. currentFrame: number;
  3851. /** The current value in which the playhead is positioned */
  3852. currentValue: number;
  3853. /** The number of frame in which the current canvas is divided. The helps to render the frames in the graph editor */
  3854. frameAxisLength: ICanvasAxis[];
  3855. /** 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*/
  3856. valueAxisLength: ICanvasAxis[];
  3857. /** If the selected keyframe should be treated as a flat tangent curve */
  3858. isFlatTangentMode: boolean;
  3859. /** If the tangent mode is active */
  3860. isTangentMode: boolean;
  3861. /** If the control points are broken or not */
  3862. isBrokenMode: boolean;
  3863. /** If selected keyframe should render its selected control point to be linear or not */
  3864. lerpMode: boolean;
  3865. /** The scale of the canvas */
  3866. scale: number;
  3867. /** The offset of the playhead to position itself on the canvas */
  3868. playheadOffset: number;
  3869. /** The error or warning message to display */
  3870. notification: string;
  3871. /** The current selected point in the SVG curve */
  3872. currentPoint: SVGPoint | undefined;
  3873. /** The start position of the playhead */
  3874. playheadPos: number;
  3875. /** If the animation is playing or not */
  3876. isPlaying: boolean;
  3877. /** The selected curve represented with an array of curves */
  3878. selectedPathData: ICurveData[] | undefined;
  3879. /** The currently selected coordinate of a complex property (i.e. x, y, z) */
  3880. selectedCoordinate: number;
  3881. /** The number of frames available in the canvas timeline*/
  3882. animationLimit: number;
  3883. /** The currently animation frames per second */
  3884. fps: number;
  3885. /** If the animation is set to loop or not while animation is playing */
  3886. isLooping: boolean;
  3887. /** The amount of vertical panning the user has moved the canvas */
  3888. panningY: number;
  3889. /** The amount of horizontal panning the user has moved the canvas */
  3890. panningX: number;
  3891. /** If the canvas has finished repositioned itself */
  3892. repositionCanvas: boolean;
  3893. /** The current selected keyframe on which we can perform actions (update frame and value) */
  3894. actionableKeyframe: IActionableKeyFrame;
  3895. /** The current value scale */
  3896. valueScaleType: CurveScale;
  3897. /** The amount scale to update valyes */
  3898. valueScale: number;
  3899. /** The canvas proportion width */
  3900. canvasLength: number;
  3901. /** The last frame to be created. */
  3902. lastKeyframeCreated: BABYLON.Nullable<string>;
  3903. /** The canvas scale width */
  3904. canvasWidthScale: number;
  3905. /** How the resize of the canvas will change the value axis */
  3906. valuesPositionResize: number;
  3907. /** How many frames are currently visible in the canvas */
  3908. framesInCanvasView: {
  3909. from: number;
  3910. to: number;
  3911. };
  3912. /** Limits the maximum frame from which a keyframe can move in the curve. So it wont overlap the curve*/
  3913. maxFrame: number | undefined;
  3914. /** Limits the minimum frame from which a keyframe can move in the curve. So it wont overlap the curve*/
  3915. minFrame: number | undefined;
  3916. /** How many frames have been increased or reduced on a windows resize event */
  3917. framesResized: number;
  3918. }
  3919. /**
  3920. * BABYLON.Animation curve Editor Component
  3921. * This component allows the use to create animations visualy from the Babylon.js playground.
  3922. * The principal features for the curve editor are:
  3923. * 1. Create animations for the selected entity properties.
  3924. * 2. Edit the animations a selected entity has.
  3925. * 3. You can load and save animations locally and from the snippet server.
  3926. * 4. After creating an animation you need to add keyframes.
  3927. * 5. You can update the frame and value of each frame.
  3928. * @property {() => void} playOrPause is the event to stop or inititate the animation on the playground scene
  3929. * @property {Scene} scene is the scene object from the playground
  3930. * @property {IAnimatable | BABYLON.TargetedAnimation} entity represents the selected entity which will be the animations target
  3931. * @property {LockObject} lockObject the inherited object to lock for modification with the BABYLON.Observable pattern
  3932. * @property {GlobalState} globalState the playground globalstate
  3933. * Check the IAnimationCurveEditorComponentState for state functionality
  3934. */
  3935. export class AnimationCurveEditorComponent extends React.Component<IAnimationCurveEditorComponentProps, IAnimationCurveEditorComponentState> {
  3936. readonly _entityName: string;
  3937. private _snippetUrl;
  3938. private _heightScale;
  3939. private _scaleFactor;
  3940. private _currentScale;
  3941. private _pixelFrameUnit;
  3942. private _svgKeyframes;
  3943. private _isPlaying;
  3944. private _graphCanvas;
  3945. private _editor;
  3946. private _editorWindow;
  3947. private _resizeId;
  3948. private _svgCanvas;
  3949. private _isTargetedAnimation;
  3950. private _resizedTimeline;
  3951. private _onBeforeRenderObserver;
  3952. private _mainAnimatable;
  3953. constructor(props: IAnimationCurveEditorComponentProps);
  3954. componentDidMount(): void;
  3955. /**
  3956. * Connects scene frame with curve editor animation
  3957. * @param prevProps previous Props
  3958. * @param prevState previous State
  3959. */
  3960. componentDidUpdate(prevProps: IAnimationCurveEditorComponentProps, prevState: any): void;
  3961. /**
  3962. * Clean up observer and listeners
  3963. */
  3964. componentWillUnmount(): void;
  3965. /**
  3966. * Set the frame on the animation
  3967. * @param value number of frame to move animation
  3968. */
  3969. onCurrentFrameChangeScene(value: number): void;
  3970. /**
  3971. * Notifications
  3972. * To add notification we set the state and clear to make the notification bar hide.
  3973. */
  3974. clearNotification: () => void;
  3975. /**
  3976. * Zoom and Scroll
  3977. * This section handles zoom and scroll
  3978. * of the graph area.
  3979. */
  3980. zoom: (e: React.WheelEvent<HTMLDivElement>) => void;
  3981. /**
  3982. * Returns Array with labels and values for Frame axis in Canvas
  3983. */
  3984. setFrameAxis(currentLength: number): {
  3985. value: number;
  3986. label: number;
  3987. }[];
  3988. /**
  3989. * Returns Array with labels, lines and values for Value axis in Canvas
  3990. */
  3991. setValueLines(): {
  3992. value: number;
  3993. label: string;
  3994. }[];
  3995. /**
  3996. * Creates a string id from animation name and the keyframe index
  3997. * @param animationName Name of animation
  3998. * @param keyframeIndex Index of keyframe
  3999. */
  4000. encodeCurveId(animationName: string, keyframeIndex: number): string;
  4001. /**
  4002. * Returns the animation keyframe index and the animation selected coordinate (x, y, z)
  4003. * @param id curve id created with index and coordinate of animation
  4004. */
  4005. decodeCurveId(id: string): {
  4006. order: number;
  4007. coordinate: number;
  4008. };
  4009. /**
  4010. * Returns the value from a keyframe
  4011. * @param id curve id
  4012. */
  4013. getKeyframeValueFromAnimation(id: string): {
  4014. frame: number;
  4015. value: number;
  4016. } | undefined;
  4017. /**
  4018. * Keyframe Manipulation
  4019. * This section handles events from SvgDraggableArea.
  4020. * @param id selected keyframe id
  4021. * @param multiselect if we are multiselecting keyframes
  4022. */
  4023. selectKeyframe: (id: string, multiselect: boolean) => void;
  4024. /**
  4025. * Determine if two control points are collinear (flat tangent)
  4026. * @param kf keyframe point
  4027. */
  4028. hasCollinearPoints: (kf: IKeyframeSvgPoint | undefined) => boolean;
  4029. /**
  4030. * Returns the previous and next keyframe from a selected frame.
  4031. * @param frame index of keyframe
  4032. */
  4033. getPreviousAndNextKeyframe: (frame: number) => {
  4034. prev: number | undefined;
  4035. next: number | undefined;
  4036. };
  4037. /**
  4038. * Selects a keyframe in animation based on its Id
  4039. * @param id keyframe id
  4040. * @param actionableKeyframe selected keyframe
  4041. */
  4042. selectKeyframeFromId: (id: string, actionableKeyframe: IActionableKeyFrame) => void;
  4043. /**
  4044. * Resets the current selected keyframe as an updatable pairs by Graph BABYLON.GUI.Control Bar
  4045. */
  4046. resetActionableKeyframe: () => void;
  4047. /**
  4048. * Sets the selected control point.
  4049. * @param type left or right control point
  4050. * @param id id of selected svg keyframe
  4051. */
  4052. selectedControlPoint: (type: string, id: string) => void;
  4053. /**
  4054. * Sets the selected control point.
  4055. */
  4056. deselectKeyframes: () => void;
  4057. /**
  4058. * Update the BABYLON.Animation Key values based on its type
  4059. * @param dataType Type of animated property
  4060. * @param newValue New value of animated property
  4061. * @param coordinate The selected property coordinate to animate (i.e. x, y, z)
  4062. */
  4063. 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;
  4064. /**
  4065. * BABYLON.Animation should always have a keyframe at Frame Zero
  4066. * @param keys BABYLON.Animation key collection
  4067. */
  4068. forceFrameZeroToExist(keys: BABYLON.IAnimationKey[]): void;
  4069. /**
  4070. * Renders SVG points with dragging of the curve
  4071. * @param updatedSvgKeyFrame selected keyframe to update
  4072. * @param id curve id where the keyframe is localted
  4073. */
  4074. renderPoints: (updatedSvgKeyFrame: IKeyframeSvgPoint, id: string) => void;
  4075. /**
  4076. * Updates the left control point on render points
  4077. * @param updatedSvgKeyFrame selected svg keyframe
  4078. * @param key animation key to update
  4079. * @param dataType type of animation
  4080. * @param coordinate coordinate to change its value (x, y, or z)
  4081. */
  4082. updateLeftControlPoint(updatedSvgKeyFrame: IKeyframeSvgPoint, key: BABYLON.IAnimationKey, dataType: number, coordinate: number): void;
  4083. /**
  4084. * Updates the right control point on render points
  4085. * @param updatedSvgKeyFrame selected svg keyframe
  4086. * @param key animation key to update
  4087. * @param dataType type of animation
  4088. * @param coordinate coordinate to change its value (x, y, or z)
  4089. */
  4090. updateRightControlPoint(updatedSvgKeyFrame: IKeyframeSvgPoint, key: BABYLON.IAnimationKey, dataType: number, coordinate: number): void;
  4091. /**
  4092. * Get the current BABYLON.GUI.Control Point weight (how far the X value is multiplied)
  4093. * @param updatedSvgKeyFrame svg keyframe from which to calculate the distance to control point
  4094. */
  4095. getControlPointWeight(updatedSvgKeyFrame: IKeyframeSvgPoint): number;
  4096. /**
  4097. * Handles a Frame selection change
  4098. * @event event input event to change frame value
  4099. */
  4100. handleFrameChange: (event: React.ChangeEvent<HTMLInputElement>) => void;
  4101. /**
  4102. * Handles how a value change on a selected frame
  4103. * @event event input event to change the value of the keyframe
  4104. */
  4105. handleValueChange: (event: React.ChangeEvent<HTMLInputElement>) => void;
  4106. /**
  4107. * Set the Keyframe from input control in Graph BABYLON.GUI.Control Bar
  4108. * @param actionableKeyframe selected keyframe
  4109. */
  4110. setKeyframeValueFromInput: (actionableKeyframe: IActionableKeyFrame) => void;
  4111. /**
  4112. * Sets the SVG Keyframe value
  4113. * Finds the selected svg keyframe and passes the correct value to the correct animated keyframe.
  4114. */
  4115. setKeyframeValue: () => void;
  4116. /**
  4117. * Set the flat tangent to the current selected control points.
  4118. * get the selected control point and updates its tangent to flat the tangent
  4119. */
  4120. setFlatTangent: () => void;
  4121. /**
  4122. * Sets Broken mode of lines
  4123. * Broken mode enables control points not to be connected on drag
  4124. */
  4125. setBrokenMode: () => void;
  4126. /**
  4127. * Sets a control point to be a linear interpolation with its Keyframe
  4128. * If left or right control point is selected, sets the Tangent value to match the next keyframe and become linear
  4129. */
  4130. setLerpToActiveControlPoint: () => void;
  4131. /**
  4132. * Adds a new keyframe to the curve on canvas click
  4133. */
  4134. addKeyframeClick: () => void;
  4135. /**
  4136. * Remove keyframe on click
  4137. */
  4138. removeKeyframeClick: () => void;
  4139. /**
  4140. * Remove the selected keyframes
  4141. * @param points the selected keyframes to remove
  4142. */
  4143. removeKeyframes: (points: IKeyframeSvgPoint[]) => void;
  4144. /**
  4145. * Adds a keyframe
  4146. * @event event Mouse click event to generate new keyframe
  4147. */
  4148. addKeyFrame(event: React.MouseEvent<SVGSVGElement>): void;
  4149. /**
  4150. * Curve Rendering Functions
  4151. * This section handles how to render curves.
  4152. * @param point point in canvas
  4153. * @param index index of svg
  4154. */
  4155. setKeyframePointLinear(point: BABYLON.Vector2, index: number): void;
  4156. /**
  4157. * Flats the tangents of the selected keyframes
  4158. * @param keyframes Selected keyframes to flat its tangents
  4159. * @param dataType Type of animated property
  4160. */
  4161. flatTangents(keyframes: BABYLON.IAnimationKey[], dataType: number): BABYLON.IAnimationKey[];
  4162. /**
  4163. * Return a Keyframe zero value depending on Type
  4164. * @param dataType Type of animated property
  4165. */
  4166. returnZero(dataType: number): 0 | BABYLON.Vector3 | BABYLON.Quaternion | BABYLON.Color3 | BABYLON.Color4 | BABYLON.Vector2 | BABYLON.Size;
  4167. /**
  4168. * Return the keyframe value as an array depending on type
  4169. * @param valueType type of animated property
  4170. * @param value the value of the property
  4171. */
  4172. getValueAsArray(valueType: number, value: number | BABYLON.Vector2 | BABYLON.Vector3 | BABYLON.Color3 | BABYLON.Color4 | BABYLON.Size | BABYLON.Quaternion): number[];
  4173. /**
  4174. * Sets the keyframe value as an array depending on type
  4175. * @param valueType type of animated property
  4176. * @param arrayValue array to place the correct value
  4177. */
  4178. setValueAsType(valueType: number, arrayValue: number[]): number | BABYLON.Vector3 | BABYLON.Quaternion | BABYLON.Color3 | BABYLON.Color4 | BABYLON.Vector2 | BABYLON.Size;
  4179. /**
  4180. * Returns the SVG Path Data to render the curve
  4181. * @param animation The animation object from where to get its keyframes
  4182. */
  4183. getPathData(animation: BABYLON.Animation | null): ICurveData[] | undefined;
  4184. /**
  4185. * Gets the selected animation properties
  4186. * @param animation BABYLON.Animation
  4187. */
  4188. getAnimationData(animation: BABYLON.Animation): {
  4189. loopMode: number | undefined;
  4190. name: string;
  4191. blendingSpeed: number;
  4192. targetPropertyPath: string[];
  4193. targetProperty: string;
  4194. framesPerSecond: number;
  4195. highestFrame: number;
  4196. usesTangents: boolean;
  4197. easingType: string | undefined;
  4198. easingMode: number | undefined;
  4199. valueType: number;
  4200. };
  4201. /**
  4202. * Calculate the correct tangents to be linear
  4203. * @param keyframes the animation keyframes
  4204. */
  4205. calculateLinearTangents(keyframes: BABYLON.IAnimationKey[]): BABYLON.IAnimationKey[];
  4206. /**
  4207. * Calculates the proper linear tangents if there is no tangents defined
  4208. * Before calculation of svg path we need to calculate the proper tangents
  4209. * @param keyframes the animation keyframes
  4210. * @param data initial svg path
  4211. * @param middle the middle of the canvas to draw the curve
  4212. * @param type type of animation
  4213. * @param coordinate (x, y, z) value
  4214. * @param animationName The animation name to generate the curve id
  4215. */
  4216. curvePathWithoutTangents(keyframes: BABYLON.IAnimationKey[], data: string, middle: number, type: number, coordinate: number, animationName: string): string;
  4217. /**
  4218. * Calculates the curve data and control points for animation
  4219. * @param keyframes the animation keyframes
  4220. * @param data initial svg path
  4221. * @param middle the middle of the canvas to draw the curve
  4222. * @param type type of animation
  4223. * @param coordinate (x, y, z) value
  4224. * @param animationName The animation name to generate the curve id
  4225. */
  4226. curvePathWithTangents(keyframes: BABYLON.IAnimationKey[], data: string, middle: number, type: number, coordinate: number, animationName: string): string;
  4227. /**
  4228. * Calculates a curve path from predefined easing function
  4229. * @param keyframes animation keyframes
  4230. * @param data the initial svg path
  4231. * @param middle the center of the canvas
  4232. * @param easingFunction the easing function to calculate the curve from (easing function should generate the correct curve)
  4233. */
  4234. curvePath(keyframes: BABYLON.IAnimationKey[], data: string, middle: number, easingFunction: BABYLON.EasingFunction): string;
  4235. /**
  4236. * Sets the proper SVG Keyframe points
  4237. * @param controlPoints array of points to generate the svg keyframe collection
  4238. * @param index index of the animation
  4239. * @param keyframesCount How many keyframes should we process
  4240. */
  4241. setKeyframePoint(controlPoints: BABYLON.Vector2[], index: number, keyframesCount: number): void;
  4242. /**
  4243. * Creates curve based on interpolated points
  4244. * @param p0 starting point of curve
  4245. * @param p1 first control point
  4246. * @param u distance between p0 and p3 as percentage to affect p1
  4247. * @param p2 second control point
  4248. * @param v distance between p0 and p3 as percentage to affect p2
  4249. * @param p3 finish point of curve
  4250. */
  4251. interpolateControlPoints(p0: BABYLON.Vector2, p1: BABYLON.Vector2, u: number, p2: BABYLON.Vector2, v: number, p3: BABYLON.Vector2): BABYLON.Vector2[] | undefined;
  4252. /**
  4253. * Deselects the current animations
  4254. */
  4255. deselectAnimation: () => void;
  4256. /**
  4257. * Remove all curves from canvas
  4258. */
  4259. cleanCanvas: () => void;
  4260. /**
  4261. * Selects the animation and renders the curve
  4262. * @param animation the animation to select and render as curve
  4263. * @param coordinate the property coordinate (x, y, z) to represent as curve
  4264. */
  4265. selectAnimation: (animation: BABYLON.Animation, coordinate?: SelectedCoordinate | undefined) => void;
  4266. /**
  4267. * Set the state for the last selected keyframe
  4268. */
  4269. postSelectionEvents: () => void;
  4270. /**
  4271. * Set main animatable to play or pause the animation
  4272. */
  4273. setMainAnimatable(): void;
  4274. /**
  4275. * Check if animation is playing
  4276. */
  4277. isAnimationPlaying(): boolean;
  4278. /**
  4279. * Stops the current playing animation
  4280. */
  4281. stopAnimation(): void;
  4282. /**
  4283. * Set if animation is looping and stops animation after it
  4284. */
  4285. setIsLooping: () => void;
  4286. setFramesPerSecond: (fps: number) => void;
  4287. /**
  4288. * Check if the animation has easing predefined
  4289. */
  4290. analyzeAnimationForLerp(animation: BABYLON.Animation | null): boolean;
  4291. /**
  4292. * Change the current frame in the canvas and timeline
  4293. * @param frame value to update on canvas and timeline
  4294. */
  4295. changeCurrentFrame: (frame: number) => void;
  4296. /**
  4297. * Calculate the value of the selected frame in curve
  4298. * @param frame the frame to calculate its current value on the curve
  4299. */
  4300. calculateCurrentPointInCurve: (frame: number) => number | undefined;
  4301. /**
  4302. * Center the position the canvas depending on Keyframe value and frame
  4303. * @param keyframe the keyframe to set as middle point
  4304. */
  4305. setCanvasPosition: (keyframe: BABYLON.IAnimationKey) => void;
  4306. /**
  4307. * Sets the current frame
  4308. * @param frame the value to set the frame
  4309. */
  4310. setCurrentFrame: (frame: number) => void;
  4311. /**
  4312. * Change the timeline animation frame limit
  4313. */
  4314. changeAnimationLimit: (limit: number) => void;
  4315. /**
  4316. * Update the frame in the selected Keyframe
  4317. */
  4318. updateFrameInKeyFrame: (frame: number, index: number) => void;
  4319. /**
  4320. * Plays or pauses the animation
  4321. * @param direction 0 stops the animation, 1 starts the animation, -1 plays animation backwards
  4322. */
  4323. playPause: (direction: number) => void;
  4324. /**
  4325. * Set the frame to selected position on canvas
  4326. * @event e click event on the SVG canvas
  4327. */
  4328. moveFrameTo(e: React.MouseEvent<SVGRectElement, MouseEvent>): void;
  4329. /**
  4330. * Register the observables for the state
  4331. */
  4332. registerObs(): void;
  4333. /**
  4334. * Checks if the current frame macthes the parameter
  4335. * @param frame The frame to check
  4336. */
  4337. isCurrentFrame(frame: number): boolean;
  4338. /**
  4339. * Set the Vertical Panning State
  4340. * @param panningY the vertical panning value
  4341. */
  4342. setPanningY: (panningY: number) => void;
  4343. /**
  4344. * Set the Vertical Panning State
  4345. * @param panningX the horizontal panning value
  4346. */
  4347. setPanningX: (panningX: number) => void;
  4348. /**
  4349. * Set state when canvas has been respositioned
  4350. */
  4351. canvasPositionEnded: () => void;
  4352. /**
  4353. *
  4354. * @param message The message to display in the notification bar
  4355. */
  4356. setNotificationMessage: (message: string) => void;
  4357. /**
  4358. * Zoom or frame the selected keyframes in the available canvas space
  4359. */
  4360. frameSelectedKeyframes: () => void;
  4361. /**
  4362. * Handle the frames quantity and scale on Window resize width
  4363. */
  4364. onWindowResizeWidth: () => void;
  4365. /**
  4366. * Set the state of frames Resized on window resize event
  4367. * @param framesResized how many frame have been added or removed on resize
  4368. */
  4369. onWindowEndResize: (framesResized: number) => void;
  4370. /** Resizes the width of the timeline */
  4371. onTimelineResize: () => void;
  4372. render(): JSX.Element;
  4373. }
  4374. }
  4375. declare module INSPECTOR {
  4376. interface IPlayheadProps {
  4377. frame: number;
  4378. offset: number;
  4379. onCurrentFrameChange: (frame: number) => void;
  4380. }
  4381. /**
  4382. * Renders the Playhead
  4383. */
  4384. export class Playhead extends React.Component<IPlayheadProps> {
  4385. private _direction;
  4386. private _active;
  4387. constructor(props: IPlayheadProps);
  4388. dragStart(e: React.TouchEvent<HTMLDivElement>): void;
  4389. dragStart(e: React.MouseEvent<HTMLDivElement, MouseEvent>): void;
  4390. drag(e: React.TouchEvent<HTMLDivElement>): void;
  4391. drag(e: React.MouseEvent<HTMLDivElement, MouseEvent>): void;
  4392. dragEnd(e: React.TouchEvent<HTMLDivElement>): void;
  4393. dragEnd(e: React.MouseEvent<HTMLDivElement, MouseEvent>): void;
  4394. calculateMove(): string;
  4395. render(): JSX.Element;
  4396. }
  4397. }
  4398. declare module INSPECTOR {
  4399. export const Contrast: IToolData;
  4400. }