import AModal from './src/Modal.mjs';
import useModal from './src/useModal/index.mjs';
import confirm, { withWarn, withInfo, withSuccess, withError, withConfirm } from './src/confirm.mjs';
import destroyFns from './src/destroyFns.mjs';
import './src/interface.mjs';
export { modalProps } from './src/props.mjs';

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

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