Browse Source

chore: fix build method component types ts error #916

richard1015 4 years ago
parent
commit
9b022ccc07
1 changed files with 1 additions and 3 deletions
  1. 1 3
      jd/generate-types.js

+ 1 - 3
jd/generate-types.js

@@ -11,9 +11,7 @@ config.nav.map((item) => {
     let { name, show, exportEmpty, type } = element;
     let { name, show, exportEmpty, type } = element;
     if (show || exportEmpty) {
     if (show || exportEmpty) {
       importStr +=
       importStr +=
-        type == 'methods'
-          ? `declare function ${name}(options: any): void\n`
-          : `declare class ${name} extends UIComponent {}\n`;
+        type == 'methods' ? `declare const ${name}: any;\n` : `declare class ${name} extends UIComponent {}\n`;
       packages.push(name);
       packages.push(name);
     }
     }
   });
   });