// 全局配置常量
export interface GlobalConfig {
  OSS_BASE_URL: string;
  APP_NAME: string;
  PUBLIC_CHATROOM_ID: string;
  PRIVATE_CHATROOM_ID: string;
}

// 认证上下文类型
export interface AuthContextType<T> {
  user: T | null;
  token: string | null;
  login: (username: string, password: string, latitude?: number, longitude?: number) => Promise<T>;
  loginWithToken: (token: string, user: T) => Promise<void>;
  logout: () => Promise<void>;
  isAuthenticated: boolean;
  isLoading: boolean;
}

// 启用/禁用状态枚举
export enum EnableStatus {
  DISABLED = 0, // 禁用
  ENABLED = 1   // 启用
}

// 启用/禁用状态中文映射
export const EnableStatusNameMap: Record<EnableStatus, string> = {
  [EnableStatus.DISABLED]: '禁用',
  [EnableStatus.ENABLED]: '启用'
};

// 删除状态枚举
export enum DeleteStatus {
  NOT_DELETED = 0, // 未删除
  DELETED = 1      // 已删除
}

// 删除状态中文映射
export const DeleteStatusNameMap: Record<DeleteStatus, string> = {
  [DeleteStatus.NOT_DELETED]: '未删除',
  [DeleteStatus.DELETED]: '已删除'
};

// 启用/禁用状态枚举
export enum DisabledStatus {
  DISABLED = 1, // 禁用
  ENABLED = 0   // 启用
}

