Fakultas Ilmu Komputer UI

types.ts 574 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
13

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