"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = void 0;

var _wechat = require("remax/wechat");

/*
 * @Author: codingfly
 * @Description:
 * @Date: 2022-02-21 08:08:15
 * @LastEditTime: 2022-05-25 14:17:11
 * @FilePath: \remaxui\src\show-toast\one\index.wechat.tsx
 */
var _default = function _default(_ref) {
  var title = _ref.title,
      icon = _ref.icon,
      mask = _ref.mask,
      _ref$duration = _ref.duration,
      duration = _ref$duration === void 0 ? 3000 : _ref$duration;
  return new Promise(function (resolve) {
    (0, _wechat.showToast)({
      icon: icon === 'fail' ? 'error' : icon,
      title: title,
      duration: duration,
      mask: mask,
      success: function success() {
        setTimeout(function () {
          resolve('');
        }, duration);
      }
    });
  });
};

exports.default = _default;