toolbox-x 1.0.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 (190) hide show
  1. package/LICENSE +201 -0
  2. package/dist/Color-B3mgF9Dh.d.cts +486 -0
  3. package/dist/Color-D38Xrw65.d.mts +486 -0
  4. package/dist/Stylog-Df7eq3-j.d.cts +519 -0
  5. package/dist/Stylog-jvlLcMQq.d.mts +519 -0
  6. package/dist/array-DvW0zIu6.d.mts +130 -0
  7. package/dist/array-rUnEVisO.d.cts +130 -0
  8. package/dist/basics-D_eSv0cu.cjs +132 -0
  9. package/dist/basics-Dp_aEK81.mjs +115 -0
  10. package/dist/basics-WEYWlnRO.d.cts +95 -0
  11. package/dist/basics-uBSfkBEI.d.mts +95 -0
  12. package/dist/case-BWIt8Ash.mjs +449 -0
  13. package/dist/case-C-S-b5YP.d.cts +327 -0
  14. package/dist/case-CS8Ii3A7.cjs +526 -0
  15. package/dist/case-CybASFPD.d.mts +327 -0
  16. package/dist/change-case.cjs +32 -0
  17. package/dist/change-case.d.cts +18 -0
  18. package/dist/change-case.d.mts +18 -0
  19. package/dist/change-case.mjs +19 -0
  20. package/dist/colors.cjs +574 -0
  21. package/dist/colors.d.cts +355 -0
  22. package/dist/colors.d.mts +355 -0
  23. package/dist/colors.mjs +547 -0
  24. package/dist/constants-2gAw23_7.mjs +144 -0
  25. package/dist/constants-B34K0QPi.d.cts +21 -0
  26. package/dist/constants-BIBDKY1u.cjs +924 -0
  27. package/dist/constants-BWT-810U.cjs +158 -0
  28. package/dist/constants-BwbHnXlM.mjs +662 -0
  29. package/dist/constants-BxN9l5el.cjs +74 -0
  30. package/dist/constants-CLS_bgKD.d.mts +847 -0
  31. package/dist/constants-D73iFu8g.mjs +171 -0
  32. package/dist/constants-DAfRxaa8.mjs +62 -0
  33. package/dist/constants-DQYeCjlx.cjs +207 -0
  34. package/dist/constants-Deeie-iH.d.mts +21 -0
  35. package/dist/constants-DpTG9RP6.d.mts +29 -0
  36. package/dist/constants-DqwnkJ_d.cjs +740 -0
  37. package/dist/constants-DvRUY_FY.cjs +150 -0
  38. package/dist/constants-VcRtQu0K.d.cts +29 -0
  39. package/dist/constants-X5hm1UtB.mjs +912 -0
  40. package/dist/constants-eNd-iYsV.mjs +134 -0
  41. package/dist/constants-qm8FafmD.d.cts +847 -0
  42. package/dist/constants.cjs +415 -0
  43. package/dist/constants.d.cts +184 -0
  44. package/dist/constants.d.mts +184 -0
  45. package/dist/constants.mjs +378 -0
  46. package/dist/convert-BOCgUv2D.cjs +252 -0
  47. package/dist/convert-Bn4jFomQ.mjs +169 -0
  48. package/dist/convert-BrzlG-m_.cjs +475 -0
  49. package/dist/convert-DhaUoPVU.mjs +368 -0
  50. package/dist/converter-1P90_RcP.d.mts +402 -0
  51. package/dist/converter-CmkcAppi.d.cts +402 -0
  52. package/dist/converter.cjs +780 -0
  53. package/dist/converter.d.cts +29 -0
  54. package/dist/converter.d.mts +29 -0
  55. package/dist/converter.mjs +771 -0
  56. package/dist/countries-CIpmtEzV.cjs +1469 -0
  57. package/dist/countries-Cy0xiqS3.mjs +1463 -0
  58. package/dist/css-colors-Bx947Ng3.d.cts +179 -0
  59. package/dist/css-colors-CXCDqQbG.cjs +186 -0
  60. package/dist/css-colors-CXTp1vvy.d.mts +179 -0
  61. package/dist/css-colors-DfUW3nTR.mjs +180 -0
  62. package/dist/date.cjs +332 -0
  63. package/dist/date.d.cts +213 -0
  64. package/dist/date.d.mts +213 -0
  65. package/dist/date.mjs +298 -0
  66. package/dist/dom.cjs +461 -0
  67. package/dist/dom.d.cts +228 -0
  68. package/dist/dom.d.mts +228 -0
  69. package/dist/dom.mjs +429 -0
  70. package/dist/form-BMFVGUrN.d.mts +118 -0
  71. package/dist/form-DRFbryvK.d.cts +118 -0
  72. package/dist/guards-3kaUX66g.mjs +157 -0
  73. package/dist/guards-C8gkvIHb.cjs +240 -0
  74. package/dist/guards-DdyU4h4o.mjs +110 -0
  75. package/dist/guards-Efhp1mNy.cjs +151 -0
  76. package/dist/guards.cjs +172 -0
  77. package/dist/guards.d.cts +399 -0
  78. package/dist/guards.d.mts +399 -0
  79. package/dist/guards.mjs +75 -0
  80. package/dist/hash-B6JPEyAz.d.mts +131 -0
  81. package/dist/hash-NTpeKYB_.d.cts +131 -0
  82. package/dist/hash.cjs +2126 -0
  83. package/dist/hash.d.cts +1239 -0
  84. package/dist/hash.d.mts +1239 -0
  85. package/dist/hash.mjs +2095 -0
  86. package/dist/http-status-BAZdtr7-.d.mts +65 -0
  87. package/dist/http-status-U_3MtoGb.d.cts +65 -0
  88. package/dist/http-status.cjs +173 -0
  89. package/dist/http-status.d.cts +142 -0
  90. package/dist/http-status.d.mts +142 -0
  91. package/dist/http-status.mjs +171 -0
  92. package/dist/index.cjs +2551 -0
  93. package/dist/index.d.cts +1493 -0
  94. package/dist/index.d.mts +1493 -0
  95. package/dist/index.mjs +2357 -0
  96. package/dist/object-B0TV3eHx.d.mts +8052 -0
  97. package/dist/object-Blq0Amdv.d.cts +8052 -0
  98. package/dist/objectify-CDs0Fbr1.mjs +417 -0
  99. package/dist/objectify-DIJ-OBmo.cjs +524 -0
  100. package/dist/paginator.cjs +245 -0
  101. package/dist/paginator.d.cts +144 -0
  102. package/dist/paginator.d.mts +144 -0
  103. package/dist/paginator.mjs +243 -0
  104. package/dist/parse-2ubxXZRp.cjs +211 -0
  105. package/dist/parse-N7g942uy.mjs +164 -0
  106. package/dist/pluralizer-BjMIc6uT.d.mts +42 -0
  107. package/dist/pluralizer-Cb6ZmrDl.d.cts +42 -0
  108. package/dist/pluralizer.cjs +678 -0
  109. package/dist/pluralizer.d.cts +152 -0
  110. package/dist/pluralizer.d.mts +152 -0
  111. package/dist/pluralizer.mjs +676 -0
  112. package/dist/primitives-B26uZolQ.cjs +228 -0
  113. package/dist/primitives-KsFUp3kQ.mjs +144 -0
  114. package/dist/specials-D48_IZbd.d.mts +108 -0
  115. package/dist/specials-DzLr1ZgU.cjs +477 -0
  116. package/dist/specials-LVONlKbQ.d.cts +108 -0
  117. package/dist/specials-uhDuRg8H.mjs +292 -0
  118. package/dist/string-CBAbxaG1.d.mts +258 -0
  119. package/dist/string-CsNsm_65.d.cts +258 -0
  120. package/dist/stylog.cjs +621 -0
  121. package/dist/stylog.d.cts +49 -0
  122. package/dist/stylog.d.mts +49 -0
  123. package/dist/stylog.mjs +614 -0
  124. package/dist/timezone-B2OYK6Fh.mjs +5589 -0
  125. package/dist/timezone-Beh9IGpw.cjs +5625 -0
  126. package/dist/types/array.cjs +16 -0
  127. package/dist/types/array.d.cts +18 -0
  128. package/dist/types/array.d.mts +18 -0
  129. package/dist/types/array.mjs +17 -0
  130. package/dist/types/colors.cjs +16 -0
  131. package/dist/types/colors.d.cts +18 -0
  132. package/dist/types/colors.d.mts +18 -0
  133. package/dist/types/colors.mjs +17 -0
  134. package/dist/types/converter.cjs +16 -0
  135. package/dist/types/converter.d.cts +18 -0
  136. package/dist/types/converter.d.mts +18 -0
  137. package/dist/types/converter.mjs +17 -0
  138. package/dist/types/form.cjs +16 -0
  139. package/dist/types/form.d.cts +18 -0
  140. package/dist/types/form.d.mts +18 -0
  141. package/dist/types/form.mjs +17 -0
  142. package/dist/types/hash.cjs +16 -0
  143. package/dist/types/hash.d.cts +18 -0
  144. package/dist/types/hash.d.mts +18 -0
  145. package/dist/types/hash.mjs +17 -0
  146. package/dist/types/http-status.cjs +16 -0
  147. package/dist/types/http-status.d.cts +18 -0
  148. package/dist/types/http-status.d.mts +18 -0
  149. package/dist/types/http-status.mjs +17 -0
  150. package/dist/types/index.cjs +16 -0
  151. package/dist/types/index.d.cts +18 -0
  152. package/dist/types/index.d.mts +18 -0
  153. package/dist/types/index.mjs +17 -0
  154. package/dist/types/number.cjs +16 -0
  155. package/dist/types/number.d.cts +18 -0
  156. package/dist/types/number.d.mts +18 -0
  157. package/dist/types/number.mjs +17 -0
  158. package/dist/types/object.cjs +16 -0
  159. package/dist/types/object.d.cts +18 -0
  160. package/dist/types/object.d.mts +18 -0
  161. package/dist/types/object.mjs +17 -0
  162. package/dist/types/pluralizer.cjs +16 -0
  163. package/dist/types/pluralizer.d.cts +18 -0
  164. package/dist/types/pluralizer.d.mts +18 -0
  165. package/dist/types/pluralizer.mjs +17 -0
  166. package/dist/types/string.cjs +16 -0
  167. package/dist/types/string.d.cts +18 -0
  168. package/dist/types/string.d.mts +18 -0
  169. package/dist/types/string.mjs +17 -0
  170. package/dist/types/stylog.cjs +16 -0
  171. package/dist/types/stylog.d.cts +18 -0
  172. package/dist/types/stylog.d.mts +18 -0
  173. package/dist/types/stylog.mjs +17 -0
  174. package/dist/types/utils.cjs +16 -0
  175. package/dist/types/utils.d.cts +18 -0
  176. package/dist/types/utils.d.mts +18 -0
  177. package/dist/types/utils.mjs +17 -0
  178. package/dist/types/verbalizer.cjs +16 -0
  179. package/dist/types/verbalizer.d.cts +30 -0
  180. package/dist/types/verbalizer.d.mts +30 -0
  181. package/dist/types/verbalizer.mjs +17 -0
  182. package/dist/utilities-CLUmdQeV.cjs +140 -0
  183. package/dist/utilities-m5yFKqLd.mjs +105 -0
  184. package/dist/utils-ClW9LA6f.mjs +449 -0
  185. package/dist/utils-DLFRgXUC.cjs +568 -0
  186. package/dist/verbalizer.cjs +998 -0
  187. package/dist/verbalizer.d.cts +148 -0
  188. package/dist/verbalizer.d.mts +148 -0
  189. package/dist/verbalizer.mjs +996 -0
  190. package/package.json +249 -0
