import pageModal from "./page-modal.vue";
import { FormGorup, FormItem } from "/@/components/BasicForm";

interface ContentApiResponse {
  code: number;
  message: string;
  data: any;
}

type API = (data: any) => Promise<ContentApiResponse>;

export type PageModalInstance = typeof pageModal & {
  dialogVisible: boolean;
  // confirmLoading: boolean;
  // type: ActionType;
};

export interface ModalConfig {
  title: string;
  api: API;
  formItems: Array<FormItem>;
  formGroup: Array<FormGorup>;
}

export const modalProps = {
  modalConfig: {
    type: Object as PropType<ModalConfig>,
    required: true
  }
};
