Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Hooke
/
tswj
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
hookehuyr
2022-06-13 10:53:44 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
d952acd251d3534403e7f3ab92442412f190fcef
d952acd2
1 parent
f20deb7c
✨ feat: TS配置全局类型和配置APPID环境变量
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
41 additions
and
4 deletions
.env
src/env.d.ts
tsconfig.json
typings/index.d.ts
.env
View file @
d952acd
...
...
@@ -12,3 +12,6 @@ VITE_OUTDIR = voice
# 是否开启调试
VITE_CONSOLE = 0
# appID相关
VITE_APPID=微信appID
...
...
src/env.d.ts
View file @
d952acd
...
...
@@ -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
{
...
...
tsconfig.json
View file @
d952acd
...
...
@@ -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"
,
...
...
typings/index.d.ts
0 → 100644
View file @
d952acd
/*
* @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}>
Please
register
or
login
to post a comment