Fakultas Ilmu Komputer UI

types.ts 641 Bytes
Newer Older
1
import { ApiResponse } from 'services/api';
2
3
4
5
6
import {
  LoginRequest,
  LoginResponse,
  RegistrationRequest,
  User,
7
  LinkUserDataResponse,
8
} from 'services/auth/models';
9
10
11
12

export interface iUserContext {
  user: User;
  isAuthenticated: boolean;
13
14
15
16
  isUnpaidClient: boolean;
  isPaidClient: boolean;
  isNutritionist: boolean;
  isAdmin: boolean;
17
  isLoading: boolean;
18
19
20
21
  isFirstLoading: boolean;
  signup: (
    data: RegistrationRequest,
  ) => ApiResponse<LoginResponse | LinkUserDataResponse>;
22
  login: (data: LoginRequest) => ApiResponse<LoginResponse>;
23
  loginWithGoogle: (_?: boolean) => Promise<void>;
24
25
  logout: () => Promise<void>;
}