babylon.guiEditor.d.ts 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796
  1. /// <reference types="react" />
  2. declare module GUIEDITOR {
  3. interface ILogComponentProps {
  4. globalState: GlobalState;
  5. }
  6. export class LogEntry {
  7. message: string;
  8. isError: boolean;
  9. constructor(message: string, isError: boolean);
  10. }
  11. export class LogComponent extends React.Component<ILogComponentProps, {
  12. logs: LogEntry[];
  13. }> {
  14. constructor(props: ILogComponentProps);
  15. componentDidMount(): void;
  16. componentDidUpdate(): void;
  17. render(): JSX.Element;
  18. }
  19. }
  20. declare module GUIEDITOR {
  21. export interface IWorkbenchComponentProps {
  22. globalState: GlobalState;
  23. }
  24. export type FramePortData = {};
  25. export const isFramePortData: (variableToCheck: any) => variableToCheck is FramePortData;
  26. export class WorkbenchComponent extends React.Component<IWorkbenchComponentProps> {
  27. private readonly MinZoom;
  28. private readonly MaxZoom;
  29. private _hostCanvas;
  30. private _gridCanvas;
  31. private _selectionContainer;
  32. private _frameContainer;
  33. private _svgCanvas;
  34. private _rootContainer;
  35. private _guiNodes;
  36. private _mouseStartPointX;
  37. private _mouseStartPointY;
  38. private _selectionStartX;
  39. private _selectionStartY;
  40. private _x;
  41. private _y;
  42. private _zoom;
  43. private _selectedGuiNodes;
  44. private _gridSize;
  45. private _selectionBox;
  46. private _frameCandidate;
  47. private _altKeyIsPressed;
  48. private _ctrlKeyIsPressed;
  49. private _oldY;
  50. _frameIsMoving: boolean;
  51. _isLoading: boolean;
  52. isOverGUINode: boolean;
  53. get gridSize(): number;
  54. set gridSize(value: number);
  55. get globalState(): GlobalState;
  56. get nodes(): GUINode[];
  57. get zoom(): number;
  58. set zoom(value: number);
  59. get x(): number;
  60. set x(value: number);
  61. get y(): number;
  62. set y(value: number);
  63. get selectedGuiNodes(): GUINode[];
  64. get canvasContainer(): HTMLDivElement;
  65. get hostCanvas(): HTMLDivElement;
  66. get svgCanvas(): HTMLElement;
  67. get selectionContainer(): HTMLDivElement;
  68. get frameContainer(): HTMLDivElement;
  69. constructor(props: IWorkbenchComponentProps);
  70. getGridPosition(position: number, useCeil?: boolean): number;
  71. getGridPositionCeil(position: number): number;
  72. updateTransform(): void;
  73. onKeyUp(): void;
  74. findNodeFromGuiElement(guiControl: Control): GUINode;
  75. reset(): void;
  76. appendBlock(guiElement: Control): GUINode;
  77. distributeGraph(): void;
  78. componentDidMount(): void;
  79. onMove(evt: React.PointerEvent): void;
  80. onDown(evt: React.PointerEvent<HTMLElement>): void;
  81. onUp(evt: React.PointerEvent): void;
  82. onWheel(evt: React.WheelEvent): void;
  83. zoomToFit(): void;
  84. createGUICanvas(): void;
  85. updateGUIs(): void;
  86. render(): JSX.Element;
  87. }
  88. }
  89. declare module GUIEDITOR {
  90. export interface IPropertyComponentProps {
  91. globalState: GlobalState;
  92. guiControl: Control;
  93. }
  94. }
  95. declare module GUIEDITOR {
  96. interface ILineContainerComponentProps {
  97. title: string;
  98. children: any[] | any;
  99. closed?: boolean;
  100. }
  101. export class LineContainerComponent extends React.Component<ILineContainerComponentProps, {
  102. isExpanded: boolean;
  103. }> {
  104. constructor(props: ILineContainerComponentProps);
  105. switchExpandedState(): void;
  106. renderHeader(): JSX.Element;
  107. render(): JSX.Element;
  108. }
  109. }
  110. declare module GUIEDITOR {
  111. export class PropertyChangedEvent {
  112. object: any;
  113. property: string;
  114. value: any;
  115. initialValue: any;
  116. }
  117. }
  118. declare module GUIEDITOR {
  119. export interface ICheckBoxLineComponentProps {
  120. label: string;
  121. target?: any;
  122. propertyName?: string;
  123. isSelected?: () => boolean;
  124. onSelect?: (value: boolean) => void;
  125. onValueChanged?: () => void;
  126. onPropertyChangedObservable?: BABYLON.Observable<PropertyChangedEvent>;
  127. disabled?: boolean;
  128. }
  129. export class CheckBoxLineComponent extends React.Component<ICheckBoxLineComponentProps, {
  130. isSelected: boolean;
  131. isDisabled?: boolean;
  132. }> {
  133. private static _UniqueIdSeed;
  134. private _uniqueId;
  135. private _localChange;
  136. constructor(props: ICheckBoxLineComponentProps);
  137. shouldComponentUpdate(nextProps: ICheckBoxLineComponentProps, nextState: {
  138. isSelected: boolean;
  139. isDisabled: boolean;
  140. }): boolean;
  141. onChange(): void;
  142. render(): JSX.Element;
  143. }
  144. }
  145. declare module GUIEDITOR {
  146. interface IFloatLineComponentProps {
  147. label: string;
  148. target: any;
  149. propertyName: string;
  150. onChange?: (newValue: number) => void;
  151. isInteger?: boolean;
  152. onPropertyChangedObservable?: BABYLON.Observable<PropertyChangedEvent>;
  153. additionalClass?: string;
  154. step?: string;
  155. digits?: number;
  156. globalState: GlobalState;
  157. min?: number;
  158. max?: number;
  159. smallUI?: boolean;
  160. onEnter?: (newValue: number) => void;
  161. }
  162. export class FloatLineComponent extends React.Component<IFloatLineComponentProps, {
  163. value: string;
  164. }> {
  165. private _localChange;
  166. private _store;
  167. private _regExp;
  168. private _digits;
  169. constructor(props: IFloatLineComponentProps);
  170. shouldComponentUpdate(nextProps: IFloatLineComponentProps, nextState: {
  171. value: string;
  172. }): boolean;
  173. raiseOnPropertyChanged(newValue: number, previousValue: number): void;
  174. updateValue(valueString: string): void;
  175. render(): JSX.Element;
  176. }
  177. }
  178. declare module GUIEDITOR {
  179. interface ISliderLineComponentProps {
  180. label: string;
  181. target?: any;
  182. propertyName?: string;
  183. minimum: number;
  184. maximum: number;
  185. step: number;
  186. directValue?: number;
  187. useEuler?: boolean;
  188. onChange?: (value: number) => void;
  189. onInput?: (value: number) => void;
  190. onPropertyChangedObservable?: BABYLON.Observable<PropertyChangedEvent>;
  191. decimalCount?: number;
  192. globalState: GlobalState;
  193. }
  194. export class SliderLineComponent extends React.Component<ISliderLineComponentProps, {
  195. value: number;
  196. }> {
  197. private _localChange;
  198. constructor(props: ISliderLineComponentProps);
  199. shouldComponentUpdate(nextProps: ISliderLineComponentProps, nextState: {
  200. value: number;
  201. }): boolean;
  202. onChange(newValueString: any): void;
  203. onInput(newValueString: any): void;
  204. prepareDataToRead(value: number): number;
  205. render(): JSX.Element;
  206. }
  207. }
  208. declare module GUIEDITOR {
  209. export class GenericPropertyComponent extends React.Component<IPropertyComponentProps> {
  210. constructor(props: IPropertyComponentProps);
  211. render(): JSX.Element;
  212. }
  213. export class GeneralPropertyTabComponent extends React.Component<IPropertyComponentProps> {
  214. constructor(props: IPropertyComponentProps);
  215. render(): JSX.Element;
  216. }
  217. export class GenericPropertyTabComponent extends React.Component<IPropertyComponentProps> {
  218. constructor(props: IPropertyComponentProps);
  219. forceRebuild(notifiers?: {
  220. "rebuild"?: boolean;
  221. "update"?: boolean;
  222. }): void;
  223. render(): JSX.Element;
  224. }
  225. }
  226. declare module GUIEDITOR {
  227. interface INumericInputComponentProps {
  228. label: string;
  229. value: number;
  230. step?: number;
  231. onChange: (value: number) => void;
  232. globalState: GlobalState;
  233. }
  234. export class NumericInputComponent extends React.Component<INumericInputComponentProps, {
  235. value: string;
  236. }> {
  237. static defaultProps: {
  238. step: number;
  239. };
  240. private _localChange;
  241. constructor(props: INumericInputComponentProps);
  242. shouldComponentUpdate(nextProps: INumericInputComponentProps, nextState: {
  243. value: string;
  244. }): boolean;
  245. updateValue(evt: any): void;
  246. render(): JSX.Element;
  247. }
  248. }
  249. declare module GUIEDITOR {
  250. interface ITextLineComponentProps {
  251. label?: string;
  252. value?: string;
  253. color?: string;
  254. underline?: boolean;
  255. onLink?: () => void;
  256. url?: string;
  257. ignoreValue?: boolean;
  258. additionalClass?: string;
  259. }
  260. export class TextLineComponent extends React.Component<ITextLineComponentProps> {
  261. constructor(props: ITextLineComponentProps);
  262. onLink(): void;
  263. renderContent(): JSX.Element | null;
  264. render(): JSX.Element;
  265. }
  266. }
  267. declare module GUIEDITOR {
  268. export class SliderPropertyTabComponent extends React.Component<IPropertyComponentProps> {
  269. constructor(props: IPropertyComponentProps);
  270. private _slider;
  271. render(): JSX.Element;
  272. }
  273. }
  274. declare module GUIEDITOR {
  275. export class PropertyGuiLedger {
  276. static RegisteredControls: {
  277. [key: string]: React.ComponentClass<IPropertyComponentProps>;
  278. };
  279. }
  280. }
  281. declare module GUIEDITOR {
  282. export class GUINode {
  283. guiControl: Control;
  284. private _x;
  285. private _y;
  286. private _gridAlignedX;
  287. private _gridAlignedY;
  288. private _globalState;
  289. private _onSelectionChangedObserver;
  290. private _onSelectionBoxMovedObserver;
  291. private _onUpdateRequiredObserver;
  292. private _ownerCanvas;
  293. private _isSelected;
  294. private _isVisible;
  295. private _enclosingFrameId;
  296. get isVisible(): boolean;
  297. set isVisible(value: boolean);
  298. get gridAlignedX(): number;
  299. get gridAlignedY(): number;
  300. get x(): number;
  301. set x(value: number);
  302. get y(): number;
  303. set y(value: number);
  304. get width(): number;
  305. get height(): number;
  306. get id(): number;
  307. get name(): string | undefined;
  308. get isSelected(): boolean;
  309. get enclosingFrameId(): number;
  310. set enclosingFrameId(value: number);
  311. set isSelected(value: boolean);
  312. constructor(globalState: GlobalState, guiControl: Control);
  313. cleanAccumulation(useCeil?: boolean): void;
  314. clicked: boolean;
  315. _onMove(evt: BABYLON.Vector2, startPos: BABYLON.Vector2): boolean;
  316. renderProperties(): BABYLON.Nullable<JSX.Element>;
  317. updateVisual(): void;
  318. dispose(): void;
  319. }
  320. }
  321. declare module GUIEDITOR {
  322. export class GlobalState {
  323. guiTexture: AdvancedDynamicTexture;
  324. hostElement: HTMLElement;
  325. hostDocument: HTMLDocument;
  326. hostWindow: Window;
  327. onSelectionChangedObservable: BABYLON.Observable<BABYLON.Nullable<GUINode>>;
  328. onRebuildRequiredObservable: BABYLON.Observable<void>;
  329. onBuiltObservable: BABYLON.Observable<void>;
  330. onResetRequiredObservable: BABYLON.Observable<void>;
  331. onUpdateRequiredObservable: BABYLON.Observable<void>;
  332. onReOrganizedRequiredObservable: BABYLON.Observable<void>;
  333. onLogRequiredObservable: BABYLON.Observable<LogEntry>;
  334. onErrorMessageDialogRequiredObservable: BABYLON.Observable<string>;
  335. onIsLoadingChanged: BABYLON.Observable<boolean>;
  336. onSelectionBoxMoved: BABYLON.Observable<DOMRect | ClientRect>;
  337. onGuiNodeRemovalObservable: BABYLON.Observable<GUINode>;
  338. backgroundColor: BABYLON.Color4;
  339. blockKeyboardEvents: boolean;
  340. controlCamera: boolean;
  341. workbench: WorkbenchComponent;
  342. storeEditorData: (serializationObject: any) => void;
  343. customSave?: {
  344. label: string;
  345. action: (data: string) => Promise<void>;
  346. };
  347. constructor();
  348. }
  349. }
  350. declare module GUIEDITOR {
  351. export interface IButtonLineComponentProps {
  352. data: string;
  353. tooltip: string;
  354. }
  355. export class DraggableLineComponent extends React.Component<IButtonLineComponentProps> {
  356. constructor(props: IButtonLineComponentProps);
  357. render(): JSX.Element;
  358. }
  359. }
  360. declare module GUIEDITOR {
  361. interface IGuiListComponentProps {
  362. globalState: GlobalState;
  363. }
  364. export class GuiListComponent extends React.Component<IGuiListComponentProps, {
  365. filter: string;
  366. }> {
  367. private _onResetRequiredObserver;
  368. private static _Tooltips;
  369. constructor(props: IGuiListComponentProps);
  370. componentWillUnmount(): void;
  371. filterContent(filter: string): void;
  372. render(): JSX.Element;
  373. }
  374. }
  375. declare module GUIEDITOR {
  376. export interface IButtonLineComponentProps {
  377. label: string;
  378. onClick: () => void;
  379. }
  380. export class ButtonLineComponent extends React.Component<IButtonLineComponentProps> {
  381. constructor(props: IButtonLineComponentProps);
  382. render(): JSX.Element;
  383. }
  384. }
  385. declare module GUIEDITOR {
  386. interface IFileButtonLineComponentProps {
  387. label: string;
  388. onClick: (file: File) => void;
  389. accept: string;
  390. }
  391. export class FileButtonLineComponent extends React.Component<IFileButtonLineComponentProps> {
  392. private static _IDGenerator;
  393. private _id;
  394. private uploadInputRef;
  395. constructor(props: IFileButtonLineComponentProps);
  396. onChange(evt: any): void;
  397. render(): JSX.Element;
  398. }
  399. }
  400. declare module GUIEDITOR {
  401. export class SerializationTools {
  402. static Deserialize(serializationObject: any, globalState: GlobalState): void;
  403. }
  404. }
  405. declare module GUIEDITOR {
  406. interface IPropertyTabComponentProps {
  407. globalState: GlobalState;
  408. }
  409. interface IPropertyTabComponentState {
  410. currentNode: BABYLON.Nullable<GUINode>;
  411. }
  412. export class PropertyTabComponent extends React.Component<IPropertyTabComponentProps, IPropertyTabComponentState> {
  413. private _onBuiltObserver;
  414. constructor(props: IPropertyTabComponentProps);
  415. componentDidMount(): void;
  416. componentWillUnmount(): void;
  417. load(file: File): void;
  418. loadFrame(file: File): void;
  419. save(): void;
  420. customSave(): void;
  421. saveToSnippetServer(): void;
  422. loadFromSnippet(): void;
  423. render(): JSX.Element;
  424. }
  425. }
  426. declare module GUIEDITOR {
  427. interface IPortalProps {
  428. globalState: GlobalState;
  429. }
  430. export class Portal extends React.Component<IPortalProps> {
  431. render(): React.ReactPortal;
  432. }
  433. }
  434. declare module GUIEDITOR {
  435. export class GUINodeTools {
  436. static CreateControlFromString(data: string): Slider | Checkbox | ColorPicker | Ellipse | Rectangle | Line | TextBlock;
  437. }
  438. }
  439. declare module GUIEDITOR {
  440. export interface INodeLocationInfo {
  441. blockId: number;
  442. x: number;
  443. y: number;
  444. }
  445. export interface IFrameData {
  446. x: number;
  447. y: number;
  448. width: number;
  449. height: number;
  450. color: number[];
  451. name: string;
  452. isCollapsed: boolean;
  453. blocks: number[];
  454. comments: string;
  455. }
  456. export interface IEditorData {
  457. locations: INodeLocationInfo[];
  458. x: number;
  459. y: number;
  460. zoom: number;
  461. frames?: IFrameData[];
  462. map?: {
  463. [key: number]: number;
  464. };
  465. }
  466. }
  467. declare module GUIEDITOR {
  468. interface IMessageDialogComponentProps {
  469. globalState: GlobalState;
  470. }
  471. export class MessageDialogComponent extends React.Component<IMessageDialogComponentProps, {
  472. message: string;
  473. isError: boolean;
  474. }> {
  475. constructor(props: IMessageDialogComponentProps);
  476. render(): JSX.Element | null;
  477. }
  478. }
  479. declare module GUIEDITOR {
  480. interface IGraphEditorProps {
  481. globalState: GlobalState;
  482. }
  483. interface IGraphEditorState {
  484. showPreviewPopUp: boolean;
  485. }
  486. export class WorkbenchEditor extends React.Component<IGraphEditorProps, IGraphEditorState> {
  487. private _workbenchCanvas;
  488. private _startX;
  489. private _moveInProgress;
  490. private _leftWidth;
  491. private _rightWidth;
  492. private _blocks;
  493. private _onWidgetKeyUpPointer;
  494. private _popUpWindow;
  495. /**
  496. * Creates a node and recursivly creates its parent nodes from it's input
  497. * @param block
  498. */
  499. createNodeFromObject(block: Control, recursion?: boolean): BABYLON.Nullable<GUINode>;
  500. componentDidMount(): void;
  501. componentWillUnmount(): void;
  502. constructor(props: IGraphEditorProps);
  503. pasteSelection(copiedNodes: GUINode[], currentX: number, currentY: number, selectNew?: boolean): GUINode[];
  504. zoomToFit(): void;
  505. showWaitScreen(): void;
  506. hideWaitScreen(): void;
  507. reOrganize(editorData?: BABYLON.Nullable<IEditorData>, isImportingAFrame?: boolean): void;
  508. onPointerDown(evt: React.PointerEvent<HTMLDivElement>): void;
  509. onPointerUp(evt: React.PointerEvent<HTMLDivElement>): void;
  510. resizeColumns(evt: React.PointerEvent<HTMLDivElement>, forLeft?: boolean): void;
  511. buildColumnLayout(): string;
  512. emitNewBlock(event: React.DragEvent<HTMLDivElement>): void;
  513. handlePopUp: () => void;
  514. handleClosingPopUp: () => void;
  515. createPopupWindow: (title: string, windowVariableName: string, width?: number, height?: number) => Window | null;
  516. copyStyles: (sourceDoc: HTMLDocument, targetDoc: HTMLDocument) => void;
  517. fixPopUpStyles: (document: Document) => void;
  518. render(): JSX.Element;
  519. }
  520. }
  521. declare module GUIEDITOR {
  522. export class Popup {
  523. static CreatePopup(title: string, windowVariableName: string, width?: number, height?: number): HTMLDivElement | null;
  524. private static _CopyStyles;
  525. }
  526. }
  527. declare module GUIEDITOR {
  528. /**
  529. * Interface used to specify creation options for the gui editor
  530. */
  531. export interface IGUIEditorOptions {
  532. hostElement?: HTMLElement;
  533. customSave?: {
  534. label: string;
  535. action: (data: string) => Promise<void>;
  536. };
  537. customLoadObservable?: BABYLON.Observable<any>;
  538. }
  539. /**
  540. * Class used to create a gui editor
  541. */
  542. export class GUIEditor {
  543. private static _CurrentState;
  544. /**
  545. * Show the gui editor
  546. * @param options defines the options to use to configure the gui editor
  547. */
  548. static Show(options: IGUIEditorOptions): void;
  549. }
  550. }
  551. declare module GUIEDITOR {
  552. interface ILineWithFileButtonComponentProps {
  553. title: string;
  554. closed?: boolean;
  555. label: string;
  556. iconImage: any;
  557. onIconClick: (file: File) => void;
  558. accept: string;
  559. uploadName?: string;
  560. }
  561. export class LineWithFileButtonComponent extends React.Component<ILineWithFileButtonComponentProps, {
  562. isExpanded: boolean;
  563. }> {
  564. private uploadRef;
  565. constructor(props: ILineWithFileButtonComponentProps);
  566. onChange(evt: any): void;
  567. switchExpandedState(): void;
  568. render(): JSX.Element;
  569. }
  570. }
  571. declare module GUIEDITOR {
  572. interface ITextInputLineComponentProps {
  573. label: string;
  574. globalState: GlobalState;
  575. target?: any;
  576. propertyName?: string;
  577. value?: string;
  578. multilines?: boolean;
  579. onChange?: (value: string) => void;
  580. validator?: (value: string) => boolean;
  581. onPropertyChangedObservable?: BABYLON.Observable<PropertyChangedEvent>;
  582. }
  583. export class TextInputLineComponent extends React.Component<ITextInputLineComponentProps, {
  584. value: string;
  585. }> {
  586. private _localChange;
  587. constructor(props: ITextInputLineComponentProps);
  588. shouldComponentUpdate(nextProps: ITextInputLineComponentProps, nextState: {
  589. value: string;
  590. }): boolean;
  591. raiseOnPropertyChanged(newValue: string, previousValue: string): void;
  592. updateValue(value: string, raisePropertyChanged: boolean): void;
  593. render(): JSX.Element;
  594. }
  595. }
  596. declare module GUIEDITOR {
  597. export interface IColorComponentEntryProps {
  598. value: number;
  599. label: string;
  600. max?: number;
  601. min?: number;
  602. onChange: (value: number) => void;
  603. }
  604. export class ColorComponentEntry extends React.Component<IColorComponentEntryProps> {
  605. constructor(props: IColorComponentEntryProps);
  606. updateValue(valueString: string): void;
  607. render(): JSX.Element;
  608. }
  609. }
  610. declare module GUIEDITOR {
  611. export interface IHexColorProps {
  612. value: string;
  613. expectedLength: number;
  614. onChange: (value: string) => void;
  615. }
  616. export class HexColor extends React.Component<IHexColorProps, {
  617. hex: string;
  618. }> {
  619. constructor(props: IHexColorProps);
  620. shouldComponentUpdate(nextProps: IHexColorProps, nextState: {
  621. hex: string;
  622. }): boolean;
  623. updateHexValue(valueString: string): void;
  624. render(): JSX.Element;
  625. }
  626. }
  627. declare module GUIEDITOR {
  628. /**
  629. * Interface used to specify creation options for color picker
  630. */
  631. export interface IColorPickerProps {
  632. color: BABYLON.Color3 | BABYLON.Color4;
  633. debugMode?: boolean;
  634. onColorChanged?: (color: BABYLON.Color3 | BABYLON.Color4) => void;
  635. }
  636. /**
  637. * Interface used to specify creation options for color picker
  638. */
  639. export interface IColorPickerState {
  640. color: BABYLON.Color3;
  641. alpha: number;
  642. }
  643. /**
  644. * Class used to create a color picker
  645. */
  646. export class ColorPicker extends React.Component<IColorPickerProps, IColorPickerState> {
  647. private _saturationRef;
  648. private _hueRef;
  649. private _isSaturationPointerDown;
  650. private _isHuePointerDown;
  651. constructor(props: IColorPickerProps);
  652. onSaturationPointerDown(evt: React.PointerEvent<HTMLDivElement>): void;
  653. onSaturationPointerUp(evt: React.PointerEvent<HTMLDivElement>): void;
  654. onSaturationPointerMove(evt: React.PointerEvent<HTMLDivElement>): void;
  655. onHuePointerDown(evt: React.PointerEvent<HTMLDivElement>): void;
  656. onHuePointerUp(evt: React.PointerEvent<HTMLDivElement>): void;
  657. onHuePointerMove(evt: React.PointerEvent<HTMLDivElement>): void;
  658. private _evaluateSaturation;
  659. private _evaluateHue;
  660. componentDidUpdate(): void;
  661. raiseOnColorChanged(): void;
  662. render(): JSX.Element;
  663. }
  664. }
  665. declare module GUIEDITOR {
  666. export interface IBooleanLineComponentProps {
  667. label: string;
  668. value: boolean;
  669. }
  670. export class BooleanLineComponent extends React.Component<IBooleanLineComponentProps> {
  671. constructor(props: IBooleanLineComponentProps);
  672. render(): JSX.Element;
  673. }
  674. }
  675. declare module GUIEDITOR {
  676. interface IFileMultipleButtonLineComponentProps {
  677. label: string;
  678. onClick: (event: any) => void;
  679. accept: string;
  680. }
  681. export class FileMultipleButtonLineComponent extends React.Component<IFileMultipleButtonLineComponentProps> {
  682. private static _IDGenerator;
  683. private _id;
  684. private uploadInputRef;
  685. constructor(props: IFileMultipleButtonLineComponentProps);
  686. onChange(evt: any): void;
  687. render(): JSX.Element;
  688. }
  689. }
  690. declare module GUIEDITOR {
  691. export interface IIconButtonLineComponentProps {
  692. icon: string;
  693. onClick: () => void;
  694. tooltip: string;
  695. active?: boolean;
  696. }
  697. export class IconButtonLineComponent extends React.Component<IIconButtonLineComponentProps> {
  698. constructor(props: IIconButtonLineComponentProps);
  699. render(): JSX.Element;
  700. }
  701. }
  702. declare module GUIEDITOR {
  703. interface IIndentedTextLineComponentProps {
  704. value?: string;
  705. color?: string;
  706. underline?: boolean;
  707. onLink?: () => void;
  708. url?: string;
  709. additionalClass?: string;
  710. }
  711. export class IndentedTextLineComponent extends React.Component<IIndentedTextLineComponentProps> {
  712. constructor(props: IIndentedTextLineComponentProps);
  713. onLink(): void;
  714. renderContent(): JSX.Element;
  715. render(): JSX.Element;
  716. }
  717. }
  718. declare module GUIEDITOR {
  719. interface ILinkButtonComponentProps {
  720. label: string;
  721. buttonLabel: string;
  722. url?: string;
  723. onClick: () => void;
  724. onIconClick?: () => void;
  725. }
  726. export class LinkButtonComponent extends React.Component<ILinkButtonComponentProps> {
  727. constructor(props: ILinkButtonComponentProps);
  728. onLink(): void;
  729. render(): JSX.Element;
  730. }
  731. }
  732. declare module GUIEDITOR {
  733. interface IMessageLineComponentProps {
  734. text: string;
  735. color?: string;
  736. }
  737. export class MessageLineComponent extends React.Component<IMessageLineComponentProps> {
  738. constructor(props: IMessageLineComponentProps);
  739. render(): JSX.Element;
  740. }
  741. }
  742. declare module GUIEDITOR {
  743. interface INumericInputComponentProps {
  744. label: string;
  745. value: number;
  746. step?: number;
  747. onChange: (value: number) => void;
  748. precision?: number;
  749. }
  750. export class NumericInputComponent extends React.Component<INumericInputComponentProps, {
  751. value: string;
  752. }> {
  753. static defaultProps: {
  754. step: number;
  755. };
  756. private _localChange;
  757. constructor(props: INumericInputComponentProps);
  758. shouldComponentUpdate(nextProps: INumericInputComponentProps, nextState: {
  759. value: string;
  760. }): boolean;
  761. updateValue(evt: any): void;
  762. onBlur(): void;
  763. render(): JSX.Element;
  764. }
  765. }
  766. declare module GUIEDITOR {
  767. interface IRadioButtonLineComponentProps {
  768. onSelectionChangedObservable: BABYLON.Observable<RadioButtonLineComponent>;
  769. label: string;
  770. isSelected: () => boolean;
  771. onSelect: () => void;
  772. }
  773. export class RadioButtonLineComponent extends React.Component<IRadioButtonLineComponentProps, {
  774. isSelected: boolean;
  775. }> {
  776. private _onSelectionChangedObserver;
  777. constructor(props: IRadioButtonLineComponentProps);
  778. componentDidMount(): void;
  779. componentWillUnmount(): void;
  780. onChange(): void;
  781. render(): JSX.Element;
  782. }
  783. }
  784. declare module GUIEDITOR {
  785. interface IValueLineComponentProps {
  786. label: string;
  787. value: number;
  788. color?: string;
  789. fractionDigits?: number;
  790. units?: string;
  791. }
  792. export class ValueLineComponent extends React.Component<IValueLineComponentProps> {
  793. constructor(props: IValueLineComponentProps);
  794. render(): JSX.Element;
  795. }
  796. }