think/packages/domains/lib/services/IUserService.d.ts

34 lines
899 B
TypeScript
Raw Normal View History

2022-03-11 13:57:55 +08:00
import { IUser, ILoginUser } from "../models";
export declare type ICreateUserDto = {
name: string;
password: string;
confirmPassword: string;
avatar?: string;
email?: string;
};
export declare type ILoginUserDto = Pick<ICreateUserDto, "name" | "password">;
export declare type IUpdateUserDto = Pick<ICreateUserDto, "avatar" | "email">;
export declare abstract class IUserService {
user;
token;
registerLoading;
registerError;
loginLoading;
loginError;
updateLoading;
updateError;
abstract register(createUser: ICreateUserDto): Promise<IUser>;
abstract login(loginUser: ILoginUserDto): Promise<ILoginUser>;
abstract updateUser(updateUser: IUpdateUserDto): Promise<IUser>;
abstract logout(): void;
/**
*
*/
abstract storetDataInBrowser(): void;
/**
*
*/
abstract syncDataInBrowser(): void;
}