@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.
Files changed (107) hide show
  1. package/CHANGELOG.md +51 -0
  2. package/LICENSE +21 -0
  3. package/README.md +253 -0
  4. package/THIRD_PARTY_NOTICES.md +52 -0
  5. package/dist/banking/index.cjs +6491 -0
  6. package/dist/banking/index.cjs.map +1 -0
  7. package/dist/banking/index.d.cts +58 -0
  8. package/dist/banking/index.d.ts +58 -0
  9. package/dist/banking/index.js +6464 -0
  10. package/dist/banking/index.js.map +1 -0
  11. package/dist/contact/index.cjs +6678 -0
  12. package/dist/contact/index.cjs.map +1 -0
  13. package/dist/contact/index.d.cts +709 -0
  14. package/dist/contact/index.d.ts +709 -0
  15. package/dist/contact/index.js +6586 -0
  16. package/dist/contact/index.js.map +1 -0
  17. package/dist/country-BhD51LDL.d.cts +433 -0
  18. package/dist/country-p0n0EVQ9.d.ts +433 -0
  19. package/dist/finance/index.cjs +3592 -0
  20. package/dist/finance/index.cjs.map +1 -0
  21. package/dist/finance/index.d.cts +83 -0
  22. package/dist/finance/index.d.ts +83 -0
  23. package/dist/finance/index.js +3584 -0
  24. package/dist/finance/index.js.map +1 -0
  25. package/dist/geography/index.cjs +4227 -0
  26. package/dist/geography/index.cjs.map +1 -0
  27. package/dist/geography/index.d.cts +34 -0
  28. package/dist/geography/index.d.ts +34 -0
  29. package/dist/geography/index.js +4202 -0
  30. package/dist/geography/index.js.map +1 -0
  31. package/dist/index.cjs +14087 -0
  32. package/dist/index.cjs.map +1 -0
  33. package/dist/index.d.cts +75 -0
  34. package/dist/index.d.ts +75 -0
  35. package/dist/index.js +13868 -0
  36. package/dist/index.js.map +1 -0
  37. package/dist/isin-EeVPpNWu.d.ts +39 -0
  38. package/dist/isin-ZlQLBVm8.d.cts +39 -0
  39. package/dist/organization/index.cjs +2376 -0
  40. package/dist/organization/index.cjs.map +1 -0
  41. package/dist/organization/index.d.cts +117 -0
  42. package/dist/organization/index.d.ts +117 -0
  43. package/dist/organization/index.js +2346 -0
  44. package/dist/organization/index.js.map +1 -0
  45. package/dist/person/index.cjs +1144 -0
  46. package/dist/person/index.cjs.map +1 -0
  47. package/dist/person/index.d.cts +60 -0
  48. package/dist/person/index.d.ts +60 -0
  49. package/dist/person/index.js +1125 -0
  50. package/dist/person/index.js.map +1 -0
  51. package/dist/person-full-name-Cmc9Ynuc.d.cts +82 -0
  52. package/dist/person-full-name-D6Hbsab6.d.ts +82 -0
  53. package/dist/phone-number-C24--ggy.d.ts +139 -0
  54. package/dist/phone-number-DZ-YxCQQ.d.cts +139 -0
  55. package/dist/property/index.cjs +487 -0
  56. package/dist/property/index.cjs.map +1 -0
  57. package/dist/property/index.d.cts +56 -0
  58. package/dist/property/index.d.ts +56 -0
  59. package/dist/property/index.js +480 -0
  60. package/dist/property/index.js.map +1 -0
  61. package/dist/sample-data/index.cjs +12310 -0
  62. package/dist/sample-data/index.cjs.map +1 -0
  63. package/dist/sample-data/index.d.cts +260 -0
  64. package/dist/sample-data/index.d.ts +260 -0
  65. package/dist/sample-data/index.js +12302 -0
  66. package/dist/sample-data/index.js.map +1 -0
  67. package/dist/swedish-address-DNC3ftRF.d.cts +297 -0
  68. package/dist/swedish-address-GMzjqgxb.d.ts +297 -0
  69. package/dist/swedish-bank-account-holder-name-BFJ8h1aO.d.cts +45 -0
  70. package/dist/swedish-bank-account-holder-name-CAAru07F.d.ts +45 -0
  71. package/dist/swedish-municipality-DlUS7g7h.d.cts +87 -0
  72. package/dist/swedish-municipality-nDRHYRAd.d.ts +87 -0
  73. package/dist/swedish-organization-name-D7NvERxA.d.cts +33 -0
  74. package/dist/swedish-organization-name-rR0Q836C.d.ts +33 -0
  75. package/dist/swedish-organization-number-Bcj7V_lh.d.cts +130 -0
  76. package/dist/swedish-organization-number-DM8dpXwR.d.ts +130 -0
  77. package/dist/swedish-organization-type-CZOdETwG.d.cts +29 -0
  78. package/dist/swedish-organization-type-CZOdETwG.d.ts +29 -0
  79. package/dist/swedish-personal-identity-number-BiIg4io3.d.ts +149 -0
  80. package/dist/swedish-personal-identity-number-Cp9Coz55.d.cts +149 -0
  81. package/dist/swedish-property-designation-BM-gdd9x.d.ts +46 -0
  82. package/dist/swedish-property-designation-BaHXufqV.d.cts +46 -0
  83. package/dist/swedish-sni-code-Ccsswpni.d.ts +53 -0
  84. package/dist/swedish-sni-code-CuJFyM6l.d.cts +53 -0
  85. package/dist/swedish-swish-number-CL6Gx_h3.d.cts +397 -0
  86. package/dist/swedish-swish-number-DDG3mNDg.d.ts +397 -0
  87. package/dist/text-candidate-qg2bD9PY.d.cts +110 -0
  88. package/dist/text-candidate-qg2bD9PY.d.ts +110 -0
  89. package/dist/text-scanning/index.cjs +10414 -0
  90. package/dist/text-scanning/index.cjs.map +1 -0
  91. package/dist/text-scanning/index.d.cts +153 -0
  92. package/dist/text-scanning/index.d.ts +153 -0
  93. package/dist/text-scanning/index.js +10406 -0
  94. package/dist/text-scanning/index.js.map +1 -0
  95. package/dist/validation/index.cjs +83 -0
  96. package/dist/validation/index.cjs.map +1 -0
  97. package/dist/validation/index.d.cts +63 -0
  98. package/dist/validation/index.d.ts +63 -0
  99. package/dist/validation/index.js +79 -0
  100. package/dist/validation/index.js.map +1 -0
  101. package/dist/web/index.cjs +3994 -0
  102. package/dist/web/index.cjs.map +1 -0
  103. package/dist/web/index.d.cts +203 -0
  104. package/dist/web/index.d.ts +203 -0
  105. package/dist/web/index.js +3987 -0
  106. package/dist/web/index.js.map +1 -0
  107. package/package.json +211 -0
