forked from Gr3q/types-cjs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGeocodeGlib-2.0.d.ts
1413 lines (1347 loc) · 46.2 KB
/
GeocodeGlib-2.0.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/** Generated with https://github.com/Gr3q/GIR2TS - If possible do not modify. */
declare namespace imports.gi.GeocodeGlib {
/** This construct is only for enabling class multi-inheritance,
* use {@link BoundingBox} instead.
*/
interface IBoundingBox {
/**
* Bottom coordinate.
*/
bottom: number;
/**
* Left coordinate.
*/
left: number;
/**
* Right coordinate.
*/
right: number;
/**
* Top coordinate.
*/
top: number;
/**
* Compare two #GeocodeBoundingBox instances for equality. This compares all
* fields and only returns %TRUE if the instances are exactly equal.
*
* Both instances must be non-%NULL.
* @param b another bounding box
* @returns %TRUE if the instances are equal, %FALSE otherwise
*/
equal(b: BoundingBox): boolean;
/**
* Gets the bottom coordinate of #bbox.
* @returns the bottom coordinate of #bbox.
*/
get_bottom(): number;
/**
* Gets the left coordinate of #bbox.
* @returns the left coordinate of #bbox.
*/
get_left(): number;
/**
* Gets the right coordinate of #bbox.
* @returns the right coordinate of #bbox.
*/
get_right(): number;
/**
* Gets the top coordinate of #bbox.
* @returns the top coordinate of #bbox.
*/
get_top(): number;
connect(signal: "notify::bottom", callback: (owner: this, ...args: any) => void): number;
connect(signal: "notify::left", callback: (owner: this, ...args: any) => void): number;
connect(signal: "notify::right", callback: (owner: this, ...args: any) => void): number;
connect(signal: "notify::top", callback: (owner: this, ...args: any) => void): number;
}
type BoundingBoxInitOptionsMixin = GObject.ObjectInitOptions &
Pick<IBoundingBox,
"bottom" |
"left" |
"right" |
"top">;
export interface BoundingBoxInitOptions extends BoundingBoxInitOptionsMixin {}
/** This construct is only for enabling class multi-inheritance,
* use {@link BoundingBox} instead.
*/
type BoundingBoxMixin = IBoundingBox & GObject.Object;
/**
* All the fields in the #GeocodeLocation structure are private and should
* never be accessed directly.
*/
interface BoundingBox extends BoundingBoxMixin {}
class BoundingBox {
public constructor(options?: Partial<BoundingBoxInitOptions>);
/**
* Creates a new #GeocodeBoundingBox object.
* @param top The left coordinate
* @param bottom The bottom coordinate
* @param left The left coordinate
* @param right The right coordinate
* @returns a new #GeocodeBoundingBox object. Use {@link GObject.unref} when done.
*/
public static new(top: number, bottom: number, left: number, right: number): BoundingBox;
}
/** This construct is only for enabling class multi-inheritance,
* use {@link Forward} instead.
*/
interface IForward {
/**
* The number of requested results to a search query.
*/
answer_count: number;
/**
* If set to #TRUE then only results in the #GeocodeForward:search-area
* bounding box are returned.
* If set to #FALSE the #GeocodeForward:search-area is treated like a
* preferred area for results.
*/
bounded: boolean;
/**
* The bounding box that limits the search area.
* If #GeocodeForward:bounded property is set to #TRUE only results from
* this area is returned.
*/
search_area: BoundingBox;
/**
* Gets the number of requested results for searches.
* @returns
*/
get_answer_count(): number;
/**
* Gets the #GeocodeForward:bounded property that regulates whether the
* #GeocodeForward:search-area property acts restricting or not.
* @returns
*/
get_bounded(): boolean;
/**
* Gets the area to limit searches within.
* @returns the search area, or %NULL if none is set
*/
get_search_area(): BoundingBox | null;
/**
* Gets the result of a forward geocoding
* query using the current backend (see {@link Geocode.forward_set_backend}). By
* default the GNOME Nominatim server is used. See #GeocodeBackend for more
* information.
*
* If no results are found, a %GEOCODE_ERROR_NO_MATCHES error is returned.
* @returns A list of
* places or %NULL in case of errors. Free the returned instances with
* {@link GObject.unref} and the list with g_list_free() when done.
*/
search(): Place[];
/**
* Asynchronously performs a forward geocoding
* query using a web service. Use {@link Geocode.forward_search} to do the same
* thing synchronously.
*
* When the operation is finished, #callback will be called. You can then call
* geocode_forward_search_finish() to get the result of the operation.
* @param cancellable optional #GCancellable forward, %NULL to ignore.
* @param callback a #GAsyncReadyCallback to call when the request is satisfied
*/
search_async(cancellable?: Gio.Cancellable | null, callback?: Gio.AsyncReadyCallback | null): void;
/**
* Finishes a forward geocoding operation. See {@link Geocode.forward_search_async}.
* @param res a #GAsyncResult.
* @returns A list of
* places or %NULL in case of errors. Free the returned instances with
* {@link GObject.unref} and the list with g_list_free() when done.
*/
search_finish(res: Gio.AsyncResult): Place[];
/**
* Sets the number of requested results to #count.
* @param count the number of requested results, which must be greater than zero
*/
set_answer_count(count: number): void;
/**
* Specifies the backend to use in the forward geocoding operation.
*
* If none is given, the default GNOME Nominatim server is used.
* @param backend a #GeocodeBackend, or %NULL to use the
* default one.
*/
set_backend(backend?: Backend | null): void;
/**
* Set the #GeocodeForward:bounded property that regulates whether the
* #GeocodeForward:search-area property acts restricting or not.
* @param bounded #TRUE to restrict results to only items contained within the
* #GeocodeForward:search-area bounding box.
*/
set_bounded(bounded: boolean): void;
/**
* Sets the area to limit searches within.
* @param box a bounding box to limit the search area.
*/
set_search_area(box: BoundingBox): void;
connect(signal: "notify::answer-count", callback: (owner: this, ...args: any) => void): number;
connect(signal: "notify::bounded", callback: (owner: this, ...args: any) => void): number;
connect(signal: "notify::search-area", callback: (owner: this, ...args: any) => void): number;
}
type ForwardInitOptionsMixin = GObject.ObjectInitOptions &
Pick<IForward,
"answer_count" |
"bounded" |
"search_area">;
export interface ForwardInitOptions extends ForwardInitOptionsMixin {}
/** This construct is only for enabling class multi-inheritance,
* use {@link Forward} instead.
*/
type ForwardMixin = IForward & GObject.Object;
/**
* All the fields in the #GeocodeForward structure are private and should never be accessed directly.
*/
interface Forward extends ForwardMixin {}
class Forward {
public constructor(options?: Partial<ForwardInitOptions>);
/**
* Creates a new #GeocodeForward to perform geocoding with. The
* #GHashTable is in the format used by Telepathy, and documented
* on <ulink url="http://telepathy.freedesktop.org/spec/Connection_Interface_Location.html#Mapping:Location">Telepathy's specification site</ulink>.
*
* See also: <ulink url="http://xmpp.org/extensions/xep-0080.html">XEP-0080 specification</ulink>.
* @param params a #GHashTable with string keys, and #GValue values.
* @returns a new #GeocodeForward. Use {@link GObject.unref} when done.
*/
public static new_for_params(params: string[]): Forward;
/**
* Creates a new #GeocodeForward to perform forward geocoding with. The
* string is in free-form format.
* @param str a string containing a free-form description of the location
* @returns a new #GeocodeForward. Use {@link GObject.unref} when done.
*/
public static new_for_string(str: string): Forward;
}
/** This construct is only for enabling class multi-inheritance,
* use {@link Location} instead.
*/
interface ILocation {
/**
* The accuracy of this location in meters.
*/
accuracy: number;
/**
* The altitude of this location in meters.
*/
altitude: number;
/**
* The Coordinate Reference System Identification of this location.
* Only the value 'wgs84' is currently valid.
*/
crs: LocationCRS;
/**
* The description of this location.
*/
description: string;
/**
* The latitude of this location in degrees.
*/
latitude: number;
/**
* The longitude of this location in degrees.
*/
longitude: number;
/**
* A timestamp in seconds since
* <ulink url="http://en.wikipedia.org/wiki/Unix_epoch">Epoch</ulink>,
* giving when the location was resolved from an address.
*
* A value of 0 (zero) will be interpreted as the current time.
*/
timestamp: number;
/**
* Compare two #GeocodeLocation instances for equality. This compares all fields
* and only returns %TRUE if the instances are exactly equal. For example, if
* both locations have the same physical coordinates, but one location has its
* #GeocodeLocation:description property set and the other does not, %FALSE
* will be returned. Similarly, if both locations have the same
* #GeocodeLocation:latitude, #GeocodeLocation:longitude and
* #GeocodeLocation:altitude, but a different #GeocodeLocation:accuracy or
* #GeocodeLocation:timestamp, %FALSE will be returned. Or if both locations
* have the same#GeocodeLocation:latitude and #GeocodeLocation:longitude but a
* different #GeocodeLocation:altitude, %FALSE will be returned.
*
* Both instances must be non-%NULL.
* @param b another location
* @returns %TRUE if the instances are equal, %FALSE otherwise
*/
equal(b: Location): boolean;
/**
* Gets the accuracy (in meters) of location #loc.
* @returns The accuracy of location #loc.
*/
get_accuracy(): number;
/**
* Gets the altitude of location #loc.
* @returns The altitude of location #loc.
*/
get_altitude(): number;
/**
* Gets the Coordinate Reference System Identification of location #loc.
* @returns The CRS of location #loc.
*/
get_crs(): LocationCRS;
/**
* Gets the description of location #loc.
* @returns The description of location #loc.
*/
get_description(): string;
/**
* Calculates the distance in km, along the curvature of the Earth,
* between 2 locations. Note that altitude changes are not
* taken into account.
* @param locb a #GeocodeLocation
* @returns a distance in km.
*/
get_distance_from(locb: Location): number;
/**
* Gets the latitude of location #loc.
* @returns The latitude of location #loc.
*/
get_latitude(): number;
/**
* Gets the longitude of location #loc.
* @returns The longitude of location #loc.
*/
get_longitude(): number;
/**
* Gets the timestamp (in seconds since the Epoch) of location #loc. See
* #GeocodeLocation:timestamp.
* @returns The timestamp of location #loc.
*/
get_timestamp(): number;
/**
* Sets the description of #loc to #description.
* @param description a description for the location
*/
set_description(description: string): void;
/**
* Initialize a #GeocodeLocation object with the given #uri.
*
* The URI should be in the geo scheme (RFC 5870) which in its simplest form
* looks like:
*
* - geo:latitude,longitude
*
* An <ulink
* url="http://developer.android.com/guide/components/intents-common.html#Maps">
* Android extension</ulink> to set a description is also supported in the form of:
*
* - geo:0,0?q=latitude,longitude(description)
* @param uri a URI mapping out a location
* @returns %TRUE on success and %FALSE on error.
*/
set_from_uri(uri: string): boolean;
/**
* Creates a URI representing #loc in the scheme specified in #scheme.
* @param scheme the scheme of the requested URI
* @returns a URI representing the location. The returned string should be freed
* with {@link G.free} when no longer needed.
*/
to_uri(scheme: LocationURIScheme): string;
connect(signal: "notify::accuracy", callback: (owner: this, ...args: any) => void): number;
connect(signal: "notify::altitude", callback: (owner: this, ...args: any) => void): number;
connect(signal: "notify::crs", callback: (owner: this, ...args: any) => void): number;
connect(signal: "notify::description", callback: (owner: this, ...args: any) => void): number;
connect(signal: "notify::latitude", callback: (owner: this, ...args: any) => void): number;
connect(signal: "notify::longitude", callback: (owner: this, ...args: any) => void): number;
connect(signal: "notify::timestamp", callback: (owner: this, ...args: any) => void): number;
}
type LocationInitOptionsMixin = GObject.ObjectInitOptions &
Pick<ILocation,
"accuracy" |
"altitude" |
"crs" |
"description" |
"latitude" |
"longitude" |
"timestamp">;
export interface LocationInitOptions extends LocationInitOptionsMixin {}
/** This construct is only for enabling class multi-inheritance,
* use {@link Location} instead.
*/
type LocationMixin = ILocation & GObject.Object;
/**
* All the fields in the #GeocodeLocation structure are private and should never be accessed directly.
*/
interface Location extends LocationMixin {}
class Location {
public constructor(options?: Partial<LocationInitOptions>);
/**
* Creates a new #GeocodeLocation object.
* @param latitude a valid latitude
* @param longitude a valid longitude
* @param accuracy accuracy of location in meters
* @returns a new #GeocodeLocation object. Use {@link GObject.unref} when done.
*/
public static new(latitude: number, longitude: number, accuracy: number): Location;
/**
* Creates a new #GeocodeLocation object.
* @param latitude a valid latitude
* @param longitude a valid longitude
* @param accuracy accuracy of location in meters
* @param description a description for the location
* @returns a new #GeocodeLocation object. Use {@link GObject.unref} when done.
*/
public static new_with_description(latitude: number, longitude: number, accuracy: number, description: string): Location;
}
/** This construct is only for enabling class multi-inheritance,
* use {@link MockBackend} instead.
*/
interface IMockBackend {
/**
* Add a query and corresponding result (or error) to the mock backend, meaning
* that if it receives a forward search for #params through
* {@link Geocode.backend_forward_search} (or its asynchronous variants), the mock
* backend will return the given #results or #error to the caller.
*
* If a set of #params is added to the backend multiple times, the most
* recently provided #results and #error will be used.
*
* Exactly one of #results and #error must be set. Empty result sets are
* represented as a %GEOCODE_ERROR_NO_MATCHES error.
* @param params query parameters to
* respond to, in the same format as accepted by {@link Geocode.forward_search}
* @param results result set
* to return for the query, or %NULL if #error is non-%NULL; result sets
* must be in the same format as returned by {@link Geocode.forward_search}
* @param error error to return for the query, or %NULL if #results
* should be returned instead; errors must match those returned by
* {@link Geocode.forward_search}
*/
add_forward_result(params: string[], results?: Place[] | null, error?: GLib.Error | null): void;
/**
* Add a query and corresponding result (or error) to the mock backend, meaning
* that if it receives a reverse search for #params through
* {@link Geocode.backend_reverse_resolve} (or its asynchronous variants), the mock
* backend will return the given #results or #error to the caller.
*
* If a set of #params is added to the backend multiple times, the most
* recently provided #results and #error will be used.
*
* Exactly one of #results and #error must be set. Empty result sets are
* represented as a %GEOCODE_ERROR_NOT_SUPPORTED error.
* @param params query parameters to
* respond to, in the same format as accepted by {@link Geocode.reverse_resolve}
* @param results result set
* to return for the query, or %NULL if #error is non-%NULL; result sets
* must be in the same format as returned by {@link Geocode.reverse_resolve}
* @param error error to return for the query, or %NULL if #results
* should be returned instead; errors must match those returned by
* {@link Geocode.reverse_resolve}
*/
add_reverse_result(params: string[], results?: Place[] | null, error?: GLib.Error | null): void;
/**
* Clear the set of stored results in the mock backend which have been added
* using {@link Geocode.mock_backend_add_forward_result} and
* geocode_mock_backend_add_reverse_result(). Additionally, clear the query log
* so far (see geocode_mock_backend_get_query_log()).
*
* This effectively resets the mock backend to its initial state.
*/
clear(): void;
/**
* Get the details of the forward and reverse queries which have been requested
* of the mock backend since the most recent call to
* {@link Geocode.mock_backend_clear}. The query details are provided as
* #GeocodeMockBackendQuery structures, which map the query parameters to
* either the result set or the error which geocode_backend_forward_search()
* or geocode_backend_reverse_resolve() (or their asynchronous variants)
* returned to the caller.
*
* The results are provided in the order in which calls were made to
* geocode_backend_forward_search() and geocode_backend_reverse_resolve().
* Results for forward and reverse queries may be interleaved.
* @returns potentially
* empty sequence of forward and reverse query details
*/
get_query_log(): MockBackendQuery[];
}
type MockBackendInitOptionsMixin = GObject.ObjectInitOptions & BackendInitOptions
export interface MockBackendInitOptions extends MockBackendInitOptionsMixin {}
/** This construct is only for enabling class multi-inheritance,
* use {@link MockBackend} instead.
*/
type MockBackendMixin = IMockBackend & GObject.Object & Backend;
/**
* All the fields in the #GeocodeMockBackend structure are private and should
* never be accessed directly.
*/
interface MockBackend extends MockBackendMixin {}
class MockBackend {
public constructor(options?: Partial<MockBackendInitOptions>);
/**
* Creates a new mock backend implementation with no initial forward or reverse
* query results (so it will return an empty result set for all queries).
* @returns a new #GeocodeMockBackend
*/
public static new(): MockBackend;
}
/** This construct is only for enabling class multi-inheritance,
* use {@link Nominatim} instead.
*/
interface INominatim {
/**
* The base URL of the Nominatim service, for example
* `https://nominatim.example.org`.
*/
base_url: string;
/**
* E-mail address of the maintainer of the software making the
* geocoding requests to the Nominatim server. This is used to contact
* them in the event of a problem with their usage. See
* [the Nominatim API](http://wiki.openstreetmap.org/wiki/Nominatim).
*/
maintainer_email_address: string;
/**
* User-Agent string to send with HTTP(S) requests, or %NULL to use the
* default user agent, which is derived from the geocode-glib version
* and #GApplication:id, for example: `geocode-glib/3.20 (MyAppId)`.
*
* As per the
* [Nominatim usage policy](http://wiki.openstreetmap.org/wiki/Nominatim_usage_policy),
* it should be set to a string which identifies the application which
* is using geocode-glib, and must be a valid
* [user agent](https://tools.ietf.org/html/rfc7231#section-5.5.3)
* string.
*/
user_agent: string;
connect(signal: "notify::base-url", callback: (owner: this, ...args: any) => void): number;
connect(signal: "notify::maintainer-email-address", callback: (owner: this, ...args: any) => void): number;
connect(signal: "notify::user-agent", callback: (owner: this, ...args: any) => void): number;
}
type NominatimInitOptionsMixin = GObject.ObjectInitOptions & BackendInitOptions &
Pick<INominatim,
"base_url" |
"maintainer_email_address" |
"user_agent">;
export interface NominatimInitOptions extends NominatimInitOptionsMixin {}
/** This construct is only for enabling class multi-inheritance,
* use {@link Nominatim} instead.
*/
type NominatimMixin = INominatim & GObject.Object & Backend;
/**
* All the fields in the #GeocodeNominatim structure are private and should
* never be accessed directly.
*/
interface Nominatim extends NominatimMixin {}
class Nominatim {
public constructor(options?: Partial<NominatimInitOptions>);
/**
* Creates a new backend implementation for an online Nominatim server. See
* the documentation for #GeocodeNominatim:base-url and
* #GeocodeNominatim:maintainer-email-address.
* @param base_url a the base URL of the Nominatim server.
* @param maintainer_email_address the email address of the software maintainer.
* @returns a new #GeocodeNominatim. Use {@link GObject.unref} when done.
*/
public static new(base_url: string, maintainer_email_address: string): Nominatim;
/**
* Gets a reference to the default Nominatim server on nominatim.gnome.org.
*
* This function is thread-safe.
* @returns a new #GeocodeNominatim. Use {@link GObject.unref} when done.
*/
public static get_gnome(): Nominatim;
}
/** This construct is only for enabling class multi-inheritance,
* use {@link Place} instead.
*/
interface IPlace {
/**
* The local administrative area.
*/
administrative_area: string;
/**
* A named area such as a campus or neighborhood.
*/
area: string;
/**
* The bounding box for the place.
*/
bounding_box: BoundingBox;
/**
* A specific building on a street or in an area.
*/
building: string;
/**
* The continent.
*/
continent: string;
/**
* The country.
*/
country: string;
/**
* The country code.
*/
country_code: string;
/**
* The county.
*/
county: string;
/**
* #GIcon representing the #GeocodePlace.
*/
readonly icon: Gio.Icon;
/**
* The location info for the place.
*/
location: Location;
/**
* The name of the place.
*/
name: string;
/**
* The OpenStreetMap id of the place.
*/
osm_id: string;
/**
* The OpenStreetMap type of the place.
*/
osm_type: PlaceOsmType;
/**
* The type of the place.
*/
place_type: PlaceType;
/**
* The postal code.
*/
postal_code: string;
/**
* The state.
*/
state: string;
/**
* The street name.
*/
street: string;
/**
* The street address.
*/
street_address: string;
/**
* The town.
*/
town: string;
/**
* Compare two #GeocodePlace instances for equality. This compares all fields
* and only returns %TRUE if the instances are exactly equal. For example, if
* both places have the same #GeocodePlace:location, but place #b has its
* #GeocodePlace:continent property set and place #a does not, %FALSE will be
* returned.
*
* Both instances must be non-%NULL.
* @param b another place
* @returns %TRUE if the instances are equal, %FALSE otherwise
*/
equal(b: Place): boolean;
/**
* Gets the local administrative area of the #place.
* @returns The local administrative area of the #place.
*/
get_administrative_area(): string;
/**
* Gets the area of the #place.
* @returns The area of the #place.
*/
get_area(): string;
/**
* Gets the bounding box for the place #place.
* @returns A #GeocodeBoundingBox, or NULL if boundaries are
* unknown.
*/
get_bounding_box(): BoundingBox;
/**
* Gets the building of the #place.
* @returns The building of the #place.
*/
get_building(): string;
/**
* Gets the continent of the #place.
* @returns The continent of the #place.
*/
get_continent(): string;
/**
* Gets the country of the #place.
* @returns The country of the #place.
*/
get_country(): string;
/**
* Gets the ISO-3166 country code of the #place.
* @returns The ISO-3166 country code of the #place, in upper case.
*/
get_country_code(): string;
/**
* Gets the county of the #place.
* @returns The country of the #place.
*/
get_county(): string;
/**
* Gets the #GIcon representing the #place.
* @returns The #GIcon representing the #place.
*/
get_icon(): Gio.Icon;
/**
* Gets the associated location object.
* @returns The associated location object.
*/
get_location(): Location;
/**
* Gets the name of the #place.
* @returns The name of the #place.
*/
get_name(): string;
/**
* Gets the OpenStreetMap ID of the #place.
* @returns The osm ID of the #place.
*/
get_osm_id(): string;
/**
* Gets the OpenStreetMap type of the #place.
* @returns The osm type of the #place.
*/
get_osm_type(): PlaceOsmType;
/**
* Gets the type of the #place.
* @returns The type of the #place.
*/
get_place_type(): PlaceType;
/**
* Gets the postal code of the #place.
* @returns The postal code of the #place.
*/
get_postal_code(): string;
/**
* Gets the state of the #place.
* @returns The state of the #place.
*/
get_state(): string;
/**
* Gets the street of the #place.
* @returns The street of the #place.
*/
get_street(): string;
/**
* Gets the street address of the #place.
* @returns The street address of the #place.
*/
get_street_address(): string;
/**
* Gets the town of the #place.
* @returns The town of the #place.
*/
get_town(): string;
/**
* Sets the local administrative area of #place to #admin_area.
* @param admin_area an administrative area for the place
*/
set_administrative_area(admin_area: string): void;
/**
* Sets the area of #place to #area.
* @param area a area
*/
set_area(area: string): void;
/**
* Sets the #GeocodeBoundingBox for the place #place.
* @param bbox A #GeocodeBoundingBox for the place
*/
set_bounding_box(bbox: BoundingBox): void;
/**
* Sets the building of #place to #building.
* @param building a building
*/
set_building(building: string): void;
/**
* Sets the continent of #place to #continent.
* @param continent a continent for the place
*/
set_continent(continent: string): void;
/**
* Sets the country of #place to #country.
* @param country a country for the place
*/
set_country(country: string): void;
/**
* Sets the ISO country code of #place to #country_code.
* @param country_code an ISO country code for the place
*/
set_country_code(country_code: string): void;
/**
* Sets the county of #place to #county.
* @param county a county for the place
*/
set_county(county: string): void;
/**
* Sets the location of #place to #location.
* @param location A location
*/
set_location(location: Location): void;
/**
* Sets the name of the #place to #name.
* @param name the name of place
*/
set_name(name: string): void;
/**
* Sets the postal code of #place to #postal_code.
* @param postal_code a postal code for the place
*/
set_postal_code(postal_code: string): void;
/**
* Sets the state of #place to #state.
* @param state a state for the place
*/
set_state(state: string): void;
/**
* Sets the street of #place to #street.
* @param street a street
*/
set_street(street: string): void;
/**
* Sets the street address of #place to #street_address.
* @param street_address a street address for the place
*/
set_street_address(street_address: string): void;
/**
* Sets the town of #place to #town.
* @param town a town for the place
*/
set_town(town: string): void;
connect(signal: "notify::administrative-area", callback: (owner: this, ...args: any) => void): number;
connect(signal: "notify::area", callback: (owner: this, ...args: any) => void): number;
connect(signal: "notify::bounding-box", callback: (owner: this, ...args: any) => void): number;
connect(signal: "notify::building", callback: (owner: this, ...args: any) => void): number;
connect(signal: "notify::continent", callback: (owner: this, ...args: any) => void): number;
connect(signal: "notify::country", callback: (owner: this, ...args: any) => void): number;
connect(signal: "notify::country-code", callback: (owner: this, ...args: any) => void): number;
connect(signal: "notify::county", callback: (owner: this, ...args: any) => void): number;
connect(signal: "notify::icon", callback: (owner: this, ...args: any) => void): number;
connect(signal: "notify::location", callback: (owner: this, ...args: any) => void): number;
connect(signal: "notify::name", callback: (owner: this, ...args: any) => void): number;
connect(signal: "notify::osm-id", callback: (owner: this, ...args: any) => void): number;
connect(signal: "notify::osm-type", callback: (owner: this, ...args: any) => void): number;
connect(signal: "notify::place-type", callback: (owner: this, ...args: any) => void): number;
connect(signal: "notify::postal-code", callback: (owner: this, ...args: any) => void): number;
connect(signal: "notify::state", callback: (owner: this, ...args: any) => void): number;
connect(signal: "notify::street", callback: (owner: this, ...args: any) => void): number;
connect(signal: "notify::street-address", callback: (owner: this, ...args: any) => void): number;
connect(signal: "notify::town", callback: (owner: this, ...args: any) => void): number;
}
type PlaceInitOptionsMixin = GObject.ObjectInitOptions &
Pick<IPlace,
"administrative_area" |
"area" |
"bounding_box" |
"building" |
"continent" |
"country" |
"country_code" |
"county" |
"location" |
"name" |
"osm_id" |
"osm_type" |
"place_type" |
"postal_code" |
"state" |
"street" |
"street_address" |
"town">;
export interface PlaceInitOptions extends PlaceInitOptionsMixin {}
/** This construct is only for enabling class multi-inheritance,
* use {@link Place} instead.
*/
type PlaceMixin = IPlace & GObject.Object;
/**
* All the fields in the #GeocodePlace structure are private and should never be accessed directly.
*/
interface Place extends PlaceMixin {}
class Place {
public constructor(options?: Partial<PlaceInitOptions>);
/**
* Creates a new #GeocodePlace object.
* @param name the name of place
* @param place_type the type of place
* @returns a new #GeocodePlace object. Use {@link GObject.unref} when done.
*/
public static new(name: string, place_type: PlaceType): Place;
/**
* Creates a new #GeocodePlace object.
* @param name the name of place
* @param place_type the type of place
* @param location the location info for the place
* @returns a new #GeocodePlace object. Use {@link GObject.unref} when done.
*/
public static new_with_location(name: string, place_type: PlaceType, location: Location): Place;
}
/** This construct is only for enabling class multi-inheritance,
* use {@link Reverse} instead.
*/
interface IReverse {
/**
* Gets the result of a reverse geocoding
* query using the current backend (see {@link Geocode.reverse_set_backend}). By
* default the GNOME Nominatim server is used. See #GeocodeBackend for more
* information.
*
* If no result could be found, a %GEOCODE_ERROR_NOT_SUPPORTED error will be
* returned. This typically happens if the coordinates to geocode are in the
* middle of the ocean.
* @returns A #GeocodePlace instance, or %NULL in case of
* errors. Free the returned instance with {@link #g.object_unref} when done.
*/
resolve(): Place;
/**
* Asynchronously gets the result of a reverse geocoding
* query using a web service. Use {@link Geocode.reverse_resolve} to do the same
* thing synchronously.
*
* When the operation is finished, #callback will be called. You can then call
* geocode_reverse_resolve_finish() to get the result of the operation.
* @param cancellable optional #GCancellable object, %NULL to ignore.
* @param callback a #GAsyncReadyCallback to call when the request is satisfied
*/
resolve_async(cancellable?: Gio.Cancellable | null, callback?: Gio.AsyncReadyCallback | null): void;
/**
* Finishes a reverse geocoding operation. See {@link Geocode.reverse_resolve_async}.
* @param res a #GAsyncResult.
* @returns A #GeocodePlace instance, or %NULL in case of
* errors. Free the returned instance with {@link #g.object_unref} when done.
*/
resolve_finish(res: Gio.AsyncResult): Place;
/**
* Specifies the backend to use in the reverse geocoding operation.
*
* If none is given, the default GNOME Nominatim server is used.
* @param backend a #GeocodeBackend, or %NULL to use the default one.
*/
set_backend(backend?: Backend | null): void;
}
type ReverseInitOptionsMixin = GObject.ObjectInitOptions
export interface ReverseInitOptions extends ReverseInitOptionsMixin {}
/** This construct is only for enabling class multi-inheritance,
* use {@link Reverse} instead.
*/
type ReverseMixin = IReverse & GObject.Object;
/**
* All the fields in the #GeocodeReverse structure are private and should never be accessed directly.
*/
interface Reverse extends ReverseMixin {}
class Reverse {
public constructor(options?: Partial<ReverseInitOptions>);
/**
* Creates a new #GeocodeReverse to perform reverse geocoding with.
* Use {@link Geocode.reverse_resolve_async} to perform the resolution.
* @param location a #GeocodeLocation object
* @returns a new #GeocodeReverse. Use {@link GObject.unref} when done.
*/
public static new_for_location(location: Location): Reverse;
}
export interface BackendInterfaceInitOptions {}
/**
* Interface which defines the basic operations for geocoding.
*/
interface BackendInterface {}
class BackendInterface {
public constructor(options?: Partial<BackendInterfaceInitOptions>);
public readonly g_iface: GObject.TypeInterface;
public readonly padding: any[];
public forward_search: {(backend: Backend, params: string[], cancellable?: Gio.Cancellable | null): Place[];};
public forward_search_async: {(backend: Backend, params: string[], cancellable?: Gio.Cancellable | null, callback?: Gio.AsyncReadyCallback | null): void;};
public forward_search_finish: {(backend: Backend, result: Gio.AsyncResult): Place[];};
public reverse_resolve: {(backend: Backend, params: string[], cancellable?: Gio.Cancellable | null): Place[];};
public reverse_resolve_async: {(backend: Backend, params: string[], cancellable?: Gio.Cancellable | null, callback?: Gio.AsyncReadyCallback | null): void;};