• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2022 Huawei Device Co., Ltd.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 /**
17  * @file
18  * @kit LocationKit
19  */
20 
21 import { AsyncCallback, Callback } from './@ohos.base';
22 import { WantAgent } from './@ohos.wantAgent';
23 
24 /**
25  * Provides interfaces for initiating location requests, ending the location service,
26  * and obtaining the location result cached by the system.
27  *
28  * @namespace geolocation
29  * @permission ohos.permission.LOCATION
30  * @syscap SystemCapability.Location.Location.Core
31  * @since 7
32  * @deprecated since 9
33  */
34 declare namespace geolocation {
35   /**
36    * Subscribe location changed
37    *
38    * @permission ohos.permission.LOCATION
39    * @param { 'locationChange' } type - Indicates the location service event to be subscribed to.
40    * @param { LocationRequest } request - Indicates the location request parameters.
41    * @param { Callback<Location> } callback - Indicates the callback for reporting the location result.
42    * @syscap SystemCapability.Location.Location.Core
43    * @since 7
44    * @deprecated since 9
45    * @useinstead ohos.geoLocationManager/geoLocationManager.on#event:locationChange
46    */
47   function on(type: 'locationChange', request: LocationRequest, callback: Callback<Location>): void;
48 
49   /**
50    * Unsubscribe location changed
51    *
52    * @permission ohos.permission.LOCATION
53    * @param { 'locationChange' } type - Indicates the location service event to be subscribed to.
54    * @param { Callback<Location> } [callback] - Indicates the callback for reporting the location result.
55    * @syscap SystemCapability.Location.Location.Core
56    * @since 7
57    * @deprecated since 9
58    * @useinstead ohos.geoLocationManager/geoLocationManager.off#event:locationChange
59    */
60   function off(type: 'locationChange', callback?: Callback<Location>): void;
61 
62   /**
63    * Subscribe location switch changed
64    *
65    * @permission ohos.permission.LOCATION
66    * @param { 'locationServiceState' } type - Indicates the location service event to be subscribed to.
67    * @param { Callback<boolean> } callback - Indicates the callback for reporting the location result.
68    * @syscap SystemCapability.Location.Location.Core
69    * @since 7
70    * @deprecated since 9
71    * @useinstead ohos.geoLocationManager/geoLocationManager.on#event:locationEnabledChange
72    */
73   function on(type: 'locationServiceState', callback: Callback<boolean>): void;
74 
75   /**
76    * Unsubscribe location switch changed
77    *
78    * @permission ohos.permission.LOCATION
79    * @param { 'locationServiceState' } type - Indicates the location service event to be subscribed to.
80    * @param { Callback<boolean> } [callback] - Indicates the callback for reporting the location result.
81    * @syscap SystemCapability.Location.Location.Core
82    * @since 7
83    * @deprecated since 9
84    * @useinstead ohos.geoLocationManager/geoLocationManager.off#event:locationEnabledChange
85    */
86   function off(type: 'locationServiceState', callback?: Callback<boolean>): void;
87 
88   /**
89    * Subscribe to cache GNSS locations update messages
90    *
91    * @permission ohos.permission.LOCATION
92    * @param { 'cachedGnssLocationsReporting' } type - Indicates the location service event to be subscribed to.
93    * @param { CachedGnssLocationsRequest } request - Indicates the cached GNSS locations request parameters.
94    * @param { Callback<Array<Location>> } callback - Indicates the callback for reporting the cached GNSS locations.
95    * @syscap SystemCapability.Location.Location.Gnss
96    * @since 8
97    * @deprecated since 9
98    * @useinstead ohos.geoLocationManager/geoLocationManager.on#event:cachedGnssLocationsChange
99    */
100   function on(type: 'cachedGnssLocationsReporting', request: CachedGnssLocationsRequest, callback: Callback<Array<Location>>): void;
101 
102   /**
103    * Unsubscribe to cache GNSS locations update messages
104    *
105    * @permission ohos.permission.LOCATION
106    * @param { 'cachedGnssLocationsReporting' } type - Indicates the location service event to be subscribed to.
107    * @param { Callback<Array<Location>> } [callback] - Indicates the callback for reporting the cached gnss locations.
108    * @syscap SystemCapability.Location.Location.Gnss
109    * @since 8
110    * @deprecated since 9
111    * @useinstead ohos.geoLocationManager/geoLocationManager.off#event:cachedGnssLocationsChange
112    */
113   function off(type: 'cachedGnssLocationsReporting', callback?: Callback<Array<Location>>): void;
114 
115   /**
116    * Subscribe gnss status changed
117    *
118    * @permission ohos.permission.LOCATION
119    * @param { 'gnssStatusChange' } type - Indicates the location service event to be subscribed to.
120    * @param { Callback<SatelliteStatusInfo> } callback - Indicates the callback for reporting the gnss status change.
121    * @syscap SystemCapability.Location.Location.Gnss
122    * @since 8
123    * @deprecated since 9
124    * @useinstead ohos.geoLocationManager/geoLocationManager.on#event:satelliteStatusChange
125    */
126   function on(type: 'gnssStatusChange', callback: Callback<SatelliteStatusInfo>): void;
127 
128   /**
129    * Unsubscribe gnss status changed
130    *
131    * @permission ohos.permission.LOCATION
132    * @param { 'gnssStatusChange' } type - Indicates the location service event to be subscribed to.
133    * @param { Callback<SatelliteStatusInfo> } [callback] - Indicates the callback for reporting the gnss status change.
134    * @syscap SystemCapability.Location.Location.Gnss
135    * @since 8
136    * @deprecated since 9
137    * @useinstead ohos.geoLocationManager/geoLocationManager.off#event:satelliteStatusChange
138    */
139   function off(type: 'gnssStatusChange', callback?: Callback<SatelliteStatusInfo>): void;
140 
141   /**
142    * Subscribe nmea message changed
143    *
144    * @permission ohos.permission.LOCATION
145    * @param { 'nmeaMessageChange' } type - Indicates the location service event to be subscribed to.
146    * @param { Callback<string> } callback - Indicates the callback for reporting the nmea message.
147    * @syscap SystemCapability.Location.Location.Gnss
148    * @since 8
149    * @deprecated since 9
150    * @useinstead ohos.geoLocationManager/geoLocationManager.on#event:nmeaMessage
151    */
152   function on(type: 'nmeaMessageChange', callback: Callback<string>): void;
153 
154   /**
155    * Unsubscribe nmea message changed
156    *
157    * @permission ohos.permission.LOCATION
158    * @param { 'nmeaMessageChange' } type - Indicates the location service event to be subscribed to.
159    * @param { Callback<string> } [callback] - Indicates the callback for reporting the nmea message.
160    * @syscap SystemCapability.Location.Location.Gnss
161    * @since 8
162    * @deprecated since 9
163    * @useinstead ohos.geoLocationManager/geoLocationManager.off#event:nmeaMessage
164    */
165   function off(type: 'nmeaMessageChange', callback?: Callback<string>): void;
166 
167   /**
168    * Add a geofence and subscribe geo fence status changed
169    *
170    * @permission ohos.permission.LOCATION
171    * @param { 'fenceStatusChange' } type - Indicates the location service event to be subscribed to.
172    * @param { GeofenceRequest } request - Indicates the Geo-fence configuration parameters.
173    * @param { WantAgent } want - Indicates which ability to start when the geofence event is triggered.
174    * @syscap SystemCapability.Location.Location.Geofence
175    * @since 8
176    * @deprecated since 9
177    * @useinstead ohos.geoLocationManager/geoLocationManager.on#event:gnssFenceStatusChange
178    */
179   function on(type: 'fenceStatusChange', request: GeofenceRequest, want: WantAgent): void;
180 
181   /**
182    * Remove a geofence and unsubscribe geo fence status changed
183    *
184    * @permission ohos.permission.LOCATION
185    * @param { 'fenceStatusChange' } type - Indicates the location service event to be subscribed to.
186    * @param { GeofenceRequest } request - Indicates the Geo-fence configuration parameters.
187    * @param { WantAgent } want - Indicates which ability to start when the geofence event is triggered.
188    * @syscap SystemCapability.Location.Location.Geofence
189    * @since 8
190    * @deprecated since 9
191    * @useinstead ohos.geoLocationManager/geoLocationManager.off#event:gnssFenceStatusChange
192    */
193   function off(type: 'fenceStatusChange', request: GeofenceRequest, want: WantAgent): void;
194 
195   /**
196    * Obtain current location
197    *
198    * @permission ohos.permission.LOCATION
199    * @param { CurrentLocationRequest } request - Indicates the location request parameters.
200    * @param { AsyncCallback<Location> } callback - Indicates the callback for reporting the location result.
201    * @syscap SystemCapability.Location.Location.Core
202    * @since 7
203    * @deprecated since 9
204    * @useinstead ohos.geoLocationManager/geoLocationManager.getCurrentLocation
205    */
206   function getCurrentLocation(request: CurrentLocationRequest, callback: AsyncCallback<Location>): void;
207 
208   /**
209    * Obtain current location
210    *
211    * @permission ohos.permission.LOCATION
212    * @param { AsyncCallback<Location> } callback - Indicates the callback for reporting the location result.
213    * @syscap SystemCapability.Location.Location.Core
214    * @since 7
215    * @deprecated since 9
216    * @useinstead ohos.geoLocationManager/geoLocationManager.getCurrentLocation
217    */
218   function getCurrentLocation(callback: AsyncCallback<Location>): void;
219 
220   /**
221    * Obtain current location
222    *
223    * @permission ohos.permission.LOCATION
224    * @param { CurrentLocationRequest } [request] - Indicates the location request parameters.
225    * @returns { Promise<Location> } The promise returned by the function.
226    * @syscap SystemCapability.Location.Location.Core
227    * @since 7
228    * @deprecated since 9
229    * @useinstead ohos.geoLocationManager/geoLocationManager.getCurrentLocation
230    */
231   function getCurrentLocation(request?: CurrentLocationRequest): Promise<Location>;
232 
233   /**
234    * Obtain last known location
235    *
236    * @permission ohos.permission.LOCATION
237    * @param { AsyncCallback<Location> } callback - Indicates the callback for reporting the location result.
238    * @syscap SystemCapability.Location.Location.Core
239    * @since 7
240    * @deprecated since 9
241    * @useinstead ohos.geoLocationManager/geoLocationManager.getLastLocation
242    */
243   function getLastLocation(callback: AsyncCallback<Location>): void;
244 
245   /**
246    * Obtain last known location
247    *
248    * @permission ohos.permission.LOCATION
249    * @returns { Promise<Location> } The promise returned by the function.
250    * @syscap SystemCapability.Location.Location.Core
251    * @since 7
252    * @deprecated since 9
253    * @useinstead ohos.geoLocationManager/geoLocationManager.getLastLocation
254    */
255   function getLastLocation(): Promise<Location>;
256 
257   /**
258    * Obtain current location switch status
259    *
260    * @permission ohos.permission.LOCATION
261    * @param { AsyncCallback<boolean> } callback - Indicates the callback for reporting the location switch result.
262    * @syscap SystemCapability.Location.Location.Core
263    * @since 7
264    * @deprecated since 9
265    * @useinstead ohos.geoLocationManager/geoLocationManager.isLocationEnabled
266    */
267   function isLocationEnabled(callback: AsyncCallback<boolean>): void;
268 
269   /**
270    * Obtain current location switch status
271    *
272    * @permission ohos.permission.LOCATION
273    * @returns { Promise<boolean> } The promise returned by the function.
274    * @syscap SystemCapability.Location.Location.Core
275    * @since 7
276    * @deprecated since 9
277    * @useinstead ohos.geoLocationManager/geoLocationManager.isLocationEnabled
278    */
279   function isLocationEnabled(): Promise<boolean>;
280 
281   /**
282    * Request enable location
283    *
284    * @permission ohos.permission.LOCATION
285    * @param { AsyncCallback<boolean> } callback - Indicates the callback for reporting the location switch status.
286    * @syscap SystemCapability.Location.Location.Core
287    * @since 7
288    * @deprecated since 9
289    */
290   function requestEnableLocation(callback: AsyncCallback<boolean>): void;
291 
292   /**
293    * Request enable location
294    *
295    * @permission ohos.permission.LOCATION
296    * @returns { Promise<boolean> } The promise returned by the function.
297    * @syscap SystemCapability.Location.Location.Core
298    * @since 7
299    * @deprecated since 9
300    */
301   function requestEnableLocation(): Promise<boolean>;
302 
303   /**
304    * Obtain address info from location
305    *
306    * @permission ohos.permission.LOCATION
307    * @param { ReverseGeoCodeRequest } request - Indicates the reverse geocode query parameters.
308    * @param { AsyncCallback<Array<GeoAddress>> } callback - Indicates the callback for reporting the address info.
309    * @syscap SystemCapability.Location.Location.Geocoder
310    * @since 7
311    * @deprecated since 9
312    * @useinstead ohos.geoLocationManager/geoLocationManager.getAddressesFromLocation
313    */
314   function getAddressesFromLocation(request: ReverseGeoCodeRequest, callback: AsyncCallback<Array<GeoAddress>>): void;
315 
316   /**
317    * Obtain address info from location
318    *
319    * @permission ohos.permission.LOCATION
320    * @param { ReverseGeoCodeRequest } request - Indicates the reverse geocode query parameters.
321    * @returns { Promise<Array<GeoAddress>> } The promise returned by the function.
322    * @syscap SystemCapability.Location.Location.Geocoder
323    * @since 7
324    * @deprecated since 9
325    * @useinstead ohos.geoLocationManager/geoLocationManager.getAddressesFromLocation
326    */
327   function getAddressesFromLocation(request: ReverseGeoCodeRequest): Promise<Array<GeoAddress>>;
328 
329   /**
330    * Obtain latitude and longitude info from location address
331    *
332    * @permission ohos.permission.LOCATION
333    * @param { GeoCodeRequest } request - Indicates the geocode query parameters.
334    * @param { AsyncCallback<Array<GeoAddress>> } callback - Indicates the callback for reporting the latitude and longitude result.
335    * @syscap SystemCapability.Location.Location.Geocoder
336    * @since 7
337    * @deprecated since 9
338    * @useinstead ohos.geoLocationManager/geoLocationManager.getAddressesFromLocationName
339    */
340   function getAddressesFromLocationName(request: GeoCodeRequest, callback: AsyncCallback<Array<GeoAddress>>): void;
341 
342   /**
343    * Obtain latitude and longitude info from location address
344    *
345    * @permission ohos.permission.LOCATION
346    * @param { GeoCodeRequest } request - Indicates the geocode query parameters.
347    * @returns { Promise<Array<GeoAddress>> } The promise returned by the function.
348    * @syscap SystemCapability.Location.Location.Geocoder
349    * @since 7
350    * @deprecated since 9
351    * @useinstead ohos.geoLocationManager/geoLocationManager.getAddressesFromLocationName
352    */
353   function getAddressesFromLocationName(request: GeoCodeRequest): Promise<Array<GeoAddress>>;
354 
355   /**
356    * Obtain geocode service status
357    *
358    * @permission ohos.permission.LOCATION
359    * @param { AsyncCallback<boolean> } callback - Indicates the callback for reporting the geocode service status.
360    * @syscap SystemCapability.Location.Location.Geocoder
361    * @since 7
362    * @deprecated since 9
363    * @useinstead ohos.geoLocationManager/geoLocationManager.isGeocoderAvailable
364    */
365   function isGeoServiceAvailable(callback: AsyncCallback<boolean>): void;
366 
367   /**
368    * Obtain geocode service status
369    *
370    * @permission ohos.permission.LOCATION
371    * @returns { Promise<boolean> } The promise returned by the function.
372    * @syscap SystemCapability.Location.Location.Geocoder
373    * @since 7
374    * @deprecated since 9
375    * @useinstead ohos.geoLocationManager/geoLocationManager.isGeocoderAvailable
376    */
377   function isGeoServiceAvailable(): Promise<boolean>;
378 
379   /**
380    * Obtain the number of cached GNSS locations reported at a time
381    *
382    * @permission ohos.permission.LOCATION
383    * @param { AsyncCallback<number> } callback - Indicates the callback for reporting the cached GNSS locations size.
384    * @syscap SystemCapability.Location.Location.Gnss
385    * @since 8
386    * @deprecated since 9
387    * @useinstead ohos.geoLocationManager/geoLocationManager.getCachedGnssLocationsSize
388    */
389   function getCachedGnssLocationsSize(callback: AsyncCallback<number>): void;
390 
391   /**
392    * Obtain the number of cached GNSS locations reported at a time
393    *
394    * @permission ohos.permission.LOCATION
395    * @returns { Promise<number> } The promise returned by the function.
396    * @syscap SystemCapability.Location.Location.Gnss
397    * @since 8
398    * @deprecated since 9
399    * @useinstead ohos.geoLocationManager/geoLocationManager.getCachedGnssLocationsSize
400    */
401   function getCachedGnssLocationsSize(): Promise<number>;
402 
403   /**
404    * All prepared GNSS locations are returned to the application through the callback function,
405    * and the bottom-layer buffer is cleared.
406    *
407    * @permission ohos.permission.LOCATION
408    * @param { AsyncCallback<boolean> } callback - Indicates the callback for reporting the result.
409    * @syscap SystemCapability.Location.Location.Gnss
410    * @since 8
411    * @deprecated since 9
412    * @useinstead ohos.geoLocationManager/geoLocationManager.flushCachedGnssLocations
413    */
414   function flushCachedGnssLocations(callback: AsyncCallback<boolean>): void;
415 
416   /**
417    * All prepared GNSS locations are returned to the application through the callback function,
418    * and the bottom-layer buffer is cleared.
419    *
420    * @permission ohos.permission.LOCATION
421    * @returns { Promise<boolean> } The promise returned by the function.
422    * @syscap SystemCapability.Location.Location.Gnss
423    * @since 8
424    * @deprecated since 9
425    * @useinstead ohos.geoLocationManager/geoLocationManager.flushCachedGnssLocations
426    */
427   function flushCachedGnssLocations(): Promise<boolean>;
428 
429   /**
430    * Send extended commands to location subsystem.
431    *
432    * @permission ohos.permission.LOCATION
433    * @param { LocationCommand } command - Indicates the extended Command Message Body.
434    * @param { AsyncCallback<boolean> } callback - Indicates the callback for reporting the send command result.
435    * @syscap SystemCapability.Location.Location.Core
436    * @since 8
437    * @deprecated since 9
438    * @useinstead ohos.geoLocationManager/geoLocationManager.sendCommand
439    */
440   function sendCommand(command: LocationCommand, callback: AsyncCallback<boolean>): void;
441 
442   /**
443    * Send extended commands to location subsystem.
444    *
445    * @permission ohos.permission.LOCATION
446    * @param { LocationCommand } command - Indicates the extended Command Message Body.
447    * @returns { Promise<boolean> } The promise returned by the function.
448    * @syscap SystemCapability.Location.Location.Core
449    * @since 8
450    * @deprecated since 9
451    * @useinstead ohos.geoLocationManager/geoLocationManager.sendCommand
452    */
453   function sendCommand(command: LocationCommand): Promise<boolean>;
454 
455   /**
456    * Satellite status information
457    *
458    * @interface SatelliteStatusInfo
459    * @permission ohos.permission.LOCATION
460    * @syscap SystemCapability.Location.Location.Gnss
461    * @since 8
462    * @deprecated since 9
463    * @useinstead ohos.geoLocationManager/geoLocationManager.SatelliteStatusInfo
464    */
465   export interface SatelliteStatusInfo {
466     /**
467      * @syscap SystemCapability.Location.Location.Gnss
468      * @since 8
469      * @deprecated since 9
470      */
471     satellitesNumber: number;
472 
473     /**
474      * @syscap SystemCapability.Location.Location.Gnss
475      * @since 8
476      * @deprecated since 9
477      */
478     satelliteIds: Array<number>;
479 
480     /**
481      * @syscap SystemCapability.Location.Location.Gnss
482      * @since 8
483      * @deprecated since 9
484      */
485     carrierToNoiseDensitys: Array<number>;
486 
487     /**
488      * @syscap SystemCapability.Location.Location.Gnss
489      * @since 8
490      * @deprecated since 9
491      */
492     altitudes: Array<number>;
493 
494     /**
495      * @syscap SystemCapability.Location.Location.Gnss
496      * @since 8
497      * @deprecated since 9
498      */
499     azimuths: Array<number>;
500 
501     /**
502      * @syscap SystemCapability.Location.Location.Gnss
503      * @since 8
504      * @deprecated since 9
505      */
506     carrierFrequencies: Array<number>;
507   }
508 
509   /**
510    * Parameters for requesting to report cache location information
511    *
512    * @interface CachedGnssLocationsRequest
513    * @permission ohos.permission.LOCATION
514    * @syscap SystemCapability.Location.Location.Gnss
515    * @since 8
516    * @deprecated since 9
517    * @useinstead ohos.geoLocationManager/geoLocationManager.CachedGnssLocationsRequest
518    */
519   export interface CachedGnssLocationsRequest {
520     /**
521      * @syscap SystemCapability.Location.Location.Gnss
522      * @since 8
523      * @deprecated since 9
524      */
525     reportingPeriodSec: number;
526 
527     /**
528      * @syscap SystemCapability.Location.Location.Gnss
529      * @since 8
530      * @deprecated since 9
531      */
532     wakeUpCacheQueueFull: boolean;
533   }
534 
535   /**
536    * Configuring parameters in geo fence requests
537    *
538    * @interface GeofenceRequest
539    * @permission ohos.permission.LOCATION
540    * @syscap SystemCapability.Location.Location.Geofence
541    * @since 8
542    * @deprecated since 9
543    * @useinstead ohos.geoLocationManager/geoLocationManager.GeofenceRequest
544    */
545   export interface GeofenceRequest {
546     /**
547      * @syscap SystemCapability.Location.Location.Geofence
548      * @since 8
549      * @deprecated since 9
550      */
551     priority: LocationRequestPriority;
552 
553     /**
554      * @syscap SystemCapability.Location.Location.Geofence
555      * @since 8
556      * @deprecated since 9
557      */
558     scenario: LocationRequestScenario;
559 
560     /**
561      * @syscap SystemCapability.Location.Location.Geofence
562      * @since 8
563      * @deprecated since 9
564      */
565     geofence: Geofence;
566   }
567 
568   /**
569    * Configuring parameters in geo fence requests
570    *
571    * @interface Geofence
572    * @permission ohos.permission.LOCATION
573    * @syscap SystemCapability.Location.Location.Geofence
574    * @since 8
575    * @deprecated since 9
576    * @useinstead ohos.geoLocationManager/geoLocationManager.Geofence
577    */
578   export interface Geofence {
579     /**
580      * @syscap SystemCapability.Location.Location.Geofence
581      * @since 8
582      * @deprecated since 9
583      */
584     latitude: number;
585 
586     /**
587      * @syscap SystemCapability.Location.Location.Geofence
588      * @since 8
589      * @deprecated since 9
590      */
591     longitude: number;
592 
593     /**
594      * @syscap SystemCapability.Location.Location.Geofence
595      * @since 8
596      * @deprecated since 9
597      */
598     radius: number;
599 
600     /**
601      * @syscap SystemCapability.Location.Location.Geofence
602      * @since 8
603      * @deprecated since 9
604      */
605     expiration: number;
606   }
607 
608   /**
609    * Configuring parameters in reverse geocode requests
610    *
611    * @interface ReverseGeoCodeRequest
612    * @permission ohos.permission.LOCATION
613    * @syscap SystemCapability.Location.Location.Geocoder
614    * @since 7
615    * @deprecated since 9
616    * @useinstead ohos.geoLocationManager/geoLocationManager.ReverseGeoCodeRequest
617    */
618   export interface ReverseGeoCodeRequest {
619     /**
620      * @syscap SystemCapability.Location.Location.Geocoder
621      * @since 7
622      * @deprecated since 9
623      */
624     locale?: string;
625 
626     /**
627      * @syscap SystemCapability.Location.Location.Geocoder
628      * @since 7
629      * @deprecated since 9
630      */
631     latitude: number;
632 
633     /**
634      * @syscap SystemCapability.Location.Location.Geocoder
635      * @since 7
636      * @deprecated since 9
637      */
638     longitude: number;
639 
640     /**
641      * @syscap SystemCapability.Location.Location.Geocoder
642      * @since 7
643      * @deprecated since 9
644      */
645     maxItems?: number;
646   }
647 
648   /**
649    * Configuring parameters in geocode requests
650    *
651    * @interface GeoCodeRequest
652    * @permission ohos.permission.LOCATION
653    * @syscap SystemCapability.Location.Location.Geocoder
654    * @since 7
655    * @deprecated since 9
656    * @useinstead ohos.geoLocationManager/geoLocationManager.GeoCodeRequest
657    */
658   export interface GeoCodeRequest {
659     /**
660      * @syscap SystemCapability.Location.Location.Geocoder
661      * @since 7
662      * @deprecated since 9
663      */
664     locale?: string;
665 
666     /**
667      * @syscap SystemCapability.Location.Location.Geocoder
668      * @since 7
669      * @deprecated since 9
670      */
671     description: string;
672 
673     /**
674      * @syscap SystemCapability.Location.Location.Geocoder
675      * @since 7
676      * @deprecated since 9
677      */
678     maxItems?: number;
679 
680     /**
681      * @syscap SystemCapability.Location.Location.Geocoder
682      * @since 7
683      * @deprecated since 9
684      */
685     minLatitude?: number;
686 
687     /**
688      * @syscap SystemCapability.Location.Location.Geocoder
689      * @since 7
690      * @deprecated since 9
691      */
692     minLongitude?: number;
693 
694     /**
695      * @syscap SystemCapability.Location.Location.Geocoder
696      * @since 7
697      * @deprecated since 9
698      */
699     maxLatitude?: number;
700 
701     /**
702      * @syscap SystemCapability.Location.Location.Geocoder
703      * @since 7
704      * @deprecated since 9
705      */
706     maxLongitude?: number;
707   }
708 
709   /**
710    * Data struct describes geographic locations.
711    *
712    * @interface GeoAddress
713    * @permission ohos.permission.LOCATION
714    * @syscap SystemCapability.Location.Location.Geocoder
715    * @since 7
716    * @deprecated since 9
717    * @useinstead ohos.geoLocationManager/geoLocationManager.GeoAddress
718    */
719   export interface GeoAddress {
720     /**
721      * Indicates latitude information.
722      * A positive value indicates north latitude,
723      * and a negative value indicates south latitude.
724      *
725      * @permission ohos.permission.LOCATION
726      * @syscap SystemCapability.Location.Location.Geocoder
727      * @since 7
728      * @deprecated since 9
729      */
730     latitude?: number;
731 
732     /**
733      * Indicates longitude information.
734      * A positive value indicates east longitude ,
735      * and a negative value indicates west longitude .
736      *
737      * @permission ohos.permission.LOCATION
738      * @syscap SystemCapability.Location.Location.Geocoder
739      * @since 7
740      * @deprecated since 9
741      */
742     longitude?: number;
743 
744     /**
745      * Indicates language used for the location description.
746      * zh indicates Chinese, and en indicates English.
747      *
748      * @permission ohos.permission.LOCATION
749      * @syscap SystemCapability.Location.Location.Geocoder
750      * @since 7
751      * @deprecated since 9
752      */
753     locale?: string;
754 
755     /**
756      * Indicates landmark of the location.
757      *
758      * @permission ohos.permission.LOCATION
759      * @syscap SystemCapability.Location.Location.Geocoder
760      * @since 7
761      * @deprecated since 9
762      */
763     placeName?: string;
764 
765     /**
766      * Indicates country code.
767      *
768      * @permission ohos.permission.LOCATION
769      * @syscap SystemCapability.Location.Location.Geocoder
770      * @since 7
771      * @deprecated since 9
772      */
773     countryCode?: string;
774 
775     /**
776      * Indicates country name.
777      *
778      * @permission ohos.permission.LOCATION
779      * @syscap SystemCapability.Location.Location.Geocoder
780      * @since 7
781      * @deprecated since 9
782      */
783     countryName?: string;
784 
785     /**
786      * Indicates administrative region name.
787      *
788      * @permission ohos.permission.LOCATION
789      * @syscap SystemCapability.Location.Location.Geocoder
790      * @since 7
791      * @deprecated since 9
792      */
793     administrativeArea?: string;
794 
795     /**
796      * Indicates sub-administrative region name.
797      *
798      * @permission ohos.permission.LOCATION
799      * @syscap SystemCapability.Location.Location.Geocoder
800      * @since 7
801      * @deprecated since 9
802      */
803     subAdministrativeArea?: string;
804 
805     /**
806      * Indicates locality information.
807      *
808      * @permission ohos.permission.LOCATION
809      * @syscap SystemCapability.Location.Location.Geocoder
810      * @since 7
811      * @deprecated since 9
812      */
813     locality?: string;
814 
815     /**
816      * Indicates sub-locality information.
817      *
818      * @permission ohos.permission.LOCATION
819      * @syscap SystemCapability.Location.Location.Geocoder
820      * @since 7
821      * @deprecated since 9
822      */
823     subLocality?: string;
824 
825     /**
826      * Indicates road name.
827      *
828      * @permission ohos.permission.LOCATION
829      * @syscap SystemCapability.Location.Location.Geocoder
830      * @since 7
831      * @deprecated since 9
832      */
833     roadName?: string;
834 
835     /**
836      * Indicates auxiliary road information.
837      *
838      * @permission ohos.permission.LOCATION
839      * @syscap SystemCapability.Location.Location.Geocoder
840      * @since 7
841      * @deprecated since 9
842      */
843     subRoadName?: string;
844 
845     /**
846      * Indicates house information.
847      *
848      * @permission ohos.permission.LOCATION
849      * @syscap SystemCapability.Location.Location.Geocoder
850      * @since 7
851      * @deprecated since 9
852      */
853     premises?: string;
854 
855     /**
856      * Indicates postal code.
857      *
858      * @permission ohos.permission.LOCATION
859      * @syscap SystemCapability.Location.Location.Geocoder
860      * @since 7
861      * @deprecated since 9
862      */
863     postalCode?: string;
864 
865     /**
866      * Indicates phone number.
867      *
868      * @permission ohos.permission.LOCATION
869      * @syscap SystemCapability.Location.Location.Geocoder
870      * @since 7
871      * @deprecated since 9
872      */
873     phoneNumber?: string;
874 
875     /**
876      * Indicates website URL.
877      *
878      * @permission ohos.permission.LOCATION
879      * @syscap SystemCapability.Location.Location.Geocoder
880      * @since 7
881      * @deprecated since 9
882      */
883     addressUrl?: string;
884 
885     /**
886      * Indicates additional information.
887      *
888      * @permission ohos.permission.LOCATION
889      * @syscap SystemCapability.Location.Location.Geocoder
890      * @since 7
891      * @deprecated since 9
892      */
893     descriptions?: Array<string>;
894 
895     /**
896      * Indicates the amount of additional descriptive information.
897      *
898      * @permission ohos.permission.LOCATION
899      * @syscap SystemCapability.Location.Location.Geocoder
900      * @since 7
901      * @deprecated since 9
902      */
903     descriptionsSize?: number;
904   }
905 
906   /**
907    * Configuring parameters in location requests
908    *
909    * @interface LocationRequest
910    * @permission ohos.permission.LOCATION
911    * @syscap SystemCapability.Location.Location.Core
912    * @since 7
913    * @deprecated since 9
914    * @useinstead ohos.geoLocationManager/geoLocationManager.LocationRequest
915    */
916   export interface LocationRequest {
917     /**
918      * @syscap SystemCapability.Location.Location.Core
919      * @since 7
920      * @deprecated since 9
921      */
922     priority?: LocationRequestPriority;
923 
924     /**
925      * @syscap SystemCapability.Location.Location.Core
926      * @since 7
927      * @deprecated since 9
928      */
929     scenario?: LocationRequestScenario;
930 
931     /**
932      * @syscap SystemCapability.Location.Location.Core
933      * @since 7
934      * @deprecated since 9
935      */
936     timeInterval?: number;
937 
938     /**
939      * @syscap SystemCapability.Location.Location.Core
940      * @since 7
941      * @deprecated since 9
942      */
943     distanceInterval?: number;
944 
945     /**
946      * @syscap SystemCapability.Location.Location.Core
947      * @since 7
948      * @deprecated since 9
949      */
950     maxAccuracy?: number;
951   }
952 
953   /**
954    * Configuring parameters in current location requests
955    *
956    * @interface CurrentLocationRequest
957    * @permission ohos.permission.LOCATION
958    * @syscap SystemCapability.Location.Location.Core
959    * @since 7
960    * @deprecated since 9
961    * @useinstead ohos.geoLocationManager/geoLocationManager.CurrentLocationRequest
962    */
963   export interface CurrentLocationRequest {
964     /**
965      * @syscap SystemCapability.Location.Location.Core
966      * @since 7
967      * @deprecated since 9
968      */
969     priority?: LocationRequestPriority;
970 
971     /**
972      * @syscap SystemCapability.Location.Location.Core
973      * @since 7
974      * @deprecated since 9
975      */
976     scenario?: LocationRequestScenario;
977 
978     /**
979      * @syscap SystemCapability.Location.Location.Core
980      * @since 7
981      * @deprecated since 9
982      */
983     maxAccuracy?: number;
984 
985     /**
986      * @syscap SystemCapability.Location.Location.Core
987      * @since 7
988      * @deprecated since 9
989      */
990     timeoutMs?: number;
991   }
992 
993   /**
994    * Provides information about geographic locations
995    *
996    * @interface Location
997    * @permission ohos.permission.LOCATION
998    * @syscap SystemCapability.Location.Location.Core
999    * @since 7
1000    * @deprecated since 9
1001    * @useinstead ohos.geoLocationManager/geoLocationManager.Location
1002    */
1003   export interface Location {
1004     /**
1005      * Indicates latitude information.
1006      * A positive value indicates north latitude,
1007      * and a negative value indicates south latitude.
1008      *
1009      * @permission ohos.permission.LOCATION
1010      * @syscap SystemCapability.Location.Location.Core
1011      * @since 7
1012      * @deprecated since 9
1013      */
1014     latitude: number;
1015 
1016     /**
1017      * Indicates Longitude information.
1018      * A positive value indicates east longitude ,
1019      * and a negative value indicates west longitude .
1020      *
1021      * @permission ohos.permission.LOCATION
1022      * @syscap SystemCapability.Location.Location.Core
1023      * @since 7
1024      * @deprecated since 9
1025      */
1026     longitude: number;
1027 
1028     /**
1029      * Indicates location altitude, in meters.
1030      *
1031      * @permission ohos.permission.LOCATION
1032      * @syscap SystemCapability.Location.Location.Core
1033      * @since 7
1034      * @deprecated since 9
1035      */
1036     altitude: number;
1037 
1038     /**
1039      * Indicates location accuracy, in meters.
1040      *
1041      * @permission ohos.permission.LOCATION
1042      * @syscap SystemCapability.Location.Location.Core
1043      * @since 7
1044      * @deprecated since 9
1045      */
1046     accuracy: number;
1047 
1048     /**
1049      * Indicates speed, in m/s.
1050      *
1051      * @permission ohos.permission.LOCATION
1052      * @syscap SystemCapability.Location.Location.Core
1053      * @since 7
1054      * @deprecated since 9
1055      */
1056     speed: number;
1057 
1058     /**
1059      * Indicates location timestamp in the UTC format.
1060      *
1061      * @permission ohos.permission.LOCATION
1062      * @syscap SystemCapability.Location.Location.Core
1063      * @since 7
1064      * @deprecated since 9
1065      */
1066     timeStamp: number;
1067 
1068     /**
1069      * Indicates direction information.
1070      *
1071      * @permission ohos.permission.LOCATION
1072      * @syscap SystemCapability.Location.Location.Core
1073      * @since 7
1074      * @deprecated since 9
1075      */
1076     direction: number;
1077 
1078     /**
1079      * Indicates location timestamp since boot.
1080      *
1081      * @permission ohos.permission.LOCATION
1082      * @syscap SystemCapability.Location.Location.Core
1083      * @since 7
1084      * @deprecated since 9
1085      */
1086     timeSinceBoot: number;
1087 
1088     /**
1089      * Indicates additional information.
1090      *
1091      * @permission ohos.permission.LOCATION
1092      * @syscap SystemCapability.Location.Location.Core
1093      * @since 7
1094      * @deprecated since 9
1095      */
1096     additions?: Array<string>;
1097 
1098     /**
1099      * Indicates the amount of additional descriptive information.
1100      *
1101      * @permission ohos.permission.LOCATION
1102      * @syscap SystemCapability.Location.Location.Core
1103      * @since 7
1104      * @deprecated since 9
1105      */
1106     additionSize?: number;
1107   }
1108 
1109   /**
1110    * Enum for location priority
1111    *
1112    * @permission ohos.permission.LOCATION
1113    * @enum { number }
1114    * @syscap SystemCapability.Location.Location.Core
1115    * @since 7
1116    * @deprecated since 9
1117    * @useinstead ohos.geoLocationManager/geoLocationManager.LocationRequestPriority
1118    */
1119   export enum LocationRequestPriority {
1120     /**
1121      * @syscap SystemCapability.Location.Location.Core
1122      * @since 7
1123      * @deprecated since 9
1124      */
1125     UNSET = 0x200,
1126 
1127     /**
1128      * @syscap SystemCapability.Location.Location.Core
1129      * @since 7
1130      * @deprecated since 9
1131      */
1132     ACCURACY,
1133 
1134     /**
1135      * @syscap SystemCapability.Location.Location.Core
1136      * @since 7
1137      * @deprecated since 9
1138      */
1139     LOW_POWER,
1140 
1141     /**
1142      * @syscap SystemCapability.Location.Location.Core
1143      * @since 7
1144      * @deprecated since 9
1145      */
1146     FIRST_FIX
1147   }
1148 
1149   /**
1150    * Enum for location scenario
1151    *
1152    * @permission ohos.permission.LOCATION
1153    * @enum { number }
1154    * @syscap SystemCapability.Location.Location.Core
1155    * @since 7
1156    * @deprecated since 9
1157    * @useinstead ohos.geoLocationManager/geoLocationManager.LocationRequestScenario
1158    */
1159   export enum LocationRequestScenario {
1160     /**
1161      * @syscap SystemCapability.Location.Location.Core
1162      * @since 7
1163      * @deprecated since 9
1164      */
1165     UNSET = 0x300,
1166 
1167     /**
1168      * @syscap SystemCapability.Location.Location.Core
1169      * @since 7
1170      * @deprecated since 9
1171      */
1172     NAVIGATION,
1173 
1174     /**
1175      * @syscap SystemCapability.Location.Location.Core
1176      * @since 7
1177      * @deprecated since 9
1178      */
1179     TRAJECTORY_TRACKING,
1180 
1181     /**
1182      * @syscap SystemCapability.Location.Location.Core
1183      * @since 7
1184      * @deprecated since 9
1185      */
1186     CAR_HAILING,
1187 
1188     /**
1189      * @syscap SystemCapability.Location.Location.Core
1190      * @since 7
1191      * @deprecated since 9
1192      */
1193     DAILY_LIFE_SERVICE,
1194 
1195     /**
1196      * @syscap SystemCapability.Location.Location.Core
1197      * @since 7
1198      * @deprecated since 9
1199      */
1200     NO_POWER
1201   }
1202 
1203   /**
1204    * Enum for error code
1205    *
1206    * @permission ohos.permission.LOCATION
1207    * @enum { number }
1208    * @syscap SystemCapability.Location.Location.Core
1209    * @since 7
1210    * @deprecated since 9
1211    */
1212   export enum GeoLocationErrorCode {
1213     /**
1214      * Indicates input parameter error.
1215      *
1216      * @permission ohos.permission.LOCATION
1217      * @syscap SystemCapability.Location.Location.Core
1218      * @since 7
1219      * @deprecated since 9
1220      */
1221     INPUT_PARAMS_ERROR,
1222 
1223     /**
1224      * Indicates reverse geocode query failed.
1225      *
1226      * @permission ohos.permission.LOCATION
1227      * @syscap SystemCapability.Location.Location.Core
1228      * @since 7
1229      * @deprecated since 9
1230      */
1231     REVERSE_GEOCODE_ERROR,
1232 
1233     /**
1234      * Indicates geocode query failed.
1235      *
1236      * @permission ohos.permission.LOCATION
1237      * @syscap SystemCapability.Location.Location.Core
1238      * @since 7
1239      * @deprecated since 9
1240      */
1241     GEOCODE_ERROR,
1242 
1243     /**
1244      * Indicates positioning failed.
1245      *
1246      * @permission ohos.permission.LOCATION
1247      * @syscap SystemCapability.Location.Location.Core
1248      * @since 7
1249        * @deprecated since 9
1250      */
1251     LOCATOR_ERROR,
1252 
1253     /**
1254      * Indicates operation failure caused by abnormal location switch.
1255      *
1256      * @permission ohos.permission.LOCATION
1257      * @syscap SystemCapability.Location.Location.Core
1258      * @since 7
1259      * @deprecated since 9
1260      */
1261     LOCATION_SWITCH_ERROR,
1262 
1263     /**
1264      * Indicates failed to get the last known location.
1265      *
1266      * @permission ohos.permission.LOCATION
1267      * @syscap SystemCapability.Location.Location.Core
1268      * @since 7
1269      * @deprecated since 9
1270      */
1271     LAST_KNOWN_LOCATION_ERROR,
1272 
1273     /**
1274      * Indicates location request timeout.
1275      *
1276      * @permission ohos.permission.LOCATION
1277      * @syscap SystemCapability.Location.Location.Core
1278      * @since 7
1279      * @deprecated since 9
1280      */
1281     LOCATION_REQUEST_TIMEOUT_ERROR
1282   }
1283 
1284   /**
1285    * Enum for location privacy type
1286    *
1287    * @permission ohos.permission.LOCATION
1288    * @enum { number }
1289    * @syscap SystemCapability.Location.Location.Core
1290    * @since 8
1291    * @deprecated since 9
1292    * @useinstead ohos.geoLocationManager/geoLocationManager.LocationPrivacyType
1293    */
1294   export enum LocationPrivacyType {
1295     /**
1296      * @syscap SystemCapability.Location.Location.Core
1297      * @since 8
1298      * @deprecated since 9
1299      */
1300     OTHERS = 0,
1301 
1302     /**
1303      * @syscap SystemCapability.Location.Location.Core
1304      * @since 8
1305      * @deprecated since 9
1306      */
1307     STARTUP,
1308 
1309     /**
1310      * @syscap SystemCapability.Location.Location.Core
1311      * @since 8
1312      * @deprecated since 9
1313      */
1314     CORE_LOCATION
1315   }
1316 
1317   /**
1318    * Location subsystem command structure
1319    *
1320    * @interface LocationCommand
1321    * @permission ohos.permission.LOCATION
1322    * @syscap SystemCapability.Location.Location.Core
1323    * @since 8
1324    * @deprecated since 9
1325    * @useinstead ohos.geoLocationManager/geoLocationManager.LocationCommand
1326    */
1327   export interface LocationCommand {
1328     /**
1329      * @syscap SystemCapability.Location.Location.Core
1330      * @since 8
1331      * @deprecated since 9
1332      */
1333     scenario: LocationRequestScenario;
1334 
1335     /**
1336      * @syscap SystemCapability.Location.Location.Core
1337      * @since 8
1338      * @deprecated since 9
1339      */
1340     command: string;
1341   }
1342 }
1343 
1344 export default geolocation;
1345