@@ -0,0 +1,297 @@
1
+ import { P as PrimitiveTypeInfo, T as TextCandidate } from './text-candidate-qg2bD9PY.cjs';
2
+ import { a as Country } from './country-BhD51LDL.cjs';
3
+
4
+ /**
5
+ * The postal city (`postort`) is the locality associated with a postal code.
6
+ * Normalization applies Swedish-aware title casing.
7
+ */
8
+ declare class AddressCity {
9
+ static readonly typeInfo: PrimitiveTypeInfo;
10
+ readonly value: string;
11
+ private constructor();
12
+ static tryParse(input: string | null | undefined): AddressCity | null;
13
+ static parse(input: string): AddressCity;
14
+ static isValid(input: string | null | undefined): boolean;
15
+ static format(input: string | null | undefined, options?: {
16
+ fallbackToTrimmedInputWhenInvalid?: boolean;
17
+ }): string | null;
18
+ static normalize(input: string | null | undefined, options?: {
19
+ fallbackToTrimmedInputWhenInvalid?: boolean;
20
+ }): string | null;
21
+ static isNormalized(input: string | null | undefined): boolean;
22
+ toNormalizedString(): string;
23
+ toString(): string;
24
+ equals(other: AddressCity | null | undefined): boolean;
25
+ compareTo(other: AddressCity | null | undefined): number;
26
+ }
27
+
28
+ /**
29
+ * A street address (`gatuadress`). Extracts care-of (c/o), apartment number
30
+ * (lgh/apt), and post box (Box) when present.
31
+ */
32
+ declare class AddressStreet {
33
+ static readonly typeInfo: PrimitiveTypeInfo;
34
+ readonly street: string;
35
+ readonly streetName: string | null;
36
+ readonly streetNumber: string | null;
37
+ readonly apartmentNumber: string | null;
38
+ readonly careOf: string | null;
39
+ readonly postBox: string | null;
40
+ private constructor();
41
+ get isPostBox(): boolean;
42
+ static tryParse(input: string | null | undefined, options?: {
43
+ city?: string | null;
44
+ zipCode?: string | null;
45
+ }): AddressStreet | null;
46
+ static parse(input: string): AddressStreet;
47
+ static isValid(input: string | null | undefined): boolean;
48
+ static format(input: string | null | undefined, options?: {
49
+ fallbackToTrimmedInputWhenInvalid?: boolean;
50
+ }): string | null;
51
+ static normalize(input: string | null | undefined, options?: {
52
+ fallbackToTrimmedInputWhenInvalid?: boolean;
53
+ }): string | null;
54
+ static isNormalized(input: string | null | undefined): boolean;
55
+ toNormalizedString(): string;
56
+ toString(): string;
57
+ equals(other: AddressStreet | null | undefined): boolean;
58
+ compareTo(other: AddressStreet | null | undefined): number;
59
+ }
60
+
61
+ /**
62
+ * A postal code (`postnummer`). Swedish 5-digit codes (formatted `NNN NN`) and
63
+ * many international formats (Danish `DK-9000`, Dutch `1012 AB`, British `W1A 1AB`)
64
+ * are accepted.
65
+ */
66
+ declare class AddressZipCode {
67
+ static readonly typeInfo: PrimitiveTypeInfo;
68
+ readonly value: string;
69
+ readonly formatted: string;
70
+ readonly country: Country | null;
71
+ private constructor();
72
+ get isSwedish(): boolean;
73
+ static tryParse(input: string | null | undefined, options?: {
74
+ country?: Country | null;
75
+ }): AddressZipCode | null;
76
+ static parse(input: string, options?: {
77
+ country?: Country | null;
78
+ }): AddressZipCode;
79
+ static isValid(input: string | null | undefined, options?: {
80
+ country?: Country | null;
81
+ }): boolean;
82
+ /** Parse as a Swedish 5-digit postal code only. */
83
+ static tryParseSwedish(input: string | null | undefined): AddressZipCode | null;
84
+ /** Parse as a non-Swedish international postal code. */
85
+ static tryParseInternational(input: string | null | undefined, country?: Country | null): AddressZipCode | null;
86
+ static format(input: string | null | undefined, options?: {
87
+ country?: Country | null;
88
+ fallbackToTrimmedInputWhenInvalid?: boolean;
89
+ }): string | null;
90
+ static normalize(input: string | null | undefined, options?: {
91
+ country?: Country | null;
92
+ fallbackToTrimmedInputWhenInvalid?: boolean;
93
+ }): string | null;
94
+ static isNormalized(input: string | null | undefined): boolean;
95
+ static findCandidatesInText(text: string): readonly TextCandidate<AddressZipCode>[];
96
+ toNormalizedString(): string;
97
+ toString(): string;
98
+ equals(other: AddressZipCode | null | undefined): boolean;
99
+ compareTo(other: AddressZipCode | null | undefined): number;
100
+ }
101
+ /** Internal masking for zip codes used in scan results. */
102
+ declare function maskZip(zip: AddressZipCode): string;
103
+
104
+ /** Common interface for all country-specific zip code types. */
105
+ interface ICountryAddressZipCode {
106
+ readonly country: Country;
107
+ readonly value: string;
108
+ readonly formatted: string;
109
+ readonly zipCode: AddressZipCode;
110
+ toNormalizedString(): string;
111
+ toString(): string;
112
+ }
113
+ /** Common interface for all country-specific address types. */
114
+ interface ICountryAddress {
115
+ readonly country: Country;
116
+ readonly street: AddressStreet;
117
+ readonly countryZipCode: ICountryAddressZipCode;
118
+ readonly city: AddressCity;
119
+ readonly address: Address;
120
+ readonly careOf: string | null;
121
+ readonly postBox: string | null;
122
+ readonly isPostBox: boolean;
123
+ readonly value: string;
124
+ readonly formatted: string;
125
+ toNormalizedString(): string;
126
+ toMultilineString(): string;
127
+ toString(): string;
128
+ }
129
+ /** Abstract base class for country-specific zip code types. */
130
+ declare abstract class CountryAddressZipCodeBase implements ICountryAddressZipCode {
131
+ readonly value: string;
132
+ readonly formatted: string;
133
+ readonly zipCode: AddressZipCode;
134
+ abstract get country(): Country;
135
+ protected constructor(value: string, formatted: string, zipCode: AddressZipCode);
136
+ toNormalizedString(): string;
137
+ toString(): string;
138
+ }
139
+ /** Abstract base class for country-specific address types. */
140
+ declare abstract class CountryAddressBase implements ICountryAddress {
141
+ readonly street: AddressStreet;
142
+ readonly city: AddressCity;
143
+ readonly address: Address;
144
+ abstract get countryZipCode(): ICountryAddressZipCode;
145
+ get country(): Country;
146
+ get careOf(): string | null;
147
+ get postBox(): string | null;
148
+ get isPostBox(): boolean;
149
+ get value(): string;
150
+ get formatted(): string;
151
+ protected constructor(street: AddressStreet, city: AddressCity, address: Address);
152
+ toNormalizedString(): string;
153
+ toString(): string;
154
+ toMultilineString(): string;
155
+ }
156
+ /**
157
+ * Validates and unwraps a generic {@link Address} for a specific country, then constructs
158
+ * a typed country-specific address. Used by every `XxxAddress.tryParse` implementation.
159
+ */
160
+ declare function tryWrapCountryAddress<TZip, TAddr>(address: Address, alpha2: string, defaultCountry: Country, tryParseZip: (value: string) => TZip | null, factory: (street: AddressStreet, zip: TZip, city: AddressCity, address: Address) => TAddr): TAddr | null;
161
+
162
+ /** A complete address combining street, zip, city and country. */
163
+ declare class Address {
164
+ static readonly typeInfo: PrimitiveTypeInfo;
165
+ readonly street: AddressStreet;
166
+ readonly zipCode: AddressZipCode | null;
167
+ readonly city: AddressCity | null;
168
+ readonly country: Country | null;
169
+ constructor(street: AddressStreet, zipCode?: AddressZipCode | null, city?: AddressCity | null, country?: Country | null);
170
+ get careOf(): string | null;
171
+ get apartmentNumber(): string | null;
172
+ get postBox(): string | null;
173
+ get isPostBox(): boolean;
174
+ get value(): string;
175
+ get formatted(): string;
176
+ static tryParse(input: string | null | undefined): Address | null;
177
+ static tryParse(parts: {
178
+ street: string | null | undefined;
179
+ zipCode?: string | null;
180
+ city?: string | null;
181
+ country?: string | null;
182
+ }): Address | null;
183
+ static parse(input: string): Address;
184
+ static isValid(input: string | null | undefined): boolean;
185
+ static format(input: string | null | undefined, options?: {
186
+ fallbackToTrimmedInputWhenInvalid?: boolean;
187
+ }): string | null;
188
+ static normalize(input: string | null | undefined, options?: {
189
+ fallbackToTrimmedInputWhenInvalid?: boolean;
190
+ }): string | null;
191
+ static isNormalized(input: string | null | undefined): boolean;
192
+ /**
193
+ * Scans unstructured text for potential Swedish-style addresses.
194
+ *
195
+ * Results are heuristic candidates and can include false positives. Zip-code
196
+ * anchored matches receive medium confidence, while street-only matches
197
+ * receive low confidence.
198
+ */
199
+ static findCandidatesInText(text: string): readonly TextCandidate<Address>[];
200
+ toNormalizedString(): string;
201
+ toMultilineString(): string;
202
+ toDisplayString(): string;
203
+ toEnglishString(): string;
204
+ toNativeString(): string;
205
+ toString(): string;
206
+ toDomesticString(): string;
207
+ /**
208
+ * Multi-line form without the country line, using the country's own zip-code
209
+ * formatting when a country-specific address type is registered.
210
+ */
211
+ toDomesticMultilineString(): string;
212
+ /**
213
+ * Wraps this address in its country-specific type when the country is known
214
+ * and an implementation is registered, otherwise `null`.
215
+ */
216
+ asCountryAddress(): ICountryAddress | null;
217
+ /** Countries that have a dedicated country-specific address type. */
218
+ static get supportedCountryAddressTypes(): readonly Country[];
219
+ private buildStreetLine;
220
+ private buildStreetCoreLine;
221
+ private buildLocalityLine;
222
+ private buildDomesticLocalityLine;
223
+ private countryFormattedZip;
224
+ private buildSingleLine;
225
+ }
226
+
227
+ /** A Swedish postal code (`postnummer`) — strictly 5 digits, formatted `NNN NN`. */
228
+ declare class SwedishAddressZipCode {
229
+ static readonly typeInfo: PrimitiveTypeInfo;
230
+ readonly value: string;
231
+ readonly formatted: string;
232
+ readonly zipCode: AddressZipCode;
233
+ get country(): Country;
234
+ private constructor();
235
+ static tryParse(input: string | null | undefined): SwedishAddressZipCode | null;
236
+ static parse(input: string): SwedishAddressZipCode;
237
+ static isValid(input: string | null | undefined): boolean;
238
+ static format(input: string | null | undefined, options?: {
239
+ fallbackToTrimmedInputWhenInvalid?: boolean;
240
+ }): string | null;
241
+ static normalize(input: string | null | undefined, options?: {
242
+ fallbackToTrimmedInputWhenInvalid?: boolean;
243
+ }): string | null;
244
+ static isNormalized(input: string | null | undefined): boolean;
245
+ toNormalizedString(): string;
246
+ toString(): string;
247
+ }
248
+
249
+ /** A Swedish address — street + 5-digit zip + city, all within Sweden. */
250
+ declare class SwedishAddress {
251
+ static readonly typeInfo: PrimitiveTypeInfo;
252
+ readonly street: AddressStreet;
253
+ readonly zipCode: SwedishAddressZipCode;
254
+ readonly city: AddressCity;
255
+ readonly address: Address;
256
+ get country(): Country;
257
+ /** The zip code as the country-agnostic {@link ICountryAddressZipCode} view. */
258
+ get countryZipCode(): ICountryAddressZipCode;
259
+ get careOf(): string | null;
260
+ get postBox(): string | null;
261
+ get isPostBox(): boolean;
262
+ get apartmentNumber(): string | null;
263
+ get value(): string;
264
+ get formatted(): string;
265
+ private constructor();
266
+ static tryParse(input: string | null | undefined): SwedishAddress | null;
267
+ static tryParse(parts: {
268
+ street: string | null | undefined;
269
+ zipCode?: string | null;
270
+ city?: string | null;
271
+ country?: string | null;
272
+ }): SwedishAddress | null;
273
+ static parse(input: string): SwedishAddress;
274
+ static isValid(input: string | null | undefined): boolean;
275
+ static format(input: string | null | undefined, options?: {
276
+ fallbackToTrimmedInputWhenInvalid?: boolean;
277
+ }): string | null;
278
+ static normalize(input: string | null | undefined, options?: {
279
+ fallbackToTrimmedInputWhenInvalid?: boolean;
280
+ }): string | null;
281
+ static isNormalized(input: string | null | undefined): boolean;
282
+ /**
283
+ * Scans unstructured text for potential Swedish addresses.
284
+ *
285
+ * Results are heuristic candidates and can include false positives. Only
286
+ * address candidates with a Swedish zip code and city are returned.
287
+ */
288
+ static findCandidatesInText(text: string): readonly TextCandidate<SwedishAddress>[];
289
+ toNormalizedString(): string;
290
+ toString(): string;
291
+ toMultilineString(): string;
292
+ private buildStreetCoreLine;
293
+ /** Wraps an already-parsed {@link Address}. Used by the country-address registry. */
294
+ static tryWrap(address: Address): SwedishAddress | null;
295
+ }
296
+
297
+ export { Address as A, CountryAddressBase as C, type ICountryAddress as I, SwedishAddress as S, AddressCity as a, AddressStreet as b, AddressZipCode as c, CountryAddressZipCodeBase as d, type ICountryAddressZipCode as e, SwedishAddressZipCode as f, maskZip as m, tryWrapCountryAddress as t };
@@ -0,0 +1,297 @@
1
+ import { P as PrimitiveTypeInfo, T as TextCandidate } from './text-candidate-qg2bD9PY.js';
2
+ import { a as Country } from './country-p0n0EVQ9.js';
3
+
4
+ /**
5
+ * The postal city (`postort`) is the locality associated with a postal code.
6
+ * Normalization applies Swedish-aware title casing.
7
+ */
8
+ declare class AddressCity {
9
+ static readonly typeInfo: PrimitiveTypeInfo;
10
+ readonly value: string;
11
+ private constructor();
12
+ static tryParse(input: string | null | undefined): AddressCity | null;
13
+ static parse(input: string): AddressCity;
14
+ static isValid(input: string | null | undefined): boolean;
15
+ static format(input: string | null | undefined, options?: {
16
+ fallbackToTrimmedInputWhenInvalid?: boolean;
17
+ }): string | null;
18
+ static normalize(input: string | null | undefined, options?: {
19
+ fallbackToTrimmedInputWhenInvalid?: boolean;
20
+ }): string | null;
21
+ static isNormalized(input: string | null | undefined): boolean;
22
+ toNormalizedString(): string;
23
+ toString(): string;
24
+ equals(other: AddressCity | null | undefined): boolean;
25
+ compareTo(other: AddressCity | null | undefined): number;
26
+ }
27
+
28
+ /**
29
+ * A street address (`gatuadress`). Extracts care-of (c/o), apartment number
30
+ * (lgh/apt), and post box (Box) when present.
31
+ */
32
+ declare class AddressStreet {
33
+ static readonly typeInfo: PrimitiveTypeInfo;
34
+ readonly street: string;
35
+ readonly streetName: string | null;
36
+ readonly streetNumber: string | null;
37
+ readonly apartmentNumber: string | null;
38
+ readonly careOf: string | null;
39
+ readonly postBox: string | null;
40
+ private constructor();
41
+ get isPostBox(): boolean;
42
+ static tryParse(input: string | null | undefined, options?: {
43
+ city?: string | null;
44
+ zipCode?: string | null;
45
+ }): AddressStreet | null;
46
+ static parse(input: string): AddressStreet;
47
+ static isValid(input: string | null | undefined): boolean;
48
+ static format(input: string | null | undefined, options?: {
49
+ fallbackToTrimmedInputWhenInvalid?: boolean;
50
+ }): string | null;
51
+ static normalize(input: string | null | undefined, options?: {
52
+ fallbackToTrimmedInputWhenInvalid?: boolean;
53
+ }): string | null;
54
+ static isNormalized(input: string | null | undefined): boolean;
55
+ toNormalizedString(): string;
56
+ toString(): string;
57
+ equals(other: AddressStreet | null | undefined): boolean;
58
+ compareTo(other: AddressStreet | null | undefined): number;
59
+ }
60
+
61
+ /**
62
+ * A postal code (`postnummer`). Swedish 5-digit codes (formatted `NNN NN`) and
63
+ * many international formats (Danish `DK-9000`, Dutch `1012 AB`, British `W1A 1AB`)
64
+ * are accepted.
65
+ */
66
+ declare class AddressZipCode {
67
+ static readonly typeInfo: PrimitiveTypeInfo;
68
+ readonly value: string;
69
+ readonly formatted: string;
70
+ readonly country: Country | null;
71
+ private constructor();
72
+ get isSwedish(): boolean;
73
+ static tryParse(input: string | null | undefined, options?: {
74
+ country?: Country | null;
75
+ }): AddressZipCode | null;
76
+ static parse(input: string, options?: {
77
+ country?: Country | null;
78
+ }): AddressZipCode;
79
+ static isValid(input: string | null | undefined, options?: {
80
+ country?: Country | null;
81
+ }): boolean;
82
+ /** Parse as a Swedish 5-digit postal code only. */
83
+ static tryParseSwedish(input: string | null | undefined): AddressZipCode | null;
84
+ /** Parse as a non-Swedish international postal code. */
85
+ static tryParseInternational(input: string | null | undefined, country?: Country | null): AddressZipCode | null;
86
+ static format(input: string | null | undefined, options?: {
87
+ country?: Country | null;
88
+ fallbackToTrimmedInputWhenInvalid?: boolean;
89
+ }): string | null;
90
+ static normalize(input: string | null | undefined, options?: {
91
+ country?: Country | null;
92
+ fallbackToTrimmedInputWhenInvalid?: boolean;
93
+ }): string | null;
94
+ static isNormalized(input: string | null | undefined): boolean;
95
+ static findCandidatesInText(text: string): readonly TextCandidate<AddressZipCode>[];
96
+ toNormalizedString(): string;
97
+ toString(): string;
98
+ equals(other: AddressZipCode | null | undefined): boolean;
99
+ compareTo(other: AddressZipCode | null | undefined): number;
100
+ }
101
+ /** Internal masking for zip codes used in scan results. */
102
+ declare function maskZip(zip: AddressZipCode): string;
103
+
104
+ /** Common interface for all country-specific zip code types. */
105
+ interface ICountryAddressZipCode {
106
+ readonly country: Country;
107
+ readonly value: string;
108
+ readonly formatted: string;
109
+ readonly zipCode: AddressZipCode;
110
+ toNormalizedString(): string;
111
+ toString(): string;
112
+ }
113
+ /** Common interface for all country-specific address types. */
114
+ interface ICountryAddress {
115
+ readonly country: Country;
116
+ readonly street: AddressStreet;
117
+ readonly countryZipCode: ICountryAddressZipCode;
118
+ readonly city: AddressCity;
119
+ readonly address: Address;
120
+ readonly careOf: string | null;
121
+ readonly postBox: string | null;
122
+ readonly isPostBox: boolean;
123
+ readonly value: string;
124
+ readonly formatted: string;
125
+ toNormalizedString(): string;
126
+ toMultilineString(): string;
127
+ toString(): string;
128
+ }
129
+ /** Abstract base class for country-specific zip code types. */
130
+ declare abstract class CountryAddressZipCodeBase implements ICountryAddressZipCode {
131
+ readonly value: string;
132
+ readonly formatted: string;
133
+ readonly zipCode: AddressZipCode;
134
+ abstract get country(): Country;
135
+ protected constructor(value: string, formatted: string, zipCode: AddressZipCode);
136
+ toNormalizedString(): string;
137
+ toString(): string;
138
+ }
139
+ /** Abstract base class for country-specific address types. */
140
+ declare abstract class CountryAddressBase implements ICountryAddress {
141
+ readonly street: AddressStreet;
142
+ readonly city: AddressCity;
143
+ readonly address: Address;
144
+ abstract get countryZipCode(): ICountryAddressZipCode;
145
+ get country(): Country;
146
+ get careOf(): string | null;
147
+ get postBox(): string | null;
148
+ get isPostBox(): boolean;
149
+ get value(): string;
150
+ get formatted(): string;
151
+ protected constructor(street: AddressStreet, city: AddressCity, address: Address);
152
+ toNormalizedString(): string;
153
+ toString(): string;
154
+ toMultilineString(): string;
155
+ }
156
+ /**
157
+ * Validates and unwraps a generic {@link Address} for a specific country, then constructs
158
+ * a typed country-specific address. Used by every `XxxAddress.tryParse` implementation.
159
+ */
160
+ declare function tryWrapCountryAddress<TZip, TAddr>(address: Address, alpha2: string, defaultCountry: Country, tryParseZip: (value: string) => TZip | null, factory: (street: AddressStreet, zip: TZip, city: AddressCity, address: Address) => TAddr): TAddr | null;
161
+
162
+ /** A complete address combining street, zip, city and country. */
163
+ declare class Address {
164
+ static readonly typeInfo: PrimitiveTypeInfo;
165
+ readonly street: AddressStreet;
166
+ readonly zipCode: AddressZipCode | null;
167
+ readonly city: AddressCity | null;
168
+ readonly country: Country | null;
169
+ constructor(street: AddressStreet, zipCode?: AddressZipCode | null, city?: AddressCity | null, country?: Country | null);
170
+ get careOf(): string | null;
171
+ get apartmentNumber(): string | null;
172
+ get postBox(): string | null;
173
+ get isPostBox(): boolean;
174
+ get value(): string;
175
+ get formatted(): string;
176
+ static tryParse(input: string | null | undefined): Address | null;
177
+ static tryParse(parts: {
178
+ street: string | null | undefined;
179
+ zipCode?: string | null;
180
+ city?: string | null;
181
+ country?: string | null;
182
+ }): Address | null;
183
+ static parse(input: string): Address;
184
+ static isValid(input: string | null | undefined): boolean;
185
+ static format(input: string | null | undefined, options?: {
186
+ fallbackToTrimmedInputWhenInvalid?: boolean;
187
+ }): string | null;
188
+ static normalize(input: string | null | undefined, options?: {
189
+ fallbackToTrimmedInputWhenInvalid?: boolean;
190
+ }): string | null;
191
+ static isNormalized(input: string | null | undefined): boolean;
192
+ /**
193
+ * Scans unstructured text for potential Swedish-style addresses.
194
+ *
195
+ * Results are heuristic candidates and can include false positives. Zip-code
196
+ * anchored matches receive medium confidence, while street-only matches
197
+ * receive low confidence.
198
+ */
199
+ static findCandidatesInText(text: string): readonly TextCandidate<Address>[];
200
+ toNormalizedString(): string;
201
+ toMultilineString(): string;
202
+ toDisplayString(): string;
203
+ toEnglishString(): string;
204
+ toNativeString(): string;
205
+ toString(): string;
206
+ toDomesticString(): string;
207
+ /**
208
+ * Multi-line form without the country line, using the country's own zip-code
209
+ * formatting when a country-specific address type is registered.
210
+ */
211
+ toDomesticMultilineString(): string;
212
+ /**
213
+ * Wraps this address in its country-specific type when the country is known
214
+ * and an implementation is registered, otherwise `null`.
215
+ */
216
+ asCountryAddress(): ICountryAddress | null;
217
+ /** Countries that have a dedicated country-specific address type. */
218
+ static get supportedCountryAddressTypes(): readonly Country[];
219
+ private buildStreetLine;
220
+ private buildStreetCoreLine;
221
+ private buildLocalityLine;
222
+ private buildDomesticLocalityLine;
223
+ private countryFormattedZip;
224
+ private buildSingleLine;
225
+ }
226
+
227
+ /** A Swedish postal code (`postnummer`) — strictly 5 digits, formatted `NNN NN`. */
228
+ declare class SwedishAddressZipCode {
229
+ static readonly typeInfo: PrimitiveTypeInfo;
230
+ readonly value: string;
231
+ readonly formatted: string;
232
+ readonly zipCode: AddressZipCode;
233
+ get country(): Country;
234
+ private constructor();
235
+ static tryParse(input: string | null | undefined): SwedishAddressZipCode | null;
236
+ static parse(input: string): SwedishAddressZipCode;
237
+ static isValid(input: string | null | undefined): boolean;
238
+ static format(input: string | null | undefined, options?: {
239
+ fallbackToTrimmedInputWhenInvalid?: boolean;
240
+ }): string | null;
241
+ static normalize(input: string | null | undefined, options?: {
242
+ fallbackToTrimmedInputWhenInvalid?: boolean;
243
+ }): string | null;
244
+ static isNormalized(input: string | null | undefined): boolean;
245
+ toNormalizedString(): string;
246
+ toString(): string;
247
+ }
248
+
249
+ /** A Swedish address — street + 5-digit zip + city, all within Sweden. */
250
+ declare class SwedishAddress {
251
+ static readonly typeInfo: PrimitiveTypeInfo;
252
+ readonly street: AddressStreet;
253
+ readonly zipCode: SwedishAddressZipCode;
254
+ readonly city: AddressCity;
255
+ readonly address: Address;
256
+ get country(): Country;
257
+ /** The zip code as the country-agnostic {@link ICountryAddressZipCode} view. */
258
+ get countryZipCode(): ICountryAddressZipCode;
259
+ get careOf(): string | null;
260
+ get postBox(): string | null;
261
+ get isPostBox(): boolean;
262
+ get apartmentNumber(): string | null;
263
+ get value(): string;
264
+ get formatted(): string;
265
+ private constructor();
266
+ static tryParse(input: string | null | undefined): SwedishAddress | null;
267
+ static tryParse(parts: {
268
+ street: string | null | undefined;
269
+ zipCode?: string | null;
270
+ city?: string | null;
271
+ country?: string | null;
272
+ }): SwedishAddress | null;
273
+ static parse(input: string): SwedishAddress;
274
+ static isValid(input: string | null | undefined): boolean;
275
+ static format(input: string | null | undefined, options?: {
276
+ fallbackToTrimmedInputWhenInvalid?: boolean;
277
+ }): string | null;
278
+ static normalize(input: string | null | undefined, options?: {
279
+ fallbackToTrimmedInputWhenInvalid?: boolean;
280
+ }): string | null;
281
+ static isNormalized(input: string | null | undefined): boolean;
282
+ /**
283
+ * Scans unstructured text for potential Swedish addresses.
284
+ *
285
+ * Results are heuristic candidates and can include false positives. Only
286
+ * address candidates with a Swedish zip code and city are returned.
287
+ */
288
+ static findCandidatesInText(text: string): readonly TextCandidate<SwedishAddress>[];
289
+ toNormalizedString(): string;
290
+ toString(): string;
291
+ toMultilineString(): string;
292
+ private buildStreetCoreLine;
293
+ /** Wraps an already-parsed {@link Address}. Used by the country-address registry. */
294
+ static tryWrap(address: Address): SwedishAddress | null;
295
+ }
296
+
297
+ export { Address as A, CountryAddressBase as C, type ICountryAddress as I, SwedishAddress as S, AddressCity as a, AddressStreet as b, AddressZipCode as c, CountryAddressZipCodeBase as d, type ICountryAddressZipCode as e, SwedishAddressZipCode as f, maskZip as m, tryWrapCountryAddress as t };
@@ -0,0 +1,45 @@
1
+ import { P as PrimitiveTypeInfo } from './text-candidate-qg2bD9PY.cjs';
2
+ import { a as PersonFullName } from './person-full-name-Cmc9Ynuc.cjs';
3
+ import { S as SwedishOrganizationName } from './swedish-organization-name-D7NvERxA.cjs';
4
+
5
+ /** The type of bank account holder. */
6
+ declare const BankAccountHolderType: {
7
+ readonly Unknown: "Unknown";
8
+ readonly Person: "Person";
9
+ readonly Organization: "Organization";
10
+ };
11
+ type BankAccountHolderType = (typeof BankAccountHolderType)[keyof typeof BankAccountHolderType];
12
+ /**
13
+ * A Swedish bank account holder name (`kontoinnehavare`).
14
+ * Detects whether the holder is a person or an organization based on
15
+ * `SwedishOrganizationName.hasOrganizationIndicators`.
16
+ */
17
+ declare class SwedishBankAccountHolderName {
18
+ static readonly typeInfo: PrimitiveTypeInfo;
19
+ readonly value: string;
20
+ readonly holderType: BankAccountHolderType;
21
+ readonly personName: PersonFullName | null;
22
+ readonly organizationName: SwedishOrganizationName | null;
23
+ private constructor();
24
+ static tryParse(input: string | null | undefined): SwedishBankAccountHolderName | null;
25
+ static parse(input: string): SwedishBankAccountHolderName;
26
+ static isValid(input: string | null | undefined): boolean;
27
+ static format(input: string | null | undefined, options?: {
28
+ fallbackToTrimmedInputWhenInvalid?: boolean;
29
+ }): string | null;
30
+ static normalize(input: string | null | undefined, options?: {
31
+ fallbackToTrimmedInputWhenInvalid?: boolean;
32
+ }): string | null;
33
+ static isNormalized(input: string | null | undefined): boolean;
34
+ toNormalizedString(): string;
35
+ toString(): string;
36
+ equals(other: SwedishBankAccountHolderName | null | undefined): boolean;
37
+ compareTo(other: SwedishBankAccountHolderName | null | undefined): number;
38
+ }
39
+ /**
40
+ * Returns a masked account holder name where each word's first character is preserved
41
+ * and the rest is masked, e.g. `Anna Andersson` → `A*** A********`.
42
+ */
43
+ declare function maskSwedishBankAccountHolderName(holder: SwedishBankAccountHolderName): string;
44
+
45
+ export { BankAccountHolderType as B, SwedishBankAccountHolderName as S, maskSwedishBankAccountHolderName as m };
@@ -0,0 +1,45 @@
1
+ import { P as PrimitiveTypeInfo } from './text-candidate-qg2bD9PY.js';
2
+ import { a as PersonFullName } from './person-full-name-D6Hbsab6.js';
3
+ import { S as SwedishOrganizationName } from './swedish-organization-name-rR0Q836C.js';
4
+
5
+ /** The type of bank account holder. */
6
+ declare const BankAccountHolderType: {
7
+ readonly Unknown: "Unknown";
8
+ readonly Person: "Person";
9
+ readonly Organization: "Organization";
10
+ };
11
+ type BankAccountHolderType = (typeof BankAccountHolderType)[keyof typeof BankAccountHolderType];
12
+ /**
13
+ * A Swedish bank account holder name (`kontoinnehavare`).
14
+ * Detects whether the holder is a person or an organization based on
15
+ * `SwedishOrganizationName.hasOrganizationIndicators`.
16
+ */
17
+ declare class SwedishBankAccountHolderName {
18
+ static readonly typeInfo: PrimitiveTypeInfo;
19
+ readonly value: string;
20
+ readonly holderType: BankAccountHolderType;
21
+ readonly personName: PersonFullName | null;
22
+ readonly organizationName: SwedishOrganizationName | null;
23
+ private constructor();
24
+ static tryParse(input: string | null | undefined): SwedishBankAccountHolderName | null;
25
+ static parse(input: string): SwedishBankAccountHolderName;
26
+ static isValid(input: string | null | undefined): boolean;
27
+ static format(input: string | null | undefined, options?: {
28
+ fallbackToTrimmedInputWhenInvalid?: boolean;
29
+ }): string | null;
30
+ static normalize(input: string | null | undefined, options?: {
31
+ fallbackToTrimmedInputWhenInvalid?: boolean;
32
+ }): string | null;
33
+ static isNormalized(input: string | null | undefined): boolean;
34
+ toNormalizedString(): string;
35
+ toString(): string;
36
+ equals(other: SwedishBankAccountHolderName | null | undefined): boolean;
37
+ compareTo(other: SwedishBankAccountHolderName | null | undefined): number;
38
+ }
39
+ /**
40
+ * Returns a masked account holder name where each word's first character is preserved
41
+ * and the rest is masked, e.g. `Anna Andersson` → `A*** A********`.
42
+ */
43
+ declare function maskSwedishBankAccountHolderName(holder: SwedishBankAccountHolderName): string;
44
+
45
+ export { BankAccountHolderType as B, SwedishBankAccountHolderName as S, maskSwedishBankAccountHolderName as m };