@budiauktioner/buildi-primitives 0.1.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.
- package/CHANGELOG.md +51 -0
- package/LICENSE +21 -0
- package/README.md +253 -0
- package/THIRD_PARTY_NOTICES.md +52 -0
- package/dist/banking/index.cjs +6491 -0
- package/dist/banking/index.cjs.map +1 -0
- package/dist/banking/index.d.cts +58 -0
- package/dist/banking/index.d.ts +58 -0
- package/dist/banking/index.js +6464 -0
- package/dist/banking/index.js.map +1 -0
- package/dist/contact/index.cjs +6678 -0
- package/dist/contact/index.cjs.map +1 -0
- package/dist/contact/index.d.cts +709 -0
- package/dist/contact/index.d.ts +709 -0
- package/dist/contact/index.js +6586 -0
- package/dist/contact/index.js.map +1 -0
- package/dist/country-BhD51LDL.d.cts +433 -0
- package/dist/country-p0n0EVQ9.d.ts +433 -0
- package/dist/finance/index.cjs +3592 -0
- package/dist/finance/index.cjs.map +1 -0
- package/dist/finance/index.d.cts +83 -0
- package/dist/finance/index.d.ts +83 -0
- package/dist/finance/index.js +3584 -0
- package/dist/finance/index.js.map +1 -0
- package/dist/geography/index.cjs +4227 -0
- package/dist/geography/index.cjs.map +1 -0
- package/dist/geography/index.d.cts +34 -0
- package/dist/geography/index.d.ts +34 -0
- package/dist/geography/index.js +4202 -0
- package/dist/geography/index.js.map +1 -0
- package/dist/index.cjs +14087 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +75 -0
- package/dist/index.d.ts +75 -0
- package/dist/index.js +13868 -0
- package/dist/index.js.map +1 -0
- package/dist/isin-EeVPpNWu.d.ts +39 -0
- package/dist/isin-ZlQLBVm8.d.cts +39 -0
- package/dist/organization/index.cjs +2376 -0
- package/dist/organization/index.cjs.map +1 -0
- package/dist/organization/index.d.cts +117 -0
- package/dist/organization/index.d.ts +117 -0
- package/dist/organization/index.js +2346 -0
- package/dist/organization/index.js.map +1 -0
- package/dist/person/index.cjs +1144 -0
- package/dist/person/index.cjs.map +1 -0
- package/dist/person/index.d.cts +60 -0
- package/dist/person/index.d.ts +60 -0
- package/dist/person/index.js +1125 -0
- package/dist/person/index.js.map +1 -0
- package/dist/person-full-name-Cmc9Ynuc.d.cts +82 -0
- package/dist/person-full-name-D6Hbsab6.d.ts +82 -0
- package/dist/phone-number-C24--ggy.d.ts +139 -0
- package/dist/phone-number-DZ-YxCQQ.d.cts +139 -0
- package/dist/property/index.cjs +487 -0
- package/dist/property/index.cjs.map +1 -0
- package/dist/property/index.d.cts +56 -0
- package/dist/property/index.d.ts +56 -0
- package/dist/property/index.js +480 -0
- package/dist/property/index.js.map +1 -0
- package/dist/sample-data/index.cjs +12310 -0
- package/dist/sample-data/index.cjs.map +1 -0
- package/dist/sample-data/index.d.cts +260 -0
- package/dist/sample-data/index.d.ts +260 -0
- package/dist/sample-data/index.js +12302 -0
- package/dist/sample-data/index.js.map +1 -0
- package/dist/swedish-address-DNC3ftRF.d.cts +297 -0
- package/dist/swedish-address-GMzjqgxb.d.ts +297 -0
- package/dist/swedish-bank-account-holder-name-BFJ8h1aO.d.cts +45 -0
- package/dist/swedish-bank-account-holder-name-CAAru07F.d.ts +45 -0
- package/dist/swedish-municipality-DlUS7g7h.d.cts +87 -0
- package/dist/swedish-municipality-nDRHYRAd.d.ts +87 -0
- package/dist/swedish-organization-name-D7NvERxA.d.cts +33 -0
- package/dist/swedish-organization-name-rR0Q836C.d.ts +33 -0
- package/dist/swedish-organization-number-Bcj7V_lh.d.cts +130 -0
- package/dist/swedish-organization-number-DM8dpXwR.d.ts +130 -0
- package/dist/swedish-organization-type-CZOdETwG.d.cts +29 -0
- package/dist/swedish-organization-type-CZOdETwG.d.ts +29 -0
- package/dist/swedish-personal-identity-number-BiIg4io3.d.ts +149 -0
- package/dist/swedish-personal-identity-number-Cp9Coz55.d.cts +149 -0
- package/dist/swedish-property-designation-BM-gdd9x.d.ts +46 -0
- package/dist/swedish-property-designation-BaHXufqV.d.cts +46 -0
- package/dist/swedish-sni-code-Ccsswpni.d.ts +53 -0
- package/dist/swedish-sni-code-CuJFyM6l.d.cts +53 -0
- package/dist/swedish-swish-number-CL6Gx_h3.d.cts +397 -0
- package/dist/swedish-swish-number-DDG3mNDg.d.ts +397 -0
- package/dist/text-candidate-qg2bD9PY.d.cts +110 -0
- package/dist/text-candidate-qg2bD9PY.d.ts +110 -0
- package/dist/text-scanning/index.cjs +10414 -0
- package/dist/text-scanning/index.cjs.map +1 -0
- package/dist/text-scanning/index.d.cts +153 -0
- package/dist/text-scanning/index.d.ts +153 -0
- package/dist/text-scanning/index.js +10406 -0
- package/dist/text-scanning/index.js.map +1 -0
- package/dist/validation/index.cjs +83 -0
- package/dist/validation/index.cjs.map +1 -0
- package/dist/validation/index.d.cts +63 -0
- package/dist/validation/index.d.ts +63 -0
- package/dist/validation/index.js +79 -0
- package/dist/validation/index.js.map +1 -0
- package/dist/web/index.cjs +3994 -0
- package/dist/web/index.cjs.map +1 -0
- package/dist/web/index.d.cts +203 -0
- package/dist/web/index.d.ts +203 -0
- package/dist/web/index.js +3987 -0
- package/dist/web/index.js.map +1 -0
- package/package.json +211 -0
|
@@ -0,0 +1,433 @@
|
|
|
1
|
+
import { P as PrimitiveTypeInfo, T as TextCandidate } from './text-candidate-qg2bD9PY.js';
|
|
2
|
+
|
|
3
|
+
interface ContinentFormatOptions {
|
|
4
|
+
fallbackToTrimmedInputWhenInvalid?: boolean;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* A continent (`kontinent`) identified by its two-letter code, English name,
|
|
8
|
+
* or Swedish name. Seven continents are recognized: Africa, Antarctica, Asia,
|
|
9
|
+
* Europe, North America, Oceania, and South America.
|
|
10
|
+
*
|
|
11
|
+
* Sources:
|
|
12
|
+
* - UN M49 Standard
|
|
13
|
+
* - Datahub continent codes
|
|
14
|
+
*/
|
|
15
|
+
declare class Continent {
|
|
16
|
+
static readonly typeInfo: PrimitiveTypeInfo;
|
|
17
|
+
static readonly Africa: Continent;
|
|
18
|
+
static readonly Antarctica: Continent;
|
|
19
|
+
static readonly Asia: Continent;
|
|
20
|
+
static readonly Europe: Continent;
|
|
21
|
+
static readonly NorthAmerica: Continent;
|
|
22
|
+
static readonly Oceania: Continent;
|
|
23
|
+
static readonly SouthAmerica: Continent;
|
|
24
|
+
/** All seven continents. */
|
|
25
|
+
static readonly all: readonly Continent[];
|
|
26
|
+
readonly code: string;
|
|
27
|
+
readonly englishName: string;
|
|
28
|
+
readonly localizedName: string;
|
|
29
|
+
private constructor();
|
|
30
|
+
get displayName(): string;
|
|
31
|
+
get value(): string;
|
|
32
|
+
static tryParse(input: string | null | undefined): Continent | null;
|
|
33
|
+
static parse(input: string): Continent;
|
|
34
|
+
static isValid(input: string | null | undefined): boolean;
|
|
35
|
+
static format(input: string | null | undefined, options?: ContinentFormatOptions): string | null;
|
|
36
|
+
static normalize(input: string | null | undefined, options?: ContinentFormatOptions): string | null;
|
|
37
|
+
static isNormalized(input: string | null | undefined): boolean;
|
|
38
|
+
toNormalizedString(): string;
|
|
39
|
+
toString(): string;
|
|
40
|
+
equals(other: Continent | null | undefined): boolean;
|
|
41
|
+
compareTo(other: Continent | null | undefined): number;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
interface GeoCoordinateFormatOptions {
|
|
45
|
+
fallbackToTrimmedInputWhenInvalid?: boolean;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* A geographic coordinate pair (latitude, longitude) in the WGS 84 reference
|
|
49
|
+
* system (`geografisk koordinat`). Parsing accepts decimal degrees, degrees
|
|
50
|
+
* with cardinal directions, DMS, and DDM formats. Swedish cardinal letters Ö
|
|
51
|
+
* (east) and V (west) are accepted alongside E and W.
|
|
52
|
+
*/
|
|
53
|
+
declare class GeoCoordinate {
|
|
54
|
+
static readonly typeInfo: PrimitiveTypeInfo;
|
|
55
|
+
readonly latitude: number;
|
|
56
|
+
readonly longitude: number;
|
|
57
|
+
private constructor();
|
|
58
|
+
/** @internal */
|
|
59
|
+
static _unsafe(latitude: number, longitude: number): GeoCoordinate;
|
|
60
|
+
get latitudeDirection(): "N" | "S";
|
|
61
|
+
get longitudeDirection(): "E" | "W";
|
|
62
|
+
/** Creates a coordinate from explicit latitude and longitude values. */
|
|
63
|
+
static create(latitude: number, longitude: number): GeoCoordinate;
|
|
64
|
+
static tryParse(input: string | null | undefined): GeoCoordinate | null;
|
|
65
|
+
static parse(input: string): GeoCoordinate;
|
|
66
|
+
static isValid(input: string | null | undefined): boolean;
|
|
67
|
+
static format(input: string | null | undefined, options?: GeoCoordinateFormatOptions): string | null;
|
|
68
|
+
static normalize(input: string | null | undefined, options?: GeoCoordinateFormatOptions): string | null;
|
|
69
|
+
static isNormalized(input: string | null | undefined): boolean;
|
|
70
|
+
toNormalizedString(): string;
|
|
71
|
+
toString(): string;
|
|
72
|
+
/** Returns the coordinate in degrees, minutes, and seconds, e.g. `59°19'45.5"N, 18°4'7"E`. */
|
|
73
|
+
toDmsString(): string;
|
|
74
|
+
/** Distance in kilometers (Haversine) between two coordinates. */
|
|
75
|
+
static distanceKilometers(a: GeoCoordinate, b: GeoCoordinate): number;
|
|
76
|
+
/** Returns true if coordinates `a` and `b` are within `radiusKm` kilometers of each other. */
|
|
77
|
+
static isWithinKilometers(a: GeoCoordinate, b: GeoCoordinate, radiusKm: number): boolean;
|
|
78
|
+
/** Distance in kilometers from this coordinate to `other`. */
|
|
79
|
+
distanceKilometersTo(other: GeoCoordinate): number;
|
|
80
|
+
/**
|
|
81
|
+
* Returns true if `other` is within `radiusKm` kilometers of this
|
|
82
|
+
* coordinate (inclusive).
|
|
83
|
+
*/
|
|
84
|
+
isWithinKilometers(other: GeoCoordinate, radiusKm: number): boolean;
|
|
85
|
+
equals(other: GeoCoordinate | null | undefined): boolean;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* The capital city of a country (`huvudstad`), with names in English, Swedish,
|
|
90
|
+
* and the country's native language, plus its geographic coordinates.
|
|
91
|
+
*/
|
|
92
|
+
declare class CountryCapital {
|
|
93
|
+
readonly englishName: string;
|
|
94
|
+
readonly localizedName: string;
|
|
95
|
+
readonly nativeName: string;
|
|
96
|
+
readonly coordinate: GeoCoordinate;
|
|
97
|
+
/** @internal */
|
|
98
|
+
constructor(englishName: string, localizedName: string, nativeName: string, coordinate: GeoCoordinate);
|
|
99
|
+
/** Capital city name in the current display language. */
|
|
100
|
+
get displayName(): string;
|
|
101
|
+
toString(): string;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
/** Text direction for a writing system. */
|
|
105
|
+
declare const TextDirection: {
|
|
106
|
+
readonly LeftToRight: "LeftToRight";
|
|
107
|
+
readonly RightToLeft: "RightToLeft";
|
|
108
|
+
};
|
|
109
|
+
type TextDirection = (typeof TextDirection)[keyof typeof TextDirection];
|
|
110
|
+
/** Primary writing script / writing system used by a language. */
|
|
111
|
+
declare const WritingScript: {
|
|
112
|
+
readonly Unknown: "Unknown";
|
|
113
|
+
readonly Latin: "Latin";
|
|
114
|
+
readonly Cyrillic: "Cyrillic";
|
|
115
|
+
readonly Arabic: "Arabic";
|
|
116
|
+
readonly Greek: "Greek";
|
|
117
|
+
readonly Hebrew: "Hebrew";
|
|
118
|
+
readonly Devanagari: "Devanagari";
|
|
119
|
+
readonly Bengali: "Bengali";
|
|
120
|
+
readonly Gurmukhi: "Gurmukhi";
|
|
121
|
+
readonly Gujarati: "Gujarati";
|
|
122
|
+
readonly Oriya: "Oriya";
|
|
123
|
+
readonly Tamil: "Tamil";
|
|
124
|
+
readonly Telugu: "Telugu";
|
|
125
|
+
readonly Kannada: "Kannada";
|
|
126
|
+
readonly Malayalam: "Malayalam";
|
|
127
|
+
readonly Sinhala: "Sinhala";
|
|
128
|
+
readonly Thai: "Thai";
|
|
129
|
+
readonly Lao: "Lao";
|
|
130
|
+
readonly Tibetan: "Tibetan";
|
|
131
|
+
readonly Myanmar: "Myanmar";
|
|
132
|
+
readonly Georgian: "Georgian";
|
|
133
|
+
readonly Hangul: "Hangul";
|
|
134
|
+
readonly Ethiopic: "Ethiopic";
|
|
135
|
+
readonly Cherokee: "Cherokee";
|
|
136
|
+
readonly Canadian: "Canadian";
|
|
137
|
+
readonly Khmer: "Khmer";
|
|
138
|
+
readonly Mongolian: "Mongolian";
|
|
139
|
+
readonly Han: "Han";
|
|
140
|
+
readonly Armenian: "Armenian";
|
|
141
|
+
readonly Thaana: "Thaana";
|
|
142
|
+
};
|
|
143
|
+
type WritingScript = (typeof WritingScript)[keyof typeof WritingScript];
|
|
144
|
+
interface LanguageFormatOptions {
|
|
145
|
+
fallbackToTrimmedInputWhenInvalid?: boolean;
|
|
146
|
+
}
|
|
147
|
+
/**
|
|
148
|
+
* A language (`språk`) identified by its ISO 639-1 two-letter code, ISO 639-2/T
|
|
149
|
+
* three-letter code, English name, Swedish name, or native name (endonym).
|
|
150
|
+
*/
|
|
151
|
+
declare class Language {
|
|
152
|
+
static readonly typeInfo: PrimitiveTypeInfo;
|
|
153
|
+
readonly alpha2Code: string;
|
|
154
|
+
readonly alpha3Code: string;
|
|
155
|
+
readonly englishName: string;
|
|
156
|
+
readonly localizedName: string;
|
|
157
|
+
readonly nativeName: string;
|
|
158
|
+
readonly script: WritingScript;
|
|
159
|
+
readonly direction: TextDirection;
|
|
160
|
+
private constructor();
|
|
161
|
+
get displayName(): string;
|
|
162
|
+
get value(): string;
|
|
163
|
+
/** @internal Used by Country and other types. */
|
|
164
|
+
static _create(alpha2: string, alpha3: string, en: string, sv: string, native: string, script: WritingScript, direction?: TextDirection): Language;
|
|
165
|
+
static tryParse(input: string | null | undefined): Language | null;
|
|
166
|
+
static parse(input: string): Language;
|
|
167
|
+
static isValid(input: string | null | undefined): boolean;
|
|
168
|
+
static format(input: string | null | undefined, options?: LanguageFormatOptions): string | null;
|
|
169
|
+
static normalize(input: string | null | undefined, options?: LanguageFormatOptions): string | null;
|
|
170
|
+
static isNormalized(input: string | null | undefined): boolean;
|
|
171
|
+
toNormalizedString(): string;
|
|
172
|
+
toDisplayString(): string;
|
|
173
|
+
toEnglishString(): string;
|
|
174
|
+
toNativeString(): string;
|
|
175
|
+
toString(): string;
|
|
176
|
+
equals(other: Language | null | undefined): boolean;
|
|
177
|
+
compareTo(other: Language | null | undefined): number;
|
|
178
|
+
/** All recognized ISO 639-1 languages. */
|
|
179
|
+
static get all(): readonly Language[];
|
|
180
|
+
static readonly Afrikaans: Language;
|
|
181
|
+
static readonly Albanian: Language;
|
|
182
|
+
static readonly Arabic: Language;
|
|
183
|
+
static readonly Bulgarian: Language;
|
|
184
|
+
static readonly Catalan: Language;
|
|
185
|
+
static readonly Chinese: Language;
|
|
186
|
+
static readonly Croatian: Language;
|
|
187
|
+
static readonly Czech: Language;
|
|
188
|
+
static readonly Danish: Language;
|
|
189
|
+
static readonly Dutch: Language;
|
|
190
|
+
static readonly English: Language;
|
|
191
|
+
static readonly Estonian: Language;
|
|
192
|
+
static readonly Faroese: Language;
|
|
193
|
+
static readonly Finnish: Language;
|
|
194
|
+
static readonly French: Language;
|
|
195
|
+
static readonly German: Language;
|
|
196
|
+
static readonly Greek: Language;
|
|
197
|
+
static readonly Hindi: Language;
|
|
198
|
+
static readonly Hungarian: Language;
|
|
199
|
+
static readonly Icelandic: Language;
|
|
200
|
+
static readonly Italian: Language;
|
|
201
|
+
static readonly Japanese: Language;
|
|
202
|
+
static readonly Korean: Language;
|
|
203
|
+
static readonly Latvian: Language;
|
|
204
|
+
static readonly Lithuanian: Language;
|
|
205
|
+
static readonly NorthernSami: Language;
|
|
206
|
+
static readonly Norwegian: Language;
|
|
207
|
+
static readonly NorwegianBokmal: Language;
|
|
208
|
+
static readonly NorwegianNynorsk: Language;
|
|
209
|
+
static readonly Polish: Language;
|
|
210
|
+
static readonly Portuguese: Language;
|
|
211
|
+
static readonly Romanian: Language;
|
|
212
|
+
static readonly Russian: Language;
|
|
213
|
+
static readonly Slovak: Language;
|
|
214
|
+
static readonly Slovenian: Language;
|
|
215
|
+
static readonly Spanish: Language;
|
|
216
|
+
static readonly Swahili: Language;
|
|
217
|
+
static readonly Swedish: Language;
|
|
218
|
+
static readonly Turkish: Language;
|
|
219
|
+
static readonly Ukrainian: Language;
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
interface CurrencyRow {
|
|
223
|
+
code: string;
|
|
224
|
+
en: string;
|
|
225
|
+
sv: string;
|
|
226
|
+
symbol: string;
|
|
227
|
+
decimalPlaces: number;
|
|
228
|
+
}
|
|
229
|
+
/**
|
|
230
|
+
* An ISO 4217 currency identified by its three-letter code (e.g. `SEK`, `EUR`).
|
|
231
|
+
*/
|
|
232
|
+
declare class Currency {
|
|
233
|
+
static readonly typeInfo: PrimitiveTypeInfo;
|
|
234
|
+
readonly code: string;
|
|
235
|
+
readonly englishName: string;
|
|
236
|
+
readonly localizedName: string;
|
|
237
|
+
readonly symbol: string;
|
|
238
|
+
readonly decimalPlaces: number;
|
|
239
|
+
private constructor();
|
|
240
|
+
/** @internal */
|
|
241
|
+
static _fromRow(row: CurrencyRow): Currency;
|
|
242
|
+
/** Display name in current UI culture (Swedish or English). */
|
|
243
|
+
/**
|
|
244
|
+
* The currency name as used in its issuing country. Falls back to
|
|
245
|
+
* {@link englishName} when no issuing country is known.
|
|
246
|
+
*/
|
|
247
|
+
get nativeName(): string;
|
|
248
|
+
get displayName(): string;
|
|
249
|
+
static tryParse(input: string | null | undefined): Currency | null;
|
|
250
|
+
static parse(input: string): Currency;
|
|
251
|
+
static isValid(input: string | null | undefined): boolean;
|
|
252
|
+
static format(input: string | null | undefined, options?: {
|
|
253
|
+
fallbackToTrimmedInputWhenInvalid?: boolean;
|
|
254
|
+
}): string | null;
|
|
255
|
+
static normalize(input: string | null | undefined, options?: {
|
|
256
|
+
fallbackToTrimmedInputWhenInvalid?: boolean;
|
|
257
|
+
}): string | null;
|
|
258
|
+
static isNormalized(input: string | null | undefined): boolean;
|
|
259
|
+
/** All known currencies. */
|
|
260
|
+
static get all(): readonly Currency[];
|
|
261
|
+
/** @internal Lookup by symbol. */
|
|
262
|
+
static tryParseSymbol(symbol: string | null | undefined): Currency | null;
|
|
263
|
+
toNormalizedString(): string;
|
|
264
|
+
toString(): string;
|
|
265
|
+
toDisplayString(): string;
|
|
266
|
+
toEnglishString(): string;
|
|
267
|
+
toNativeString(): string;
|
|
268
|
+
equals(other: Currency | null | undefined): boolean;
|
|
269
|
+
compareTo(other: Currency | null | undefined): number;
|
|
270
|
+
static get SEK(): Currency;
|
|
271
|
+
static get EUR(): Currency;
|
|
272
|
+
static get USD(): Currency;
|
|
273
|
+
static get NOK(): Currency;
|
|
274
|
+
static get DKK(): Currency;
|
|
275
|
+
static get GBP(): Currency;
|
|
276
|
+
}
|
|
277
|
+
/**
|
|
278
|
+
* Returns the primary currency for a country, or `null` when no association
|
|
279
|
+
* is known. Resolves the country's first `currencyCodes` entry to a
|
|
280
|
+
* {@link Currency} instance.
|
|
281
|
+
*/
|
|
282
|
+
declare function getCurrencyForCountry(country: Country): Currency | null;
|
|
283
|
+
|
|
284
|
+
/**
|
|
285
|
+
* Static country data: ISO 3166-1 alpha-2/alpha-3/numeric codes, English/Swedish/native names,
|
|
286
|
+
* E.164 calling code, ccTLD, continent. Sourced from ISO 3166, ITU-T E.164, and IANA root db.
|
|
287
|
+
*/
|
|
288
|
+
interface CountryRow {
|
|
289
|
+
readonly alpha2: string;
|
|
290
|
+
readonly alpha3: string;
|
|
291
|
+
readonly numeric: number;
|
|
292
|
+
readonly en: string;
|
|
293
|
+
readonly sv: string;
|
|
294
|
+
readonly native: string;
|
|
295
|
+
readonly callingCode: string;
|
|
296
|
+
readonly tld: string;
|
|
297
|
+
readonly continent: Continent;
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
/** A neighboring country with its distance from a reference point (kilometers). */
|
|
301
|
+
interface CountryDistance {
|
|
302
|
+
readonly country: Country;
|
|
303
|
+
readonly distanceKilometers: number;
|
|
304
|
+
}
|
|
305
|
+
/**
|
|
306
|
+
* A country identified by its English name, Swedish name, local name (endonym),
|
|
307
|
+
* or ISO 3166-1 codes. Each country exposes its phone calling code, ccTLD,
|
|
308
|
+
* continent, European classifications (EU, EEA, Schengen, Nordics, SEPA), and
|
|
309
|
+
* currency metadata. Parsing accepts English/Swedish/local names, alpha-2 and
|
|
310
|
+
* alpha-3 codes, and common aliases (USA, UK, Holland, etc.).
|
|
311
|
+
*/
|
|
312
|
+
declare class Country {
|
|
313
|
+
static readonly typeInfo: PrimitiveTypeInfo;
|
|
314
|
+
readonly alpha2Code: string;
|
|
315
|
+
readonly alpha3Code: string;
|
|
316
|
+
readonly numericCode: number;
|
|
317
|
+
readonly englishName: string;
|
|
318
|
+
readonly localizedName: string;
|
|
319
|
+
readonly nativeName: string;
|
|
320
|
+
readonly callingCode: string;
|
|
321
|
+
readonly topLevelDomain: string;
|
|
322
|
+
readonly continent: Continent;
|
|
323
|
+
readonly currencyCodes: readonly string[];
|
|
324
|
+
readonly languageCodes: readonly string[];
|
|
325
|
+
private constructor();
|
|
326
|
+
/** The canonical value of this country: its ISO 3166-1 alpha-2 code. */
|
|
327
|
+
get value(): string;
|
|
328
|
+
/** Display name in the current culture (Swedish or English). */
|
|
329
|
+
get displayName(): string;
|
|
330
|
+
/** Culture-independent display form. Always the English name. */
|
|
331
|
+
get formatted(): string;
|
|
332
|
+
/** Geographic coordinate of the country (centroid, from Wikidata P625). */
|
|
333
|
+
get coordinate(): GeoCoordinate;
|
|
334
|
+
/** Approximate latitude (WGS 84) of the country centroid. */
|
|
335
|
+
get latitude(): number;
|
|
336
|
+
/** Approximate longitude (WGS 84) of the country centroid. */
|
|
337
|
+
get longitude(): number;
|
|
338
|
+
/** Capital city, or `null` for entries without a capital (e.g. Antarctica). */
|
|
339
|
+
get capital(): CountryCapital | null;
|
|
340
|
+
get isInEuropeanUnion(): boolean;
|
|
341
|
+
get isInEea(): boolean;
|
|
342
|
+
get isInSchengen(): boolean;
|
|
343
|
+
get isInNordics(): boolean;
|
|
344
|
+
get isInSepa(): boolean;
|
|
345
|
+
/** True when the euro is among the country's legal tenders. */
|
|
346
|
+
get usesEuro(): boolean;
|
|
347
|
+
/** Primary ISO 4217 currency code, or `null` when unknown. */
|
|
348
|
+
get currencyCode(): string | null;
|
|
349
|
+
/**
|
|
350
|
+
* Primary legal-tender currency, or `null` when unknown. Countries with
|
|
351
|
+
* several legal tenders (Cuba, Panama, Namibia) return the first; use
|
|
352
|
+
* {@link currencies} for the full list.
|
|
353
|
+
*/
|
|
354
|
+
get currency(): Currency | null;
|
|
355
|
+
/** All recognized currencies for this country, in priority order. */
|
|
356
|
+
get currencies(): readonly Currency[];
|
|
357
|
+
/**
|
|
358
|
+
* Primary official language, or `null` when unknown. Countries with several
|
|
359
|
+
* official languages (Belgium, Switzerland) return the most widely spoken;
|
|
360
|
+
* use {@link officialLanguages} for the full list.
|
|
361
|
+
*/
|
|
362
|
+
get primaryLanguage(): Language | null;
|
|
363
|
+
/** All official languages of the country, in priority order. */
|
|
364
|
+
get officialLanguages(): readonly Language[];
|
|
365
|
+
static tryParse(input: string | null | undefined): Country | null;
|
|
366
|
+
static parse(input: string): Country;
|
|
367
|
+
static isValid(input: string | null | undefined): boolean;
|
|
368
|
+
static format(input: string | null | undefined, options?: {
|
|
369
|
+
fallbackToTrimmedInputWhenInvalid?: boolean;
|
|
370
|
+
}): string | null;
|
|
371
|
+
static normalize(input: string | null | undefined, options?: {
|
|
372
|
+
fallbackToTrimmedInputWhenInvalid?: boolean;
|
|
373
|
+
}): string | null;
|
|
374
|
+
static isNormalized(input: string | null | undefined): boolean;
|
|
375
|
+
/** Look up a country by its phone calling code. Primary owner wins for shared codes. */
|
|
376
|
+
static tryFindByCallingCode(callingCode: string | null | undefined): Country | null;
|
|
377
|
+
/** All known countries. */
|
|
378
|
+
static get all(): readonly Country[];
|
|
379
|
+
/**
|
|
380
|
+
* Returns countries within `radiusKm` of this country, ordered by distance.
|
|
381
|
+
*/
|
|
382
|
+
findNeighbors(radiusKm: number): readonly CountryDistance[];
|
|
383
|
+
/** Returns countries within `radiusKm` of `coordinate`, ordered by distance. */
|
|
384
|
+
static findNeighbors(coordinate: GeoCoordinate, radiusKm: number): readonly CountryDistance[];
|
|
385
|
+
/**
|
|
386
|
+
* Scans unstructured text for country names (4+ chars, word-bounded). Low confidence
|
|
387
|
+
* because country names can occur in non-geographic contexts.
|
|
388
|
+
*/
|
|
389
|
+
static findCandidatesInText(text: string): readonly TextCandidate<Country>[];
|
|
390
|
+
toNormalizedString(): string;
|
|
391
|
+
toString(): string;
|
|
392
|
+
toDisplayString(): string;
|
|
393
|
+
toEnglishString(): string;
|
|
394
|
+
toNativeString(): string;
|
|
395
|
+
equals(other: Country | null | undefined): boolean;
|
|
396
|
+
compareTo(other: Country | null | undefined): number;
|
|
397
|
+
static get Sweden(): Country;
|
|
398
|
+
static get Norway(): Country;
|
|
399
|
+
static get Finland(): Country;
|
|
400
|
+
static get Denmark(): Country;
|
|
401
|
+
static get Iceland(): Country;
|
|
402
|
+
static get Germany(): Country;
|
|
403
|
+
static get Poland(): Country;
|
|
404
|
+
static get Estonia(): Country;
|
|
405
|
+
static get Lithuania(): Country;
|
|
406
|
+
static get Latvia(): Country;
|
|
407
|
+
static get Romania(): Country;
|
|
408
|
+
static get Bulgaria(): Country;
|
|
409
|
+
static get CzechRepublic(): Country;
|
|
410
|
+
static get Spain(): Country;
|
|
411
|
+
static get Netherlands(): Country;
|
|
412
|
+
static get Greece(): Country;
|
|
413
|
+
static get Italy(): Country;
|
|
414
|
+
static get Slovenia(): Country;
|
|
415
|
+
static get Croatia(): Country;
|
|
416
|
+
static get Portugal(): Country;
|
|
417
|
+
static get Hungary(): Country;
|
|
418
|
+
static get France(): Country;
|
|
419
|
+
static get Slovakia(): Country;
|
|
420
|
+
static get Belgium(): Country;
|
|
421
|
+
static get UnitedKingdom(): Country;
|
|
422
|
+
static get Austria(): Country;
|
|
423
|
+
static get Cyprus(): Country;
|
|
424
|
+
static get Switzerland(): Country;
|
|
425
|
+
static get Ireland(): Country;
|
|
426
|
+
static get Luxembourg(): Country;
|
|
427
|
+
static get Malta(): Country;
|
|
428
|
+
static get Liechtenstein(): Country;
|
|
429
|
+
/** @internal */
|
|
430
|
+
static _fromRow(row: CountryRow): Country;
|
|
431
|
+
}
|
|
432
|
+
|
|
433
|
+
export { Continent as C, GeoCoordinate as G, Language as L, TextDirection as T, WritingScript as W, Country as a, CountryCapital as b, type CountryDistance as c, Currency as d, getCurrencyForCountry as g };
|