@temboplus/frontend-core 0.2.5 → 0.2.6

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 (86) hide show
  1. package/README.md +63 -14
  2. package/esm/src/data/countries.d.ts +12 -2
  3. package/esm/src/data/countries.js +496 -248
  4. package/esm/src/models/amount/amount.d.ts.map +1 -1
  5. package/esm/src/models/amount/amount.js +1 -1
  6. package/esm/src/models/bank/bank.d.ts +127 -0
  7. package/esm/src/models/bank/bank.d.ts.map +1 -1
  8. package/esm/src/models/bank/bank.js +264 -7
  9. package/esm/src/models/bank/index.d.ts +0 -1
  10. package/esm/src/models/bank/index.d.ts.map +1 -1
  11. package/esm/src/models/bank/index.js +0 -1
  12. package/esm/src/models/country/country.d.ts +162 -24
  13. package/esm/src/models/country/country.d.ts.map +1 -1
  14. package/esm/src/models/country/country.js +442 -42
  15. package/esm/src/models/country/index.d.ts +1 -1
  16. package/esm/src/models/country/index.d.ts.map +1 -1
  17. package/esm/src/models/country/index.js +1 -1
  18. package/esm/src/models/country/types.d.ts +53 -0
  19. package/esm/src/models/country/types.d.ts.map +1 -0
  20. package/esm/src/models/country/types.js +43 -0
  21. package/esm/src/models/currency/currency.d.ts +127 -4
  22. package/esm/src/models/currency/currency.d.ts.map +1 -1
  23. package/esm/src/models/currency/currency.js +229 -11
  24. package/esm/src/models/currency/index.d.ts +1 -1
  25. package/esm/src/models/currency/index.d.ts.map +1 -1
  26. package/esm/src/models/currency/index.js +1 -1
  27. package/esm/src/models/currency/types.d.ts +20 -0
  28. package/esm/src/models/currency/types.d.ts.map +1 -0
  29. package/esm/src/models/currency/types.js +13 -0
  30. package/esm/src/models/phone_number/global/phone_number.d.ts +3 -2
  31. package/esm/src/models/phone_number/global/phone_number.d.ts.map +1 -1
  32. package/esm/src/models/phone_number/global/service.d.ts +27 -20
  33. package/esm/src/models/phone_number/global/service.d.ts.map +1 -1
  34. package/esm/src/models/phone_number/global/service.js +61 -40
  35. package/package.json +1 -1
  36. package/script/src/data/countries.d.ts +12 -2
  37. package/script/src/data/countries.js +496 -248
  38. package/script/src/models/amount/amount.d.ts.map +1 -1
  39. package/script/src/models/amount/amount.js +4 -4
  40. package/script/src/models/bank/bank.d.ts +127 -0
  41. package/script/src/models/bank/bank.d.ts.map +1 -1
  42. package/script/src/models/bank/bank.js +273 -12
  43. package/script/src/models/bank/index.d.ts +0 -1
  44. package/script/src/models/bank/index.d.ts.map +1 -1
  45. package/script/src/models/bank/index.js +0 -1
  46. package/script/src/models/country/country.d.ts +162 -24
  47. package/script/src/models/country/country.d.ts.map +1 -1
  48. package/script/src/models/country/country.js +453 -49
  49. package/script/src/models/country/index.d.ts +1 -1
  50. package/script/src/models/country/index.d.ts.map +1 -1
  51. package/script/src/models/country/index.js +1 -1
  52. package/script/src/models/country/types.d.ts +53 -0
  53. package/script/src/models/country/types.d.ts.map +1 -0
  54. package/script/src/models/country/types.js +46 -0
  55. package/script/src/models/currency/currency.d.ts +127 -4
  56. package/script/src/models/currency/currency.d.ts.map +1 -1
  57. package/script/src/models/currency/currency.js +237 -15
  58. package/script/src/models/currency/index.d.ts +1 -1
  59. package/script/src/models/currency/index.d.ts.map +1 -1
  60. package/script/src/models/currency/index.js +1 -1
  61. package/script/src/models/currency/types.d.ts +20 -0
  62. package/script/src/models/currency/types.d.ts.map +1 -0
  63. package/script/src/models/currency/types.js +14 -0
  64. package/script/src/models/phone_number/global/phone_number.d.ts +3 -2
  65. package/script/src/models/phone_number/global/phone_number.d.ts.map +1 -1
  66. package/script/src/models/phone_number/global/service.d.ts +27 -20
  67. package/script/src/models/phone_number/global/service.d.ts.map +1 -1
  68. package/script/src/models/phone_number/global/service.js +61 -40
  69. package/esm/src/models/bank/service.d.ts +0 -106
  70. package/esm/src/models/bank/service.d.ts.map +0 -1
  71. package/esm/src/models/bank/service.js +0 -240
  72. package/esm/src/models/country/service.d.ts +0 -111
  73. package/esm/src/models/country/service.d.ts.map +0 -1
  74. package/esm/src/models/country/service.js +0 -366
  75. package/esm/src/models/currency/service.d.ts +0 -96
  76. package/esm/src/models/currency/service.d.ts.map +0 -1
  77. package/esm/src/models/currency/service.js +0 -194
  78. package/script/src/models/bank/service.d.ts +0 -106
  79. package/script/src/models/bank/service.d.ts.map +0 -1
  80. package/script/src/models/bank/service.js +0 -247
  81. package/script/src/models/country/service.d.ts +0 -111
  82. package/script/src/models/country/service.d.ts.map +0 -1
  83. package/script/src/models/country/service.js +0 -373
  84. package/script/src/models/currency/service.d.ts +0 -96
  85. package/script/src/models/currency/service.d.ts.map +0 -1
  86. package/script/src/models/currency/service.js +0 -201
