Sfoglia il codice sorgente

优化类型定义

Michael Wang 3 anni fa
parent
commit
c49a57eb76
1 ha cambiato i file con 4 aggiunte e 1 eliminazioni
  1. 4 1
      src/types/global.d.ts

+ 4 - 1
src/types/global.d.ts

@@ -16,9 +16,12 @@ declare global {
   const $message: MessageApiInjection;
   const $dialog: DialogApiInjection;
   const _hmt: string[][];
+  // 这样定义才能 window._hmt ; 和下面的 interface window 一样
+  // eslint-disable-next-line no-var
+  // var _hmt: string[][];
 
   interface Window {
-    nodeRequire: (path: string) => any;
+    nodeRequire: typeof require;
   }
 }