import Vnmf from '../../index' declare module '../../index' { namespace openEmbeddedMiniProgram { interface Option { /** Applet to open appId */ appId: string /** Path to open page,Open the first page if empty。path Medium ? And the rest of it will be. query,In small program `App.onLaunch`、`App.onShow` and `Page.onLoad` for the echo function or little game [Vnmf.onShow](#) Reciprocal function、[Vnmf.getLaunchOptionsSync](/docs/apis/base/weapp/life-cycle/getLaunchOptionsSync) , you can get it. query Data。For the little game,You can only pass in. query Part,To achieve a cross-reference effect,Like:Organisation "?foo=bar"。 */ path?: string /** Data to be transmitted target applets,Target applets are available. `App.onLaunch`,`App.onShow` Can not get folder: %s: %s。If it's a little game,,Yes. [Vnmf.onShow](#)、[Vnmf.getLaunchOptionsSync](/docs/apis/base/weapp/life-cycle/getLaunchOptionsSync) This data is available.。 */ extraData?: VnmfGeneral.IAnyObject /** Applet version to open。This parameter is valid only for the current applet when developing or experiential versions。If the current applet is an official version,And the applet opened must be official version.。*/ envVersion?: keyof EnvVersion /** Applet Link,When passing this parameter,You can't pass it. appId and path。Links can be accessed【Applet Menu】->【Copy Link】Fetch。 */ shortLink?: string /** Interface calls a successful echo function */ success?: (res: VnmfGeneral.CallbackResult) => void /** Interface call failed echo function */ fail?: (res: VnmfGeneral.CallbackResult) => void /** Interface call to the end of echo function(Call successfully、Any failure will be enforced.) */ complete?: (res: VnmfGeneral.CallbackResult) => void } interface EnvVersion { /** Development */ develop /** Empirical version */ trial /** Official edition */ release } } namespace navigateToMiniProgram { interface Option { /** Applet to open appId */ appId: string /** Path to open page,Open the first page if empty。path Medium ? And the rest of it will be. query,In small program `App.onLaunch`、`App.onShow` and `Page.onLoad` for the echo function or little game [Vnmf.onShow](#) Reciprocal function、[Vnmf.getLaunchOptionsSync](/docs/apis/base/weapp/life-cycle/getLaunchOptionsSync) , you can get it. query Data。For the little game,You can only pass in. query Part,To achieve a cross-reference effect,Like:Organisation "?foo=bar"。 */ path?: string /** Data to be transmitted target applets,Target applets are available. `App.onLaunch`,`App.onShow` Can not get folder: %s: %s。If it's a little game,,Yes. [Vnmf.onShow](#)、[Vnmf.getLaunchOptionsSync](/docs/apis/base/weapp/life-cycle/getLaunchOptionsSync) This data is available.。 */ extraData?: VnmfGeneral.IAnyObject /** Applet version to open。This parameter is valid only for the current applet when developing or experiential versions。If the current applet is an official version,And the applet opened must be official version.。*/ envVersion?: keyof EnvVersion /** Applet Link,When passing this parameter,You can't pass it. appId and path。Links can be accessed【Applet Menu】->【Copy Link】Fetch。 */ shortLink?: string /** Interface calls a successful echo function */ success?: (res: VnmfGeneral.CallbackResult) => void /** Interface call failed echo function */ fail?: (res: VnmfGeneral.CallbackResult) => void /** Interface call to the end of echo function(Call successfully、Any failure will be enforced.) */ complete?: (res: VnmfGeneral.CallbackResult) => void } interface EnvVersion { /** Development */ develop /** Empirical version */ trial /** Official edition */ release } } namespace navigateBackMiniProgram { interface Option { /** Need to return data the previous applet,The last applet is available. `App.onShow` Can not get folder: %s: %s。 [Details](https://developers.weixin.qq.com/miniprogram/dev/reference/api/App.html)。 */ extraData?: VnmfGeneral.IAnyObject /** Interface calls a successful echo function */ success?: (res: VnmfGeneral.CallbackResult) => void /** Interface call failed echo function */ fail?: (res: VnmfGeneral.CallbackResult) => void /** Interface call to the end of echo function(Call successfully、Any failure will be enforced.) */ complete?: (res: VnmfGeneral.CallbackResult) => void } } namespace exitMiniProgram { interface Option { /** Interface calls a successful echo function */ success?: (res: VnmfGeneral.CallbackResult) => void /** Interface call failed echo function */ fail?: (res: VnmfGeneral.CallbackResult) => void /** Interface call to the end of echo function(Call successfully、Any failure will be enforced.) */ complete?: (res: VnmfGeneral.CallbackResult) => void } } namespace openBusinessView { /** * wxpayScoreEnable Operational parameters * @see https://pay.weixin.qq.com/wiki/doc/apiv3/apis/chapter6_1_9.shtml */ interface ScoreEnableExtraData { /** * Use to jump micro-side authorization data,Jump to micro-side transfer,Valid as1Hours;apply_permissions_tokenIt's possible.[《Business pre-authorizationAPI》](https://pay.weixin.qq.com/wiki/doc/apiv3/apis/chapter6_1_2.shtml)Retrieving parameters for interfaces。 * Example value [v]:1230000109 * @type {string[1,2048]} */ apply_permissions_token: string } /** * wxpayScoreUse Operational parameters * @see https://pay.weixin.qq.com/wiki/doc/apiv3/apis/chapter6_1_13.shtml */ interface ScoreUsedExtraData { /** * Business Number:The number of the business in which payment is to be made by micro-mail.。 * Example value [v]:1230000109 * @type {string[1,32]} */ mch_id: string /** * Yes.【Create Order】Return Fields for Interfacepackage, and then click the %1 %2。 * Example value [v]:XXXXXXXX * @type {string[1,128]} */ package: string /** * Time stamp:Generate signature time stamp,Unit seconds。 * Example value [v]:1530097563 * @type {string[1,32]} */ timestamp: string /** * Random String:Generate signature random string。By Numbers、Case letters make up,No more than length32bits。 * Example value [v]:zyx53Nkey8o4bHpxTQvd8m7e92nG5mG2 * @type {string[1,32]} */ nonce_str: string /** * Could not close temporary folder: %s:Signature Type,Support onlyHMAC-SHA256。 * Example value [v]:HMAC-SHA256 * @type {string[1,32]} */ sign_type: string /** * Signature:Use Fieldsmch_id、service_id、out_order_no、timestamp、nonce_str、sign_typeSigning value calculated by signature generation algorithm。 * Example value [v]:029B52F67573D7E3BE74904BF9AEA * @type {string[1,64]} */ sign: string } /** * wxpayScoreDetail Operational parameters * @see https://pay.weixin.qq.com/wiki/doc/apiv3/apis/chapter6_1_25.shtml */ interface ScoreDetailExtraData { /** * Business Number:The number of the business in which payment is to be made by micro-mail.。 * Example value [v]:1230000109 * @type {string[1,32]} */ mch_id: string /** * ServicesID * Example value [v]:88888888000011 * @type {string[1,32]} */ service_id: string /** * Business service order number:Internal service order number for the business system(It's not a transaction number.)。 * Example value [v]:234323JKHDFE1243252 * @type {string[1,32]} */ out_order_no: string /** * Time stamp:Generate signature time stamp,Unit seconds。 * Example value [v]:1530097563 * @type {string[1,32]} */ timestamp: string /** * Random String:Generate signature random string。By Numbers、Case letters make up,No more than length32bits。 * Example value [v]:zyx53Nkey8o4bHpxTQvd8m7e92nG5mG2 * @type {string[1,32]} */ nonce_str: string /** * Could not close temporary folder: %s:Signature Type,Support onlyHMAC-SHA256。 * Example value [v]:HMAC-SHA256 * @type {string[1,32]} */ sign_type: string /** * Signature:Use Fieldsmch_id、service_id、out_order_no、timestamp、nonce_str、sign_typeSigning value calculated by signature generation algorithm。 * Example value [v]:029B52F67573D7E3BE74904BF9AEA * @type {string[1,64]} */ sign: string } interface Option { /** * Jump Type:Fixed Configuration:wxpayScoreDetail * Example value [v]:wxpayScoreDetail * @type {string[1,16]} * @memberof Option */ businessType: 'wxpayScoreEnable' | 'wxpayScoreUse' | 'wxpayScoreDetail' | string /** Operational parameters:Business data to be transmitted payment points */ extraData: ScoreEnableExtraData | ScoreUsedExtraData | ScoreDetailExtraData /** Interface calls a successful echo function */ success?: (res: VnmfGeneral.CallbackResult) => void /** Interface call failed echo function */ fail?: (res: VnmfGeneral.CallbackResult) => void /** Interface call to the end of echo function(Call successfully、Any failure will be enforced.) */ complete?: (res: VnmfGeneral.CallbackResult) => void } } interface VnmfStatic { /** Open halfscreen applet。Access guidelines, please refer to. [Half-screen applet capability](https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/openEmbeddedMiniProgram.html)。 * @supported weapp * @see https://developers.weixin.qq.com/miniprogram/dev/api/navigate/wx.openEmbeddedMiniProgram.html */ openEmbeddedMiniProgram(option?: openEmbeddedMiniProgram.Option): Promise /** Open another applet * * **Use Restrictions** * ##### Require user to trigger a jump * From 2.3.0 Version Start,Any location if the user does not click on applet page,Developer will not be able to call this interface automatically another applet。 * ##### Require user confirmation to jump * From 2.3.0 Version Start,Before jumping to other applets,The window will be increased in a uniform manner.,Ask whether to jump,Could not close temporary folder: %s。If the user click cancels,Reverse `fail cancel`。 * ##### The number of other sub-procedures per applet that can jump is limited to no more than 10 One. * From 2.4.0 Version and specified date(To be determined)Here we go.,When Developer submits a new version of the applet code,If other applet functions are used,a list of applets that need to jump in the code configuration,Limit not to exceed 10 One.,Otherwise, we won't be able to pass the audit.。The list can be updated when a new edition is issued,Dynamic changes not supported。Details of the configuration method [Applet Global Configuration](https://developers.weixin.qq.com/miniprogram/dev/reference/configuration/app.html)。When calling this interface,♪ Jumping appId Must be in configuration list,Or we'll call back. `fail appId "${appId}" is not in navigateToMiniProgramAppIdList`。 * * **About debugging** * - Call this on the Developer Tool API It's not a real jump to another applet.,But the Developer Tool will verify success of this call jump.。[Details](https://developers.weixin.qq.com/miniprogram/dev/devtools/different.html#Jump Applet Debug Support) * - Debugging of the jump-backed applet on Developer 's tool to process receiving parameters。[Details](https://developers.weixin.qq.com/miniprogram/dev/devtools/different.html#Jump Applet Debug Support) * @supported weapp, tt * @example * ```tsx * Vnmf.navigateToMiniProgram({ * appId: '', * path: 'page/index/index?id=123', * extraData: { * foo: 'bar' * }, * envVersion: 'develop', * success: function(res) { * // It's on, it's on. * } * }) * ``` * @see https://developers.weixin.qq.com/miniprogram/dev/api/open-api/miniprogram-navigate/wx.navigateToMiniProgram.html */ navigateToMiniProgram(option: navigateToMiniProgram.Option): Promise /** Back to Previous Applet。Only when the current applet is opened by other applets can it be called successfully. * * Attention.:**Can not open message iOS 6.5.9,Android 6.5.10 Support for versions above** * @supported weapp, tt * @example * ```tsx * Vnmf.navigateBackMiniProgram({ * extraData: { * foo: 'bar' * }, * success: function (res) { * // Returns successful * } * }) * ``` * @see https://developers.weixin.qq.com/miniprogram/dev/api/open-api/miniprogram-navigate/wx.navigateBackMiniProgram.html */ navigateBackMiniProgram(option: navigateBackMiniProgram.Option): Promise /** Quit the current applet。Click behaviour is necessary to call successfully.。 * @supported weapp * @example * ```tsx * Vnmf.exitMiniProgram() * ··· * * @see https://developers.weixin.qq.com/miniprogram/dev/api/navigate/wx.exitMiniProgram.html */ exitMiniProgram(option?: exitMiniProgram.Option): Promise /** Business opens the micromail payment score program by calling order details interface,Guide users to view order details(Applet) * @supported weapp * @example * ```tsx * if (Vnmf.openBusinessView) { * Vnmf.openBusinessView({ * businessType: 'wxpayScoreDetail', * extraData: { * mch_id: '1230000109', * service_id: '88888888000011', * out_order_no: '1234323JKHDFE1243252', * timestamp: '1530097563', * nonce_str: 'zyx53Nkey8o4bHpxTQvd8m7e92nG5mG2', * sign_type: 'HMAC-SHA256', * sign: '029B52F67573D7E3BE74904BF9AEA' * }, * success() { * //dosomething * }, * fail() { * //dosomething * }, * complete() { * //dosomething * } * }); * } else { * //Guide users to upgrade the micro-mail version * } * ``` * @see https://pay.weixin.qq.com/wiki/doc/apiv3/apis/chapter6_1_25.shtml */ openBusinessView(option: openBusinessView.Option): Promise } }