pakdatakit 1.1.0 → 2.1.1

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 (127) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +909 -666
  3. package/dist/address.cjs +17 -0
  4. package/dist/address.d.cts +36 -0
  5. package/dist/address.d.ts +36 -0
  6. package/dist/address.js +4 -0
  7. package/dist/chunk-3COX5FSL.cjs +1650 -0
  8. package/dist/chunk-432ZYMYV.js +31 -0
  9. package/dist/chunk-43ULDYUP.cjs +235 -0
  10. package/dist/chunk-44YRK7WO.js +231 -0
  11. package/dist/chunk-4EUKCSLW.js +221 -0
  12. package/dist/chunk-4VVFS6FN.cjs +715 -0
  13. package/dist/chunk-6TSKA2PH.js +38 -0
  14. package/dist/chunk-APXP7OK7.cjs +226 -0
  15. package/dist/chunk-AUATLZA5.cjs +168 -0
  16. package/dist/chunk-BSS4Z7NI.cjs +422 -0
  17. package/dist/chunk-CEPNSHIC.js +33 -0
  18. package/dist/chunk-CYJJ7KGC.cjs +108 -0
  19. package/dist/chunk-E47SNBWQ.cjs +224 -0
  20. package/dist/chunk-E7GAK72W.js +20 -0
  21. package/dist/chunk-EEVNLTB4.js +32 -0
  22. package/dist/chunk-ENQ7O7VW.js +32 -0
  23. package/dist/chunk-H6M6L26S.cjs +37 -0
  24. package/dist/chunk-HBOZIITD.js +351 -0
  25. package/dist/chunk-HTCSHHOR.cjs +35 -0
  26. package/dist/chunk-JKE4AMSZ.js +47 -0
  27. package/dist/chunk-JNP27XW2.cjs +22 -0
  28. package/dist/chunk-K6CZFCX6.js +1642 -0
  29. package/dist/chunk-KEHCTYLO.cjs +52 -0
  30. package/dist/chunk-KQKW2ZEK.cjs +18 -0
  31. package/dist/chunk-L2BDDM2W.js +165 -0
  32. package/dist/chunk-L45UXUWX.js +21 -0
  33. package/dist/chunk-LIYNKIKS.js +709 -0
  34. package/dist/chunk-LVHTH4P7.cjs +41 -0
  35. package/dist/chunk-P4CGOJEM.js +16 -0
  36. package/dist/chunk-PHHKIMO2.cjs +35 -0
  37. package/dist/chunk-QQQKISXT.js +223 -0
  38. package/dist/chunk-T3E4B5MJ.js +417 -0
  39. package/dist/chunk-VPBMIYO2.cjs +38 -0
  40. package/dist/chunk-XCXFGTHW.cjs +355 -0
  41. package/dist/chunk-Y6BUGLXU.js +95 -0
  42. package/dist/chunk-YLWZGSFY.cjs +99 -0
  43. package/dist/chunk-YS7MOLK2.cjs +23 -0
  44. package/dist/chunk-Z5JEIQVW.js +102 -0
  45. package/dist/cli.js +78 -2654
  46. package/dist/cnic.cjs +15 -0
  47. package/dist/cnic.d.cts +35 -0
  48. package/dist/cnic.d.ts +35 -0
  49. package/dist/cnic.js +2 -0
  50. package/dist/format.cjs +14 -0
  51. package/dist/format.d.cts +27 -0
  52. package/dist/format.d.ts +27 -0
  53. package/dist/format.js +1 -0
  54. package/dist/geo.cjs +27 -0
  55. package/dist/geo.d.cts +43 -0
  56. package/dist/geo.d.ts +43 -0
  57. package/dist/geo.js +2 -0
  58. package/dist/hijri.cjs +26 -0
  59. package/dist/hijri.d.cts +62 -0
  60. package/dist/hijri.d.ts +62 -0
  61. package/dist/hijri.js +1 -0
  62. package/dist/holidays.cjs +19 -0
  63. package/dist/holidays.d.cts +72 -0
  64. package/dist/holidays.d.ts +72 -0
  65. package/dist/holidays.js +2 -0
  66. package/dist/iban.cjs +15 -0
  67. package/dist/iban.d.cts +21 -0
  68. package/dist/iban.d.ts +21 -0
  69. package/dist/iban.js +2 -0
  70. package/dist/index.cjs +211 -0
  71. package/dist/index.d.cts +16 -0
  72. package/dist/index.d.ts +16 -300
  73. package/dist/index.js +18 -2764
  74. package/dist/networks.cjs +12 -0
  75. package/dist/networks.d.cts +20 -0
  76. package/dist/networks.d.ts +20 -0
  77. package/dist/networks.js +3 -0
  78. package/dist/numbers.cjs +24 -0
  79. package/dist/numbers.d.cts +53 -0
  80. package/dist/numbers.d.ts +53 -0
  81. package/dist/numbers.js +3 -0
  82. package/dist/phone.cjs +29 -0
  83. package/dist/phone.d.cts +56 -0
  84. package/dist/phone.d.ts +56 -0
  85. package/dist/phone.js +4 -0
  86. package/dist/postal.cjs +27 -0
  87. package/dist/postal.d.cts +40 -0
  88. package/dist/postal.d.ts +40 -0
  89. package/dist/postal.js +2 -0
  90. package/dist/raast.cjs +20 -0
  91. package/dist/raast.d.cts +125 -0
  92. package/dist/raast.d.ts +125 -0
  93. package/dist/raast.js +3 -0
  94. package/dist/rules-GxgPiVws.d.cts +7 -0
  95. package/dist/rules-GxgPiVws.d.ts +7 -0
  96. package/dist/tax.cjs +20 -0
  97. package/dist/tax.d.cts +47 -0
  98. package/dist/tax.d.ts +47 -0
  99. package/dist/tax.js +3 -0
  100. package/dist/text.cjs +23 -0
  101. package/dist/text.d.cts +34 -0
  102. package/dist/text.d.ts +34 -0
  103. package/dist/text.js +2 -0
  104. package/dist/valibot.cjs +47 -0
  105. package/dist/valibot.d.cts +22 -0
  106. package/dist/valibot.d.ts +22 -0
  107. package/dist/valibot.js +25 -0
  108. package/dist/whatsapp.cjs +12 -0
  109. package/dist/whatsapp.d.cts +12 -0
  110. package/dist/whatsapp.d.ts +12 -0
  111. package/dist/whatsapp.js +3 -0
  112. package/dist/words.cjs +14 -0
  113. package/dist/words.d.cts +49 -0
  114. package/dist/words.d.ts +49 -0
  115. package/dist/words.js +1 -0
  116. package/dist/yup.cjs +32 -0
  117. package/dist/yup.d.cts +22 -0
  118. package/dist/yup.d.ts +22 -0
  119. package/dist/yup.js +30 -0
  120. package/dist/zod.cjs +27 -0
  121. package/dist/zod.d.cts +22 -0
  122. package/dist/zod.d.ts +22 -0
  123. package/dist/zod.js +25 -0
  124. package/package.json +309 -77
  125. package/dist/cli.d.ts +0 -1
  126. package/dist/cli.js.map +0 -1
  127. package/dist/index.js.map +0 -1
