Przeglądaj źródła

Adding export as namespace

d.ts file should have the export as namespace. It would also be nicer to
see it at the beginning.
Raanan Weber 8 lat temu
rodzic
commit
77ce086397
1 zmienionych plików z 4 dodań i 3 usunięć
  1. 4 3
      Tools/Gulp/gulp-addDtsExport.js

+ 4 - 3
Tools/Gulp/gulp-addDtsExport.js

@@ -5,8 +5,9 @@ module.exports = function (varName) {
     return through.obj(function (file, enc, cb) {
 
         var moduleExportsAddition =
- //           '\nexport as namespace ' + varName + ';\n' +
-            '\nexport = ' + varName + ';\n';
+            'export = ' + varName + ';\n' +
+            'export as namespace ' + varName + ';\n\n';
+
 
         if (file.isNull()) {
             cb(null, file);
@@ -19,7 +20,7 @@ module.exports = function (varName) {
         }
 
         try {
-            file.contents = new Buffer(String(file.contents) + moduleExportsAddition);
+            file.contents = new Buffer(moduleExportsAddition + String(file.contents));
             this.push(file);
 
         } catch (err) {