/*
 * @Author: LiZhiWei
 * @Date: 2026-01-13 15:01:49
 * @LastEditors: LiZhiWei
 * @LastEditTime: 2026-01-15 17:51:48
 * @Description:
 */
declare global {
  type Card = {
    title: string
    desc: string
    icon: string
  }

  type CaseItem = {
    title: string
    desc: string
    img: string
    btnText: string
    points: {
      title: string
      itemDesc: string
    }[]
  }

  type HistoryEvent = {
    month: string
    content: string
  }

  type HistoryYear = {
    year: string
    events: HistoryEvent[]
  }

  type AbilityTab = {
    id: string
    title: string
  }

  type BasicResponse<T = any> = {
    code: number
    message: string
    data: T
  }

  /**
   * 接口返回数据模型
   */
  type ApiResponse<T = unknown> = {
    data: BasicResponse<T>
  }

  /**
   * table
   */
  type TableData<T = unknown> = {
    list: Array<T>
    pageSize?: number
    pageNum?: number
    pages?: number
    total?: number
  }

  type Page = {
    pageSize?: number
    pageNum?: number
    isPage?: boolean
  }

  /**
   * dialog数据
   */
  type ModalData<T = unknown> = {
    isShow?: boolean
    type?: string
    loading?: boolean
    row?: T
    title?: string
  }

  /**
   * 枚举
   */
  type IOption = {
    id?: string
    code?: string
    value?: string
    name?: string
    label?: string
    type?: string
    leaf?: boolean
    children?: IOption[]
  }

  /**
   * 表单验证
   */
  type IFormValidateCallback = {
    (message?: string | Error | undefined): Error | void
  }

  type IFormValidator = (
    rule: {
      field: string
    },
    value: string,
    callback: IFormValidateCallback
  ) => void

  type FormRuleItemParams = {
    required?: boolean
    message?: string
    validator?: IFormValidator
    trigger?: string
  }
  type AnyObject<T = unknown> = {
    [key: string]: T
  }
}

export {}
