import Vnmf from '../../index' declare module '../../index' { namespace showToast { interface Option { /** Contents of the hint */ title: string /** Interface call to the end of echo function(Call successfully、Any failure will be enforced.) */ complete?: (res: VnmfGeneral.CallbackResult) => void /** Postponement of hint */ duration?: number /** Interface call failed echo function */ fail?: (res: VnmfGeneral.CallbackResult) => void /** Icon * * Optional value: * - 'success': Show successful icons,Right now. title Maximum display of text 7 length of a Chinese word; * - 'error': Show Failed Icons,Right now. title Maximum display of text 7 length of a Chinese word; * - 'loading': Show Load Icons,Right now. title Maximum display of text 7 length of a Chinese word; * - 'none': Do not show icons,Right now. title Text shows a maximum of two rows */ icon?: 'success' | 'error' | 'loading' | 'none' /** Custom icon's local path,image Priority is higher than icon */ image?: string /** Whether Transparency Mask should be displayed,♪ And keep your touch from piercing */ mask?: boolean /** Interface calls a successful echo function */ success?: (res: VnmfGeneral.CallbackResult) => void } } namespace showModal { interface Option { /** Undo the text colour of button,It has to be. 16 Colour Strings in Evolution Format */ cancelColor?: string /** Unbutton Text,Up to 4 Character */ cancelText?: string /** Interface call to the end of echo function(Call successfully、Any failure will be enforced.) */ complete?: (res: VnmfGeneral.CallbackResult) => void /** Text Colour for Confirming Buttons,It has to be. 16 Colour Strings in Evolution Format */ confirmColor?: string /** Text for Confirming Buttons,Up to 4 Character */ confirmText?: string /** Contents of the hint */ content?: string /** Interface call failed echo function */ fail?: (res: VnmfGeneral.CallbackResult) => void /** Whether to show cancel buttons */ showCancel?: boolean /** Interface calls a successful echo function */ success?: (result: SuccessCallbackResult) => void /** Caption of the hint */ title?: string } interface SuccessCallbackResult extends VnmfGeneral.CallbackResult { /** Yes. true Hour,Means the user clicked to cancel(For Android The system differentiates between clicking on the monstrosity off and cancel button off.) */ cancel: boolean /** Yes. true Hour,Means the user clicked on OK button */ confirm: boolean /** Call Results */ errMsg: string } } namespace showLoading { interface Option { /** Contents of the hint */ title: string /** Interface call to the end of echo function(Call successfully、Any failure will be enforced.) */ complete?: (res: VnmfGeneral.CallbackResult) => void /** Interface call failed echo function */ fail?: (res: VnmfGeneral.CallbackResult) => void /** Whether Transparency Mask should be displayed,♪ And keep your touch from piercing */ mask?: boolean /** Interface calls a successful echo function */ success?: (res: VnmfGeneral.CallbackResult) => void } } namespace showActionSheet { interface Option { /** Warning Document */ alertText?: string /** Text array of buttons,The maximum length of the array is 6 */ itemList: string[] /** Interface call to the end of echo function(Call successfully、Any failure will be enforced.) */ complete?: (res: VnmfGeneral.CallbackResult) => void /** Interface call failed echo function */ fail?: (res: VnmfGeneral.CallbackResult) => void /** Text colour for buttons */ itemColor?: string /** Interface calls a successful echo function */ success?: (result: SuccessCallbackResult) => void } interface SuccessCallbackResult extends VnmfGeneral.CallbackResult { /** The number of the buttons that user clicks on,Top to Bottom Order,From0Here we go. */ tapIndex: number /** Call Results */ errMsg: string } } namespace hideToast { interface Option { /** Interface call to the end of echo function(Call successfully、Any failure will be enforced.) */ complete?: (res: VnmfGeneral.CallbackResult) => void /** Interface call failed echo function */ fail?: (res: VnmfGeneral.CallbackResult) => void /** Interface calls a successful echo function */ success?: (res: VnmfGeneral.CallbackResult) => void } } namespace hideLoading { interface Option { /** Interface call to the end of echo function(Call successfully、Any failure will be enforced.) */ complete?: (res: VnmfGeneral.CallbackResult) => void /** Interface call failed echo function */ fail?: (res: VnmfGeneral.CallbackResult) => void /** Interface calls a successful echo function */ success?: (res: VnmfGeneral.CallbackResult) => void } } namespace enableAlertBeforeUnload { interface Option { /** Query the contents of dialogue box */ message: string /** Interface call to the end of echo function(Call successfully、Any failure will be enforced.) */ complete?: (res: VnmfGeneral.CallbackResult) => void /** Interface call failed echo function */ fail?: (res: VnmfGeneral.CallbackResult) => void /** Interface calls a successful echo function */ success?: (res: VnmfGeneral.CallbackResult) => void } } namespace disableAlertBeforeUnload { interface Option { /** Interface call to the end of echo function(Call successfully、Any failure will be enforced.) */ complete?: (res: VnmfGeneral.CallbackResult) => void /** Interface call failed echo function */ fail?: (res: VnmfGeneral.CallbackResult) => void /** Interface calls a successful echo function */ success?: (res: VnmfGeneral.CallbackResult) => void } } interface VnmfStatic { /** Show message hint box * * **Attention.** * - Vnmf.showLoading and Vnmf.showToast At the same time, only one can be shown. * - Vnmf.showToast Should read Vnmf.hideToast Pair Use * @supported weapp, h5, rn, tt * @example * ```tsx * Vnmf.showToast({ * title: 'Success', * icon: 'success', * duration: 2000 * }) * ``` * @see https://developers.weixin.qq.com/miniprogram/dev/api/ui/interaction/wx.showToast.html */ showToast(option?: showToast.Option): Promise /** Show Model Dialog * **Attention.** * - Android 6.7.2 The following version,When clicking on cancel or monstrosity,Turn back. fail, errMsg Yes. "fail cancel"; * - Android 6.7.2 and above and iOS Clicking on the monstrosity doesn't close a plastic bullet window.,So try not to use it.「Cancel」Achieving business logic in branches * @supported weapp, h5, rn, tt * @example * ```tsx * Vnmf.showModal({ * title: 'Hint', * content: 'It's a model bullet window.', * success: function (res) { * if (res.confirm) { * console.log('User click OK') * } else if (res.cancel) { * console.log('User Click Cancel') * } * } * }) * ``` * @see https://developers.weixin.qq.com/miniprogram/dev/api/ui/interaction/wx.showModal.html */ showModal(option?: showModal.Option): Promise /** Display loading Hint Box。You need to call it on your own. Vnmf.hideLoading Can not close message: %s * * **Attention.** * - Vnmf.showLoading and Vnmf.showToast At the same time, only one can be shown. * - Vnmf.showLoading Should read Vnmf.hideLoading Pair Use * @supported weapp, h5, rn, tt * @example * ```tsx * Vnmf.showLoading({ * title: 'Loading', * }) * setTimeout(function () { * Vnmf.hideLoading() * }, 2000) * ``` * @see https://developers.weixin.qq.com/miniprogram/dev/api/ui/interaction/wx.showLoading.html */ showLoading(option?: showLoading.Option): Promise /** Show Operation Menu * * **Attention.** * - Android 6.7.2 The following version,When clicking on cancel or monstrosity,Turn back. fail, errMsg Yes. "fail cancel"; * - Android 6.7.2 and above and iOS Clicking on the monstrosity doesn't close a plastic bullet window.,So try not to use it.「Cancel」Achieving business logic in branches * @supported weapp, h5, rn, tt * @example * ```tsx * Vnmf.showActionSheet({ * itemList: ['A', 'B', 'C'], * success: function (res) { * console.log(res.tapIndex) * }, * fail: function (res) { * console.log(res.errMsg) * } * }) * ``` * @see https://developers.weixin.qq.com/miniprogram/dev/api/ui/interaction/wx.showActionSheet.html */ showActionSheet(option: showActionSheet.Option): Promise /** Hide Message Hint Box * @supported weapp, h5, rn, tt * @see https://developers.weixin.qq.com/miniprogram/dev/api/ui/interaction/wx.hideToast.html */ hideToast(option?: hideToast.Option): void /** Hide loading Hint Box * @supported weapp, h5, rn, tt * @example * ```tsx * Vnmf.showLoading({ * title: 'Loading', * }) * setTimeout(function (){ * Vnmf.hideLoading() * },2000) * ``` * @see https://developers.weixin.qq.com/miniprogram/dev/api/ui/interaction/wx.hideLoading.html */ hideLoading(option?: hideLoading.Option): void /** Hide loading Hint Box /** Open the applet page to return query dialogue * @supported weapp * @example * ```tsx * Vnmf.enableAlertBeforeUnload({ * success: function () { * console.log('success') * }, * }) * ``` * @see https://developers.weixin.qq.com/miniprogram/dev/api/ui/interaction/wx.enableAlertBeforeUnload.html */ enableAlertBeforeUnload(option: enableAlertBeforeUnload.Option): void /** Close the applet page and return query dialogue * @supported weapp * @see https://developers.weixin.qq.com/miniprogram/dev/api/ui/interaction/wx.disableAlertBeforeUnload.html */ disableAlertBeforeUnload(option?: disableAlertBeforeUnload.Option): void } }