import Vnmf from '../../index' declare module '../../index' { namespace openLocation { interface Option { /** Latitude,Scope-90~90,Negative number indicates south latitude.。Use gcj02 National Bureau of Survey coordinates */ latitude: number /** Longitude,Scope-180~180,Negative number for West.。Use gcj02 National Bureau of Survey coordinates */ longitude: number /** Detailed description of address */ address?: 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 /** Organisation */ name?: string /** Scale,Scope5~18 */ scale?: number /** Interface calls a successful echo function */ success?: (res: VnmfGeneral.CallbackResult) => void } } namespace getLocation { interface Option { /** Organisation true Height message will be returned,High accuracy required for acquisition,It slows down the speed of interface return. */ altitude?: 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 /** High-precision positioning timeout(ms),Returns the maximum accuracy within specified time,Value3000msIt's the high-precision position that works. */ highAccuracyExpireTime?: number /** Activate high-precision positioning. */ isHighAccuracy?: boolean /** Interface calls a successful echo function */ success?: (result: SuccessCallbackResult) => void /** wgs84 Back gps Coordinates,gcj02 returns can be used Vnmf.openLocation Coordinates of the */ type?: string } interface SuccessCallbackResult extends VnmfGeneral.CallbackResult { /** Accuracy of position */ accuracy: number /** Height,Units m */ altitude: number /** Horizontal Precision,Units m */ horizontalAccuracy: number /** Latitude,Scope -90~90,Negative number indicates south latitude. */ latitude: number /** Longitude,Scope -180~180,Negative number for West. */ longitude: number /** Speed,Units m/s */ speed: number /** Vertical Precision,Units m(Android Can not get folder: %s: %s,Back 0) */ verticalAccuracy: number /** Call Results */ errMsg: string } } namespace choosePoi { 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?: (result: SuccessCallbackResult) => void } interface SuccessCallbackResult extends VnmfGeneral.CallbackResult { /** When selecting a city,Value as 1,Select exact position,Value as 2 */ type: number /** Name of city */ city: number /** Location Name */ name: string /** _Other Organiser */ address: string /** Latitude,Floats,Scope-90~90,Negative number indicates south latitude.。Use gcj02 National Bureau of Survey coordinates */ latitude: number /** Longitude,Floats,Scope-180~180,Negative number for West.。Use gcj02 National Bureau of Survey coordinates */ longitude: number } } namespace chooseLocation { interface Option { /** Target Latitude */ latitude?: number /** Target longitude */ longitude?: number /** Map Point Selection Component Parameters * @supported h5 * @h5 Support only H5 Use * @see https://lbs.qq.com/webApi/component/componentGuide/componentPicker */ mapOpts?: Record /** 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 { /** _Other Organiser */ address: string /** Latitude,Floats,Scope-90~90,Negative number indicates south latitude.。Use gcj02 National Bureau of Survey coordinates */ latitude: number /** Longitude,Floats,Scope-180~180,Negative number for West.。Use gcj02 National Bureau of Survey coordinates */ longitude: number /** Location Name */ name: string /** Call Results */ errMsg: string } } namespace stopLocationUpdate { 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 startLocationUpdateBackground { 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 startLocationUpdate { 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 onLocationChangeError { /** Listen to the echo function triggered when continuous location interface returns failed */ type Callback = ( result: CallbackResult, ) => void interface CallbackResult { /** Error Code */ errCode: number } } namespace onLocationChange { /** Rewind function for real-time geographic change events */ type Callback = ( result: CallbackResult, ) => void interface CallbackResult { /** Accuracy of position */ accuracy: number /** Height,Units m */ altitude: number /** Horizontal Precision,Units m */ horizontalAccuracy: number /** Latitude,Scope -90~90,Negative number indicates south latitude. */ latitude: number /** Longitude,Scope -180~180,Negative number for West. */ longitude: number /** Speed,Units m/s */ speed: number /** Vertical Precision,Units m(Android Can not get folder: %s: %s,Back 0) */ verticalAccuracy: number } } namespace getFuzzyLocation { interface Option { /** wgs84 Back gps Coordinates,gcj02 returns can be used Vnmf.openLocation Coordinates of the */ type?: 'wgs84' | 'gcj02' /** 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?: (result: SuccessCallbackResult) => void } interface SuccessCallbackResult extends VnmfGeneral.CallbackResult { /** Latitude,Scope -90~90,Negative number indicates south latitude. */ latitude: number /** Longitude,Scope -180~180,Negative number for West. */ longitude: number } } interface VnmfStatic { /** Close listening real-time position changes,The reception stopped at the front and back. * @supported weapp, rn, tt * @see https://developers.weixin.qq.com/miniprogram/dev/api/location/wx.stopLocationUpdate.html */ stopLocationUpdate(option?: stopLocationUpdate.Option): void /** Take location messages when you open the applet to front and back.,The user needs to be guided turn it on.[Delegation of authority](../open-api/authorize/authorize.md#Backstage position.)。After authorization,Post message changes are accepted for applets running or entering backstage。 * * **Attention.** * - Andrew Weiss.7.0.6Version,iOS 7.0.5Version supports the interface * - Yes, it is.app.jsonCannot initialise Evolution's mail component.requiredBackgroundModes: ['location']After Use * - Cannot initialise Evolution's mail component.[Description of geographical location](https://developers.weixin.qq.com/miniprogram/dev/reference/configuration/app.html#permission)。 * @supported weapp * @see https://developers.weixin.qq.com/miniprogram/dev/api/location/wx.startLocationUpdateBackground.html */ startLocationUpdateBackground( option?: startLocationUpdateBackground.Option, ): void /** Take position when you open the applet and go to front desk. * * **Attention.** * - Cannot initialise Evolution's mail component.[Description of geographical location](https://developers.weixin.qq.com/miniprogram/dev/reference/configuration/app.html#permission)。 * @supported weapp, rn, tt * @see https://developers.weixin.qq.com/miniprogram/dev/api/location/wx.startLocationUpdate.html */ startLocationUpdate(option?: startLocationUpdate.Option): void /** View position using micro-mail built-in maps * @supported weapp, h5, tt * @example * ```tsx * Vnmf.getLocation({ * type: 'gcj02', //Return can be used Vnmf.openLocationLatitude, longitude, longitude. * success: function (res) { * const latitude = res.latitude * const longitude = res.longitude * Vnmf.openLocation({ * latitude, * longitude, * scale: 18 * }) * } * }) * ``` * @see https://developers.weixin.qq.com/miniprogram/dev/api/location/wx.openLocation.html */ openLocation(option: openLocation.Option): Promise /** Trigger when bugging the continuous location interface to return failed * @supported weapp, tt * @see https://developers.weixin.qq.com/miniprogram/dev/api/location/wx.onLocationChangeError.html */ onLocationChangeError( /** Listen to the echo function triggered when continuous location interface returns failed */ callback: onLocationChangeError.Callback, ): void /** Listen to real-time geographic change events,Need to combine Vnmf.startLocationUpdateBackground、Vnmf.startLocationUpdate Use。 * @supported weapp, rn, tt * @example * ```tsx * const _locationChangeFn = function (res) { * console.log('location change', res) * } * Vnmf.onLocationChange(_locationChangeFn) * Vnmf.offLocationChange(_locationChangeFn) * ``` * @see https://developers.weixin.qq.com/miniprogram/dev/api/location/wx.onLocationChange.html */ onLocationChange( /** Rewind function for real-time geographic change events */ callback: onLocationChange.Callback, ): void /** Trigger on decryption of continuous location interface return failure * @supported weapp, tt * @see https://developers.weixin.qq.com/miniprogram/dev/api/location/wx.offLocationChangeError.html */ offLocationChangeError( /** Listen to the echo function triggered when continuous location interface returns failed */ callback: onLocationChangeError.Callback, ): void /** Disaggregate real-time geographic change events * @supported weapp, rn, tt * @see https://developers.weixin.qq.com/miniprogram/dev/api/location/wx.offLocationChange.html */ offLocationChange( /** Rewind function for real-time geographic change events */ callback: (res: VnmfGeneral.CallbackResult) => void, ): void /** Get the current geographic location、Speed。When the user leaves applet,This interface cannot be called。Activate high-precision positioning.,The interface takes more time.,Assignable highAccuracyExpireTime As timeout。 * * **Attention.** * - Use positioning simulations in toolsIPPositioning,There could be some kind of error.。And the tool is currently only supported gcj02 Coordinates。 * - Reverse address parsing with a third party service,Confirm the default coordinates of third-party service.,Correct coordinate conversion.。 * @supported weapp, rn, tt * @example * ```tsx * Vnmf.getLocation({ * type: 'wgs84', * success: function (res) { * const latitude = res.latitude * const longitude = res.longitude * const speed = res.speed * const accuracy = res.accuracy * } * }) * ``` * @see https://developers.weixin.qq.com/miniprogram/dev/api/location/wx.getLocation.html */ getLocation(option: getLocation.Option): Promise /** OpenPOICannot initialise Evolution's mail component.,Support Fuzzy Positioning(Precision to the city.)A mix with precise positioning。 * @supported weapp * @see https://developers.weixin.qq.com/miniprogram/dev/api/location/wx.choosePoi.html */ choosePoi(option: choosePoi.Option): Promise /** Open Map Selection。 * * `chooseLocation` apiThe function depends on the tether's location.,That's why it needs to be used. api Key。If you don't.,You can go to the troupe.[Developer Console](https://lbs.qq.com/console/mykey.html?console=mykey)Conduct of the application。 * @supported weapp, h5, tt * @example * ```tsx * // config/index.js * * // Access api After Keys,You need to fill it in the constant configuration of project`defineConstants.LOCATION_APIKEY`Medium: * const config = { * defineConstants: { * LOCATION_APIKEY: JSON.stringify('XXXXX-XXXXX-XXXXX-XXXXX-XXXXX-XXXXX') * }, * // ... * } * ``` * @see https://developers.weixin.qq.com/miniprogram/dev/api/location/wx.chooseLocation.html */ chooseLocation(option: chooseLocation.Option): Promise /** Retrieve the current blurred geographic location * @supported weapp * @example * ```tsx * Vnmf.getFuzzyLocation({ * type: 'wgs84', * success (res) { * const latitude = res.latitude * const longitude = res.longitude * }, * }) * ``` * @see https://developers.weixin.qq.com/miniprogram/dev/api/location/wx.getFuzzyLocation.html */ getFuzzyLocation(option: getFuzzyLocation.Option): Promise } }