Skip to content

Commit bf9baf0

Browse files
Azir-11honghuangdc
authored andcommitted
refactor(types): move Auth and Route namespaces to separate files and clean up api.d.ts
1 parent bbadd41 commit bf9baf0

File tree

2 files changed

+39
-0
lines changed

2 files changed

+39
-0
lines changed

src/typings/api/auth.d.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
declare namespace Api {
2+
/**
3+
* namespace Auth
4+
*
5+
* backend api module: "auth"
6+
*/
7+
namespace Auth {
8+
interface LoginToken {
9+
token: string;
10+
refreshToken: string;
11+
}
12+
13+
interface UserInfo {
14+
userId: string;
15+
userName: string;
16+
roles: string[];
17+
buttons: string[];
18+
}
19+
}
20+
}

src/typings/api/route.d.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
declare namespace Api {
2+
/**
3+
* namespace Route
4+
*
5+
* backend api module: "route"
6+
*/
7+
namespace Route {
8+
type ElegantConstRoute = import('@elegant-router/types').ElegantConstRoute;
9+
10+
interface MenuRoute extends ElegantConstRoute {
11+
id: string;
12+
}
13+
14+
interface UserRoute {
15+
routes: MenuRoute[];
16+
home: import('@elegant-router/types').LastLevelRouteKey;
17+
}
18+
}
19+
}

0 commit comments

Comments
 (0)