Browse Source

Enhance Typescript version compatibility

sebastien 7 years ago
parent
commit
5d4bc1d07b
3 changed files with 6 additions and 6 deletions
  1. 2 2
      inspector/src/Inspector.ts
  2. 1 1
      inspector/src/properties_gui.ts
  3. 3 3
      inspector/src/tools/LabelTool.ts

+ 2 - 2
inspector/src/Inspector.ts

@@ -32,9 +32,9 @@ export class Inspector {
 
     private _parentElement: Nullable<HTMLElement>;
 
-    public onGUILoaded: Observable<typeof import("babylonjs-gui")>;
+    public onGUILoaded: Observable<any>;
 
-    public static GUIObject: typeof import("babylonjs-gui"); // should be typeof "babylonjs-gui";
+    public static GUIObject: any; // should be typeof "babylonjs-gui";
 
     /** The inspector is created with the given engine.
      * If the parameter 'popup' is false, the inspector is created as a right panel on the main window.

+ 1 - 1
inspector/src/properties_gui.ts

@@ -1,7 +1,7 @@
 
 import { PROPERTIES } from "./properties";
 
-export type GUITyping = typeof import("babylonjs-gui");
+export type GUITyping = any;
 
 export let guiLoaded: boolean = false;
 /**

+ 3 - 3
inspector/src/tools/LabelTool.ts

@@ -64,7 +64,7 @@ export class LabelTool extends AbstractTool {
         return true;
     }
 
-    private _createLabel(mesh: AbstractMesh, GUI: typeof import("babylonjs-gui")) {
+    private _createLabel(mesh: AbstractMesh, GUI: any) {
         // Don't create label for "system nodes" (starting and ending with ###)
         let name = mesh.name;
 
@@ -73,14 +73,14 @@ export class LabelTool extends AbstractTool {
         }
 
         if (mesh && this._advancedTexture) {
-            let rect1: import("babylonjs-gui").Rectangle = new GUI.Rectangle();
+            let rect1 = new GUI.Rectangle();
             rect1.width = 4 + 10 * name.length + "px";
             rect1.height = "22px";
             rect1.background = "rgba(0,0,0,0.6)";
             rect1.color = "black";
             this._advancedTexture.addControl(rect1);
 
-            let label: import("babylonjs-gui").TextBlock = new GUI.TextBlock();
+            let label = new GUI.TextBlock();
             label.text = name;
             label.fontSize = 12;
             rect1.addControl(label);