-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.d.ts
77 lines (65 loc) · 1.88 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
type MunicipalDisctric = string;
type Municipality = Record<string, MunicipalDisctric[]>;
type ProvinceSearchResult = { province: Province; municipality: string };
type RegionSeachResult = Record<Region, string[]>;
interface UtilsDO {
Geo: Geo;
Validator: Validator;
}
declare const UtilsDo: UtilsDO;
export const Geo: Geo;
export const Validator: Validator;
export default UtilsDo;
class Geo {
public readonly numberOfProvinces: number;
public readonly numberOfMunicipalities: number;
public readonly numberOfMunicipalDistrict: number;
getProvinces(): Province[];
getMunicipalitiesOf(provincesName: Province): Municipality | undefined;
getMunicipalDistrictOf(
province: Province,
municipality: string
): MunicipalDisctric[] | undefined;
getProvinceByMunicipality(municipality: string): Province | undefined;
getProvinceByMunicipalDistrict(
municipalDisctric: string
): ProvinceSearchResult[] | undefined;
getRegions(): string;
getRegionsAndZones(): RegionSeachResult[];
getProvincesByRegion(region: string): string | undefined;
getProvincesByZone(zone: string): string | undefined;
}
class Validator {
setStrictValidation(value: boolean): void;
isAnIde(id: string | number): boolean;
formatToIde(id: string | number): string;
isATel(tel: string | number): boolean;
formatToTel(tel: string | number): string;
isRNC(input: string | number): boolean;
formatToRNC(rnc: string | number): string;
}
type Region = "Cibao" | "Sur" | "Este";
type Province =
| "Azua"
| "Bahoruco"
| "Barahona"
| "Dajabón"
| "Duarte"
| "El Seibo"
| "Elías Piña"
| "Espaillat"
| "Hato Mayor"
| "Hermanas Mirabal"
| "Independencia"
| "La Altagracia"
| "La Romana"
| "La Vega"
| "María Trinidad Sánchez"
| "Monseñor Nouel"
| "Montecristi"
| "Monte Plata"
| "Pedernales"
| "Peravia"
| "Puerto Plata"
| "Samamá"
| "San Cristóbal";