@@ -0,0 +1,258 @@
1
+ /**
2
+ * Copyright 2026 - present Nazmul Hassan
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+
17
+ import { t as LOWERCASE } from "./constants-B34K0QPi.cjs";
18
+ import { In as Join, t as $Countries, ur as Split, zn as LooseLiteral } from "./object-Blq0Amdv.cjs";
19
+
20
+ //#region src/types/string.d.ts
21
+ declare global {
22
+ interface String {
23
+ toLowerCase(): string;
24
+ /**
25
+ * * Converts all the alphabetic characters in a string to lowercase.
26
+ *
27
+ * @typeParam `Lower` - A type-level flag. If `'T'`, returns the lowercase string type (`Lowercase<string>`). Otherwise, returns literal `Lower` (must be Lowercase type).
28
+ *
29
+ * @remarks
30
+ * - This augmentation only affects TypeScript type inference.
31
+ * - Runtime behavior remains identical to the standard `toLowerCase()` method.
32
+ */
33
+ toLowerCase<Lower extends 'T' | Lowercase<string>>(): Lower extends 'T' ? Lowercase<string> : Lower;
34
+ toUpperCase(): string;
35
+ /**
36
+ * * Converts all the alphabetic characters in a string to uppercase.
37
+ *
38
+ * @typeParam `Upper` - A type-level flag. If `'T'`, returns the uppercase string type (`Uppercase<string>`). Otherwise, returns literal `Upper` (must be Uppercase type).
39
+ *
40
+ * @remarks
41
+ * - This augmentation only affects TypeScript type inference.
42
+ * - Runtime behavior remains identical to the standard `toUpperCase()` method.
43
+ */
44
+ toUpperCase<Upper extends 'T' | Uppercase<string>>(): Upper extends 'T' ? Uppercase<string> : Upper;
45
+ }
46
+ }
47
+ /** - Options for generating anagrams. */
48
+ interface AnagramOptions {
49
+ /**
50
+ * Maximum number of anagrams to generate.
51
+ * Defaults to `100`. Pass `"all"` to return all possible anagrams.
52
+ */
53
+ limit?: number | 'all';
54
+ /**
55
+ * Optional dictionary array of strings for validating anagrams.
56
+ * - Pass `false` (default) to skip dictionary lookup.
57
+ * - Pass an array of strings to include only anagrams present in that array.
58
+ * - Dictionary lookup is case-insensitive; internally, a cached lowercase `Set` is used for performance.
59
+ * - Duplicate entries in the dictionary are ignored.
60
+ */
61
+ dictionary?: false | string[];
62
+ }
63
+ /** - Options for `capitalizeString` function. */
64
+ interface CapitalizeOptions {
65
+ /** If true, capitalizes the first letter of each word (space separated). Defaults to `false`. */
66
+ capitalizeEachFirst?: boolean;
67
+ /** If true, ensures that the whole string is capitalized. Defaults to `false`. */
68
+ capitalizeAll?: boolean;
69
+ /** If true, ensures that the rest of the string is lowercase. Defaults to `true`. */
70
+ lowerCaseRest?: boolean;
71
+ }
72
+ /** - Configuration options for ID generation. */
73
+ interface RandomIdOptions {
74
+ /** A string to prepend to the ID. Default is an empty string. */
75
+ prefix?: string;
76
+ /** A string to append to the ID. Default is an empty string.*/
77
+ suffix?: string;
78
+ /** Whether to include the current timestamp in the ID. Default is `false`. */
79
+ timeStamp?: boolean;
80
+ /** The length of the random alphanumeric string. Default is `16`. */
81
+ length?: number;
82
+ /** The separator to use between parts of the ID. Default is an empty string. */
83
+ separator?: string;
84
+ /** Specifies the case for the full id (this includes alphanumeric string and suffix+prefix). Default is `null`. */
85
+ caseOption?: 'upper' | 'lower' | null;
86
+ }
87
+ /** - Case formats for converting a string */
88
+ type CaseFormat = 'camelCase' | 'snake_case' | 'kebab-case' | 'PascalCase' | 'Title Case' | 'Sentence case' | 'UPPERCASE' | 'lowercase';
89
+ /** * Options for `convertStringCase`. */
90
+ interface StringCaseOptions {
91
+ /**
92
+ * Preserve acronym-like tokens (tokens that are ALL UPPERCASE with length >= 2)
93
+ * when converting to PascalCase / Title Case / camelCase (mid tokens).
94
+ *
95
+ * Behavior summary:
96
+ * - PascalCase: keep acronyms intact (API -> API).
97
+ * - camelCase: first token acronyms are lowercased entirely (API -> api),
98
+ * subsequent token acronyms are preserved (API -> API).
99
+ * - Title Case: acronym tokens are preserved (API).
100
+ * - snake_case / kebab-case: tokens are lowercased (xml-http-request).
101
+ */
102
+ preserveAcronyms?: boolean;
103
+ }
104
+ /** Options for masking a string. */
105
+ interface MaskOptions {
106
+ /** Number of characters to keep at the start. Defaults to `1`. */
107
+ start?: number;
108
+ /** Number of characters to keep at the end. Defaults to `1`. */
109
+ end?: number;
110
+ /** Character to use for masking. Defaults to `*`. */
111
+ maskCharacter?: string;
112
+ }
113
+ /** Formatted query string as `?${string}` = `?key=value&...` or empty string. */
114
+ type QueryString = `?${string}` | '';
115
+ /** Full country name */
116
+ type CountryName = $Countries['country_name'];
117
+ /** Country code, e.g. `"880" | "973" | "994" | "1-242" ...` */
118
+ type CountryCode = $Countries['country_code'];
119
+ /** ISO country country codes (3-character), e.g. `"BGD" | "BRB" | "BLR" ...` */
120
+ type CountryISO = $Countries['iso_code'];
121
+ /** ISO country country codes (2-character), e.g. `"BD" | "BB" | "BY" ...` */
122
+ type CountryShortISO = $Countries['iso_code_short'];
123
+ /** ISO 2 character country code or any string */
124
+ type Country = LooseLiteral<CountryShortISO>;
125
+ /** Lowercase prepositions, articles, conjunctions, and auxiliary verbs ({@link LOWERCASE}) */
126
+ type $LowerCaseWord = (typeof LOWERCASE)[number];
127
+ /** Ensure early inference and string constraint. */
128
+ type $EnsureString<Str> = Str extends string ? Str : never;
129
+ /** Check if a string literal `Str` contains a substring `SubStr` */
130
+ type Includes<Str extends string, SubStr extends string> = Str extends `${string}${SubStr}${string}` ? true : false;
131
+ /** Trim leading space from a string literal */
132
+ type $TrimLeft<Str extends string> = Str extends ` ${infer R}` ? $TrimLeft<R> : Str;
133
+ /** Trim trailing space from a string literal */
134
+ type $TrimRight<Str extends string> = Str extends `${infer L} ` ? $TrimRight<L> : Str;
135
+ /** Trim leading and trailing spaces from a string literal */
136
+ type Trim<Str extends string> = $TrimRight<$TrimLeft<Str>>;
137
+ /** Default delimiter characters */
138
+ type $DefaultDelimiters = ' ' | '-' | '_' | '.' | '/';
139
+ /** Turn user delim string like "*+," into '*, +, ,' union */
140
+ type $UserDelimiters<Del extends string> = Del extends '' ? never : Del extends `${infer C}${infer R}` ? C | $UserDelimiters<R> : never;
141
+ /** Is char `C` a delimiter (either default or user-provided)? */
142
+ type $IsDelimiter<C extends string, Del extends string> = C extends $DefaultDelimiters ? true : C extends $UserDelimiters<Del> ? true : false;
143
+ /** Insert space before capital letters: "helloWorld" -> "hello World" */
144
+ type $SpaceBeforeCaps<Str extends string> = Str extends `${infer F}${infer R}` ? R extends Uncapitalize<R> ? `${F}${$SpaceBeforeCaps<R>}` : `${F} ${$SpaceBeforeCaps<R>}` : Str;
145
+ /** Replace delimiter(s) with space(s) */
146
+ type $ReplaceDelimiters<Str extends string, Del extends string, Acc extends string = '', LastWasSpace extends boolean = false> = Str extends `${infer F}${infer R}` ? $IsDelimiter<F, Del> extends true ? $ReplaceDelimiters<R, Del, Acc extends '' ? ' ' : LastWasSpace extends true ? Acc : `${Acc} `, true> : $ReplaceDelimiters<R, Del, `${Acc}${F}`, false> : Acc;
147
+ /** Normalize {@link $DefaultDelimiters} or {@link $UserDelimiters} `Del` in a string literal `Str` with space(s) */
148
+ type $NormalizeString<Str extends string, Del extends string = ''> = Trim<$ReplaceDelimiters<$SpaceBeforeCaps<Str>, Del, '', false>>;
149
+ /** Lowercase all the words in a tuple */
150
+ type $LowercaseWords<T extends readonly string[]> = T extends [infer H extends string, ...infer R extends string[]] ? [Lowercase<H>, ...$LowercaseWords<R>] : [];
151
+ /** Uppercase all the words in a tuple */
152
+ type $UppercaseWords<T extends readonly string[]> = T extends [infer H extends string, ...infer R extends string[]] ? [Uppercase<Lowercase<H>>, ...$UppercaseWords<R>] : [];
153
+ /** Capitalize (first letter capital) all the words in a tuple */
154
+ type $CapitalizeWords<T extends readonly string[]> = T extends [infer H extends string, ...infer R extends string[]] ? [Capitalize<Lowercase<H>>, ...$CapitalizeWords<R>] : [];
155
+ /** Capitalize (first letter capital) all the words in a tuple */
156
+ type $TitleCaseWords<T extends readonly string[]> = T extends [infer H extends string, ...infer R extends string[]] ? [H extends $LowerCaseWord ? Lowercase<H> : Capitalize<Lowercase<H>>, ...$TitleCaseWords<R>] : [];
157
+ /**
158
+ * - Converts a string literal `Str` into `camelCase`, using optional custom delimiters `Del` alongside {@link $DefaultDelimiters}.
159
+ * @remarks TypeScript supports up to ~45 characters for reliable literal inference.
160
+ */
161
+ type CamelCase<Str extends string, Del extends string = ''> = Split<$NormalizeString<Str, Del>, ' '> extends [infer F extends string, ...infer R extends string[]] ? `${Lowercase<F>}${Join<$CapitalizeWords<R>, ''>}` : '';
162
+ /**
163
+ * - Converts a string literal `Str` into `snake_case`, using optional custom delimiters `Del` alongside {@link $DefaultDelimiters}.
164
+ * @remarks TypeScript supports up to ~45 characters for reliable literal inference.
165
+ */
166
+ type SnakeCase<Str extends string, Del extends string = ''> = Join<$LowercaseWords<Split<$NormalizeString<Str, Del>, ' '>>, '_'>;
167
+ /**
168
+ * - Converts a string literal `Str` into `kebab-case`, using optional custom delimiters `Del` alongside {@link $DefaultDelimiters}.
169
+ * @remarks TypeScript supports up to ~45 characters for reliable literal inference.
170
+ */
171
+ type KebabCase<Str extends string, Del extends string = ''> = Join<$LowercaseWords<Split<$NormalizeString<Str, Del>, ' '>>, '-'>;
172
+ /**
173
+ * - Converts a string literal `Str` into `PascalCase`, using optional custom delimiters `Del` alongside {@link $DefaultDelimiters}.
174
+ * @remarks TypeScript supports up to ~45 characters for reliable literal inference.
175
+ */
176
+ type PascalCase<Str extends string, Del extends string = ''> = Join<$CapitalizeWords<Split<$NormalizeString<Str, Del>, ' '>>, ''>;
177
+ /**
178
+ * - Converts a string literal `Str` into `Pascal_Snake_Case`, using optional custom delimiters `Del` alongside {@link $DefaultDelimiters}.
179
+ * @remarks TypeScript supports up to ~45 characters for reliable literal inference.
180
+ */
181
+ type PascalSnakeCase<Str extends string, Del extends string = ''> = Join<$CapitalizeWords<Split<$NormalizeString<Str, Del>, ' '>>, '_'>;
182
+ /**
183
+ * - Converts a string literal `Str` into `CONSTANT_CASE`, using optional custom delimiters `Del` alongside {@link $DefaultDelimiters}.
184
+ * @remarks TypeScript supports up to ~45 characters for reliable literal inference.
185
+ */
186
+ type ConstantCase<Str extends string, Del extends string = ''> = Join<$UppercaseWords<Split<$NormalizeString<Str, Del>, ' '>>, '_'>;
187
+ /**
188
+ * - Converts a string literal `Str` into `Train-Case`, using optional custom delimiters `Del` alongside {@link $DefaultDelimiters}.
189
+ * @remarks TypeScript supports up to ~45 characters for reliable literal inference.
190
+ */
191
+ type TrainCase<Str extends string, Del extends string = ''> = Join<$CapitalizeWords<Split<$NormalizeString<Str, Del>, ' '>>, '-'>;
192
+ /**
193
+ * - Converts a string literal `Str` into `Dot.Case`/`dot.case`, using optional custom delimiters `Del` alongside {@link $DefaultDelimiters}.
194
+ * @remarks TypeScript supports up to ~45 characters for reliable literal inference.
195
+ */
196
+ type DotCase<Str extends string, Del extends string = ''> = Join<Split<$NormalizeString<Str, Del>, ' '>, '.'>;
197
+ /**
198
+ * - Converts a string literal `Str` into `path/case`, using optional custom delimiters `Del` alongside {@link $DefaultDelimiters}.
199
+ * @remarks TypeScript supports up to ~45 characters for reliable literal inference.
200
+ */
201
+ type PathCase<Str extends string, Del extends string = ''> = Join<$LowercaseWords<Split<$NormalizeString<Str, Del>, ' '>>, '/'>;
202
+ /**
203
+ * - Converts a string literal `Str` into `Title Case`, using optional custom delimiters `Del` alongside {@link $DefaultDelimiters}.
204
+ * @remarks
205
+ * - TypeScript supports up to ~45 characters for reliable literal inference.
206
+ * - Lowercase auxiliaries, prepositions, articles and conjunctions unless they are at the beginning.
207
+ */
208
+ type TitleCase<Str extends string, Del extends string = ''> = Split<$NormalizeString<Str, Del>, ' '> extends [infer F extends string, ...infer R extends string[]] ? `${Capitalize<Lowercase<F>>} ${Join<$TitleCaseWords<R>, ' '>}` : ' ';
209
+ /**
210
+ * - Converts a string literal `Str` into `Sentence case`, using optional custom delimiters `Del` alongside {@link $DefaultDelimiters}.
211
+ * @remarks It will lowercase: auxiliaries, prepositions, articles and conjunctions unless they are at the beginning.
212
+ */
213
+ type SentenceCase<Str extends string, Del extends string = ''> = Split<$NormalizeString<Str, Del>, ' '> extends [infer F extends string, ...infer R extends string[]] ? `${Capitalize<Lowercase<F>>} ${Join<$LowercaseWords<R>, ' '>}` : ' ';
214
+ /** Matches any non-Latin character. */
215
+ type SpecialCharacter = Lowercase<string> & Uppercase<string>;
216
+ /** Evaluates whether a string consists only of Latin alphabet characters. */
217
+ type IsAlphabet<T extends string> = T extends `${infer Head}${infer Tail}` ? Head extends SpecialCharacter ? false : IsAlphabet<Tail> : true;
218
+ /** Restricts a string to Latin-only characters; otherwise resolves to never. */
219
+ type Alphabet<T extends string> = IsAlphabet<T> extends true ? T : never;
220
+ /** Types related to string diffing and similarity calculations. */
221
+ type DiffLineType = 'added' | 'removed' | 'unchanged' | 'modified';
222
+ /** A single line difference between two strings, including the type of difference and the content of the line in both original and modified strings. */
223
+ interface DiffLine {
224
+ /** The type of difference: 'added', 'removed', 'unchanged', or 'modified'. */
225
+ type: DiffLineType;
226
+ /** The content of the original line. Undefined for added lines. */
227
+ original?: string;
228
+ /** The content of the modified line. Undefined for removed lines. */
229
+ modified?: string;
230
+ /** The line number in the original string (1-based). Undefined for added lines. */
231
+ originalLineNum?: number;
232
+ /** The line number in the modified string (1-based). Undefined for removed lines. */
233
+ modifiedLineNum?: number;
234
+ }
235
+ /** The result of a line-level diff operation, including an array of line differences and summary statistics. */
236
+ interface DiffResult {
237
+ /** An array of line differences, where each line is categorized as 'added', 'removed', 'unchanged', or 'modified'. */
238
+ lines: DiffLine[];
239
+ /** Statistics summarizing the diff results, including counts of added, removed, changed, and unchanged lines. */
240
+ stats: {
241
+ /** Total number of lines that were added in the modified string compared to the original. */linesAdded: number; /** Total number of lines that were removed from the original string in the modified version. */
242
+ linesRemoved: number; /** Total number of lines that were modified (changed content) between the original and modified strings. */
243
+ linesChanged: number; /** Total number of lines that remained unchanged between the original and modified strings. */
244
+ linesUnchanged: number;
245
+ };
246
+ }
247
+ /** A single character annotated with a `highlighted` flag indicating whether it differs from the other string in a diff operation. */
248
+ type HighlightedText = {
249
+ text: string;
250
+ highlighted: boolean;
251
+ };
252
+ /** Result of a character-level diff, mapping each character in both strings to a `highlighted` flag. */
253
+ type CharDiffResult = {
254
+ /** An array of characters from the original string, each annotated with a `highlighted` flag indicating whether it differs from the modified string. */original: HighlightedText[]; /** An array of characters from the modified string, each annotated with a `highlighted` flag indicating whether it differs from the original string. */
255
+ modified: HighlightedText[];
256
+ };
257
+ //#endregion
258
+ export { MaskOptions as A, TitleCase as B, DiffLineType as C, Includes as D, HighlightedText as E, RandomIdOptions as F, Trim as H, SentenceCase as I, SnakeCase as L, PascalSnakeCase as M, PathCase as N, IsAlphabet as O, QueryString as P, SpecialCharacter as R, DiffLine as S, DotCase as T, TrainCase as V, Country as _, $NormalizeString as a, CountryName as b, $TrimRight as c, AnagramOptions as d, CamelCase as f, ConstantCase as g, CharDiffResult as h, $LowercaseWords as i, PascalCase as j, KebabCase as k, $UppercaseWords as l, CaseFormat as m, $EnsureString as n, $TitleCaseWords as o, CapitalizeOptions as p, $LowerCaseWord as r, $TrimLeft as s, $CapitalizeWords as t, Alphabet as u, CountryCode as v, DiffResult as w, CountryShortISO as x, CountryISO as y, StringCaseOptions as z };