mirror of
https://github.com/muerwre/orchidmap-front.git
synced 2025-04-25 02:56:41 +07:00
reducers typescripting
This commit is contained in:
parent
4c6526efc9
commit
85b8860862
15 changed files with 496 additions and 316 deletions
45
src/constants/auth.ts
Normal file
45
src/constants/auth.ts
Normal file
|
@ -0,0 +1,45 @@
|
|||
type valueof<T> = T[keyof T]
|
||||
|
||||
export interface IRoles {
|
||||
guest: string,
|
||||
vk: string,
|
||||
}
|
||||
|
||||
export interface IUser {
|
||||
new_messages: number,
|
||||
place_types: {},
|
||||
random_url: string,
|
||||
role: IRoles[keyof IRoles],
|
||||
routes: {},
|
||||
success: boolean,
|
||||
id?: string,
|
||||
token?: string,
|
||||
userdata: {
|
||||
name: string,
|
||||
agent: string,
|
||||
ip: string,
|
||||
photo: string,
|
||||
}
|
||||
}
|
||||
|
||||
export const ROLES: IRoles = {
|
||||
guest: 'guest',
|
||||
vk: 'vk',
|
||||
};
|
||||
|
||||
export const DEFAULT_USER: IUser = {
|
||||
new_messages: 0,
|
||||
place_types: {},
|
||||
random_url: '',
|
||||
role: ROLES.guest,
|
||||
routes: {},
|
||||
success: false,
|
||||
id: null,
|
||||
token: null,
|
||||
userdata: {
|
||||
name: '',
|
||||
agent: '',
|
||||
ip: '',
|
||||
photo: '',
|
||||
}
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue