import Vnmf from '../../index' declare module '../../index' { namespace updateShareMenu { interface Option { /** It's a dynamic message. activityId。Through [updatableMessage.createActivityId](https://developers.weixin.qq.com/miniprogram/dev/api-backend/open-api/updatable-message/updatableMessage.createActivityId.html) Interface Acquisition */ activityId?: 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 /** Is it a dynamic message?,Details[Dynamic Message](https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/share/updatable-message.html) */ isUpdatableMessage?: boolean /** Interface calls a successful echo function */ success?: (res: VnmfGeneral.CallbackResult) => void /** Template information for dynamic messages */ templateInfo?: UpdatableMessageFrontEndTemplateInfo /** Whether to use a band shareTicket Forward[Details](https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/share.html) */ withShareTicket?: boolean } /** Template information for dynamic messages */ interface UpdatableMessageFrontEndTemplateInfo { /** List of parameters */ parameterList: UpdatableMessageFrontEndParameter[] } /** List of parameters */ interface UpdatableMessageFrontEndParameter { /** Parameter Name */ name: string /** Parameter Values */ value: string } } namespace showShareMenu { 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 /** Whether to use a band shareTicket Forward[Details](https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/share.html) */ withShareTicket?: boolean /** QQApplet sharing functionality,Support shared toQQ、QQSpace、We're friends. friends, we're、MicroFriends. * @supported weapp, qq * @qq QQSupported Values: ['qq', 'qzone', 'wechatFriends', 'wechatMoment'] * @weapp Can not open message:['wechatFriends', 'wechatMoment'] / ['shareAppMessage', 'shareTimeline'] */ showShareItems?: string[] } } namespace showShareImageMenu { interface Option { /** Picture address to share,Must be local or temporary */ path: 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 } } namespace shareVideoMessage { interface Option { /** Video address to share,Must be local or temporary */ videoPath: string /** Thumbnail Path,Use video header if left empty */ thumbPath?: 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 } } namespace shareFileMessage { interface Option { /** Video address to share,Must be local or temporary */ filePath: string /** Custom Filename,Use if left empty filePath Filename in */ fileName?: 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 } } namespace onCopyUrl { /** The user clicks on the top right corner menu「Copy Link」The echo function for events triggered by a button */ type Callback = (result: CallbackResult) => void interface CallbackResult { /** Query string carried on the current page when opening applet with a short chain。When used in applets,Call when entering the page `Vnmf.onCopyUrl` Custom `query`,Call on exit page `Vnmf.offCopyUrl`,Prevent impact on other pages。 */ query: string } } namespace hideShareMenu { interface Option { /** This interface is Beta Version,For the time being. Android Platform support。The list of forwarding button names that need to be hidden,Default['shareAppMessage', 'shareTimeline']。button name legal value contains "shareAppMessage"、"shareTimeline" Two. */ menus?: string[] /** Interface calls a successful echo function */ success?: (result: 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 getShareInfo { interface Option { /** shareTicket */ shareTicket: string /** Timeout,Units ms */ timeout?: number /** Interface calls a successful echo function */ success?: (result: SuccessCallbackResult) => 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 SuccessCallbackResult extends VnmfGeneral.CallbackResult { /** Clouds corresponding to sensitive data ID,Let's go, let's go.[Cloud development](https://developers.weixin.qq.com/miniprogram/dev/wxcloud/basis/getting-started.html)The applets will return.,Direct access to open data through cloud calls,See you later.[Cloud call direct access to open data](https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/signature.html#method-cloud) */ cloudID?: string /** Encryption data for complete forwarding of information, including sensitive,See you later.[Encryption Data Decrypt algorithm](https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/signature.html) */ encryptedData: string /** Cannot initialise Evolution's mail component. */ errMsg: string /** Initial vector of encryption algorithms,See you later.[Encryption Data Decrypt algorithm](https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/signature.html) */ iv: string } } namespace authPrivateMessage { interface Option { /** shareTicket */ shareTicket: string /** Interface calls a successful echo function */ success?: (result: SuccessCallbackResult) => 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 SuccessCallbackResult extends VnmfGeneral.CallbackResult { /** Clouds corresponding to sensitive data ID,Let's go, let's go.[Cloud development](https://developers.weixin.qq.com/miniprogram/dev/wxcloud/basis/getting-started.html)The applets will return.,Direct access to open data through cloud calls,See you later.[Cloud call direct access to open data](https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/signature.html#method-cloud) */ cloudID?: string /** Encryption data for complete forwarding of information, including sensitive,See you later.[Encryption Data Decrypt algorithm](https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/signature.html) */ encryptedData: string /** Cannot initialise Evolution's mail component. */ errMsg: string /** Initial vector of encryption algorithms,See you later.[Encryption Data Decrypt algorithm](https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/signature.html) */ iv: string } } interface VnmfStatic { /** Update Forward Properties * @supported weapp * @example * ```tsx * Vnmf.updateShareMenu({ * withShareTicket: true, * success () { } * }) * ``` * @see https://developers.weixin.qq.com/miniprogram/dev/api/share/wx.updateShareMenu.html */ updateShareMenu (option: updateShareMenu.Option): Promise /** Show the forward button for current page * @supported weapp, qq, tt * @example * ```tsx * Vnmf.showShareMenu({ * withShareTicket: true * }) * ``` * @see https://developers.weixin.qq.com/miniprogram/dev/api/share/wx.showShareMenu.html */ showShareMenu (option: showShareMenu.Option): Promise /** Open shared picture window,You can send pictures to your friends.、Collection or Download * @supported weapp * @example * ```tsx * Vnmf.downloadFile({ * url: 'https://res.wx.qq.com/wxdoc/dist/assets/img/demo.ef5c5bef.jpg', * success: (res) => { * wx.showShareImageMenu({ * path: res.tempFilePath * }) * } * }) * ``` * @see https://developers.weixin.qq.com/miniprogram/dev/api/share/wx.showShareImageMenu.html */ showShareImageMenu (option: showShareImageMenu.Option): Promise /** Forward video to chat * @supported weapp * @example * callback Writing * * ```tsx * Vnmf.downloadFile({ * url: URL, // Downloadurl * success (res) { * // Download and forward after completion * Vnmf.shareVideoMessage({ * videoPath: res.tempFilePath, * success() {}, * fail: console.error, * }) * }, * fail: console.error, * }) * ``` * * async await Writing * * ```tsx * const { tempFilePath } = await Vnmf.downloadFile({ * url: URL, // Downloadurl * }) * // Download and forward after completion * await Vnmf.shareVideoMessage({ * videoPath: res.tempFilePath, * }) * ``` * @see https://developers.weixin.qq.com/miniprogram/dev/api/share/wx.shareVideoMessage.html */ shareVideoMessage (option: shareVideoMessage.Option): Promise /** Forward files to chat * @supported weapp * @see https://developers.weixin.qq.com/miniprogram/dev/api/share/wx.shareFileMessage.html */ shareFileMessage (option: shareFileMessage.Option): Promise /** Listening to users clicking on the top right corner menu「Copy Link」Events triggered by buttons * * > This interface is Beta Version,For the time being. Android Platform support。 * @supported weapp * @see https://developers.weixin.qq.com/miniprogram/dev/api/share/wx.onCopyUrl.html */ onCopyUrl ( /** The user clicks on the top right corner menu「Copy Link」The echo function for events triggered by a button */ callback: onCopyUrl.Callback, ): void /** Disable listening to users clicking on the top right corner menu「Copy Link」Events triggered by buttons * * > This interface is Beta Version,For the time being. Android Platform support。 * @supported weapp * @see https://developers.weixin.qq.com/miniprogram/dev/api/share/wx.offCopyUrl.html */ offCopyUrl ( /** The user clicks on the top right corner menu「Copy Link」The echo function for events triggered by a button */ callback: onCopyUrl.Callback, ): void /** Hide the forwarding button for current page * @supported weapp, tt * @example * ```tsx * Vnmf.hideShareMenu() * ``` * @see https://developers.weixin.qq.com/miniprogram/dev/api/share/wx.hideShareMenu.html */ hideShareMenu (option?: hideShareMenu.Option): Promise /** Can not open message * * **Tips** * - If the name of group is to be displayed,You can use it.[Open Data Component](/docs/components/open/open-data) * @supported weapp * @example * There are two ways to get sensitive data.,- It's for use. [Encryption Data Decrypt algorithm](https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/signature.html#%E5%8A%A0%E5%AF%86%E6%95%B0%E6%8D%AE%E8%A7%A3%E5%AF%86%E7%AE%97%E6%B3%95) 。 * Access to open data is as follows: json Structure(of which openGId The only identification of the current group): * ```json * { * "openGId": "OPENGID" * } * ``` * @see https://developers.weixin.qq.com/miniprogram/dev/api/share/wx.getShareInfo.html */ getShareInfo (option: getShareInfo.Option): Promise /** Authenticate private messages * @supported weapp * @example * ```tsx * Vnmf.authPrivateMessage({ * shareTicket: 'xxxxxx', * success(res) { * console.log('authPrivateMessage success', res) * // res * // { * // errMsg: 'authPrivateMessage:ok' * // valid: true * // iv: 'xxxx', * // encryptedData: 'xxxxxx' * // } * }, * fail(res) { * console.log('authPrivateMessage fail', res) * } * }) * ``` * @see https://developers.weixin.qq.com/miniprogram/dev/api/share/wx.authPrivateMessage.html */ authPrivateMessage (option: authPrivateMessage.Option): Promise } }