import type { ModalProps } from 'naive-ui/lib/';
/**
 * @description: 弹窗对外暴露的方法
 */
export interface ModalMethods {
  setModalProps: (props: modalProps) => void;
  openModal: (record?: Recordable, isView?: boolean) => void;
  closeModal: () => void;
  setSubLoading: (status: boolean) => void;
  setModalLoading: (status: boolean) => void;
}

/**
 * 支持修改，DialogOptions 參數
 */
export interface modalProps extends ModalProps {
  /**
   * 弹窗标题
   */
  title?: string;
  /**
   * 弹窗宽度
   */
  width?: number;
  /**
   * 弹窗是否显示
   */
  visible?: boolean;
  /**
   * 弹窗是否显示遮罩层
   */
  maskClosable?: boolean;
  /**
   * 弹窗是否显示头部
   */
  showHeader?: boolean;
  subBtuText?: string;
  showIcon?: boolean;
  /** \
   * 弹窗标题是否自动拼接新增和编辑
   */
  isShowHeaderText?: boolean;
  /**
   * 弹窗内容高度
   */
  height?: number;
  showFooter?: boolean;
}

export type RegisterFn = (ModalInstance: ModalMethods) => void;

export type UseModalReturnType = [RegisterFn, ModalMethods];
