@maptiler/client 1.8.1 → 2.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -101,93 +101,773 @@ declare class ClientConfig {
101
101
  */
102
102
  declare const config: ClientConfig;
103
103
 
104
+ type LanguageInfo = {
105
+ /**
106
+ * Two-letter ISO code, such as `"en"` for English language.
107
+ * Can be `null` if the language is a flag to be evaluated at runtime,
108
+ * as it is the case for some "modes".
109
+ */
110
+ code: string | null;
111
+ /**
112
+ * The full OSM language flag, such as `"name:en"` for the English language.
113
+ * Can also be a non-OSM flag if the language needs to be evaluated at runtime, such as `"auto"`,
114
+ * as it is the case for some "modes".
115
+ */
116
+ flag: string;
117
+ /**
118
+ * English name of the language.
119
+ */
120
+ name: string;
121
+ /**
122
+ * Whether the language leverages only the latin charsets.
123
+ */
124
+ latin: boolean;
125
+ /**
126
+ * Some language descriptions corresponds to "modes" rather than to actual languages.
127
+ * For instance the "visitor" mode consists in displaying bilingual labels.
128
+ */
129
+ isMode: boolean;
130
+ /**
131
+ * Whether the language is compatible with the geocoding API
132
+ */
133
+ geocoding: boolean;
134
+ };
104
135
  /**
105
- * Languages. Note that not all the languages of this list are available but the compatibility list may be expanded in the future.
106
- */
107
- declare const LanguageGeocoding: {
108
- AUTO: string;
109
- ALBANIAN: string;
110
- ARABIC: string;
111
- ARMENIAN: string;
112
- AZERBAIJANI: string;
113
- BELORUSSIAN: string;
114
- BOSNIAN: string;
115
- BRETON: string;
116
- BULGARIAN: string;
117
- CATALAN: string;
118
- CHINESE: string;
119
- CROATIAN: string;
120
- CZECH: string;
121
- DANISH: string;
122
- DUTCH: string;
123
- ENGLISH: string;
124
- ESPERANTO: string;
125
- ESTONIAN: string;
126
- FINNISH: string;
127
- FRENCH: string;
128
- FRISIAN: string;
129
- GEORGIAN: string;
130
- GERMAN: string;
131
- GREEK: string;
132
- HEBREW: string;
133
- HUNGARIAN: string;
134
- ICELANDIC: string;
135
- IRISH: string;
136
- ITALIAN: string;
137
- JAPANESE: string;
138
- KANNADA: string;
139
- KAZAKH: string;
140
- KOREAN: string;
141
- ROMAN_LATIN: string;
142
- LATVIAN: string;
143
- LITHUANIAN: string;
144
- LUXEMBOURGISH: string;
145
- MACEDONIAN: string;
146
- MALTESE: string;
147
- NORWEGIAN: string;
148
- POLISH: string;
149
- PORTUGUESE: string;
150
- ROMANIAN: string;
151
- ROMANSH: string;
152
- RUSSIAN: string;
153
- SCOTTISH_GAELIC: string;
154
- SERBIAN_CYRILLIC: string;
155
- SLOVAK: string;
156
- SLOVENE: string;
157
- SPANISH: string;
158
- SWEDISH: string;
159
- THAI: string;
160
- TURKISH: string;
161
- UKRAINIAN: string;
162
- WELSH: string;
136
+ * List of "non-ISO specific" languages.
137
+ */
138
+ declare const NonISOLanguage: {
139
+ /**
140
+ * Language mode to display the labels in the end user's device language.
141
+ */
142
+ readonly AUTO: LanguageInfo;
143
+ /**
144
+ * The OSM language using latin script. MapTiler discourages its use as a primary language setting due to the lack of actual linguistic specificity,
145
+ * though it can be an handy fallback. This is not to be confused with the "Classical Latin" language, which is available under the tag `.CLASSICAL_LATIN`.
146
+ */
147
+ readonly LATIN: LanguageInfo;
148
+ /**
149
+ * The OSM language using non-latin script. MapTiler discourages its use as a primary language setting due to the lack of actual linguistic specificity,
150
+ * though it can be an handy fallback.
151
+ */
152
+ readonly NON_LATIN: LanguageInfo;
153
+ /**
154
+ * Using the local language generaly (but not always) means that every labels of a given region will use the dominant local language.
155
+ */
156
+ readonly LOCAL: LanguageInfo;
163
157
  };
164
- type Values<T> = T[keyof T];
165
158
  /**
166
- * Built-in languages values as strings
159
+ * List of "country specific" languages.
167
160
  */
168
- type LanguageGeocodingString = Values<typeof LanguageGeocoding>;
169
- declare function getAutoLanguageGeocoding(): LanguageGeocodingString;
161
+ declare const ISOLanguage: {
162
+ /**
163
+ * Albanian language
164
+ */
165
+ readonly ALBANIAN: LanguageInfo;
166
+ /**
167
+ * Amharic language
168
+ */
169
+ readonly AMHARIC: LanguageInfo;
170
+ /**
171
+ * Arabic language (right-to-left script)
172
+ */
173
+ readonly ARABIC: LanguageInfo;
174
+ /**
175
+ * Armenian language
176
+ */
177
+ readonly ARMENIAN: LanguageInfo;
178
+ /**
179
+ * Azerbaijani language
180
+ */
181
+ readonly AZERBAIJANI: LanguageInfo;
182
+ /**
183
+ * Basque language
184
+ */
185
+ readonly BASQUE: LanguageInfo;
186
+ /**
187
+ * Belarusian langauge
188
+ */
189
+ readonly BELARUSIAN: LanguageInfo;
190
+ /**
191
+ * Bengali language
192
+ */
193
+ readonly BENGALI: LanguageInfo;
194
+ /**
195
+ * Bosnian language
196
+ */
197
+ readonly BOSNIAN: LanguageInfo;
198
+ /**
199
+ * Breton language
200
+ */
201
+ readonly BRETON: LanguageInfo;
202
+ /**
203
+ * Bulgarian language
204
+ */
205
+ readonly BULGARIAN: LanguageInfo;
206
+ /**
207
+ * Catalan language
208
+ */
209
+ readonly CATALAN: LanguageInfo;
210
+ /**
211
+ * Chinese language
212
+ */
213
+ readonly CHINESE: LanguageInfo;
214
+ /**
215
+ * Traditional Chinese language
216
+ */
217
+ readonly TRADITIONAL_CHINESE: LanguageInfo;
218
+ /**
219
+ * Simplified Chinese language
220
+ */
221
+ readonly SIMPLIFIED_CHINESE: LanguageInfo;
222
+ /**
223
+ * Corsican language
224
+ */
225
+ readonly CORSICAN: LanguageInfo;
226
+ /**
227
+ * Croatian language
228
+ */
229
+ readonly CROATIAN: LanguageInfo;
230
+ /**
231
+ * Czech language
232
+ */
233
+ readonly CZECH: LanguageInfo;
234
+ /**
235
+ * Danish language
236
+ */
237
+ readonly DANISH: LanguageInfo;
238
+ /**
239
+ * Dutch language
240
+ */
241
+ readonly DUTCH: LanguageInfo;
242
+ /**
243
+ * German language
244
+ */
245
+ readonly GERMAN: LanguageInfo;
246
+ /**
247
+ * Greek language
248
+ */
249
+ readonly GREEK: LanguageInfo;
250
+ /**
251
+ * English language
252
+ */
253
+ readonly ENGLISH: LanguageInfo;
254
+ /**
255
+ * Esperanto language
256
+ */
257
+ readonly ESPERANTO: LanguageInfo;
258
+ /**
259
+ * Estonian language
260
+ */
261
+ readonly ESTONIAN: LanguageInfo;
262
+ /**
263
+ * Finnish language
264
+ */
265
+ readonly FINNISH: LanguageInfo;
266
+ /**
267
+ * French language
268
+ */
269
+ readonly FRENCH: LanguageInfo;
270
+ /**
271
+ * Frisian language
272
+ */
273
+ readonly FRISIAN: LanguageInfo;
274
+ /**
275
+ * Georgian language
276
+ */
277
+ readonly GEORGIAN: LanguageInfo;
278
+ /**
279
+ * Hebrew language (right-to-left non-latin script)
280
+ */
281
+ readonly HEBREW: LanguageInfo;
282
+ /**
283
+ * Hindi language
284
+ */
285
+ readonly HINDI: LanguageInfo;
286
+ /**
287
+ * Hungarian language
288
+ */
289
+ readonly HUNGARIAN: LanguageInfo;
290
+ /**
291
+ * Icelandic language
292
+ */
293
+ readonly ICELANDIC: LanguageInfo;
294
+ /**
295
+ * Indonesian language
296
+ */
297
+ readonly INDONESIAN: LanguageInfo;
298
+ /**
299
+ * Irish language
300
+ */
301
+ readonly IRISH: LanguageInfo;
302
+ /**
303
+ * Italian language
304
+ */
305
+ readonly ITALIAN: LanguageInfo;
306
+ /**
307
+ * Japanese language
308
+ */
309
+ readonly JAPANESE: LanguageInfo;
310
+ /**
311
+ * Japanese language in Hiragana form
312
+ */
313
+ readonly JAPANESE_HIRAGANA: LanguageInfo;
314
+ /**
315
+ * Japanese language (latin script)
316
+ */
317
+ readonly JAPANESE_2018: LanguageInfo;
318
+ /**
319
+ * Japanese language in Kana form (non-latin script)
320
+ */
321
+ readonly JAPANESE_KANA: LanguageInfo;
322
+ /**
323
+ * Japanse language, romanized (latin script)
324
+ */
325
+ readonly JAPANESE_LATIN: LanguageInfo;
326
+ /**
327
+ * Kannada language
328
+ */
329
+ readonly KANNADA: LanguageInfo;
330
+ /**
331
+ * Kazakh language
332
+ */
333
+ readonly KAZAKH: LanguageInfo;
334
+ /**
335
+ * Korean language
336
+ */
337
+ readonly KOREAN: LanguageInfo;
338
+ /**
339
+ * Korean language (latin script)
340
+ */
341
+ readonly KOREAN_LATIN: LanguageInfo;
342
+ /**
343
+ * Kurdish language
344
+ */
345
+ readonly KURDISH: LanguageInfo;
346
+ /**
347
+ * Classical Latin language
348
+ */
349
+ readonly CLASSICAL_LATIN: LanguageInfo;
350
+ /**
351
+ * Latvian language
352
+ */
353
+ readonly LATVIAN: LanguageInfo;
354
+ /**
355
+ * Lithuanian language
356
+ */
357
+ readonly LITHUANIAN: LanguageInfo;
358
+ /**
359
+ * Luxembourgish language
360
+ */
361
+ readonly LUXEMBOURGISH: LanguageInfo;
362
+ /**
363
+ * Macedonian language
364
+ */
365
+ readonly MACEDONIAN: LanguageInfo;
366
+ /**
367
+ * Malayalm language
368
+ */
369
+ readonly MALAYALAM: LanguageInfo;
370
+ /**
371
+ * Maltese language
372
+ */
373
+ readonly MALTESE: LanguageInfo;
374
+ /**
375
+ * Norwegian language
376
+ */
377
+ readonly NORWEGIAN: LanguageInfo;
378
+ /**
379
+ * Occitan language
380
+ */
381
+ readonly OCCITAN: LanguageInfo;
382
+ /**
383
+ * Persian language
384
+ */
385
+ readonly PERSIAN: LanguageInfo;
386
+ /**
387
+ * Polish language
388
+ */
389
+ readonly POLISH: LanguageInfo;
390
+ /**
391
+ * Portuguese language
392
+ */
393
+ readonly PORTUGUESE: LanguageInfo;
394
+ /**
395
+ * Punjabi language
396
+ */
397
+ readonly PUNJABI: LanguageInfo;
398
+ /**
399
+ * Western Punjabi language
400
+ */
401
+ readonly WESTERN_PUNJABI: LanguageInfo;
402
+ /**
403
+ * Romanian language
404
+ */
405
+ readonly ROMANIAN: LanguageInfo;
406
+ /**
407
+ * Romansh language
408
+ */
409
+ readonly ROMANSH: LanguageInfo;
410
+ /**
411
+ * Russian language
412
+ */
413
+ readonly RUSSIAN: LanguageInfo;
414
+ /**
415
+ * Serbian language (cyrillic script)
416
+ */
417
+ readonly SERBIAN_CYRILLIC: LanguageInfo;
418
+ /**
419
+ * Serbian language (latin script)
420
+ */
421
+ readonly SERBIAN_LATIN: LanguageInfo;
422
+ /**
423
+ * Scottish Gaelic language
424
+ */
425
+ readonly SCOTTISH_GAELIC: LanguageInfo;
426
+ /**
427
+ * Slovak language
428
+ */
429
+ readonly SLOVAK: LanguageInfo;
430
+ /**
431
+ * Slovene language
432
+ */
433
+ readonly SLOVENE: LanguageInfo;
434
+ /**
435
+ * Spanish language
436
+ */
437
+ readonly SPANISH: LanguageInfo;
438
+ /**
439
+ * Swedish language
440
+ */
441
+ readonly SWEDISH: LanguageInfo;
442
+ /**
443
+ * Tamil language
444
+ */
445
+ readonly TAMIL: LanguageInfo;
446
+ /**
447
+ * Telugu language
448
+ */
449
+ readonly TELUGU: LanguageInfo;
450
+ /**
451
+ * Thai language
452
+ */
453
+ readonly THAI: LanguageInfo;
454
+ /**
455
+ * Turkish language
456
+ */
457
+ readonly TURKISH: LanguageInfo;
458
+ /**
459
+ * Ukrainian language
460
+ */
461
+ readonly UKRAINIAN: LanguageInfo;
462
+ /**
463
+ * Vietnamese language (latin script)
464
+ */
465
+ readonly VIETNAMESE: LanguageInfo;
466
+ /**
467
+ * Welsh language
468
+ */
469
+ readonly WELSH: LanguageInfo;
470
+ };
471
+ /**
472
+ * The complete list of languages
473
+ */
474
+ declare const Language: {
475
+ /**
476
+ * Albanian language
477
+ */
478
+ readonly ALBANIAN: LanguageInfo;
479
+ /**
480
+ * Amharic language
481
+ */
482
+ readonly AMHARIC: LanguageInfo;
483
+ /**
484
+ * Arabic language (right-to-left script)
485
+ */
486
+ readonly ARABIC: LanguageInfo;
487
+ /**
488
+ * Armenian language
489
+ */
490
+ readonly ARMENIAN: LanguageInfo;
491
+ /**
492
+ * Azerbaijani language
493
+ */
494
+ readonly AZERBAIJANI: LanguageInfo;
495
+ /**
496
+ * Basque language
497
+ */
498
+ readonly BASQUE: LanguageInfo;
499
+ /**
500
+ * Belarusian langauge
501
+ */
502
+ readonly BELARUSIAN: LanguageInfo;
503
+ /**
504
+ * Bengali language
505
+ */
506
+ readonly BENGALI: LanguageInfo;
507
+ /**
508
+ * Bosnian language
509
+ */
510
+ readonly BOSNIAN: LanguageInfo;
511
+ /**
512
+ * Breton language
513
+ */
514
+ readonly BRETON: LanguageInfo;
515
+ /**
516
+ * Bulgarian language
517
+ */
518
+ readonly BULGARIAN: LanguageInfo;
519
+ /**
520
+ * Catalan language
521
+ */
522
+ readonly CATALAN: LanguageInfo;
523
+ /**
524
+ * Chinese language
525
+ */
526
+ readonly CHINESE: LanguageInfo;
527
+ /**
528
+ * Traditional Chinese language
529
+ */
530
+ readonly TRADITIONAL_CHINESE: LanguageInfo;
531
+ /**
532
+ * Simplified Chinese language
533
+ */
534
+ readonly SIMPLIFIED_CHINESE: LanguageInfo;
535
+ /**
536
+ * Corsican language
537
+ */
538
+ readonly CORSICAN: LanguageInfo;
539
+ /**
540
+ * Croatian language
541
+ */
542
+ readonly CROATIAN: LanguageInfo;
543
+ /**
544
+ * Czech language
545
+ */
546
+ readonly CZECH: LanguageInfo;
547
+ /**
548
+ * Danish language
549
+ */
550
+ readonly DANISH: LanguageInfo;
551
+ /**
552
+ * Dutch language
553
+ */
554
+ readonly DUTCH: LanguageInfo;
555
+ /**
556
+ * German language
557
+ */
558
+ readonly GERMAN: LanguageInfo;
559
+ /**
560
+ * Greek language
561
+ */
562
+ readonly GREEK: LanguageInfo;
563
+ /**
564
+ * English language
565
+ */
566
+ readonly ENGLISH: LanguageInfo;
567
+ /**
568
+ * Esperanto language
569
+ */
570
+ readonly ESPERANTO: LanguageInfo;
571
+ /**
572
+ * Estonian language
573
+ */
574
+ readonly ESTONIAN: LanguageInfo;
575
+ /**
576
+ * Finnish language
577
+ */
578
+ readonly FINNISH: LanguageInfo;
579
+ /**
580
+ * French language
581
+ */
582
+ readonly FRENCH: LanguageInfo;
583
+ /**
584
+ * Frisian language
585
+ */
586
+ readonly FRISIAN: LanguageInfo;
587
+ /**
588
+ * Georgian language
589
+ */
590
+ readonly GEORGIAN: LanguageInfo;
591
+ /**
592
+ * Hebrew language (right-to-left non-latin script)
593
+ */
594
+ readonly HEBREW: LanguageInfo;
595
+ /**
596
+ * Hindi language
597
+ */
598
+ readonly HINDI: LanguageInfo;
599
+ /**
600
+ * Hungarian language
601
+ */
602
+ readonly HUNGARIAN: LanguageInfo;
603
+ /**
604
+ * Icelandic language
605
+ */
606
+ readonly ICELANDIC: LanguageInfo;
607
+ /**
608
+ * Indonesian language
609
+ */
610
+ readonly INDONESIAN: LanguageInfo;
611
+ /**
612
+ * Irish language
613
+ */
614
+ readonly IRISH: LanguageInfo;
615
+ /**
616
+ * Italian language
617
+ */
618
+ readonly ITALIAN: LanguageInfo;
619
+ /**
620
+ * Japanese language
621
+ */
622
+ readonly JAPANESE: LanguageInfo;
623
+ /**
624
+ * Japanese language in Hiragana form
625
+ */
626
+ readonly JAPANESE_HIRAGANA: LanguageInfo;
627
+ /**
628
+ * Japanese language (latin script)
629
+ */
630
+ readonly JAPANESE_2018: LanguageInfo;
631
+ /**
632
+ * Japanese language in Kana form (non-latin script)
633
+ */
634
+ readonly JAPANESE_KANA: LanguageInfo;
635
+ /**
636
+ * Japanse language, romanized (latin script)
637
+ */
638
+ readonly JAPANESE_LATIN: LanguageInfo;
639
+ /**
640
+ * Kannada language
641
+ */
642
+ readonly KANNADA: LanguageInfo;
643
+ /**
644
+ * Kazakh language
645
+ */
646
+ readonly KAZAKH: LanguageInfo;
647
+ /**
648
+ * Korean language
649
+ */
650
+ readonly KOREAN: LanguageInfo;
651
+ /**
652
+ * Korean language (latin script)
653
+ */
654
+ readonly KOREAN_LATIN: LanguageInfo;
655
+ /**
656
+ * Kurdish language
657
+ */
658
+ readonly KURDISH: LanguageInfo;
659
+ /**
660
+ * Classical Latin language
661
+ */
662
+ readonly CLASSICAL_LATIN: LanguageInfo;
663
+ /**
664
+ * Latvian language
665
+ */
666
+ readonly LATVIAN: LanguageInfo;
667
+ /**
668
+ * Lithuanian language
669
+ */
670
+ readonly LITHUANIAN: LanguageInfo;
671
+ /**
672
+ * Luxembourgish language
673
+ */
674
+ readonly LUXEMBOURGISH: LanguageInfo;
675
+ /**
676
+ * Macedonian language
677
+ */
678
+ readonly MACEDONIAN: LanguageInfo;
679
+ /**
680
+ * Malayalm language
681
+ */
682
+ readonly MALAYALAM: LanguageInfo;
683
+ /**
684
+ * Maltese language
685
+ */
686
+ readonly MALTESE: LanguageInfo;
687
+ /**
688
+ * Norwegian language
689
+ */
690
+ readonly NORWEGIAN: LanguageInfo;
691
+ /**
692
+ * Occitan language
693
+ */
694
+ readonly OCCITAN: LanguageInfo;
695
+ /**
696
+ * Persian language
697
+ */
698
+ readonly PERSIAN: LanguageInfo;
699
+ /**
700
+ * Polish language
701
+ */
702
+ readonly POLISH: LanguageInfo;
703
+ /**
704
+ * Portuguese language
705
+ */
706
+ readonly PORTUGUESE: LanguageInfo;
707
+ /**
708
+ * Punjabi language
709
+ */
710
+ readonly PUNJABI: LanguageInfo;
711
+ /**
712
+ * Western Punjabi language
713
+ */
714
+ readonly WESTERN_PUNJABI: LanguageInfo;
715
+ /**
716
+ * Romanian language
717
+ */
718
+ readonly ROMANIAN: LanguageInfo;
719
+ /**
720
+ * Romansh language
721
+ */
722
+ readonly ROMANSH: LanguageInfo;
723
+ /**
724
+ * Russian language
725
+ */
726
+ readonly RUSSIAN: LanguageInfo;
727
+ /**
728
+ * Serbian language (cyrillic script)
729
+ */
730
+ readonly SERBIAN_CYRILLIC: LanguageInfo;
731
+ /**
732
+ * Serbian language (latin script)
733
+ */
734
+ readonly SERBIAN_LATIN: LanguageInfo;
735
+ /**
736
+ * Scottish Gaelic language
737
+ */
738
+ readonly SCOTTISH_GAELIC: LanguageInfo;
739
+ /**
740
+ * Slovak language
741
+ */
742
+ readonly SLOVAK: LanguageInfo;
743
+ /**
744
+ * Slovene language
745
+ */
746
+ readonly SLOVENE: LanguageInfo;
747
+ /**
748
+ * Spanish language
749
+ */
750
+ readonly SPANISH: LanguageInfo;
751
+ /**
752
+ * Swedish language
753
+ */
754
+ readonly SWEDISH: LanguageInfo;
755
+ /**
756
+ * Tamil language
757
+ */
758
+ readonly TAMIL: LanguageInfo;
759
+ /**
760
+ * Telugu language
761
+ */
762
+ readonly TELUGU: LanguageInfo;
763
+ /**
764
+ * Thai language
765
+ */
766
+ readonly THAI: LanguageInfo;
767
+ /**
768
+ * Turkish language
769
+ */
770
+ readonly TURKISH: LanguageInfo;
771
+ /**
772
+ * Ukrainian language
773
+ */
774
+ readonly UKRAINIAN: LanguageInfo;
775
+ /**
776
+ * Vietnamese language (latin script)
777
+ */
778
+ readonly VIETNAMESE: LanguageInfo;
779
+ /**
780
+ * Welsh language
781
+ */
782
+ readonly WELSH: LanguageInfo;
783
+ /**
784
+ * Language mode to display the labels in the end user's device language.
785
+ */
786
+ readonly AUTO: LanguageInfo;
787
+ /**
788
+ * The OSM language using latin script. MapTiler discourages its use as a primary language setting due to the lack of actual linguistic specificity,
789
+ * though it can be an handy fallback. This is not to be confused with the "Classical Latin" language, which is available under the tag `.CLASSICAL_LATIN`.
790
+ */
791
+ readonly LATIN: LanguageInfo;
792
+ /**
793
+ * The OSM language using non-latin script. MapTiler discourages its use as a primary language setting due to the lack of actual linguistic specificity,
794
+ * though it can be an handy fallback.
795
+ */
796
+ readonly NON_LATIN: LanguageInfo;
797
+ /**
798
+ * Using the local language generaly (but not always) means that every labels of a given region will use the dominant local language.
799
+ */
800
+ readonly LOCAL: LanguageInfo;
801
+ };
802
+ /**
803
+ * Get language infos from a provided language key, the key being the no-whitespace capital name.
804
+ * By default, the language dictionary to look into is the one defined in this library, but another one could be provided
805
+ * Returns `null` if not found.
806
+ */
807
+ declare function getLanguageInfoFromKey(languageKey: string, languageDictionary?: {
808
+ [k: string]: LanguageInfo;
809
+ }): LanguageInfo | null;
810
+ /**
811
+ * Get the language info from a provided 2-character iso code.
812
+ * By default, the language dictionary to look into is the one defined in this library, but another one could be provided
813
+ * Returns `null` if not found.
814
+ */
815
+ declare function getLanguageInfoFromCode(languageCode: string, languageDictionary?: {
816
+ [k: string]: LanguageInfo;
817
+ }): LanguageInfo | null;
818
+ /**
819
+ * Get the language info from a language flag (e.g. `"name:en"`).
820
+ * This is also handy to check is a given language flag is a supported language.
821
+ * By default, the language dictionary to look into is the one defined in this library, but another one could be provided
822
+ * Returns `null` if not found.
823
+ */
824
+ declare function getLanguageInfoFromFlag(languageFlag: string, languageDictionary?: {
825
+ [k: string]: LanguageInfo;
826
+ }): LanguageInfo | null;
827
+ /**
828
+ * Get the default language of the device, as a LanguageInfo object.
829
+ */
830
+ declare function getAutoLanguage(): LanguageInfo;
831
+ declare function isLanguageInfo(obj: unknown): obj is LanguageInfo;
832
+ /**
833
+ * By default, the language dictionary to look into is the one defined in this library, but another one could be provided
834
+ */
835
+ declare function toLanguageInfo(lang: LanguageInfo | string, languageDictionary?: {
836
+ [k: string]: LanguageInfo;
837
+ }): LanguageInfo | null;
838
+ /**
839
+ * Tells if two languages are the same, even though possibly provided under different forms.
840
+ * Note: this is not comparing object references, but values.
841
+ */
842
+ declare function areSameLanguages(langA: string | LanguageInfo, langB: string | LanguageInfo, languageDictionary?: {
843
+ [k: string]: LanguageInfo;
844
+ }): boolean;
170
845
 
171
846
  type LanguageGeocodingOptions = {
172
847
  /**
173
848
  * Prefer results in specific language. It’s possible to specify multiple values.
174
849
  */
175
- language?: LanguageGeocodingString | Array<LanguageGeocodingString>;
850
+ language?: string | Array<string> | LanguageInfo | Array<LanguageInfo>;
176
851
  };
852
+ type GeocodingPlaceType = "continental_marine" | "country" | "major_landform" | "region" | "subregion" | "county" | "joint_municipality" | "joint_submunicipality" | "municipality" | "municipal_district" | "locality" | "neighbourhood" | "place" | "postal_code" | "address" | "road" | "poi";
177
853
  type CommonForwardAndReverseGeocodingOptions = LanguageGeocodingOptions & {
178
854
  /**
179
- * Custom MapTiler Cloud API key to use instead of the one in global `config`
855
+ * Custom MapTiler Cloud API key to use instead of the one in global `config`.
180
856
  */
181
857
  apiKey?: string;
182
858
  /**
183
- * Maximum number of results to show. Must be between 1 and 10. Default is 5 for forward and 1 for reverse geocoding.
859
+ * Maximum number of results to show. Must be between 1 and 10.
860
+ * For reverse geocoding with multiple `types` this must not be set or must be set to 1.
861
+ * Default is 5 for forward and 1 for reverse geocoding.
184
862
  */
185
863
  limit?: number;
186
864
  /**
187
- * Filter of feature types to return.
188
- * If not specified, feature of all available types except `poi` are returned (`types = ["poi"]`, `excludeTypes = true`).
865
+ * Features of specified types to query.
866
+ * If not specified, feature of all available types except `poi` and `major_landform` will be queried (`types = ["poi", "major_landform"]`, `excludeTypes = true`).
867
+ * In case of reverse geocoding if just a single type is specified, then multiple nearby features of the single type can be returned,
868
+ * otherwise single feature for every specified type (or default types) can be returned.
189
869
  */
190
- types?: ("country" | "region" | "subregion" | "county" | "joint_municipality" | "joint_submunicipality" | "municipality" | "municipal_district" | "locality" | "neighbourhood" | "place" | "postal_code" | "address" | "poi")[];
870
+ types?: GeocodingPlaceType[];
191
871
  /**
192
872
  * Set to `true` to use all available feature types except those mentioned in `types`. Default value is `false` if `types` is specified.
193
873
  */
@@ -297,7 +977,7 @@ type GeocodingFeature = Feature<Geometry, FeatureProperties> & FeatureBase & {
297
977
  * An array of feature types describing the feature.
298
978
  * Currently each feature has only single type but this may change in the future.
299
979
  */
300
- place_type: string[];
980
+ place_type: GeocodingPlaceType[];
301
981
  /**
302
982
  * Localized type of the place name, matches `place_type` property
303
983
  */
@@ -316,6 +996,16 @@ type GeocodingFeature = Feature<Geometry, FeatureProperties> & FeatureBase & {
316
996
  * You can use the relevance property to remove results that don't fully match the query.
317
997
  */
318
998
  relevance: number;
999
+ /**
1000
+ * A string analogous to the `text` field that more closely matches the query than results in the specified language.
1001
+ * For example, querying _Praha, Czechia_ with language set to English (`en`) might return a feature with the `text` _Prague_ and the `matching_text` _Praha_.
1002
+ */
1003
+ matching_text?: string;
1004
+ /**
1005
+ * A string analogous to the `place_name` field that more closely matches the query than results in the specified language.
1006
+ * For example, querying _Praha, Czechia_ with language set to English (`en`) might return a feature with the `place_name` _Prague, Czechia_ and a `matching_place_name` of _Praha, Czechia_.
1007
+ */
1008
+ matching_place_name?: string;
319
1009
  };
320
1010
  type GeocodingSearchResult = {
321
1011
  type: "FeatureCollection";
@@ -336,7 +1026,9 @@ type GeocodingSearchResult = {
336
1026
  * Performs a forward geocoding query to MapTiler API.
337
1027
  * Providing a human readable place name (of a city, country, street, etc.), the function returns
338
1028
  * a list of candidate locations including longitude and latitude.
1029
+ *
339
1030
  * Learn more on the MapTiler API reference page: https://docs.maptiler.com/cloud/api/geocoding/#search-by-name-forward
1031
+ *
340
1032
  * @param query
341
1033
  * @param options
342
1034
  * @returns
@@ -345,7 +1037,9 @@ declare function forward(query: string, options?: GeocodingOptions): Promise<Geo
345
1037
  /**
346
1038
  * Perform a reverse geocoding query to MapTiler API.
347
1039
  * Providing a longitude and latitude, this function returns a set of human readable information about this place (country, city, street, etc.)
1040
+ *
348
1041
  * Learn more on the MapTiler API reference page: https://docs.maptiler.com/cloud/api/geocoding/#search-by-coordinates-reverse
1042
+ *
349
1043
  * @param position
350
1044
  * @param options
351
1045
  * @returns
@@ -355,7 +1049,9 @@ declare function reverse(position: Position, options?: ReverseGeocodingOptions):
355
1049
  * Perform a geocoding query to MapTiler API to obtain fature by its ID.
356
1050
  * Providing a feature ID, this function returns a feature which includes its full geometry.
357
1051
  * Note that the feature ID is not stable and it changes when the database is re-indexed.
1052
+ *
358
1053
  * Learn more on the MapTiler API reference page: https://docs.maptiler.com/cloud/api/geocoding/#search-by-feature-id
1054
+ *
359
1055
  * @param id
360
1056
  * @param options
361
1057
  * @returns
@@ -364,7 +1060,9 @@ declare function byId(id: string, options?: ByIdGeocodingOptions): Promise<Geoco
364
1060
  /**
365
1061
  * Perform a batch geocoding query to MapTiler API.
366
1062
  * Provide multiple queries in the array. Each query can be forward, reverse or by feature ID.
1063
+ *
367
1064
  * Learn more on the MapTiler API reference page: https://docs.maptiler.com/cloud/api/geocoding/#batch-geocoding
1065
+ *
368
1066
  * @param queries
369
1067
  * @param options
370
1068
  * @returns
@@ -380,63 +1078,6 @@ declare const geocoding: {
380
1078
  reverse: typeof reverse;
381
1079
  byId: typeof byId;
382
1080
  batch: typeof batch$1;
383
- language: {
384
- AUTO: string;
385
- ALBANIAN: string;
386
- ARABIC: string;
387
- ARMENIAN: string;
388
- AZERBAIJANI: string;
389
- BELORUSSIAN: string;
390
- BOSNIAN: string;
391
- BRETON: string;
392
- BULGARIAN: string;
393
- CATALAN: string;
394
- CHINESE: string;
395
- CROATIAN: string;
396
- CZECH: string;
397
- DANISH: string;
398
- DUTCH: string;
399
- ENGLISH: string;
400
- ESPERANTO: string;
401
- ESTONIAN: string;
402
- FINNISH: string;
403
- FRENCH: string;
404
- FRISIAN: string;
405
- GEORGIAN: string;
406
- GERMAN: string;
407
- GREEK: string;
408
- HEBREW: string;
409
- HUNGARIAN: string;
410
- ICELANDIC: string;
411
- IRISH: string;
412
- ITALIAN: string;
413
- JAPANESE: string;
414
- KANNADA: string;
415
- KAZAKH: string;
416
- KOREAN: string;
417
- ROMAN_LATIN: string;
418
- LATVIAN: string;
419
- LITHUANIAN: string;
420
- LUXEMBOURGISH: string;
421
- MACEDONIAN: string;
422
- MALTESE: string;
423
- NORWEGIAN: string;
424
- POLISH: string;
425
- PORTUGUESE: string;
426
- ROMANIAN: string;
427
- ROMANSH: string;
428
- RUSSIAN: string;
429
- SCOTTISH_GAELIC: string;
430
- SERBIAN_CYRILLIC: string;
431
- SLOVAK: string;
432
- SLOVENE: string;
433
- SPANISH: string;
434
- SWEDISH: string;
435
- THAI: string;
436
- TURKISH: string;
437
- UKRAINIAN: string;
438
- WELSH: string;
439
- };
440
1081
  };
441
1082
 
442
1083
  /**
@@ -1504,4 +2145,4 @@ declare const misc: {
1504
2145
  simplify: typeof simplify;
1505
2146
  };
1506
2147
 
1507
- export { type AutomaticStaticMapOptions, type BoundedStaticMapOptions, type BufferToPixelDataFunction, type ByIdGeocodingOptions, type CenteredStaticMapOptions, ClientConfig, type CommonForwardAndReverseGeocodingOptions, type CoordinateExport, type CoordinateGrid, type CoordinateId, type CoordinateSearch, type CoordinateSearchResult, type CoordinateTransformResult, type CoordinateTransformation, type Coordinates, type CoordinatesSearchOptions, type CoordinatesTransformOptions, type DefaultTransformation, type ElevationAtOptions, type ElevationBatchOptions, type FeatureHierarchy, type FetchFunction, type GeocodingFeature, type GeocodingOptions, type GeocodingSearchResult, type GeolocationInfoOptions, type GeolocationResult, type GetDataOptions, LanguageGeocoding, type LanguageGeocodingOptions, type LanguageGeocodingString, MapStyle, type MapStylePreset, type MapStyleType, MapStyleVariant, type PixelData, ReferenceMapStyle, type ReverseGeocodingOptions, ServiceError, type StaticMapBaseOptions, type StaticMapMarker, type TileJSON, type XYZ, bufferToPixelDataBrowser, circumferenceAtLatitude, config, coordinates, data, elevation, expandMapStyle, geocoding, geolocation, getAutoLanguageGeocoding, getBufferToPixelDataParser, getTileCache, mapStylePresetList, math, misc, staticMaps, styleToStyle };
2148
+ export { type AutomaticStaticMapOptions, type BoundedStaticMapOptions, type BufferToPixelDataFunction, type ByIdGeocodingOptions, type CenteredStaticMapOptions, ClientConfig, type CommonForwardAndReverseGeocodingOptions, type CoordinateExport, type CoordinateGrid, type CoordinateId, type CoordinateSearch, type CoordinateSearchResult, type CoordinateTransformResult, type CoordinateTransformation, type Coordinates, type CoordinatesSearchOptions, type CoordinatesTransformOptions, type DefaultTransformation, type ElevationAtOptions, type ElevationBatchOptions, type FeatureHierarchy, type FetchFunction, type GeocodingFeature, type GeocodingOptions, type GeocodingPlaceType, type GeocodingSearchResult, type GeolocationInfoOptions, type GeolocationResult, type GetDataOptions, ISOLanguage, Language, type LanguageGeocodingOptions, type LanguageInfo, MapStyle, type MapStylePreset, type MapStyleType, MapStyleVariant, NonISOLanguage, type PixelData, ReferenceMapStyle, type ReverseGeocodingOptions, ServiceError, type StaticMapBaseOptions, type StaticMapMarker, type TileJSON, type XYZ, areSameLanguages, bufferToPixelDataBrowser, circumferenceAtLatitude, config, coordinates, data, elevation, expandMapStyle, geocoding, geolocation, getAutoLanguage, getBufferToPixelDataParser, getLanguageInfoFromCode, getLanguageInfoFromFlag, getLanguageInfoFromKey, getTileCache, isLanguageInfo, mapStylePresetList, math, misc, staticMaps, styleToStyle, toLanguageInfo };