feature(auth): create types
This commit is contained in:
@@ -1,2 +1,3 @@
|
|||||||
export * from "./lib";
|
export * from "./lib";
|
||||||
export * from "./ui";
|
export * from "./ui";
|
||||||
|
export * from "./model";
|
||||||
|
|||||||
2
src/features/auth/model/index.ts
Normal file
2
src/features/auth/model/index.ts
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
export * from "./types/service";
|
||||||
|
export * from "./types/store";
|
||||||
18
src/features/auth/model/types/service.ts
Normal file
18
src/features/auth/model/types/service.ts
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
import type { User } from "entities/User";
|
||||||
|
|
||||||
|
export interface AuthResponse {
|
||||||
|
/**
|
||||||
|
* Access token for the authenticated user.
|
||||||
|
*/
|
||||||
|
accessToken: string;
|
||||||
|
/**
|
||||||
|
* User object associated with the access token.
|
||||||
|
*/
|
||||||
|
user: User;
|
||||||
|
}
|
||||||
|
|
||||||
|
export type AuthStatus =
|
||||||
|
| "idle"
|
||||||
|
| "loading"
|
||||||
|
| "authenticated"
|
||||||
|
| "unauthenticated";
|
||||||
7
src/features/auth/model/types/store.ts
Normal file
7
src/features/auth/model/types/store.ts
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
import type { User } from "entities/User";
|
||||||
|
import type { AuthStatus } from "./service";
|
||||||
|
|
||||||
|
export interface AuthStore {
|
||||||
|
user?: User;
|
||||||
|
status?: AuthStatus;
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user