@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,149 @@
|
|
|
1
|
+
import { P as PrimitiveTypeInfo, T as TextCandidate } from './text-candidate-qg2bD9PY.js';
|
|
2
|
+
import { ValidationResult } from './validation/index.js';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Provides the current date/time for date-dependent primitives such as
|
|
6
|
+
* `SwedishPersonalIdentityNumber` (century derivation), `PersonAge`, and
|
|
7
|
+
* coordination numbers.
|
|
8
|
+
*
|
|
9
|
+
* The .NET equivalent is `IBudiTimeProvider`. JS doesn't have an idiomatic
|
|
10
|
+
* "ambient clock" abstraction, so date-dependent functions accept an optional
|
|
11
|
+
* `Clock` parameter and fall back to {@link systemClock} when absent.
|
|
12
|
+
*/
|
|
13
|
+
interface Clock {
|
|
14
|
+
/** Returns the current date/time. */
|
|
15
|
+
now(): Date;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Local parser for Swedish personnummer and samordningsnummer.
|
|
20
|
+
*
|
|
21
|
+
* Replaces the .NET dependency on ActiveLogin.Identity with an in-house
|
|
22
|
+
* implementation that supports the same input shapes:
|
|
23
|
+
*
|
|
24
|
+
* - 12 digits: `199908072391`
|
|
25
|
+
* - 10 digits: `9908072391` (century inferred)
|
|
26
|
+
* - Separator forms: `YYMMDD-NNNC` or `YYYYMMDD-NNNC`. The separator may be
|
|
27
|
+
* `-` (standard) or `+` (used when the person is 100 years or older;
|
|
28
|
+
* only valid when the input was given in 10-digit form).
|
|
29
|
+
*
|
|
30
|
+
* For coordination numbers (`samordningsnummer`) the day-of-month is shifted
|
|
31
|
+
* by 60 (i.e. real day = day - 60), so valid days for coordination numbers
|
|
32
|
+
* are 61-91 (or 60 when day-of-month is unknown).
|
|
33
|
+
*/
|
|
34
|
+
|
|
35
|
+
type PinKind = "personal" | "coordination";
|
|
36
|
+
interface ParsedPin {
|
|
37
|
+
kind: PinKind;
|
|
38
|
+
/** Full 4-digit year. */
|
|
39
|
+
year: number;
|
|
40
|
+
/** 1-12. */
|
|
41
|
+
month: number;
|
|
42
|
+
/**
|
|
43
|
+
* For personal numbers: 1-31. For coordination numbers: realDay (1-31) or
|
|
44
|
+
* `0` when the day-of-month is unknown (raw day was 60).
|
|
45
|
+
*/
|
|
46
|
+
realDay: number;
|
|
47
|
+
/** Three-digit individual number. */
|
|
48
|
+
individual: string;
|
|
49
|
+
/** Single check digit. */
|
|
50
|
+
checkDigit: string;
|
|
51
|
+
/** Whether the input had a `+` separator (indicates 100+ years old at parse time). */
|
|
52
|
+
hadPlusSeparator: boolean;
|
|
53
|
+
}
|
|
54
|
+
declare function parsePin(input: string, clock?: Clock): ParsedPin | null;
|
|
55
|
+
/** Build the canonical 12-digit form. */
|
|
56
|
+
declare function pinTo12Digit(p: ParsedPin): string;
|
|
57
|
+
/** Build the canonical 10-digit display form (`YYMMDD-NNNC` or `YYMMDD+NNNC`). */
|
|
58
|
+
declare function pinTo10Digit(p: ParsedPin, clock?: Clock): string;
|
|
59
|
+
/** Estimate gender. The third digit of the individual portion is even for female, odd for male. */
|
|
60
|
+
declare function pinGender(p: ParsedPin): "female" | "male";
|
|
61
|
+
/** Best-effort date of birth (`null` if coordination day is unknown). */
|
|
62
|
+
declare function pinDateOfBirth(p: ParsedPin): Date | null;
|
|
63
|
+
/** Age in whole years (`null` if coordination day is unknown). */
|
|
64
|
+
declare function pinAgeInYears(p: ParsedPin, clock?: Clock): number | null;
|
|
65
|
+
|
|
66
|
+
/** A Swedish Coordination Number (`samordningsnummer`). */
|
|
67
|
+
declare class SwedishCoordinationNumber {
|
|
68
|
+
static readonly typeInfo: PrimitiveTypeInfo;
|
|
69
|
+
readonly _pin: ParsedPin;
|
|
70
|
+
readonly _clock: Clock;
|
|
71
|
+
private constructor();
|
|
72
|
+
get formatted(): string;
|
|
73
|
+
get value(): string;
|
|
74
|
+
get realDay(): number;
|
|
75
|
+
get dateOfBirthHint(): Date | null;
|
|
76
|
+
get ageHint(): number | null;
|
|
77
|
+
get genderHint(): "female" | "male";
|
|
78
|
+
static tryParse(input: string | null | undefined, options?: {
|
|
79
|
+
clock?: Clock;
|
|
80
|
+
}): SwedishCoordinationNumber | null;
|
|
81
|
+
static parse(input: string, options?: {
|
|
82
|
+
clock?: Clock;
|
|
83
|
+
}): SwedishCoordinationNumber;
|
|
84
|
+
static isValid(input: string | null | undefined): boolean;
|
|
85
|
+
static format(input: string | null | undefined, options?: {
|
|
86
|
+
fallbackToTrimmedInputWhenInvalid?: boolean;
|
|
87
|
+
clock?: Clock;
|
|
88
|
+
}): string | null;
|
|
89
|
+
static normalize(input: string | null | undefined, options?: {
|
|
90
|
+
fallbackToTrimmedInputWhenInvalid?: boolean;
|
|
91
|
+
clock?: Clock;
|
|
92
|
+
}): string | null;
|
|
93
|
+
static isNormalized(input: string | null | undefined): boolean;
|
|
94
|
+
static validate(input: string | null | undefined): ValidationResult;
|
|
95
|
+
toNormalizedString(): string;
|
|
96
|
+
toString(): string;
|
|
97
|
+
to10DigitString(): string;
|
|
98
|
+
to12DigitString(): string;
|
|
99
|
+
static findCandidatesInText(text: string): readonly TextCandidate<SwedishCoordinationNumber>[];
|
|
100
|
+
equals(other: SwedishCoordinationNumber | null | undefined): boolean;
|
|
101
|
+
compareTo(other: SwedishCoordinationNumber | null | undefined): number;
|
|
102
|
+
}
|
|
103
|
+
/** Mask a coordination number, e.g. `680164-2395` -> `680164-****`. */
|
|
104
|
+
declare function maskCoordinationNumber(c: SwedishCoordinationNumber, options?: {
|
|
105
|
+
maskBirthDate?: boolean;
|
|
106
|
+
}): string;
|
|
107
|
+
|
|
108
|
+
/** A Swedish Personal Identity Number (`personnummer`). */
|
|
109
|
+
declare class SwedishPersonalIdentityNumber {
|
|
110
|
+
static readonly typeInfo: PrimitiveTypeInfo;
|
|
111
|
+
readonly _pin: ParsedPin;
|
|
112
|
+
readonly _clock: Clock;
|
|
113
|
+
private constructor();
|
|
114
|
+
get formatted(): string;
|
|
115
|
+
get value(): string;
|
|
116
|
+
get dateOfBirthHint(): Date;
|
|
117
|
+
get ageHint(): number;
|
|
118
|
+
get genderHint(): "female" | "male";
|
|
119
|
+
static tryParse(input: string | null | undefined, options?: {
|
|
120
|
+
clock?: Clock;
|
|
121
|
+
}): SwedishPersonalIdentityNumber | null;
|
|
122
|
+
static parse(input: string, options?: {
|
|
123
|
+
clock?: Clock;
|
|
124
|
+
}): SwedishPersonalIdentityNumber;
|
|
125
|
+
static isValid(input: string | null | undefined): boolean;
|
|
126
|
+
static format(input: string | null | undefined, options?: {
|
|
127
|
+
fallbackToTrimmedInputWhenInvalid?: boolean;
|
|
128
|
+
clock?: Clock;
|
|
129
|
+
}): string | null;
|
|
130
|
+
static normalize(input: string | null | undefined, options?: {
|
|
131
|
+
fallbackToTrimmedInputWhenInvalid?: boolean;
|
|
132
|
+
clock?: Clock;
|
|
133
|
+
}): string | null;
|
|
134
|
+
static isNormalized(input: string | null | undefined): boolean;
|
|
135
|
+
static validate(input: string | null | undefined): ValidationResult;
|
|
136
|
+
toNormalizedString(): string;
|
|
137
|
+
toString(): string;
|
|
138
|
+
to10DigitString(): string;
|
|
139
|
+
to12DigitString(): string;
|
|
140
|
+
static findCandidatesInText(text: string): readonly TextCandidate<SwedishPersonalIdentityNumber>[];
|
|
141
|
+
equals(other: SwedishPersonalIdentityNumber | null | undefined): boolean;
|
|
142
|
+
compareTo(other: SwedishPersonalIdentityNumber | null | undefined): number;
|
|
143
|
+
}
|
|
144
|
+
/** Mask a personal identity number, e.g. `990807-2391` -> `990807-****`. */
|
|
145
|
+
declare function maskPersonalIdentityNumber(p: SwedishPersonalIdentityNumber, options?: {
|
|
146
|
+
maskBirthDate?: boolean;
|
|
147
|
+
}): string;
|
|
148
|
+
|
|
149
|
+
export { type Clock as C, type ParsedPin as P, SwedishCoordinationNumber as S, type PinKind as a, SwedishPersonalIdentityNumber as b, maskPersonalIdentityNumber as c, pinAgeInYears as d, pinDateOfBirth as e, pinGender as f, pinTo10Digit as g, pinTo12Digit as h, maskCoordinationNumber as m, parsePin as p };
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
import { P as PrimitiveTypeInfo, T as TextCandidate } from './text-candidate-qg2bD9PY.cjs';
|
|
2
|
+
import { ValidationResult } from './validation/index.cjs';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Provides the current date/time for date-dependent primitives such as
|
|
6
|
+
* `SwedishPersonalIdentityNumber` (century derivation), `PersonAge`, and
|
|
7
|
+
* coordination numbers.
|
|
8
|
+
*
|
|
9
|
+
* The .NET equivalent is `IBudiTimeProvider`. JS doesn't have an idiomatic
|
|
10
|
+
* "ambient clock" abstraction, so date-dependent functions accept an optional
|
|
11
|
+
* `Clock` parameter and fall back to {@link systemClock} when absent.
|
|
12
|
+
*/
|
|
13
|
+
interface Clock {
|
|
14
|
+
/** Returns the current date/time. */
|
|
15
|
+
now(): Date;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Local parser for Swedish personnummer and samordningsnummer.
|
|
20
|
+
*
|
|
21
|
+
* Replaces the .NET dependency on ActiveLogin.Identity with an in-house
|
|
22
|
+
* implementation that supports the same input shapes:
|
|
23
|
+
*
|
|
24
|
+
* - 12 digits: `199908072391`
|
|
25
|
+
* - 10 digits: `9908072391` (century inferred)
|
|
26
|
+
* - Separator forms: `YYMMDD-NNNC` or `YYYYMMDD-NNNC`. The separator may be
|
|
27
|
+
* `-` (standard) or `+` (used when the person is 100 years or older;
|
|
28
|
+
* only valid when the input was given in 10-digit form).
|
|
29
|
+
*
|
|
30
|
+
* For coordination numbers (`samordningsnummer`) the day-of-month is shifted
|
|
31
|
+
* by 60 (i.e. real day = day - 60), so valid days for coordination numbers
|
|
32
|
+
* are 61-91 (or 60 when day-of-month is unknown).
|
|
33
|
+
*/
|
|
34
|
+
|
|
35
|
+
type PinKind = "personal" | "coordination";
|
|
36
|
+
interface ParsedPin {
|
|
37
|
+
kind: PinKind;
|
|
38
|
+
/** Full 4-digit year. */
|
|
39
|
+
year: number;
|
|
40
|
+
/** 1-12. */
|
|
41
|
+
month: number;
|
|
42
|
+
/**
|
|
43
|
+
* For personal numbers: 1-31. For coordination numbers: realDay (1-31) or
|
|
44
|
+
* `0` when the day-of-month is unknown (raw day was 60).
|
|
45
|
+
*/
|
|
46
|
+
realDay: number;
|
|
47
|
+
/** Three-digit individual number. */
|
|
48
|
+
individual: string;
|
|
49
|
+
/** Single check digit. */
|
|
50
|
+
checkDigit: string;
|
|
51
|
+
/** Whether the input had a `+` separator (indicates 100+ years old at parse time). */
|
|
52
|
+
hadPlusSeparator: boolean;
|
|
53
|
+
}
|
|
54
|
+
declare function parsePin(input: string, clock?: Clock): ParsedPin | null;
|
|
55
|
+
/** Build the canonical 12-digit form. */
|
|
56
|
+
declare function pinTo12Digit(p: ParsedPin): string;
|
|
57
|
+
/** Build the canonical 10-digit display form (`YYMMDD-NNNC` or `YYMMDD+NNNC`). */
|
|
58
|
+
declare function pinTo10Digit(p: ParsedPin, clock?: Clock): string;
|
|
59
|
+
/** Estimate gender. The third digit of the individual portion is even for female, odd for male. */
|
|
60
|
+
declare function pinGender(p: ParsedPin): "female" | "male";
|
|
61
|
+
/** Best-effort date of birth (`null` if coordination day is unknown). */
|
|
62
|
+
declare function pinDateOfBirth(p: ParsedPin): Date | null;
|
|
63
|
+
/** Age in whole years (`null` if coordination day is unknown). */
|
|
64
|
+
declare function pinAgeInYears(p: ParsedPin, clock?: Clock): number | null;
|
|
65
|
+
|
|
66
|
+
/** A Swedish Coordination Number (`samordningsnummer`). */
|
|
67
|
+
declare class SwedishCoordinationNumber {
|
|
68
|
+
static readonly typeInfo: PrimitiveTypeInfo;
|
|
69
|
+
readonly _pin: ParsedPin;
|
|
70
|
+
readonly _clock: Clock;
|
|
71
|
+
private constructor();
|
|
72
|
+
get formatted(): string;
|
|
73
|
+
get value(): string;
|
|
74
|
+
get realDay(): number;
|
|
75
|
+
get dateOfBirthHint(): Date | null;
|
|
76
|
+
get ageHint(): number | null;
|
|
77
|
+
get genderHint(): "female" | "male";
|
|
78
|
+
static tryParse(input: string | null | undefined, options?: {
|
|
79
|
+
clock?: Clock;
|
|
80
|
+
}): SwedishCoordinationNumber | null;
|
|
81
|
+
static parse(input: string, options?: {
|
|
82
|
+
clock?: Clock;
|
|
83
|
+
}): SwedishCoordinationNumber;
|
|
84
|
+
static isValid(input: string | null | undefined): boolean;
|
|
85
|
+
static format(input: string | null | undefined, options?: {
|
|
86
|
+
fallbackToTrimmedInputWhenInvalid?: boolean;
|
|
87
|
+
clock?: Clock;
|
|
88
|
+
}): string | null;
|
|
89
|
+
static normalize(input: string | null | undefined, options?: {
|
|
90
|
+
fallbackToTrimmedInputWhenInvalid?: boolean;
|
|
91
|
+
clock?: Clock;
|
|
92
|
+
}): string | null;
|
|
93
|
+
static isNormalized(input: string | null | undefined): boolean;
|
|
94
|
+
static validate(input: string | null | undefined): ValidationResult;
|
|
95
|
+
toNormalizedString(): string;
|
|
96
|
+
toString(): string;
|
|
97
|
+
to10DigitString(): string;
|
|
98
|
+
to12DigitString(): string;
|
|
99
|
+
static findCandidatesInText(text: string): readonly TextCandidate<SwedishCoordinationNumber>[];
|
|
100
|
+
equals(other: SwedishCoordinationNumber | null | undefined): boolean;
|
|
101
|
+
compareTo(other: SwedishCoordinationNumber | null | undefined): number;
|
|
102
|
+
}
|
|
103
|
+
/** Mask a coordination number, e.g. `680164-2395` -> `680164-****`. */
|
|
104
|
+
declare function maskCoordinationNumber(c: SwedishCoordinationNumber, options?: {
|
|
105
|
+
maskBirthDate?: boolean;
|
|
106
|
+
}): string;
|
|
107
|
+
|
|
108
|
+
/** A Swedish Personal Identity Number (`personnummer`). */
|
|
109
|
+
declare class SwedishPersonalIdentityNumber {
|
|
110
|
+
static readonly typeInfo: PrimitiveTypeInfo;
|
|
111
|
+
readonly _pin: ParsedPin;
|
|
112
|
+
readonly _clock: Clock;
|
|
113
|
+
private constructor();
|
|
114
|
+
get formatted(): string;
|
|
115
|
+
get value(): string;
|
|
116
|
+
get dateOfBirthHint(): Date;
|
|
117
|
+
get ageHint(): number;
|
|
118
|
+
get genderHint(): "female" | "male";
|
|
119
|
+
static tryParse(input: string | null | undefined, options?: {
|
|
120
|
+
clock?: Clock;
|
|
121
|
+
}): SwedishPersonalIdentityNumber | null;
|
|
122
|
+
static parse(input: string, options?: {
|
|
123
|
+
clock?: Clock;
|
|
124
|
+
}): SwedishPersonalIdentityNumber;
|
|
125
|
+
static isValid(input: string | null | undefined): boolean;
|
|
126
|
+
static format(input: string | null | undefined, options?: {
|
|
127
|
+
fallbackToTrimmedInputWhenInvalid?: boolean;
|
|
128
|
+
clock?: Clock;
|
|
129
|
+
}): string | null;
|
|
130
|
+
static normalize(input: string | null | undefined, options?: {
|
|
131
|
+
fallbackToTrimmedInputWhenInvalid?: boolean;
|
|
132
|
+
clock?: Clock;
|
|
133
|
+
}): string | null;
|
|
134
|
+
static isNormalized(input: string | null | undefined): boolean;
|
|
135
|
+
static validate(input: string | null | undefined): ValidationResult;
|
|
136
|
+
toNormalizedString(): string;
|
|
137
|
+
toString(): string;
|
|
138
|
+
to10DigitString(): string;
|
|
139
|
+
to12DigitString(): string;
|
|
140
|
+
static findCandidatesInText(text: string): readonly TextCandidate<SwedishPersonalIdentityNumber>[];
|
|
141
|
+
equals(other: SwedishPersonalIdentityNumber | null | undefined): boolean;
|
|
142
|
+
compareTo(other: SwedishPersonalIdentityNumber | null | undefined): number;
|
|
143
|
+
}
|
|
144
|
+
/** Mask a personal identity number, e.g. `990807-2391` -> `990807-****`. */
|
|
145
|
+
declare function maskPersonalIdentityNumber(p: SwedishPersonalIdentityNumber, options?: {
|
|
146
|
+
maskBirthDate?: boolean;
|
|
147
|
+
}): string;
|
|
148
|
+
|
|
149
|
+
export { type Clock as C, type ParsedPin as P, SwedishCoordinationNumber as S, type PinKind as a, SwedishPersonalIdentityNumber as b, maskPersonalIdentityNumber as c, pinAgeInYears as d, pinDateOfBirth as e, pinGender as f, pinTo10Digit as g, pinTo12Digit as h, maskCoordinationNumber as m, parsePin as p };
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { P as PrimitiveTypeInfo, T as TextCandidate } from './text-candidate-qg2bD9PY.js';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* A Swedish property designation (`fastighetsbeteckning`), e.g. `Stockholm Söder 75:2`.
|
|
5
|
+
* Combines the municipality/tract name with a register number `BLOCK:UNIT`.
|
|
6
|
+
*/
|
|
7
|
+
declare class SwedishPropertyDesignation {
|
|
8
|
+
static readonly typeInfo: PrimitiveTypeInfo;
|
|
9
|
+
/** The full designation, e.g. `Stockholm Söder 75:2`. */
|
|
10
|
+
readonly value: string;
|
|
11
|
+
/** The capitalized designation name, e.g. `Stockholm Söder`. */
|
|
12
|
+
readonly designationName: string;
|
|
13
|
+
/** The register number `BLOCK:UNIT`, e.g. `75:2`. */
|
|
14
|
+
readonly registerNumber: string;
|
|
15
|
+
/** Block portion of the register number. */
|
|
16
|
+
readonly blockNumber: number;
|
|
17
|
+
/** Unit portion of the register number. */
|
|
18
|
+
readonly unitNumber: number;
|
|
19
|
+
private constructor();
|
|
20
|
+
static tryParse(input: string | null | undefined): SwedishPropertyDesignation | null;
|
|
21
|
+
static parse(input: string): SwedishPropertyDesignation;
|
|
22
|
+
static isValid(input: string | null | undefined): boolean;
|
|
23
|
+
static format(input: string | null | undefined, options?: {
|
|
24
|
+
fallbackToTrimmedInputWhenInvalid?: boolean;
|
|
25
|
+
}): string | null;
|
|
26
|
+
static normalize(input: string | null | undefined, options?: {
|
|
27
|
+
fallbackToTrimmedInputWhenInvalid?: boolean;
|
|
28
|
+
}): string | null;
|
|
29
|
+
static isNormalized(input: string | null | undefined): boolean;
|
|
30
|
+
toNormalizedString(): string;
|
|
31
|
+
toString(): string;
|
|
32
|
+
static findCandidatesInText(text: string): readonly TextCandidate<SwedishPropertyDesignation>[];
|
|
33
|
+
equals(other: SwedishPropertyDesignation | null | undefined): boolean;
|
|
34
|
+
compareTo(other: SwedishPropertyDesignation | null | undefined): number;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Masks the property designation preserving the name, e.g.
|
|
38
|
+
* `Stockholm Söder 75:2` → `Stockholm Söder **:*`.
|
|
39
|
+
*/
|
|
40
|
+
declare function maskSwedishPropertyDesignation(d: SwedishPropertyDesignation): string;
|
|
41
|
+
/** Returns a Lantmäteriet map search URL for the designation. */
|
|
42
|
+
declare function getLantmaterietUrl(d: SwedishPropertyDesignation): string;
|
|
43
|
+
/** Returns a Hitta.se map search URL for the designation. */
|
|
44
|
+
declare function getPropertyHittaUrl(d: SwedishPropertyDesignation): string;
|
|
45
|
+
|
|
46
|
+
export { SwedishPropertyDesignation as S, getPropertyHittaUrl as a, getLantmaterietUrl as g, maskSwedishPropertyDesignation as m };
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { P as PrimitiveTypeInfo, T as TextCandidate } from './text-candidate-qg2bD9PY.cjs';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* A Swedish property designation (`fastighetsbeteckning`), e.g. `Stockholm Söder 75:2`.
|
|
5
|
+
* Combines the municipality/tract name with a register number `BLOCK:UNIT`.
|
|
6
|
+
*/
|
|
7
|
+
declare class SwedishPropertyDesignation {
|
|
8
|
+
static readonly typeInfo: PrimitiveTypeInfo;
|
|
9
|
+
/** The full designation, e.g. `Stockholm Söder 75:2`. */
|
|
10
|
+
readonly value: string;
|
|
11
|
+
/** The capitalized designation name, e.g. `Stockholm Söder`. */
|
|
12
|
+
readonly designationName: string;
|
|
13
|
+
/** The register number `BLOCK:UNIT`, e.g. `75:2`. */
|
|
14
|
+
readonly registerNumber: string;
|
|
15
|
+
/** Block portion of the register number. */
|
|
16
|
+
readonly blockNumber: number;
|
|
17
|
+
/** Unit portion of the register number. */
|
|
18
|
+
readonly unitNumber: number;
|
|
19
|
+
private constructor();
|
|
20
|
+
static tryParse(input: string | null | undefined): SwedishPropertyDesignation | null;
|
|
21
|
+
static parse(input: string): SwedishPropertyDesignation;
|
|
22
|
+
static isValid(input: string | null | undefined): boolean;
|
|
23
|
+
static format(input: string | null | undefined, options?: {
|
|
24
|
+
fallbackToTrimmedInputWhenInvalid?: boolean;
|
|
25
|
+
}): string | null;
|
|
26
|
+
static normalize(input: string | null | undefined, options?: {
|
|
27
|
+
fallbackToTrimmedInputWhenInvalid?: boolean;
|
|
28
|
+
}): string | null;
|
|
29
|
+
static isNormalized(input: string | null | undefined): boolean;
|
|
30
|
+
toNormalizedString(): string;
|
|
31
|
+
toString(): string;
|
|
32
|
+
static findCandidatesInText(text: string): readonly TextCandidate<SwedishPropertyDesignation>[];
|
|
33
|
+
equals(other: SwedishPropertyDesignation | null | undefined): boolean;
|
|
34
|
+
compareTo(other: SwedishPropertyDesignation | null | undefined): number;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Masks the property designation preserving the name, e.g.
|
|
38
|
+
* `Stockholm Söder 75:2` → `Stockholm Söder **:*`.
|
|
39
|
+
*/
|
|
40
|
+
declare function maskSwedishPropertyDesignation(d: SwedishPropertyDesignation): string;
|
|
41
|
+
/** Returns a Lantmäteriet map search URL for the designation. */
|
|
42
|
+
declare function getLantmaterietUrl(d: SwedishPropertyDesignation): string;
|
|
43
|
+
/** Returns a Hitta.se map search URL for the designation. */
|
|
44
|
+
declare function getPropertyHittaUrl(d: SwedishPropertyDesignation): string;
|
|
45
|
+
|
|
46
|
+
export { SwedishPropertyDesignation as S, getPropertyHittaUrl as a, getLantmaterietUrl as g, maskSwedishPropertyDesignation as m };
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { P as PrimitiveTypeInfo } from './text-candidate-qg2bD9PY.js';
|
|
2
|
+
|
|
3
|
+
/** ISO 20275 Entity Legal Form code. */
|
|
4
|
+
declare class ElfCode {
|
|
5
|
+
static readonly typeInfo: PrimitiveTypeInfo;
|
|
6
|
+
readonly code: string;
|
|
7
|
+
readonly englishName: string | null;
|
|
8
|
+
readonly localizedName: string | null;
|
|
9
|
+
get displayName(): string;
|
|
10
|
+
get isKnown(): boolean;
|
|
11
|
+
private constructor();
|
|
12
|
+
static tryParse(input: string | null | undefined): ElfCode | null;
|
|
13
|
+
static parse(input: string): ElfCode;
|
|
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: ElfCode | null | undefined): boolean;
|
|
25
|
+
compareTo(other: ElfCode | null | undefined): number;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/** Swedish SNI code (`SNI-kod`). */
|
|
29
|
+
declare class SwedishSniCode {
|
|
30
|
+
static readonly typeInfo: PrimitiveTypeInfo;
|
|
31
|
+
readonly code: string;
|
|
32
|
+
readonly formatted: string;
|
|
33
|
+
get divisionCode(): string;
|
|
34
|
+
get groupCode(): string;
|
|
35
|
+
get subGroupCode(): string;
|
|
36
|
+
private constructor();
|
|
37
|
+
static tryParse(input: string | null | undefined): SwedishSniCode | null;
|
|
38
|
+
static parse(input: string): SwedishSniCode;
|
|
39
|
+
static isValid(input: string | null | undefined): boolean;
|
|
40
|
+
static format(input: string | null | undefined, options?: {
|
|
41
|
+
fallbackToTrimmedInputWhenInvalid?: boolean;
|
|
42
|
+
}): string | null;
|
|
43
|
+
static normalize(input: string | null | undefined, options?: {
|
|
44
|
+
fallbackToTrimmedInputWhenInvalid?: boolean;
|
|
45
|
+
}): string | null;
|
|
46
|
+
static isNormalized(input: string | null | undefined): boolean;
|
|
47
|
+
toNormalizedString(): string;
|
|
48
|
+
toString(): string;
|
|
49
|
+
equals(other: SwedishSniCode | null | undefined): boolean;
|
|
50
|
+
compareTo(other: SwedishSniCode | null | undefined): number;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export { ElfCode as E, SwedishSniCode as S };
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { P as PrimitiveTypeInfo } from './text-candidate-qg2bD9PY.cjs';
|
|
2
|
+
|
|
3
|
+
/** ISO 20275 Entity Legal Form code. */
|
|
4
|
+
declare class ElfCode {
|
|
5
|
+
static readonly typeInfo: PrimitiveTypeInfo;
|
|
6
|
+
readonly code: string;
|
|
7
|
+
readonly englishName: string | null;
|
|
8
|
+
readonly localizedName: string | null;
|
|
9
|
+
get displayName(): string;
|
|
10
|
+
get isKnown(): boolean;
|
|
11
|
+
private constructor();
|
|
12
|
+
static tryParse(input: string | null | undefined): ElfCode | null;
|
|
13
|
+
static parse(input: string): ElfCode;
|
|
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: ElfCode | null | undefined): boolean;
|
|
25
|
+
compareTo(other: ElfCode | null | undefined): number;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/** Swedish SNI code (`SNI-kod`). */
|
|
29
|
+
declare class SwedishSniCode {
|
|
30
|
+
static readonly typeInfo: PrimitiveTypeInfo;
|
|
31
|
+
readonly code: string;
|
|
32
|
+
readonly formatted: string;
|
|
33
|
+
get divisionCode(): string;
|
|
34
|
+
get groupCode(): string;
|
|
35
|
+
get subGroupCode(): string;
|
|
36
|
+
private constructor();
|
|
37
|
+
static tryParse(input: string | null | undefined): SwedishSniCode | null;
|
|
38
|
+
static parse(input: string): SwedishSniCode;
|
|
39
|
+
static isValid(input: string | null | undefined): boolean;
|
|
40
|
+
static format(input: string | null | undefined, options?: {
|
|
41
|
+
fallbackToTrimmedInputWhenInvalid?: boolean;
|
|
42
|
+
}): string | null;
|
|
43
|
+
static normalize(input: string | null | undefined, options?: {
|
|
44
|
+
fallbackToTrimmedInputWhenInvalid?: boolean;
|
|
45
|
+
}): string | null;
|
|
46
|
+
static isNormalized(input: string | null | undefined): boolean;
|
|
47
|
+
toNormalizedString(): string;
|
|
48
|
+
toString(): string;
|
|
49
|
+
equals(other: SwedishSniCode | null | undefined): boolean;
|
|
50
|
+
compareTo(other: SwedishSniCode | null | undefined): number;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export { ElfCode as E, SwedishSniCode as S };
|