import "antd-mobile/es/toast/style";
import _Toast from "antd-mobile/es/toast";
export default (function (_ref) {
  var _ref$icon = _ref.icon,
      icon = _ref$icon === void 0 ? 'success' : _ref$icon,
      title = _ref.title,
      duration = _ref.duration,
      _ref$mask = _ref.mask,
      mask = _ref$mask === void 0 ? false : _ref$mask;
  return new Promise(function (resolve) {
    if (icon === 'none') {
      _Toast.show(title, duration, mask);

      setTimeout(resolve, duration);
    } else {
      _Toast.success(title, duration, function () {
        return resolve('');
      }, mask);
    }
  });
});