import Vnmf from '../../index' declare module '../../index' { namespace stopCompass { 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 startCompass { 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 onCompassChange { /** Backup function for compass data change events */ type Callback = ( result: OnCompassChangeCallbackResult, ) => void interface OnCompassChangeCallbackResult { /** Precision * * Due to Platform differences,accuracy Yes. iOS/Android Values vary from one value to another。 * * - iOS:accuracy It's one. number Value of type,It's a deviation from the magnetic arctic.。0 This means the device is pointing to magnetic north.,90 It's pointing east.,180 It's pointing south.,And so on.。 * - Android:accuracy It's one. string Embrace value of type。 */ accuracy: number | keyof accuracy | string /** Number of directions facing */ direction: number } interface accuracy { /** High Precision */ high /** Medium Precision */ medium /** Low Precision */ low /** Untrusted.,Sensor lost connection. */ 'no-contact' /** Untrusted.,Reason unknown */ unreliable /** Unknown Accurate Enumeration Value,That's the one. Android The accuracy of the system returned at this time value Not a standard Accuracy Enumeration Value */ 'unknow ${value}' } } interface VnmfStatic { /** Stop listening to compass data * @supported weapp, h5, tt * @example * ```tsx * Vnmf.stopCompass() * ``` * @see https://developers.weixin.qq.com/miniprogram/dev/api/device/compass/wx.stopCompass.html */ stopCompass(option?: stopCompass.Option): Promise /** Start listening to compass data. * @supported weapp, h5, tt * @example * ```js * Vnmf.startCompass() * ``` * @see https://developers.weixin.qq.com/miniprogram/dev/api/device/compass/wx.startCompass.html */ startCompass(option?: startCompass.Option): Promise /** Listen to compass data changes。Frequency:5 Number of times/sec,When the interface is called, listening will start automatically.,Available Vnmf.stopCompass Stop listening.。 * @supported weapp, h5, tt * @example * ```tsx * Vnmf.onCompassChange(function (res) { * console.log(res.direction) * }) * ``` * @see https://developers.weixin.qq.com/miniprogram/dev/api/device/compass/wx.onCompassChange.html */ onCompassChange( /** Backup function for compass data change events */ callback: onCompassChange.Callback, ): void /** Disable listening to compass data changes,Parameter is empty,And cancel all bugs.。 * @supported weapp, h5 * @see https://developers.weixin.qq.com/miniprogram/dev/api/device/compass/wx.offCompassChange.html */ offCompassChange( /** Backup function for compass data change events */ callback: (...args: any[]) => any, ): void } }