import type { KnownProblem } from "$lib/models/internal/KnownProblem" export interface IAccountService { session: Session, login_async(payload: LoginPayload): Promise, logout_async(): Promise, create_account_async(payload: CreateAccountPayload): Promise, delete_current_async(): Promise, update_current_async(payload: UpdateAccountPayload): Promise, } export type Session = { profile: { username: string, displayName: string, id: string, }, lastChecked: number, } export type LoginPayload = { username: string, password: string, persist: boolean } export type LoginResponse = { isLoggedIn: boolean } export type CreateAccountPayload = { username: string, password: string, } export type CreateAccountResponse = { isCreated: boolean, knownProblem?: KnownProblem } export type DeleteAccountResponse = { isDeleted: boolean } export type UpdateAccountPayload = { username: string, password: string } export type UpdateAccountResponse = { isUpdated: boolean, knownProblem?: KnownProblem }