package/dist/iban.d.ts ADDED
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Validates a Pakistani IBAN using format and ISO 13616 mod-97 checksum.
3
+ *
4
+ * Accepts spaced or unspaced input. Only `PK` IBANs of exactly 24 characters
5
+ * are supported.
6
+ *
7
+ * @param iban - IBAN string to validate
8
+ * @returns `true` if valid, otherwise `false`
9
+ */
10
+ declare function validateIBAN(iban: string): boolean;
11
+ /**
12
+ * Returns the bank name for a valid Pakistani IBAN based on its 4-letter bank code.
13
+ *
14
+ * Returns `null` when the IBAN is invalid or the bank code is not in the dataset.
15
+ *
16
+ * @param iban - IBAN string to look up
17
+ * @returns Bank name or `null` if not found
18
+ */
19
+ declare function getBankFromIBAN(iban: string): string | null;
20
+
21
+ export { getBankFromIBAN, validateIBAN };
package/dist/iban.js ADDED
@@ -0,0 +1,2 @@
1
+ export { getBankFromIBAN, validateIBAN } from './chunk-4EUKCSLW.js';
2
+ import './chunk-ENQ7O7VW.js';
package/dist/index.cjs ADDED
@@ -0,0 +1,211 @@
1
+ 'use strict';
2
+
3
+ var chunkAPXP7OK7_cjs = require('./chunk-APXP7OK7.cjs');
4
+ var chunkBSS4Z7NI_cjs = require('./chunk-BSS4Z7NI.cjs');
5
+ var chunkPHHKIMO2_cjs = require('./chunk-PHHKIMO2.cjs');
6
+ var chunkYS7MOLK2_cjs = require('./chunk-YS7MOLK2.cjs');
7
+ var chunk43ULDYUP_cjs = require('./chunk-43ULDYUP.cjs');
8
+ var chunkH6M6L26S_cjs = require('./chunk-H6M6L26S.cjs');
9
+ var chunkKEHCTYLO_cjs = require('./chunk-KEHCTYLO.cjs');
10
+ var chunkKQKW2ZEK_cjs = require('./chunk-KQKW2ZEK.cjs');
11
+ require('./chunk-YLWZGSFY.cjs');
12
+ var chunkAUATLZA5_cjs = require('./chunk-AUATLZA5.cjs');
13
+ var chunk4VVFS6FN_cjs = require('./chunk-4VVFS6FN.cjs');
14
+ var chunkHTCSHHOR_cjs = require('./chunk-HTCSHHOR.cjs');
15
+ var chunkLVHTH4P7_cjs = require('./chunk-LVHTH4P7.cjs');
16
+ var chunk3COX5FSL_cjs = require('./chunk-3COX5FSL.cjs');
17
+ var chunkXCXFGTHW_cjs = require('./chunk-XCXFGTHW.cjs');
18
+ var chunkCYJJ7KGC_cjs = require('./chunk-CYJJ7KGC.cjs');
19
+ var chunkE47SNBWQ_cjs = require('./chunk-E47SNBWQ.cjs');
20
+ require('./chunk-VPBMIYO2.cjs');
21
+
22
+
23
+
24
+ Object.defineProperty(exports, "amountInWords", {
25
+ enumerable: true,
26
+ get: function () { return chunkAPXP7OK7_cjs.amountInWords; }
27
+ });
28
+ Object.defineProperty(exports, "numberToWords", {
29
+ enumerable: true,
30
+ get: function () { return chunkAPXP7OK7_cjs.numberToWords; }
31
+ });
32
+ Object.defineProperty(exports, "analyzeNumber", {
33
+ enumerable: true,
34
+ get: function () { return chunkBSS4Z7NI_cjs.analyzeNumber; }
35
+ });
36
+ Object.defineProperty(exports, "getAreaCode", {
37
+ enumerable: true,
38
+ get: function () { return chunkBSS4Z7NI_cjs.getAreaCode; }
39
+ });
40
+ Object.defineProperty(exports, "getNumberType", {
41
+ enumerable: true,
42
+ get: function () { return chunkBSS4Z7NI_cjs.getNumberType; }
43
+ });
44
+ Object.defineProperty(exports, "validateLandline", {
45
+ enumerable: true,
46
+ get: function () { return chunkBSS4Z7NI_cjs.validateLandline; }
47
+ });
48
+ Object.defineProperty(exports, "analyzePhone", {
49
+ enumerable: true,
50
+ get: function () { return chunkPHHKIMO2_cjs.analyzePhone; }
51
+ });
52
+ Object.defineProperty(exports, "formatPhone", {
53
+ enumerable: true,
54
+ get: function () { return chunkPHHKIMO2_cjs.formatPhone; }
55
+ });
56
+ Object.defineProperty(exports, "validatePhone", {
57
+ enumerable: true,
58
+ get: function () { return chunkPHHKIMO2_cjs.validatePhone; }
59
+ });
60
+ Object.defineProperty(exports, "getNetwork", {
61
+ enumerable: true,
62
+ get: function () { return chunkYS7MOLK2_cjs.getNetwork; }
63
+ });
64
+ Object.defineProperty(exports, "createMerchantQr", {
65
+ enumerable: true,
66
+ get: function () { return chunk43ULDYUP_cjs.createMerchantQr; }
67
+ });
68
+ Object.defineProperty(exports, "createRaastP2PQr", {
69
+ enumerable: true,
70
+ get: function () { return chunk43ULDYUP_cjs.createRaastP2PQr; }
71
+ });
72
+ Object.defineProperty(exports, "parseRaastQr", {
73
+ enumerable: true,
74
+ get: function () { return chunk43ULDYUP_cjs.parseRaastQr; }
75
+ });
76
+ Object.defineProperty(exports, "analyzeNTN", {
77
+ enumerable: true,
78
+ get: function () { return chunkH6M6L26S_cjs.analyzeNTN; }
79
+ });
80
+ Object.defineProperty(exports, "validateNTN", {
81
+ enumerable: true,
82
+ get: function () { return chunkH6M6L26S_cjs.validateNTN; }
83
+ });
84
+ Object.defineProperty(exports, "validateSTRN", {
85
+ enumerable: true,
86
+ get: function () { return chunkH6M6L26S_cjs.validateSTRN; }
87
+ });
88
+ Object.defineProperty(exports, "normalizeRomanUrdu", {
89
+ enumerable: true,
90
+ get: function () { return chunkKEHCTYLO_cjs.normalizeRomanUrdu; }
91
+ });
92
+ Object.defineProperty(exports, "normalizeText", {
93
+ enumerable: true,
94
+ get: function () { return chunkKEHCTYLO_cjs.normalizeText; }
95
+ });
96
+ Object.defineProperty(exports, "toEnglishDigits", {
97
+ enumerable: true,
98
+ get: function () { return chunkKEHCTYLO_cjs.toEnglishDigits; }
99
+ });
100
+ Object.defineProperty(exports, "toUrduDigits", {
101
+ enumerable: true,
102
+ get: function () { return chunkKEHCTYLO_cjs.toUrduDigits; }
103
+ });
104
+ Object.defineProperty(exports, "createWhatsAppLink", {
105
+ enumerable: true,
106
+ get: function () { return chunkKQKW2ZEK_cjs.createWhatsAppLink; }
107
+ });
108
+ Object.defineProperty(exports, "formatAddress", {
109
+ enumerable: true,
110
+ get: function () { return chunkAUATLZA5_cjs.formatAddress; }
111
+ });
112
+ Object.defineProperty(exports, "parseAddress", {
113
+ enumerable: true,
114
+ get: function () { return chunkAUATLZA5_cjs.parseAddress; }
115
+ });
116
+ Object.defineProperty(exports, "getCityByPostalCode", {
117
+ enumerable: true,
118
+ get: function () { return chunk4VVFS6FN_cjs.getCityByPostalCode; }
119
+ });
120
+ Object.defineProperty(exports, "getPostalAreas", {
121
+ enumerable: true,
122
+ get: function () { return chunk4VVFS6FN_cjs.getPostalAreas; }
123
+ });
124
+ Object.defineProperty(exports, "getPostalCode", {
125
+ enumerable: true,
126
+ get: function () { return chunk4VVFS6FN_cjs.getPostalCode; }
127
+ });
128
+ Object.defineProperty(exports, "getPostalCodes", {
129
+ enumerable: true,
130
+ get: function () { return chunk4VVFS6FN_cjs.getPostalCodes; }
131
+ });
132
+ Object.defineProperty(exports, "searchPostalCodes", {
133
+ enumerable: true,
134
+ get: function () { return chunk4VVFS6FN_cjs.searchPostalCodes; }
135
+ });
136
+ Object.defineProperty(exports, "getCNICInfo", {
137
+ enumerable: true,
138
+ get: function () { return chunkHTCSHHOR_cjs.getCNICInfo; }
139
+ });
140
+ Object.defineProperty(exports, "validateCNIC", {
141
+ enumerable: true,
142
+ get: function () { return chunkHTCSHHOR_cjs.validateCNIC; }
143
+ });
144
+ Object.defineProperty(exports, "formatLakh", {
145
+ enumerable: true,
146
+ get: function () { return chunkLVHTH4P7_cjs.formatLakh; }
147
+ });
148
+ Object.defineProperty(exports, "formatPKR", {
149
+ enumerable: true,
150
+ get: function () { return chunkLVHTH4P7_cjs.formatPKR; }
151
+ });
152
+ Object.defineProperty(exports, "getDistrictProvince", {
153
+ enumerable: true,
154
+ get: function () { return chunk3COX5FSL_cjs.getDistrictProvince; }
155
+ });
156
+ Object.defineProperty(exports, "getDistrictsByProvince", {
157
+ enumerable: true,
158
+ get: function () { return chunk3COX5FSL_cjs.getDistrictsByProvince; }
159
+ });
160
+ Object.defineProperty(exports, "getProvince", {
161
+ enumerable: true,
162
+ get: function () { return chunk3COX5FSL_cjs.getProvince; }
163
+ });
164
+ Object.defineProperty(exports, "searchCities", {
165
+ enumerable: true,
166
+ get: function () { return chunk3COX5FSL_cjs.searchCities; }
167
+ });
168
+ Object.defineProperty(exports, "searchDistricts", {
169
+ enumerable: true,
170
+ get: function () { return chunk3COX5FSL_cjs.searchDistricts; }
171
+ });
172
+ Object.defineProperty(exports, "getHolidaysOn", {
173
+ enumerable: true,
174
+ get: function () { return chunkXCXFGTHW_cjs.getHolidaysOn; }
175
+ });
176
+ Object.defineProperty(exports, "getPakistanHolidays", {
177
+ enumerable: true,
178
+ get: function () { return chunkXCXFGTHW_cjs.getPakistanHolidays; }
179
+ });
180
+ Object.defineProperty(exports, "isPakistanHoliday", {
181
+ enumerable: true,
182
+ get: function () { return chunkXCXFGTHW_cjs.isPakistanHoliday; }
183
+ });
184
+ Object.defineProperty(exports, "formatHijri", {
185
+ enumerable: true,
186
+ get: function () { return chunkCYJJ7KGC_cjs.formatHijri; }
187
+ });
188
+ Object.defineProperty(exports, "fromHijri", {
189
+ enumerable: true,
190
+ get: function () { return chunkCYJJ7KGC_cjs.fromHijri; }
191
+ });
192
+ Object.defineProperty(exports, "getHijriMonthName", {
193
+ enumerable: true,
194
+ get: function () { return chunkCYJJ7KGC_cjs.getHijriMonthName; }
195
+ });
196
+ Object.defineProperty(exports, "isRamadan", {
197
+ enumerable: true,
198
+ get: function () { return chunkCYJJ7KGC_cjs.isRamadan; }
199
+ });
200
+ Object.defineProperty(exports, "toHijri", {
201
+ enumerable: true,
202
+ get: function () { return chunkCYJJ7KGC_cjs.toHijri; }
203
+ });
204
+ Object.defineProperty(exports, "getBankFromIBAN", {
205
+ enumerable: true,
206
+ get: function () { return chunkE47SNBWQ_cjs.getBankFromIBAN; }
207
+ });
208
+ Object.defineProperty(exports, "validateIBAN", {
209
+ enumerable: true,
210
+ get: function () { return chunkE47SNBWQ_cjs.validateIBAN; }
211
+ });
@@ -0,0 +1,16 @@
1
+ export { CNICInfo, getCNICInfo, validateCNIC } from './cnic.cjs';
2
+ export { PhoneAnalysis, analyzePhone, formatPhone, validatePhone } from './phone.cjs';
3
+ export { NetworkName, getNetwork } from './networks.cjs';
4
+ export { getDistrictProvince, getDistrictsByProvince, getProvince, searchCities, searchDistricts } from './geo.cjs';
5
+ export { formatLakh, formatPKR } from './format.cjs';
6
+ export { createWhatsAppLink } from './whatsapp.cjs';
7
+ export { getBankFromIBAN, validateIBAN } from './iban.cjs';
8
+ export { getCityByPostalCode, getPostalAreas, getPostalCode, getPostalCodes, searchPostalCodes } from './postal.cjs';
9
+ export { ParsedAddress, formatAddress, parseAddress } from './address.cjs';
10
+ export { normalizeRomanUrdu, normalizeText, toEnglishDigits, toUrduDigits } from './text.cjs';
11
+ export { HijriDate, HijriOptions, formatHijri, fromHijri, getHijriMonthName, isRamadan, toHijri } from './hijri.cjs';
12
+ export { AmountInWordsOptions, NumberToWordsOptions, WordsLanguage, amountInWords, numberToWords } from './words.cjs';
13
+ export { NTNInfo, NTNType, analyzeNTN, validateNTN, validateSTRN } from './tax.cjs';
14
+ export { NumberInfo, NumberType, analyzeNumber, getAreaCode, getNumberType, validateLandline } from './numbers.cjs';
15
+ export { MerchantAccountInfo, MerchantQrOptions, ParsedRaastQr, RaastP2PQrOptions, createMerchantQr, createRaastP2PQr, parseRaastQr } from './raast.cjs';
16
+ export { Holiday, HolidayId, HolidayOptions, IslamicHolidayId, getHolidaysOn, getPakistanHolidays, isPakistanHoliday } from './holidays.cjs';
package/dist/index.d.ts CHANGED
@@ -1,300 +1,16 @@
1
- /**
2
- * Validates a Pakistani CNIC number.
3
- *
4
- * Accepts formats with or without dashes/spaces (e.g. `3520212345671` or `35202-1234567-1`).
5
- * Strips separators before checking for exactly 13 numeric digits.
6
- *
7
- * @param cnic - The CNIC string to validate
8
- * @returns `true` if the CNIC is valid, otherwise `false`
9
- */
10
- declare function validateCNIC(cnic: string): boolean;
11
-
12
- type NetworkName = 'Jazz' | 'Zong' | 'Telenor' | 'Ufone' | 'Unknown';
13
- /**
14
- * Detects the mobile network for a Pakistani phone number based on its prefix.
15
- *
16
- * Returns the original issuing network (Jazz, Zong, Telenor, or Ufone).
17
- * Due to Mobile Number Portability (MNP), the current carrier may differ.
18
- *
19
- * @param phone - The phone number to look up
20
- * @returns Network name or `"Unknown"` if the prefix is not recognized
21
- */
22
- declare function getNetwork(phone: string): NetworkName;
23
-
24
- /** Combined phone validation, formatting, and network analysis result. */
25
- interface PhoneAnalysis {
26
- valid: boolean;
27
- formatted: string | null;
28
- network: NetworkName;
29
- }
30
- /**
31
- * Validates a Pakistani mobile phone number.
32
- *
33
- * Accepts local (`03001234567`), international (`+923001234567`),
34
- * and short (`3001234567`) formats. Ignores spaces and dashes.
35
- *
36
- * @param phone - The phone number string to validate
37
- * @returns `true` if valid, otherwise `false`
38
- */
39
- declare function validatePhone(phone: string): boolean;
40
- /**
41
- * Formats a Pakistani mobile number to international E.164 style (`+923001234567`).
42
- *
43
- * Returns an empty string when the input is not a valid Pakistani mobile number.
44
- *
45
- * @param phone - The phone number string to format
46
- * @returns Formatted phone number or empty string if invalid
47
- */
48
- declare function formatPhone(phone: string): string;
49
-
50
- /**
51
- * Analyzes a Pakistani mobile number in a single call.
52
- *
53
- * Combines validation, E.164 formatting, and network detection.
54
- * Invalid numbers return `{ valid: false, formatted: null, network: "Unknown" }`.
55
- *
56
- * @param phone - Phone number in any supported format
57
- * @returns Structured phone analysis result
58
- */
59
- declare function analyzePhone(phone: string): PhoneAnalysis;
60
-
61
- /**
62
- * Returns the province for a given Pakistani city name.
63
- *
64
- * Matching is case-insensitive and ignores inconsistent spacing.
65
- * Returns `null` when no exact city match is found.
66
- *
67
- * @param city - The city name to look up
68
- * @returns Province name or `null` if not found
69
- */
70
- declare function getProvince(city: string): string | null;
71
- /**
72
- * Searches cities by partial, case-insensitive name match.
73
- *
74
- * @param query - Partial city name to search for
75
- * @returns Alphabetically sorted list of matching city names
76
- */
77
- declare function searchCities(query: string): string[];
78
- /**
79
- * Returns the province for a given Pakistani district name.
80
- *
81
- * Matching is case-insensitive and ignores inconsistent spacing.
82
- * Returns `null` when no exact district match is found.
83
- *
84
- * @param district - The district name to look up
85
- * @returns Province name or `null` if not found
86
- */
87
- declare function getDistrictProvince(district: string): string | null;
88
- /**
89
- * Searches districts by partial, case-insensitive name match.
90
- *
91
- * @param query - Partial district name to search for
92
- * @returns Alphabetically sorted list of matching district names
93
- */
94
- declare function searchDistricts(query: string): string[];
95
- /**
96
- * Returns all districts for a given province (case-insensitive).
97
- *
98
- * @param province - Province name to filter by
99
- * @returns Alphabetically sorted district names
100
- */
101
- declare function getDistrictsByProvince(province: string): string[];
102
-
103
- /**
104
- * Formats a numeric amount as Pakistani Rupees with comma separators.
105
- *
106
- * Non-finite values and negative amounts are treated as zero.
107
- *
108
- * @param amount - The amount in PKR
109
- * @returns Formatted string (e.g. `"Rs. 150,000"`)
110
- */
111
- declare function formatPKR(amount: number): string;
112
- /**
113
- * Formats a numeric amount using Pakistani lakh/crore conventions.
114
- *
115
- * - Amounts >= 1 crore render as `"N Crore"` (e.g. `10000000` → `"1 Crore"`)
116
- * - Amounts >= 1 lakh render as `"N Lakh"` (e.g. `2500000` → `"25 Lakh"`)
117
- * - Smaller amounts fall back to {@link formatPKR}
118
- *
119
- * Non-finite values and negative amounts are treated as zero.
120
- *
121
- * @param amount - The amount in PKR
122
- * @returns Human-readable lakh/crore string
123
- */
124
- declare function formatLakh(amount: number): string;
125
-
126
- /**
127
- * Creates a WhatsApp click-to-chat link for a Pakistani mobile number.
128
- *
129
- * Accepts local, international, and short phone formats. Returns an empty
130
- * string when the phone number is invalid.
131
- *
132
- * @param phone - Pakistani mobile number in any supported format
133
- * @param message - Optional pre-filled message (URL-encoded)
134
- * @returns WhatsApp wa.me link or empty string if invalid
135
- */
136
- declare function createWhatsAppLink(phone: string, message?: string): string;
137
-
138
- /**
139
- * Validates a Pakistani IBAN using format and ISO 13616 mod-97 checksum.
140
- *
141
- * Accepts spaced or unspaced input. Only `PK` IBANs of exactly 24 characters
142
- * are supported.
143
- *
144
- * @param iban - IBAN string to validate
145
- * @returns `true` if valid, otherwise `false`
146
- */
147
- declare function validateIBAN(iban: string): boolean;
148
- /**
149
- * Returns the bank name for a valid Pakistani IBAN based on its 4-letter bank code.
150
- *
151
- * Returns `null` when the IBAN is invalid or the bank code is not in the dataset.
152
- *
153
- * @param iban - IBAN string to look up
154
- * @returns Bank name or `null` if not found
155
- */
156
- declare function getBankFromIBAN(iban: string): string | null;
157
-
158
- /**
159
- * Returns the city name for a Pakistani postal code.
160
- *
161
- * @param postalCode - Postal code to look up (whitespace is ignored)
162
- * @returns City name or `null` if not found
163
- */
164
- declare function getCityByPostalCode(postalCode: string): string | null;
165
- /**
166
- * Returns the primary postal code for a Pakistani city.
167
- *
168
- * Matching is case-insensitive and whitespace-tolerant.
169
- * When multiple postal codes exist, returns the primary GPO code.
170
- *
171
- * @param city - City name to look up
172
- * @returns Postal code or `null` if not found
173
- */
174
- declare function getPostalCode(city: string): string | null;
175
- /**
176
- * Returns all known postal codes for a city (case-insensitive).
177
- *
178
- * @param city - City name to look up
179
- * @returns Alphabetically sorted postal codes
180
- */
181
- declare function getPostalCodes(city: string): string[];
182
- /**
183
- * Searches postal entries by city name, area, or postal code prefix.
184
- *
185
- * @param query - Partial search term
186
- * @returns Matching postal code strings, sorted alphabetically
187
- */
188
- declare function searchPostalCodes(query: string): string[];
189
- /**
190
- * Returns known area names for a city's postal entries.
191
- *
192
- * @param city - City name to look up
193
- * @returns Alphabetically sorted area names
194
- */
195
- declare function getPostalAreas(city: string): string[];
196
-
197
- /** Parsed components of a Pakistani mailing address. */
198
- interface ParsedAddress {
199
- raw: string;
200
- street: string | null;
201
- area: string | null;
202
- city: string | null;
203
- district: string | null;
204
- province: string | null;
205
- postalCode: string | null;
206
- }
207
- /**
208
- * Parses a free-form Pakistani address into structured components.
209
- *
210
- * Extracts postal codes, matches known cities/districts/provinces from datasets,
211
- * and assigns remaining segments to street and area fields.
212
- *
213
- * @param address - Raw address string
214
- * @returns Structured address components
215
- */
216
- declare function parseAddress(address: string): ParsedAddress;
217
- /**
218
- * Formats structured address components into a single mailing line.
219
- *
220
- * @param parts - Address components to format
221
- * @returns Formatted address string
222
- */
223
- declare function formatAddress(parts: ParsedAddress): string;
224
-
225
- /**
226
- * Normalizes general text: trims, collapses whitespace, and applies Unicode NFC.
227
- *
228
- * @param text - Input text
229
- * @returns Normalized text
230
- */
231
- declare function normalizeText(text: string): string;
232
- /**
233
- * Normalizes informal Roman Urdu spellings to common canonical forms.
234
- *
235
- * Also applies {@link normalizeText} and converts Urdu/Arabic digits to English.
236
- *
237
- * @param text - Roman Urdu input
238
- * @returns Normalized Roman Urdu string
239
- */
240
- declare function normalizeRomanUrdu(text: string): string;
241
- /**
242
- * Converts English/Arabic-Indic digits in a string to Urdu digits (۰–۹).
243
- *
244
- * @param text - Input text
245
- * @returns Text with Urdu digits
246
- */
247
- declare function toUrduDigits(text: string): string;
248
- /**
249
- * Converts Urdu/Arabic-Indic digits in a string to English digits (0–9).
250
- *
251
- * @param text - Input text
252
- * @returns Text with English digits
253
- */
254
- declare function toEnglishDigits(text: string): string;
255
-
256
- /** Islamic (Hijri) date components. */
257
- interface HijriDate {
258
- year: number;
259
- month: number;
260
- day: number;
261
- }
262
- /**
263
- * Converts a Gregorian `Date` to a Hijri (Islamic) date.
264
- *
265
- * Uses the Kuwaiti algorithm (approximate, suitable for general applications).
266
- *
267
- * @param date - Gregorian date (local date components are used)
268
- * @returns Hijri date components
269
- */
270
- declare function toHijri(date: Date): HijriDate;
271
- /**
272
- * Converts a Hijri date to a Gregorian `Date` (local midnight).
273
- *
274
- * @param hijri - Hijri date components
275
- * @returns Gregorian date
276
- */
277
- declare function fromHijri(hijri: HijriDate): Date;
278
- /**
279
- * Formats a Gregorian date as a Hijri date string.
280
- *
281
- * @param date - Gregorian date
282
- * @returns Formatted Hijri string (e.g. `"14 Ramadan 1447"`)
283
- */
284
- declare function formatHijri(date: Date): string;
285
- /**
286
- * Returns the English name of a Hijri month (1–12).
287
- *
288
- * @param month - Hijri month number
289
- * @returns Month name or empty string if invalid
290
- */
291
- declare function getHijriMonthName(month: number): string;
292
- /**
293
- * Returns whether a Gregorian date falls in the month of Ramadan.
294
- *
295
- * @param date - Gregorian date
296
- * @returns `true` during Ramadan
297
- */
298
- declare function isRamadan(date: Date): boolean;
299
-
300
- export { type HijriDate, type NetworkName, type ParsedAddress, type PhoneAnalysis, analyzePhone, createWhatsAppLink, formatAddress, formatHijri, formatLakh, formatPKR, formatPhone, fromHijri, getBankFromIBAN, getCityByPostalCode, getDistrictProvince, getDistrictsByProvince, getHijriMonthName, getNetwork, getPostalAreas, getPostalCode, getPostalCodes, getProvince, isRamadan, normalizeRomanUrdu, normalizeText, parseAddress, searchCities, searchDistricts, searchPostalCodes, toEnglishDigits, toHijri, toUrduDigits, validateCNIC, validateIBAN, validatePhone };
1
+ export { CNICInfo, getCNICInfo, validateCNIC } from './cnic.js';
2
+ export { PhoneAnalysis, analyzePhone, formatPhone, validatePhone } from './phone.js';
3
+ export { NetworkName, getNetwork } from './networks.js';
4
+ export { getDistrictProvince, getDistrictsByProvince, getProvince, searchCities, searchDistricts } from './geo.js';
5
+ export { formatLakh, formatPKR } from './format.js';
6
+ export { createWhatsAppLink } from './whatsapp.js';
7
+ export { getBankFromIBAN, validateIBAN } from './iban.js';
8
+ export { getCityByPostalCode, getPostalAreas, getPostalCode, getPostalCodes, searchPostalCodes } from './postal.js';
9
+ export { ParsedAddress, formatAddress, parseAddress } from './address.js';
10
+ export { normalizeRomanUrdu, normalizeText, toEnglishDigits, toUrduDigits } from './text.js';
11
+ export { HijriDate, HijriOptions, formatHijri, fromHijri, getHijriMonthName, isRamadan, toHijri } from './hijri.js';
12
+ export { AmountInWordsOptions, NumberToWordsOptions, WordsLanguage, amountInWords, numberToWords } from './words.js';
13
+ export { NTNInfo, NTNType, analyzeNTN, validateNTN, validateSTRN } from './tax.js';
14
+ export { NumberInfo, NumberType, analyzeNumber, getAreaCode, getNumberType, validateLandline } from './numbers.js';
15
+ export { MerchantAccountInfo, MerchantQrOptions, ParsedRaastQr, RaastP2PQrOptions, createMerchantQr, createRaastP2PQr, parseRaastQr } from './raast.js';
16
+ export { Holiday, HolidayId, HolidayOptions, IslamicHolidayId, getHolidaysOn, getPakistanHolidays, isPakistanHoliday } from './holidays.js';