/**
 * IAuthStorage 接口
 *
 * 对齐 Dart 端 `IAuthStorage`（lib/data/services/storage/iauth_storage.dart）：
 *   - loginToken / loginProvider / guestToken / deviceId / refreshToken / ASID / PSID 字段的 CRUD
 *   - `clearAuthData()` 批量清空登录态
 *   - `clearBusinessAuthData()` 仅清空真实用户登录态，保留 guest token / deviceId
 *   - 所有方法返回 `Promise<Result<T>>`，与 Dart `Future<Result<T>>` 对齐
 */

import type { Result } from "@/utils/result";
import type { LoginStatus } from "@/data/dto/auth";

export interface IAuthStorage {
  getLoginToken(): Promise<Result<string | null>>;
  setLoginToken(token: string): Promise<Result<void>>;
  hasLoginToken(): Promise<Result<boolean>>;
  clearLoginToken(): Promise<Result<void>>;

  getLoginProvider(): Promise<Result<LoginStatus | null>>;
  setLoginProvider(provider: LoginStatus): Promise<Result<void>>;
  clearLoginProvider(): Promise<Result<void>>;

  getGuestToken(): Promise<Result<string | null>>;
  setGuestToken(token: string): Promise<Result<void>>;
  hasGuestToken(): Promise<Result<boolean>>;
  clearGuestToken(): Promise<Result<void>>;

  getDeviceId(): Promise<Result<string | null>>;
  setDeviceId(deviceId: string): Promise<Result<void>>;

  getRefreshToken(): Promise<Result<string | null>>;
  setRefreshToken(token: string): Promise<Result<void>>;
  clearRefreshToken(): Promise<Result<void>>;

  getAsid(): Promise<Result<string | null>>;
  setAsid(id: string): Promise<Result<void>>;
  clearAsid(): Promise<Result<void>>;

  getPsid(): Promise<Result<string | null>>;
  setPsid(id: string): Promise<Result<void>>;
  clearPsid(): Promise<Result<void>>;

  clearBusinessAuthData(): Promise<Result<void>>;
  clearAuthData(): Promise<Result<void>>;
}
