Pārlūkot izejas kodu

tsdoc and declaration fixed

Raanan Weber 7 gadi atpakaļ
vecāks
revīzija
5d9bd3f184

+ 14 - 0
Tools/Gulp/config.json

@@ -1797,6 +1797,13 @@
         "build": {
             "srcOutputDirectory": "../../gui/src/",
             "distOutputDirectory": "/gui/",
+            "dtsBundle": {
+                "name": "babylonjs-gui",
+                "main": "../../dist/preview release/gui/build/index.d.ts",
+                "out": "../babylon.gui.module.d.ts",
+                "baseDir": "../../dist/preview release/gui/build/",
+                "headerText": "BabylonJS GUI"
+            },
             "processDeclaration": {
                 "filename": "babylon.gui.module.d.ts",
                 "packageName": "babylonjs-gui",
@@ -1824,6 +1831,13 @@
         "build": {
             "srcOutputDirectory": "../../inspector/src/",
             "distOutputDirectory": "/inspector/",
+            "dtsBundle": {
+                "name": "babylonjs-inspector",
+                "main": "../../dist/preview release/inspector/build/index.d.ts",
+                "out": "../babylon.inspector.module.d.ts",
+                "baseDir": "../../dist/preview release/inspector/build/",
+                "headerText": "BabylonJS Inspector"
+            },
             "processDeclaration": {
                 "filename": "babylon.inspector.module.d.ts",
                 "packageName": "babylonjs-inspector",

+ 11 - 6
Tools/Gulp/gulpfile.js

@@ -556,13 +556,18 @@ var buildExternalLibrary = function (library, settings, watch) {
                 sequence.push(
                     buildEvent
                 );
-                if (settings.build.processDeclaration) {
+                if (settings.build.dtsBundle || settings.build.processDeclaration) {
                     buildEvent.on("end", function () {
-                        let fileLocation = path.join(outputDirectory, settings.build.processDeclaration.filename);
-                        fs.readFile(fileLocation, function (err, data) {
-                            var newData = processDeclaration(data, settings.build.processDeclaration);
-                            fs.writeFile(fileLocation.replace('.module', ''), newData);
-                        });
+                        if (settings.build.dtsBundle) {
+                            dtsBundle.bundle(settings.build.dtsBundle);
+                        } if (settings.build.processDeclaration) {
+                            let fileLocation = path.join(outputDirectory, settings.build.processDeclaration.filename);
+                            fs.readFile(fileLocation, function (err, data) {
+                                if (err) throw err;
+                                var newData = processDeclaration(data, settings.build.processDeclaration);
+                                fs.writeFile(fileLocation.replace('.module', ''), newData);
+                            });
+                        }
                     });
                 }
                 /*if (settings.build.processDeclaration) {

+ 1 - 1
Tools/Gulp/processViewerDeclaration.js

@@ -59,7 +59,7 @@ module.exports = function (data, options) {
 
     str = str.replace(/export {(.*)};/g, '');
 
-    str = str.split("\n").filter(line => line.trim()).join("\n");
+    str = str.split("\n").filter(line => line.trim()).filter(line => line.indexOf("export * from") === -1).join("\n");
 
     return str;
 }

+ 3 - 1
gui/src/2D/controls/control.ts

@@ -1405,8 +1405,10 @@ export class Control {
      * @param size defines the size of the header
      * @param options defines options used to configure the header
      * @returns a new StackPanel
+     * @ignore
+     * @hidden
      */
-    public static AddHeader: (control: Control, text: string, size: string | number, options: { isHorizontal: boolean, controlFirst: boolean }) => any;
+    public static AddHeader: (control: Control, text: string, size: string | number, options: { isHorizontal: boolean, controlFirst: boolean }) => any = () => { };
 
     /** @hidden */
     protected static drawEllipse(x: number, y: number, width: number, height: number, context: CanvasRenderingContext2D): void {

+ 13 - 1
gui/src/2D/controls/statics.ts

@@ -2,10 +2,22 @@ import { Control } from "./control";
 import { StackPanel } from "./stackPanel";
 import { TextBlock } from "./textBlock";
 
-let name = "Statics";
+/**
+ * Forcing an export so that this code will execute
+ * @ignore
+ */
+const name = "Statics";
 
 export { name };
 
+/**
+ * Creates a stack panel that can be used to render headers
+ * @param control defines the control to associate with the header
+ * @param text defines the text of the header
+ * @param size defines the size of the header
+ * @param options defines options used to configure the header
+ * @returns a new StackPanel
+ */
 Control.AddHeader = function (control: Control, text: string, size: string | number, options: { isHorizontal: boolean, controlFirst: boolean }): StackPanel {
     let panel = new StackPanel("panel");
     let isHorizontal = options ? options.isHorizontal : true;

+ 3 - 2
gui/webpack.config.js

@@ -57,13 +57,14 @@ module.exports = {
             path.resolve(__dirname, './src/**/*.js'),
             path.resolve(__dirname, './src/**/*.map')
         ]),
-        new DtsBundleWebpack({
+        // moved out of here due to the way gulp works...
+        /*new DtsBundleWebpack({
             name: "babylonjs-gui",
             main: path.resolve(__dirname, '../dist/preview release/gui/build/index.d.ts'),
             out: path.resolve(__dirname, '../dist/preview release/gui/babylon.gui.module.d.ts'),
             baseDir: path.resolve(__dirname, '../dist/preview release/gui/build/'),
             headerText: "BabylonJS GUI"
-        }),
+        }),*/
         new webpack.WatchIgnorePlugin([
             /\.js$/,
             /\.d\.ts$/

+ 3 - 2
inspector/webpack.config.js

@@ -81,13 +81,14 @@ module.exports = {
             path.resolve(__dirname, './src/**/*.js'),
             path.resolve(__dirname, './src/**/*.map')
         ]),
-        new DtsBundleWebpack({
+        // removed due to the way gulp=webpack works
+        /*new DtsBundleWebpack({
             name: "babylonjs-inspector",
             main: path.resolve(__dirname, '../dist/preview release/inspector/build/index.d.ts'),
             out: path.resolve(__dirname, '../dist/preview release/inspector/babylon.inspector.module.d.ts'),
             baseDir: path.resolve(__dirname, '../dist/preview release/inspector/build/'),
             headerText: "BabylonJS Inspector"
-        }),
+        }),*/
         new webpack.WatchIgnorePlugin([
             /\.js$/,
             /\.d\.ts$/

+ 7 - 1
src/Materials/babylon.effect.ts

@@ -1423,7 +1423,13 @@
             return this;
         }
 
-        public RegisterShader(name: string, pixelShader?: string, vertexShader?: string) {
+        /**
+         * This function will add a new shader to the shader store
+         * @param name the name of the shader
+         * @param pixelShader optional pixel shader content
+         * @param vertexShader optional vertex shader content
+         */
+        public static RegisterShader(name: string, pixelShader?: string, vertexShader?: string) {
             if (pixelShader) {
                 Effect.ShadersStore[`${name}PixelShader`] = pixelShader;
             }