diff --git a/src/render/typings.d.ts b/src/render/typings.d.ts deleted file mode 100644 index 77842c9..0000000 --- a/src/render/typings.d.ts +++ /dev/null @@ -1,11 +0,0 @@ - -// declare const React: string -declare module '*.json' -declare module '*.png' -declare module '*.jpg' - - -interface Window { - /** 关闭预加载动画 */ - ClosePreloadLoading: () => void -} diff --git a/tsconfig.json b/tsconfig.json index a42f71f..9143c99 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -17,8 +17,5 @@ "@root/*": ["./*"] }, "allowSyntheticDefaultImports": true - }, - "include": [ - "src" - ] + } } diff --git a/typings/assets.d.ts b/typings/assets.d.ts new file mode 100644 index 0000000..cc9ed96 --- /dev/null +++ b/typings/assets.d.ts @@ -0,0 +1,24 @@ +declare module '*.png' { + const src: string + export default src +} + +declare module '*.jpg' { + const src: string + export default src +} + +declare module '*.gif' { + const src: string + export default src +} + +declare module '*.webp' { + const src: string + export default src +} + +declare module '*.svg' { + const src: string + export default src +} diff --git a/typings/global.d.ts b/typings/global.d.ts new file mode 100644 index 0000000..c79b31c --- /dev/null +++ b/typings/global.d.ts @@ -0,0 +1,11 @@ + +declare namespace NodeJS { + interface ProcessEnv { + readonly NODE_ENV: 'development' | 'production' + } +} + +interface Window { + /** 关闭预加载动画 */ + removeLoading: () => void +} diff --git a/src/render/shims-vue.d.ts b/typings/shims-vue.d.ts similarity index 100% rename from src/render/shims-vue.d.ts rename to typings/shims-vue.d.ts diff --git a/typings/typings.d.ts b/typings/typings.d.ts deleted file mode 100644 index 5b40a42..0000000 --- a/typings/typings.d.ts +++ /dev/null @@ -1,5 +0,0 @@ - -interface Window { - /** 浏览器下开发,关闭 electron 载入动画 */ - stopLoading: () => void -}