Explorar o código

优化类型定义

Michael Wang %!s(int64=3) %!d(string=hai) anos
pai
achega
c49a57eb76
Modificáronse 1 ficheiros con 4 adicións e 1 borrados
  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;
   }
 }