@@ -1,106 +0,0 @@
1
- import { Bank } from "./bank.js";
2
- /**
3
- * Regex pattern to validate SWIFT codes.
4
- * The SWIFT code must follow the format: XXXX XX XX XXX (optional last part for branches).
5
- * @constant {RegExp}
6
- */
7
- export declare const SWIFT_CODE_REGEX: RegExp;
8
- /**
9
- * Service for managing bank data.
10
- * @class BankService
11
- */
12
- export declare class BankService {
13
- private static instance;
14
- private bankList;
15
- private bankRecord;
16
- private banksByName;
17
- private banksByShortName;
18
- private staticReferences;
19
- private constructor();
20
- /**
21
- * Gets the singleton instance of BankService.
22
- * Creates the instance if it doesn't exist.
23
- * @static
24
- * @returns {BankService} The singleton instance
25
- */
26
- static getInstance(): BankService;
27
- /**
28
- * Initializes the service with bank data.
29
- * Should be called once when your application starts.
30
- */
31
- private initialize;
32
- /**
33
- * Gets all banks.
34
- * @returns {Bank[]} Array of all banks
35
- */
36
- getAll(): Bank[];
37
- /**
38
- * Gets all banks as a record.
39
- * @returns {Record<string, Bank>} Record of bank SWIFT codes and bank objects
40
- */
41
- getAllAsRecord(): Record<string, Bank>;
42
- /**
43
- * Gets static bank references to be used by the Bank class.
44
- * @returns {Map<string, Bank>} Map of static references
45
- */
46
- getStaticReferences(): Map<string, Bank>;
47
- /**
48
- * Retrieves a bank by its SWIFT code.
49
- * @param {string} swiftCode The SWIFT code of the bank.
50
- * @returns {Bank | undefined} The bank corresponding to the SWIFT code or `undefined` if not found.
51
- */
52
- fromSWIFTCode(swiftCode: string): Bank | undefined;
53
- /**
54
- * Retrieves a bank by its name.
55
- * @param {string} bankName The name of the bank.
56
- * @returns {Bank | undefined} The bank corresponding to the name or `undefined` if not found.
57
- */
58
- fromBankName(bankName: string): Bank | undefined;
59
- /**
60
- * Validates if a given SWIFT/BIC (Bank Identifier Code) is valid.
61
- * @param {string | null | undefined} swiftCode - The SWIFT/BIC code to validate.
62
- * @returns {boolean} Returns true if the SWIFT code is valid, false otherwise.
63
- */
64
- isValidSwiftCode(swiftCode?: string | null): boolean;
65
- /**
66
- * Validates if a given bank name is valid.
67
- * @param {string | null | undefined} bankName - The bank name to validate.
68
- * @returns {boolean} Returns true if the bank name is valid, false otherwise.
69
- */
70
- isValidBankName(bankName?: string | null): boolean;
71
- /**
72
- * Searches for banks that match the given search term.
73
- * @param {string} searchTerm - The partial name or SWIFT code to search for.
74
- * @param {number} [limit=10] - Maximum number of results to return.
75
- * @returns {Bank[]} Array of matching banks, limited to specified count.
76
- */
77
- search(searchTerm: string, limit?: number): Bank[];
78
- /**
79
- * Compares two Bank instances for equality by checking their full name, short name, and SWIFT code
80
- *
81
- * @param {Bank} bank1 - First bank to compare
82
- * @param {Bank} bank2 - Second bank to compare
83
- * @returns {boolean} True if banks are equal, false otherwise
84
- * @private
85
- */
86
- compare(bank1: Bank, bank2: Bank): boolean;
87
- /**
88
- * Retrieves all SWIFT codes from the TZ_BANKS list.
89
- * @returns {string[]} A list of all SWIFT codes in uppercase.
90
- */
91
- getAllSwiftCodes(): string[];
92
- /**
93
- * Checks whether a given SWIFT code is in the correct format.
94
- * @param {string} swiftCode The SWIFT code to check.
95
- * @returns {boolean} `true` if the SWIFT code matches the expected format; `false` otherwise.
96
- */
97
- isValidSwiftCodeFormat(swiftCode: string): boolean;
98
- /**
99
- * Validates whether a given SWIFT code is correct.
100
- * It checks both the SWIFT code format and if the SWIFT code exists in the list of valid codes.
101
- * @param {string} [swiftCode] The SWIFT code to validate.
102
- * @returns {boolean} `true` if valid, otherwise `false`.
103
- */
104
- validateSWIFTCode: (swiftCode?: string) => boolean;
105
- }
106
- //# sourceMappingURL=service.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"service.d.ts","sourceRoot":"","sources":["../../../../src/src/models/bank/service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAGjC;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,QAAgD,CAAC;AAE9E;;;GAGG;AACH,qBAAa,WAAW;IACtB,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAc;IACrC,OAAO,CAAC,QAAQ,CAAc;IAC9B,OAAO,CAAC,UAAU,CAA4B;IAC9C,OAAO,CAAC,WAAW,CAA4B;IAC/C,OAAO,CAAC,gBAAgB,CAA4B;IAGpD,OAAO,CAAC,gBAAgB,CAAgC;IAExD,OAAO;IAEP;;;;;OAKG;IACH,MAAM,CAAC,WAAW,IAAI,WAAW;IAQjC;;;OAGG;IACH,OAAO,CAAC,UAAU;IA0ClB;;;OAGG;IACH,MAAM,IAAI,IAAI,EAAE;IAIhB;;;OAGG;IACH,cAAc,IAAI,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC;IAItC;;;OAGG;IACH,mBAAmB,IAAI,GAAG,CAAC,MAAM,EAAE,IAAI,CAAC;IAIxC;;;;OAIG;IACH,aAAa,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS;IAKlD;;;;OAIG;IACH,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS;IAqChD;;;;OAIG;IACH,gBAAgB,CAAC,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,OAAO;IAKpD;;;;OAIG;IACH,eAAe,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,OAAO;IAKlD;;;;;OAKG;IACH,MAAM,CAAC,UAAU,EAAE,MAAM,EAAE,KAAK,GAAE,MAAW,GAAG,IAAI,EAAE;IAetD;;;;;;;OAOG;IACH,OAAO,CAAC,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,GAAG,OAAO;IAQ1C;;;OAGG;IACH,gBAAgB,IAAI,MAAM,EAAE;IAI5B;;;;OAIG;IACH,sBAAsB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO;IAIlD;;;;;OAKG;IACH,iBAAiB,eAAgB,MAAM,KAAG,OAAO,CAQ/C;CACH"}
@@ -1,247 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.BankService = exports.SWIFT_CODE_REGEX = void 0;
7
- const bank_js_1 = require("./bank.js");
8
- const banks_tz_js_1 = __importDefault(require("../../data/banks_tz.js"));
9
- /**
10
- * Regex pattern to validate SWIFT codes.
11
- * The SWIFT code must follow the format: XXXX XX XX XXX (optional last part for branches).
12
- * @constant {RegExp}
13
- */
14
- exports.SWIFT_CODE_REGEX = /^[A-Z]{4}[A-Z]{2}[A-Z0-9]{2}([A-Z0-9]{3})?$/;
15
- /**
16
- * Service for managing bank data.
17
- * @class BankService
18
- */
19
- class BankService {
20
- constructor() {
21
- Object.defineProperty(this, "bankList", {
22
- enumerable: true,
23
- configurable: true,
24
- writable: true,
25
- value: []
26
- });
27
- Object.defineProperty(this, "bankRecord", {
28
- enumerable: true,
29
- configurable: true,
30
- writable: true,
31
- value: {}
32
- });
33
- Object.defineProperty(this, "banksByName", {
34
- enumerable: true,
35
- configurable: true,
36
- writable: true,
37
- value: {}
38
- });
39
- Object.defineProperty(this, "banksByShortName", {
40
- enumerable: true,
41
- configurable: true,
42
- writable: true,
43
- value: {}
44
- });
45
- // Static references for direct access through Bank class
46
- Object.defineProperty(this, "staticReferences", {
47
- enumerable: true,
48
- configurable: true,
49
- writable: true,
50
- value: new Map()
51
- });
52
- /**
53
- * Validates whether a given SWIFT code is correct.
54
- * It checks both the SWIFT code format and if the SWIFT code exists in the list of valid codes.
55
- * @param {string} [swiftCode] The SWIFT code to validate.
56
- * @returns {boolean} `true` if valid, otherwise `false`.
57
- */
58
- Object.defineProperty(this, "validateSWIFTCode", {
59
- enumerable: true,
60
- configurable: true,
61
- writable: true,
62
- value: (swiftCode) => {
63
- if (!swiftCode)
64
- return false;
65
- const normalizedCode = swiftCode.trim().toUpperCase();
66
- return (this.isValidSwiftCodeFormat(normalizedCode) &&
67
- this.getAllSwiftCodes().includes(normalizedCode));
68
- }
69
- });
70
- }
71
- /**
72
- * Gets the singleton instance of BankService.
73
- * Creates the instance if it doesn't exist.
74
- * @static
75
- * @returns {BankService} The singleton instance
76
- */
77
- static getInstance() {
78
- if (!BankService.instance) {
79
- BankService.instance = new BankService();
80
- BankService.instance.initialize();
81
- }
82
- return BankService.instance;
83
- }
84
- /**
85
- * Initializes the service with bank data.
86
- * Should be called once when your application starts.
87
- */
88
- initialize() {
89
- try {
90
- const data = JSON.parse(JSON.stringify(banks_tz_js_1.default));
91
- const banks = Object.values(data).map((b) => new bank_js_1.Bank(b.fullName, b.shortName, b.swiftCode));
92
- const swiftCodeRecord = {};
93
- const nameRecord = {};
94
- const shortNameRecord = {};
95
- banks.forEach((bank) => {
96
- // Populate records
97
- swiftCodeRecord[bank.swiftCode.toUpperCase()] = bank;
98
- nameRecord[bank.fullName.toUpperCase()] = bank;
99
- shortNameRecord[bank.shortName.toUpperCase()] = bank;
100
- // Add to static references with uppercase short name
101
- const shortName = bank.shortName.toUpperCase();
102
- this.staticReferences.set(shortName, bank);
103
- // Handle bank names with spaces (like "GT BANK")
104
- if (shortName.includes(" ")) {
105
- const noSpaceName = shortName.replace(/\s+/g, "_");
106
- this.staticReferences.set(noSpaceName, bank);
107
- }
108
- });
109
- this.bankRecord = swiftCodeRecord;
110
- this.banksByName = nameRecord;
111
- this.banksByShortName = shortNameRecord;
112
- this.bankList = banks;
113
- }
114
- catch (error) {
115
- console.error("Failed to initialize BankService:", error);
116
- }
117
- }
118
- /**
119
- * Gets all banks.
120
- * @returns {Bank[]} Array of all banks
121
- */
122
- getAll() {
123
- return this.bankList;
124
- }
125
- /**
126
- * Gets all banks as a record.
127
- * @returns {Record<string, Bank>} Record of bank SWIFT codes and bank objects
128
- */
129
- getAllAsRecord() {
130
- return this.bankRecord;
131
- }
132
- /**
133
- * Gets static bank references to be used by the Bank class.
134
- * @returns {Map<string, Bank>} Map of static references
135
- */
136
- getStaticReferences() {
137
- return this.staticReferences;
138
- }
139
- /**
140
- * Retrieves a bank by its SWIFT code.
141
- * @param {string} swiftCode The SWIFT code of the bank.
142
- * @returns {Bank | undefined} The bank corresponding to the SWIFT code or `undefined` if not found.
143
- */
144
- fromSWIFTCode(swiftCode) {
145
- if (!swiftCode || typeof swiftCode !== "string")
146
- return;
147
- return this.bankRecord[swiftCode.toUpperCase()];
148
- }
149
- /**
150
- * Retrieves a bank by its name.
151
- * @param {string} bankName The name of the bank.
152
- * @returns {Bank | undefined} The bank corresponding to the name or `undefined` if not found.
153
- */
154
- fromBankName(bankName) {
155
- if (!bankName || typeof bankName !== "string")
156
- return;
157
- // First try shortname exact match
158
- const bankByShortName = this.banksByShortName[bankName.toUpperCase()];
159
- if (bankByShortName)
160
- return bankByShortName;
161
- // Next try fullname exact match
162
- const bankByName = this.banksByName[bankName.toUpperCase()];
163
- if (bankByName)
164
- return bankByName;
165
- // If not found, try more lenient matching on full name
166
- for (const [name, bankObj] of Object.entries(this.banksByName)) {
167
- if (bankName.toUpperCase() === name.toUpperCase()) {
168
- return bankObj;
169
- }
170
- }
171
- // Try lenient matching on short name
172
- for (const [shortName, bankObj] of Object.entries(this.banksByShortName)) {
173
- if (bankName.toUpperCase() === shortName.toUpperCase()) {
174
- return bankObj;
175
- }
176
- }
177
- // Legacy fallback - case insensitive exact match
178
- return this.bankList.find((bank) => bank.fullName.toLowerCase() === bankName.toLowerCase() ||
179
- bankName.toLowerCase() === bank.shortName.toLowerCase());
180
- }
181
- /**
182
- * Validates if a given SWIFT/BIC (Bank Identifier Code) is valid.
183
- * @param {string | null | undefined} swiftCode - The SWIFT/BIC code to validate.
184
- * @returns {boolean} Returns true if the SWIFT code is valid, false otherwise.
185
- */
186
- isValidSwiftCode(swiftCode) {
187
- if (!swiftCode)
188
- return false;
189
- return !!this.fromSWIFTCode(swiftCode);
190
- }
191
- /**
192
- * Validates if a given bank name is valid.
193
- * @param {string | null | undefined} bankName - The bank name to validate.
194
- * @returns {boolean} Returns true if the bank name is valid, false otherwise.
195
- */
196
- isValidBankName(bankName) {
197
- if (!bankName)
198
- return false;
199
- return !!this.fromBankName(bankName);
200
- }
201
- /**
202
- * Searches for banks that match the given search term.
203
- * @param {string} searchTerm - The partial name or SWIFT code to search for.
204
- * @param {number} [limit=10] - Maximum number of results to return.
205
- * @returns {Bank[]} Array of matching banks, limited to specified count.
206
- */
207
- search(searchTerm, limit = 10) {
208
- if (!searchTerm || typeof searchTerm !== "string")
209
- return [];
210
- const term = searchTerm.toLowerCase().trim();
211
- if (term.length === 0)
212
- return [];
213
- const results = this.bankList.filter((bank) => bank.fullName.toLowerCase().includes(term) ||
214
- bank.shortName.toLowerCase().includes(term) ||
215
- bank.swiftCode.toLowerCase().includes(term));
216
- return results.slice(0, limit);
217
- }
218
- /**
219
- * Compares two Bank instances for equality by checking their full name, short name, and SWIFT code
220
- *
221
- * @param {Bank} bank1 - First bank to compare
222
- * @param {Bank} bank2 - Second bank to compare
223
- * @returns {boolean} True if banks are equal, false otherwise
224
- * @private
225
- */
226
- compare(bank1, bank2) {
227
- return (bank1.fullName === bank2.fullName &&
228
- bank1.shortName === bank2.shortName &&
229
- bank1.swiftCode === bank2.swiftCode);
230
- }
231
- /**
232
- * Retrieves all SWIFT codes from the TZ_BANKS list.
233
- * @returns {string[]} A list of all SWIFT codes in uppercase.
234
- */
235
- getAllSwiftCodes() {
236
- return this.bankList.map((bank) => bank.swiftCode.toUpperCase());
237
- }
238
- /**
239
- * Checks whether a given SWIFT code is in the correct format.
240
- * @param {string} swiftCode The SWIFT code to check.
241
- * @returns {boolean} `true` if the SWIFT code matches the expected format; `false` otherwise.
242
- */
243
- isValidSwiftCodeFormat(swiftCode) {
244
- return exports.SWIFT_CODE_REGEX.test(swiftCode);
245
- }
246
- }
247
- exports.BankService = BankService;
@@ -1,111 +0,0 @@
1
- import { CONTINENT, Country, SUB_REGION } from "./country.js";
2
- /**
3
- * Service for managing country data.
4
- * @class CountryService
5
- */
6
- export declare class CountryService {
7
- private static instance;
8
- private countryList;
9
- private codeRecord;
10
- private iso3Record;
11
- private nameRecord;
12
- private continentRecord;
13
- private regionRecord;
14
- private staticReferences;
15
- private constructor();
16
- /**
17
- * Gets the singleton instance of CountryService.
18
- * Creates the instance if it doesn't exist.
19
- * @static
20
- * @returns {CountryService} The singleton instance
21
- */
22
- static getInstance(): CountryService;
23
- /**
24
- * Maps a string continent name to the CONTINENT enum
25
- * @param continentName String continent name from JSON
26
- * @returns The corresponding CONTINENT enum value
27
- */
28
- private mapContinent;
29
- /**
30
- * Maps a string region name to the SUB_REGION enum
31
- * @param regionName String region name from JSON
32
- * @returns The corresponding SUB_REGION enum value
33
- */
34
- private mapRegion;
35
- /**
36
- * Initializes the service with country data.
37
- * Should be called once when your application starts.
38
- */
39
- private initialize;
40
- /**
41
- * Initialize the static properties on the Country class
42
- */
43
- private initializeCountryStatics;
44
- /**
45
- * Gets all countries.
46
- * @returns {Country[]} Array of all countries
47
- */
48
- getAll(): Country[];
49
- /**
50
- * Gets static country references to be used by the Country class.
51
- * @returns {Map<string, Country>} Map of static references
52
- */
53
- getStaticReferences(): Map<string, Country>;
54
- /**
55
- * Gets all countries as a record.
56
- * @returns {Record<string, Country>} Record of country codes and country objects
57
- */
58
- getAllAsRecord(): Record<string, Country>;
59
- /**
60
- * Gets all countries from a specific continent.
61
- * @param {CONTINENT} continent The continent enum value
62
- * @returns {Country[]} Array of countries in the specified continent
63
- */
64
- getByContinent(continent: CONTINENT): Country[];
65
- /**
66
- * Gets all countries from a specific region.
67
- * @param {SUB_REGION} region The region enum value
68
- * @returns {Country[]} Array of countries in the specified region
69
- */
70
- getByRegion(region: SUB_REGION): Country[];
71
- /**
72
- * Gets the full name record mapping.
73
- * @returns {Record<string, Country>} Record of uppercase full name keys to country objects
74
- */
75
- getFullNameRecord(): Record<string, Country>;
76
- /**
77
- * Retrieves a country by its ISO-2 code.
78
- * @param {string} code The ISO-2 code of the country.
79
- * @returns {Country | undefined} The country corresponding to the ISO code or `undefined` if not found.
80
- */
81
- fromCode(code: string): Country | undefined;
82
- /**
83
- * Retrieves a country by its ISO-3 code.
84
- * @param {string} iso3 The ISO-3 code of the country.
85
- * @returns {Country | undefined} The country corresponding to the ISO-3 code or `undefined` if not found.
86
- */
87
- fromIso3(iso3: string): Country | undefined;
88
- /**
89
- * Retrieves a country by its name.
90
- * @param {string} countryName The name of the country.
91
- * @returns {Country | undefined} The country corresponding to the name or `undefined` if not found.
92
- */
93
- fromName(countryName: string): Country | undefined;
94
- /**
95
- * Searches for countries that match the given search term.
96
- * @param {string} searchTerm - The partial name or code to search for.
97
- * @param {number} [limit=10] - Maximum number of results to return.
98
- * @returns {Country[]} Array of matching countries, limited to specified count.
99
- */
100
- search(searchTerm: string, limit?: number): Country[];
101
- /**
102
- * Compares two Country instances for equality by checking their name and code
103
- *
104
- * @param {Country} country1 - First country to compare
105
- * @param {Country} country2 - Second country to compare
106
- * @returns {boolean} True if countries are equal, false otherwise
107
- * @private
108
- */
109
- compare(country1: Country, country2: Country): boolean;
110
- }
111
- //# sourceMappingURL=service.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"service.d.ts","sourceRoot":"","sources":["../../../../src/src/models/country/service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAG9D;;;GAGG;AACH,qBAAa,cAAc;IACzB,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAiB;IACxC,OAAO,CAAC,WAAW,CAAiB;IACpC,OAAO,CAAC,UAAU,CAA+B;IACjD,OAAO,CAAC,UAAU,CAA+B;IAEjD,OAAO,CAAC,UAAU,CAA+B;IACjD,OAAO,CAAC,eAAe,CAGrB;IACF,OAAO,CAAC,YAAY,CAGlB;IAGF,OAAO,CAAC,gBAAgB,CAAmC;IAE3D,OAAO;IAEP;;;;;OAKG;IACH,MAAM,CAAC,WAAW,IAAI,cAAc;IAQpC;;;;OAIG;IACH,OAAO,CAAC,YAAY;IAqBpB;;;;OAIG;IACH,OAAO,CAAC,SAAS;IAiDjB;;;OAGG;IACH,OAAO,CAAC,UAAU;IAqIlB;;OAEG;IACH,OAAO,CAAC,wBAAwB;IAchC;;;OAGG;IACH,MAAM,IAAI,OAAO,EAAE;IAInB;;;OAGG;IACH,mBAAmB,IAAI,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC;IAI3C;;;OAGG;IACH,cAAc,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAIzC;;;;OAIG;IACH,cAAc,CAAC,SAAS,EAAE,SAAS,GAAG,OAAO,EAAE;IAI/C;;;;OAIG;IACH,WAAW,CAAC,MAAM,EAAE,UAAU,GAAG,OAAO,EAAE;IAI1C;;;OAGG;IACH,iBAAiB,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAI5C;;;;OAIG;IACH,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,GAAG,SAAS;IAI3C;;;;OAIG;IACH,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,GAAG,SAAS;IAI3C;;;;OAIG;IACH,QAAQ,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,GAAG,SAAS;IAgBlD;;;;;OAKG;IACH,MAAM,CAAC,UAAU,EAAE,MAAM,EAAE,KAAK,GAAE,MAAW,GAAG,OAAO,EAAE;IAgBzD;;;;;;;OAOG;IACH,OAAO,CAAC,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,GAAG,OAAO;CAMvD"}