import Vnmf from '../../index' declare module '../../index' { namespace startDeviceMotionListening { 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 /** Execution frequency of the echo function to listen changes in direction device * @default "normal" */ interval?: keyof Interval /** Interface calls a successful echo function */ success?: (res: VnmfGeneral.CallbackResult) => void } interface Interval { /** The echo frequency for updating the game,Yes. 20ms/Number of times Left and right. */ game /** Applies to Updates UI The echo frequency of the,Yes. 60ms/Number of times Left and right. */ ui /** Normal echo frequency,Yes. 200ms/Number of times Left and right. */ normal } } namespace stopDeviceMotionListening { 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 onDeviceMotionChange { /** Echo function for device direction change events */ type Callback = (result: CallbackResult) => void interface CallbackResult { /** ♪ When Mobile Coordinates X/Y and Earth. X/Y When rehearsing,Around. Z The angle of the axial rotation is alpha,Range value is [0, 2*PI)。Counterclockwise Turns Right。 */ alpha: number /** When a cell phone's coordinates... Y/Z And the Earth. Y/Z When rehearsing,Around. X The angle of the axial rotation is beta。Range value is [-1*PI, PI) 。The top is turning straight towards the surface of Earth.。It could be right for the user.。 */ beta: number /** Be a cell phone. X/Z And the Earth. X/Z When rehearsing,Around. Y The angle of the axial rotation is gamma。Range value is [-1*PI/2, PI/2)。Right towards the surface of Earth.。 */ gamma: number } } interface VnmfStatic { /** Start listening to changes in the direction of device。 * @supported weapp, h5, rn * @see https://developers.weixin.qq.com/miniprogram/dev/api/device/motion/wx.startDeviceMotionListening.html */ startDeviceMotionListening( option: startDeviceMotionListening.Option, ): void /** * Stop listening to changes in the direction of device。 * @supported weapp, h5, rn * @see https://developers.weixin.qq.com/miniprogram/dev/api/device/motion/wx.stopDeviceMotionListening.html */ stopDeviceMotionListening( option?: stopDeviceMotionListening.Option, ): void /** * Hearing device change of direction event。Frequency basis Vnmf.startDeviceMotionListening() It's... it's... interval Parameters。You can use it. Vnmf.stopDeviceMotionListening() Stop listening.。 * @supported weapp, h5, rn * @see https://developers.weixin.qq.com/miniprogram/dev/api/device/motion/wx.onDeviceMotionChange.html */ onDeviceMotionChange (callback: onDeviceMotionChange.Callback): void /** Disable listening device change of direction event,Parameter is empty,And cancel all bugs.。 * @supported weapp, h5, rn * @see https://developers.weixin.qq.com/miniprogram/dev/api/device/motion/wx.offDeviceMotionChange.html */ offDeviceMotionChange( /** Echo function for device direction change events */ callback?: (...args: any[]) => any, ): void } }