import Modal from './Modal.mjs';
import confirm, { withWarn, withInfo, withSuccess, withError, withConfirm } from './confirm.mjs';
import useModal from './useModal/index.mjs';
import destroyFns from './destroyFns.mjs';

function modalWarn(props) {
  return confirm(withWarn(props));
}
Modal.useModal = useModal;
Modal.info = function infoFn(props) {
  return confirm(withInfo(props));
};
Modal.success = function successFn(props) {
  return confirm(withSuccess(props));
};
Modal.error = function errorFn(props) {
  return confirm(withError(props));
};
Modal.warning = modalWarn;
Modal.warn = modalWarn;
Modal.confirm = function confirmFn(props) {
  return confirm(withConfirm(props));
};
Modal.destroyAll = function destroyAllFn() {
  while (destroyFns.length) {
    const close = destroyFns.pop();
    if (close)
      close();
  }
};
Modal.install = function(app) {
  app.component(Modal.name, Modal);
  return app;
};

export { Modal as default };
//# sourceMappingURL=index.mjs.map
