hookehuyr

✨ feat: TS配置全局类型和配置APPID环境变量

......@@ -12,3 +12,6 @@ VITE_OUTDIR = voice
# 是否开启调试
VITE_CONSOLE = 0
# appID相关
VITE_APPID=微信appID
......
......@@ -7,9 +7,10 @@
* @Description:
*/
interface ImportMetaEnv extends Readonly<Record<string, string>> {
readonly VITE_OPENID: string
readonly VITE_ID: string
readonly VITE_PIN: string
readonly VITE_OPENID: string;
readonly VITE_ID: string;
readonly VITE_PIN: string;
readonly VITE_APPID: string;
}
interface ImportMeta {
......
......@@ -35,11 +35,12 @@
]
},
"include": [
"**/*.d.ts",
"src/**/*.ts",
"src/**/*.tsx",
"src/**/*.vue",
"tests/**/*.ts",
"tests/**/*.tsx", "src/views/test/test.js",
"tests/**/*.tsx",
],
"exclude": [
"node_modules",
......
/*
* @Date: 2022-06-13 10:39:44
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2022-06-13 10:41:43
* @FilePath: /tswj/typings/index.d.ts
* @Description: 文件描述
*/
export {};
// => 全局类型声明
declare global {
interface Window {
_hmt: any;
wx: any;
AlipayJSBridge: any;
}
namespace GD {
interface BaseResponse<T = any> {
code: number;
data: T;
msg: string;
page: {
pageNo: number;
pageSize: number;
pages: number;
total: number;
};
}
}
}
// const response = GD.BaseResponse<{name: string}>