/* Copyright 2021. Huawei Technologies Co., Ltd. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License") you may not use this file except in compliance with the License. You may obtain a copy of the License at https://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ export interface LocationRequest { priority: HMSLocation.PriorityConstants, interval: number, numUpdates: number, fastestInterval: number, expirationTime: number, isFastestIntervalExplicitlySet: boolean, expirationTimeDuration: number, smallestDisplacement: number, maxWaitTime: number, needAddress: boolean, language: string, countryCode: string } export interface LocationSettingsRequest { requests: LocationRequest[], alwaysShow: boolean, needBle: boolean } interface NavigationResult { environment: number, confidence: number } interface LocationSettingsResult { locationSettingsStates: LocationSettingsStates, statusCheck: StatusCheck } interface StatusCheck { statusCode: number } export interface LocationSettingsStates { blePresent: boolean bleUsable: boolean, gpsPresent: boolean, gpsUsable: boolean, gnssPresent: boolean, gnssUsable: boolean, locationPresent: boolean, locationUsable: boolean, hmsLocationPresent: boolean, hmsLocationUsable: boolean, networkLocationPresent: boolean, networkLocationUsable: boolean, } interface LocationUpdateResultContainer { locationResult: LocationUpdateResult } interface LocationUpdateResult { locations: LocationResult[] } export interface LocationUpdateRequest { locationRequest: LocationRequest, uuid: string, } export interface MockLocation { mLatitude: number, mLongitude: number, } interface LocationAvailabilityResult { locationAvailability: LocationAvailability } interface LocationResult { location: Location, address: Address } interface Address { mCountryName: string, mCountryCode: string, mState: string, mCounty: string, mCity: string, mStreet: string, mFeatureName: string, mPostalCode: string, mPhone: string, mUrl: string mExtraInfo: Object } export interface Location { mProvider: string, mAltitude: number, mBearing: number, mLatitude: number, mLongitude: number, mSpeed: number, mTime: number, mHorizontalAccuracyMeters: number, mElapsedRealtimeNanos: number, mBearingAccuracyDegrees: number, mSpeedAccuracyMetersPerSecond: number, mVerticalAccuracyMeters: number } export interface LastLocationRequest { needAddress: boolean, language: string, countryCode: string } interface LocationAvailability { cellStatus: number, locationStatus: number, elapsedRealtimeNs: number wifiStatus: number } export interface LocationUpdateResultValue { value: LocationUpdateResultContainer } declare class FusedLocationService { checkLocationSettings(request: LocationSettingsRequest): Promise; getLastLocation(lastLocationRequest: LastLocationRequest): Promise; getLocationAvailability(): Promise; getNavigationContextState(requestType: HMSLocation.NavigationRequestConstants): Promise; removeLocationUpdates(uuid: string): Promise; requestLocationUpdates(locationUpdateRequest: LocationUpdateRequest, callback: (data: LocationUpdateResultValue) => void): Promise; requestLocationUpdatesEx(locationUpdateRequest: LocationUpdateRequest, callback: (data: LocationUpdateResultValue) => void): Promise; setMockLocation(mockLocation: MockLocation): Promise; setMockMode(isMockMode: boolean): Promise; } declare class HMSLocation { public static init(NativeModules: any, DeviceEventEmitte: any): void; public static destroy(): void; public static getFusedLocationProviderClient(): FusedLocationService; } declare namespace HMSLocation { enum NavigationRequestConstants { OVERPASS = 1, IS_SUPPORT_EX = 2, } enum PriorityConstants { PRIORITY_HIGH_ACCURACY = 100, PRIORITY_BALANCED_POWER_ACCURACY = 102, PRIORITY_LOW_POWER = 104, PRIORITY_NO_POWER = 105, PRIORITY_HD_ACCURACY = 200 } } export default HMSLocation;