Michael Wang преди 3 години
родител
ревизия
c49a57eb76
променени са 1 файла, в които са добавени 4 реда и са изтрити 1 реда
  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;
   }
 }