import Vnmf from '../../index' declare module '../../index' { namespace startAccelerometer { type Option = { /** * The execution frequency of monitoring acceleration data recovery function * @default "normal" */ interval?: keyof Interval /** The callback function of the interface call (Call success 、Failure will be executed ) */ complete?: (res: VnmfGeneral.CallbackResult) => void /** Interface call failure recovery function */ fail?: (res: VnmfGeneral.CallbackResult) => void /** Interface call successful callback function */ success?: (res: VnmfGeneral.CallbackResult) => void } type Interval = { /** Applicable to updating the game callback frequency ,exist 20ms/Second-rate about */ game: 'game', /** Applicable to update UI Return frequency ,exist 60ms/Second-rate about */ ui: 'ui', /** Ordinary callback frequency ,exist 200ms/Second-rate about */ normal: 'normal' } } namespace stopAccelerometer { type Option = { /** The callback function of the interface call (Call success 、Failure will be executed ) */ complete?: (res: VnmfGeneral.CallbackResult) => void /** Interface call failure recovery function */ fail?: (res: VnmfGeneral.CallbackResult) => void /** Interface call successful callback function */ success?: (res: VnmfGeneral.CallbackResult) => void } } namespace onAccelerometerChange { type Callback = (res: Result) => void type Result = { /** X axis */ x: number /** Y axis */ y: number /** Z axis */ z: number } } interface VnmfStatic { /** * Start listening to the acceleration data 。 * @example * ```tsx * Vnmf.startAccelerometer({ interval: 'game' }) * ``` * @supported weapp, h5, rn, tt * @see https://developers.weixin.qq.com/miniprogram/dev/api/device/accelerometer/wx.startAccelerometer.html */ startAccelerometer (res?: startAccelerometer.Option): Promise /** * Stop monitoring acceleration data 。 * @example * ```tsx * Vnmf.stopAccelerometer() * ``` * @supported weapp, h5, rn, tt * @see https://developers.weixin.qq.com/miniprogram/dev/api/device/accelerometer/wx.stopAccelerometer.html */ stopAccelerometer (res?: stopAccelerometer.Option): Promise /** * Monitoring Acceleration Data ,frequency :5Second-rate /second ,After the interface is called, it will automatically start monitoring ,be usable `Vnmf.stopAccelerometer` Stop monitoring 。 * @supported weapp, h5, rn, tt * @example * ```tsx * Vnmf.onAccelerometerChange(res => { * console.log(res.x) * console.log(res.y) * console.log(res.z) * }) * ``` * @see https://developers.weixin.qq.com/miniprogram/dev/api/device/accelerometer/wx.onAccelerometerChange.html */ onAccelerometerChange (callback: onAccelerometerChange.Callback): void /** * Cancel the monitoring acceleration data event ,The parameter is empty ,Then cancel all events monitoring 。 * @supported weapp, h5, rn * @see https://developers.weixin.qq.com/miniprogram/dev/api/device/accelerometer/wx.offAccelerometerChange.html */ offAccelerometerChange( /** The callback function of the acceleration data event */ callback?: (...args: any[]) => any, ): void } }