/*
 * @Author: jixiang
 * @Date: 2021-04-07 11:06:09
 * @Description:一些通用的interface
 * @FilePath: /book_pc/src/@type/index.ts
 * 56580223@qq.com
 */
import { AppStateType } from '@/store/modules/app/state';
import { UserStateType } from '@/store/modules/user/state';

// vuex state 的模块的类型
type ModuleType = {
  app: AppStateType;
  user: UserStateType;
};

// 所有的StateType
export type StateType = ModuleType;

/** http请求响应格式  */
export declare interface ApiResponse {
  errCode: number;
  errMsg?: string;
  data?: any;
}

// ant-design-button 颜色
export type ButtonColorType = 'primary' | 'danger' | 'dashed' | 'ghost' | 'default' | 'link';

// icon的类型
export type IconType = 'icon' | 'iconfont';

// 对话框打开类型
export type ModalOpenMode = 'edit' | 'add' | 'other';

export interface BasicUserType {
  id: number;
  name?: string;
  avatar?: string;
  role?: string;
  department?: string;
  code?: string;
  createTime?: string;
  description?: string;
  email?: string;
  lastLoginTime?: string;
  modifyTime?: string;
  modifyUser?: number;
  nickName?: string;
  phone?: string;
  roleId?: number;
  roleName?: string;
  status?: number;
  tenantId?: number;
  type?: string;
  userId?: number;
  username?: string;
  cloudRole?: string;
}

// 接口响应通过格式
export interface HttpResponse {
  status: number;
  statusText: string;
  data: {
    code: number;
    desc: string;
    [key: string]: any;
  };
}
