import Vnmf from '../../index' declare module '../../index' { namespace authorizeForMiniProgram { interface Option { /** Could not close temporary folder: %s scope,Details [scope List](https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/authorize.html#scope-%E5%88%97%E8%A1%A8) */ scope: keyof Scope | 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 } /** scope Legacy value * @see https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/authorize.html#scope-%E5%88%97%E8%A1%A8 */ interface Scope { 'scope.record' 'scope.writePhotosAlbum' 'scope.camera' } } namespace authorize { interface Option { /** Could not close temporary folder: %s scope,Details [scope List](https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/authorize.html#scope-%E5%88%97%E8%A1%A8) */ scope: 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 } } interface VnmfStatic { /** **Only small program plugins can call the interface**,Same as always. [Vnmf.authorize](../authorize)。There are only three types of support at the moment. scope * @supported weapp * @example * ```tsx * // We can do it. Vnmf.getSetting Let's check if the user's authorized. "scope.record" Here. scope * Vnmf.authorizeForMiniProgram({ * scope: 'scope.record', * success () { * // The user has agreed to the recording function for applet.,Follow-up Call Vnmf.startRecord Interfaces do not pop windows for queries * Vnmf.startRecord() * } * }) * ``` * @see https://developers.weixin.qq.com/miniprogram/dev/api/open-api/authorize/wx.authorizeForMiniProgram.html */ authorizeForMiniProgram(option: authorizeForMiniProgram.Option): Promise /** Initiation of authorization requests to users in advance。As soon as you call, the window will pop up and ask if user agrees to authorize applet use a certain function or access some of user's data.,But there's no actual call to the interface.。If the user has previously agreed to authorization,,And the window won't show up.,Direct return successful.。For more details, please. [User Permissions](https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/authorize.html)。 * @supported weapp, rn, tt * @example * ```tsx * // We can do it. Vnmf.getSetting Let's check if the user's authorized. "scope.record" Here. scope * Vnmf.getSetting({ * success: function (res) { * if (!res.authSetting['scope.record']) { * Vnmf.authorize({ * scope: 'scope.record', * success: function () { * // The user has agreed to the recording function for applet.,Follow-up Call Vnmf.startRecord Interfaces do not pop windows for queries * Vnmf.startRecord() * } * }) * } * } * }) * ``` * @see https://developers.weixin.qq.com/miniprogram/dev/api/open-api/authorize/wx.authorize.html */ authorize(option: authorize.Option): Promise } }