Skip to content

Commit d37ce04

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

File tree

3 files changed

+39
-37
lines changed

3 files changed

+39
-37
lines changed

src/typings/api.d.ts

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -47,41 +47,4 @@ declare namespace Api {
4747
status: EnableStatus | null;
4848
} & T;
4949
}
50-
51-
/**
52-
* namespace Auth
53-
*
54-
* backend api module: "auth"
55-
*/
56-
namespace Auth {
57-
interface LoginToken {
58-
token: string;
59-
refreshToken: string;
60-
}
61-
62-
interface UserInfo {
63-
userId: string;
64-
userName: string;
65-
roles: string[];
66-
buttons: string[];
67-
}
68-
}
69-
70-
/**
71-
* namespace Route
72-
*
73-
* backend api module: "route"
74-
*/
75-
namespace Route {
76-
type ElegantConstRoute = import('@elegant-router/types').ElegantConstRoute;
77-
78-
interface MenuRoute extends ElegantConstRoute {
79-
id: string;
80-
}
81-
82-
interface UserRoute {
83-
routes: MenuRoute[];
84-
home: import('@elegant-router/types').LastLevelRouteKey;
85-
}
86-
}
8750
}

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)