inferred-types 0.44.0 → 0.45.2

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 (345) hide show
  1. package/dist/constants/Characters.d.ts +2 -0
  2. package/dist/constants/Characters.d.ts.map +1 -0
  3. package/dist/constants/Characters.js +5 -0
  4. package/dist/constants/NetworkConstants.d.ts +29 -0
  5. package/dist/constants/NetworkConstants.d.ts.map +1 -0
  6. package/dist/constants/NetworkConstants.js +83 -0
  7. package/dist/constants/Phone.d.ts +8 -0
  8. package/dist/constants/Phone.d.ts.map +1 -0
  9. package/dist/constants/Phone.js +262 -0
  10. package/dist/constants/ProxmoxConstants.d.ts +2 -0
  11. package/dist/constants/ProxmoxConstants.d.ts.map +1 -0
  12. package/dist/constants/ProxmoxConstants.js +3 -0
  13. package/dist/constants/index.d.ts +4 -1
  14. package/dist/constants/index.d.ts.map +1 -1
  15. package/dist/constants/index.js +4 -1
  16. package/dist/constants/tsconfig.tsbuildinfo +1 -1
  17. package/dist/inferred-types/index.cjs +1657 -1029
  18. package/dist/inferred-types/tsconfig.tsbuildinfo +1 -1
  19. package/dist/runtime/api/defineApi.d.ts +56 -0
  20. package/dist/runtime/api/defineApi.d.ts.map +1 -0
  21. package/dist/runtime/api/defineApi.js +97 -0
  22. package/dist/runtime/api/handleDoneFn.d.ts.map +1 -0
  23. package/dist/runtime/api/index.d.ts +3 -0
  24. package/dist/runtime/api/index.d.ts.map +1 -0
  25. package/dist/runtime/api/index.js +2 -0
  26. package/dist/runtime/boolean-logic/ifArrayPartial.d.ts +1 -1
  27. package/dist/runtime/boolean-logic/ifArrayPartial.d.ts.map +1 -1
  28. package/dist/runtime/boolean-logic/ifArrayPartial.js +1 -1
  29. package/dist/runtime/boolean-logic/ifLength.d.ts.map +1 -1
  30. package/dist/runtime/boolean-logic/ifScalar.d.ts.map +1 -1
  31. package/dist/runtime/boolean-logic/ifScalar.js +1 -1
  32. package/dist/runtime/boolean-logic/index.d.ts +0 -1
  33. package/dist/runtime/boolean-logic/index.d.ts.map +1 -1
  34. package/dist/runtime/boolean-logic/index.js +0 -1
  35. package/dist/runtime/dictionary/defineOptions.d.ts +26 -0
  36. package/dist/runtime/dictionary/defineOptions.d.ts.map +1 -0
  37. package/dist/runtime/dictionary/defineOptions.js +30 -0
  38. package/dist/runtime/dictionary/keysOf.d.ts +1 -1
  39. package/dist/runtime/dictionary/keysOf.d.ts.map +1 -1
  40. package/dist/runtime/dictionary/withKeys.d.ts +1 -1
  41. package/dist/runtime/errors/KindError.d.ts +2 -2
  42. package/dist/runtime/errors/KindError.d.ts.map +1 -1
  43. package/dist/runtime/functions/index.d.ts +1 -0
  44. package/dist/runtime/functions/index.d.ts.map +1 -1
  45. package/dist/runtime/functions/index.js +1 -0
  46. package/dist/runtime/functions/wrapFn.d.ts +2 -0
  47. package/dist/runtime/functions/wrapFn.d.ts.map +1 -0
  48. package/dist/runtime/functions/wrapFn.js +24 -0
  49. package/dist/runtime/index.d.ts +2 -1
  50. package/dist/runtime/index.d.ts.map +1 -1
  51. package/dist/runtime/index.js +2 -10
  52. package/dist/runtime/lists/find.d.ts +1 -1
  53. package/dist/runtime/lists/find.d.ts.map +1 -1
  54. package/dist/runtime/lists/intersection.d.ts.map +1 -1
  55. package/dist/runtime/lists/intersection.js +2 -1
  56. package/dist/runtime/literals/asPhoneNumber.d.ts +10 -0
  57. package/dist/runtime/literals/asPhoneNumber.d.ts.map +1 -0
  58. package/dist/runtime/literals/asPhoneNumber.js +62 -0
  59. package/dist/runtime/literals/index.d.ts +5 -0
  60. package/dist/runtime/literals/index.d.ts.map +1 -1
  61. package/dist/runtime/literals/index.js +5 -0
  62. package/dist/runtime/literals/retainChars.d.ts +16 -0
  63. package/dist/runtime/literals/retainChars.d.ts.map +1 -0
  64. package/dist/runtime/literals/retainChars.js +17 -0
  65. package/dist/runtime/literals/retainWhile.d.ts +11 -0
  66. package/dist/runtime/literals/retainWhile.d.ts.map +1 -0
  67. package/dist/runtime/literals/retainWhile.js +12 -0
  68. package/dist/runtime/literals/stripChars.d.ts +10 -0
  69. package/dist/runtime/literals/stripChars.d.ts.map +1 -0
  70. package/dist/runtime/literals/stripChars.js +11 -0
  71. package/dist/runtime/literals/stripLeading.d.ts +3 -3
  72. package/dist/runtime/literals/stripLeading.d.ts.map +1 -1
  73. package/dist/runtime/literals/stripLeading.js +5 -5
  74. package/dist/runtime/literals/takeNumericCharacters.d.ts +9 -0
  75. package/dist/runtime/literals/takeNumericCharacters.d.ts.map +1 -0
  76. package/dist/runtime/literals/takeNumericCharacters.js +12 -0
  77. package/dist/runtime/literals/unset.d.ts +8 -0
  78. package/dist/runtime/literals/unset.d.ts.map +1 -0
  79. package/dist/runtime/literals/unset.js +14 -0
  80. package/dist/runtime/meta/index.d.ts +3 -0
  81. package/dist/runtime/meta/index.d.ts.map +1 -0
  82. package/dist/runtime/meta/index.js +2 -0
  83. package/dist/runtime/meta/urlMeta.d.ts +52 -0
  84. package/dist/runtime/meta/urlMeta.d.ts.map +1 -0
  85. package/dist/runtime/meta/urlMeta.js +57 -0
  86. package/dist/runtime/meta/youtube-meta.d.ts +38 -0
  87. package/dist/runtime/meta/youtube-meta.d.ts.map +1 -0
  88. package/dist/runtime/meta/youtube-meta.js +67 -0
  89. package/dist/runtime/runtime-types/dict.d.ts +2 -2
  90. package/dist/runtime/runtime-types/dict.d.ts.map +1 -1
  91. package/dist/runtime/runtime-types/ip6Prefix.d.ts +1 -1
  92. package/dist/runtime/runtime-types/parse.d.ts +1 -1
  93. package/dist/runtime/runtime-types/shape-helpers/getTokenData.d.ts +1 -1
  94. package/dist/runtime/runtime-types/shape-helpers/getTokenName.d.ts +1 -1
  95. package/dist/runtime/runtime-types/shape-helpers/singletons.d.ts.map +1 -1
  96. package/dist/runtime/runtime-types/shape-helpers/singletons.js +1 -1
  97. package/dist/runtime/runtime-types/shape.d.ts +1 -1
  98. package/dist/runtime/runtime-types/shape.js +1 -1
  99. package/dist/runtime/tsconfig.tsbuildinfo +1 -1
  100. package/dist/runtime/type-conversion/asChars.d.ts +8 -0
  101. package/dist/runtime/type-conversion/asChars.d.ts.map +1 -0
  102. package/dist/runtime/type-conversion/asChars.js +8 -0
  103. package/dist/runtime/type-conversion/index.d.ts +2 -0
  104. package/dist/runtime/type-conversion/index.d.ts.map +1 -1
  105. package/dist/runtime/type-conversion/index.js +2 -0
  106. package/dist/runtime/type-conversion/ip6GroupExpansion.d.ts +14 -0
  107. package/dist/runtime/type-conversion/ip6GroupExpansion.d.ts.map +1 -0
  108. package/dist/runtime/type-conversion/ip6GroupExpansion.js +15 -0
  109. package/dist/runtime/type-guards/api-tg.d.ts +33 -0
  110. package/dist/runtime/type-guards/api-tg.d.ts.map +1 -0
  111. package/dist/runtime/type-guards/api-tg.js +38 -0
  112. package/dist/runtime/type-guards/hasWhitespace.d.ts +7 -0
  113. package/dist/runtime/type-guards/hasWhitespace.d.ts.map +1 -0
  114. package/dist/runtime/type-guards/hasWhitespace.js +11 -0
  115. package/dist/runtime/type-guards/index.d.ts +11 -0
  116. package/dist/runtime/type-guards/index.d.ts.map +1 -1
  117. package/dist/runtime/type-guards/index.js +11 -0
  118. package/dist/runtime/type-guards/isConstant.d.ts +6 -0
  119. package/dist/runtime/type-guards/isConstant.d.ts.map +1 -1
  120. package/dist/runtime/type-guards/isConstant.js +12 -2
  121. package/dist/runtime/type-guards/isEmail.d.ts +7 -0
  122. package/dist/runtime/type-guards/isEmail.d.ts.map +1 -0
  123. package/dist/runtime/type-guards/isEmail.js +11 -0
  124. package/dist/runtime/type-guards/isHexadecimal.d.ts +8 -0
  125. package/dist/runtime/type-guards/isHexadecimal.d.ts.map +1 -0
  126. package/dist/runtime/type-guards/isHexadecimal.js +13 -0
  127. package/dist/runtime/type-guards/isPhoneNumber.d.ts +14 -0
  128. package/dist/runtime/type-guards/isPhoneNumber.d.ts.map +1 -0
  129. package/dist/runtime/type-guards/isPhoneNumber.js +26 -0
  130. package/dist/runtime/type-guards/isSpecificConstant.js +2 -3
  131. package/dist/runtime/type-guards/isTrimmable.d.ts +7 -0
  132. package/dist/runtime/type-guards/isTrimmable.d.ts.map +1 -0
  133. package/dist/runtime/type-guards/isTrimmable.js +9 -0
  134. package/dist/runtime/type-guards/isUnset.d.ts +18 -0
  135. package/dist/runtime/type-guards/isUnset.d.ts.map +1 -0
  136. package/dist/runtime/type-guards/isUnset.js +23 -0
  137. package/dist/runtime/type-guards/isUrl.d.ts +2 -4
  138. package/dist/runtime/type-guards/isUrl.d.ts.map +1 -1
  139. package/dist/runtime/type-guards/isUrl.js +2 -3
  140. package/dist/runtime/type-guards/network-tg.d.ts +54 -0
  141. package/dist/runtime/type-guards/network-tg.d.ts.map +1 -0
  142. package/dist/runtime/type-guards/network-tg.js +94 -0
  143. package/dist/runtime/type-guards/repos.d.ts +6 -6
  144. package/dist/runtime/type-guards/repos.d.ts.map +1 -1
  145. package/dist/runtime/type-guards/youtube.d.ts +44 -0
  146. package/dist/runtime/type-guards/youtube.d.ts.map +1 -0
  147. package/dist/runtime/type-guards/youtube.js +84 -0
  148. package/dist/types/api/api.d.ts +96 -37
  149. package/dist/types/api/api.d.ts.map +1 -1
  150. package/dist/types/base-types/fns/EscapeFunction.d.ts +22 -0
  151. package/dist/types/base-types/fns/EscapeFunction.d.ts.map +1 -0
  152. package/dist/types/base-types/fns/OptionalParamFn.d.ts +30 -0
  153. package/dist/types/base-types/fns/OptionalParamFn.d.ts.map +1 -0
  154. package/dist/types/base-types/fns/index.d.ts +2 -0
  155. package/dist/types/base-types/fns/index.d.ts.map +1 -1
  156. package/dist/types/base-types/fns/index.js +2 -0
  157. package/dist/types/boolean-logic/branching/If.d.ts +2 -3
  158. package/dist/types/boolean-logic/branching/If.d.ts.map +1 -1
  159. package/dist/types/boolean-logic/branching/IfUnset.d.ts +12 -0
  160. package/dist/types/boolean-logic/branching/IfUnset.d.ts.map +1 -0
  161. package/dist/types/boolean-logic/branching/OnPass.d.ts +4 -3
  162. package/dist/types/boolean-logic/branching/OnPass.d.ts.map +1 -1
  163. package/dist/types/boolean-logic/branching/WhenNever.d.ts +11 -0
  164. package/dist/types/boolean-logic/branching/WhenNever.d.ts.map +1 -0
  165. package/dist/types/boolean-logic/branching/index.d.ts +2 -0
  166. package/dist/types/boolean-logic/branching/index.d.ts.map +1 -1
  167. package/dist/types/boolean-logic/branching/index.js +2 -0
  168. package/dist/types/boolean-logic/combinators/And.d.ts +1 -1
  169. package/dist/types/boolean-logic/combinators/And.d.ts.map +1 -1
  170. package/dist/types/boolean-logic/combinators/Compare.d.ts +3 -3
  171. package/dist/types/boolean-logic/combinators/Compare.d.ts.map +1 -1
  172. package/dist/types/boolean-logic/combinators/Not.d.ts +5 -6
  173. package/dist/types/boolean-logic/combinators/Not.d.ts.map +1 -1
  174. package/dist/types/boolean-logic/combinators/Some.d.ts +8 -0
  175. package/dist/types/boolean-logic/combinators/Some.d.ts.map +1 -0
  176. package/dist/types/boolean-logic/combinators/Some.js +1 -0
  177. package/dist/types/boolean-logic/combinators/index.d.ts +1 -0
  178. package/dist/types/boolean-logic/combinators/index.d.ts.map +1 -1
  179. package/dist/types/boolean-logic/combinators/index.js +1 -0
  180. package/dist/types/boolean-logic/narrowing/AsDoneFn.d.ts +2 -2
  181. package/dist/types/boolean-logic/narrowing/AsDoneFn.d.ts.map +1 -1
  182. package/dist/types/boolean-logic/operators/ApiOperators.d.ts +11 -0
  183. package/dist/types/boolean-logic/operators/ApiOperators.d.ts.map +1 -0
  184. package/dist/types/boolean-logic/operators/ApiOperators.js +1 -0
  185. package/dist/types/boolean-logic/operators/Extends.d.ts +2 -1
  186. package/dist/types/boolean-logic/operators/Extends.d.ts.map +1 -1
  187. package/dist/types/boolean-logic/operators/HasSameValues.d.ts +4 -3
  188. package/dist/types/boolean-logic/operators/HasSameValues.d.ts.map +1 -1
  189. package/dist/types/boolean-logic/operators/IsBoolean.d.ts +2 -1
  190. package/dist/types/boolean-logic/operators/IsBoolean.d.ts.map +1 -1
  191. package/dist/types/boolean-logic/operators/IsCssHexadecimal.d.ts +9 -0
  192. package/dist/types/boolean-logic/operators/IsCssHexadecimal.d.ts.map +1 -0
  193. package/dist/types/boolean-logic/operators/IsCssHexadecimal.js +1 -0
  194. package/dist/types/boolean-logic/operators/IsEqual.d.ts +7 -1
  195. package/dist/types/boolean-logic/operators/IsEqual.d.ts.map +1 -1
  196. package/dist/types/boolean-logic/operators/IsGreaterThan.d.ts +2 -2
  197. package/dist/types/boolean-logic/operators/IsGreaterThan.d.ts.map +1 -1
  198. package/dist/types/boolean-logic/operators/IsLessThan.d.ts +13 -0
  199. package/dist/types/boolean-logic/operators/IsLessThan.d.ts.map +1 -0
  200. package/dist/types/boolean-logic/operators/IsLessThan.js +1 -0
  201. package/dist/types/boolean-logic/operators/IsNever.d.ts +2 -1
  202. package/dist/types/boolean-logic/operators/IsNever.d.ts.map +1 -1
  203. package/dist/types/boolean-logic/operators/IsNumber.d.ts +2 -2
  204. package/dist/types/boolean-logic/operators/IsNumber.d.ts.map +1 -1
  205. package/dist/types/boolean-logic/operators/IsString.d.ts +2 -2
  206. package/dist/types/boolean-logic/operators/IsString.d.ts.map +1 -1
  207. package/dist/types/boolean-logic/operators/IsUnset.d.ts +9 -0
  208. package/dist/types/boolean-logic/operators/IsUnset.d.ts.map +1 -0
  209. package/dist/types/boolean-logic/operators/IsUnset.js +1 -0
  210. package/dist/types/boolean-logic/operators/IsUrl.d.ts +35 -0
  211. package/dist/types/boolean-logic/operators/IsUrl.d.ts.map +1 -0
  212. package/dist/types/boolean-logic/operators/IsUrl.js +1 -0
  213. package/dist/types/boolean-logic/operators/Network-operators.d.ts +71 -0
  214. package/dist/types/boolean-logic/operators/Network-operators.d.ts.map +1 -0
  215. package/dist/types/boolean-logic/operators/Network-operators.js +1 -0
  216. package/dist/types/boolean-logic/operators/PhoneOperators.d.ts +33 -0
  217. package/dist/types/boolean-logic/operators/PhoneOperators.d.ts.map +1 -0
  218. package/dist/types/boolean-logic/operators/PhoneOperators.js +1 -0
  219. package/dist/types/boolean-logic/operators/YouTube-operators.d.ts +32 -0
  220. package/dist/types/boolean-logic/operators/YouTube-operators.d.ts.map +1 -0
  221. package/dist/types/boolean-logic/operators/YouTube-operators.js +1 -0
  222. package/dist/types/boolean-logic/operators/index.d.ts +7 -1
  223. package/dist/types/boolean-logic/operators/index.d.ts.map +1 -1
  224. package/dist/types/boolean-logic/operators/index.js +7 -1
  225. package/dist/types/dictionary/Keys.d.ts +58 -4
  226. package/dist/types/dictionary/Keys.d.ts.map +1 -1
  227. package/dist/types/dictionary/KvFn.d.ts +2 -2
  228. package/dist/types/dictionary/KvFn.d.ts.map +1 -1
  229. package/dist/types/dictionary/MakeKeysOptional.d.ts +12 -3
  230. package/dist/types/dictionary/MakeKeysOptional.d.ts.map +1 -1
  231. package/dist/types/dictionary/MakeKeysRequired.d.ts +14 -0
  232. package/dist/types/dictionary/MakeKeysRequired.d.ts.map +1 -0
  233. package/dist/types/dictionary/MakeKeysRequired.js +1 -0
  234. package/dist/types/dictionary/OptionalKeys.d.ts +19 -4
  235. package/dist/types/dictionary/OptionalKeys.d.ts.map +1 -1
  236. package/dist/types/dictionary/OptionalKeys.js +1 -0
  237. package/dist/types/dictionary/RequiredKeys.d.ts +14 -6
  238. package/dist/types/dictionary/RequiredKeys.d.ts.map +1 -1
  239. package/dist/types/dictionary/Values.d.ts +2 -2
  240. package/dist/types/dictionary/Values.d.ts.map +1 -1
  241. package/dist/types/dictionary/index.d.ts +1 -2
  242. package/dist/types/dictionary/index.d.ts.map +1 -1
  243. package/dist/types/dictionary/index.js +1 -2
  244. package/dist/types/errors/KindError.d.ts +1 -1
  245. package/dist/types/errors/KindError.d.ts.map +1 -1
  246. package/dist/types/functions/FnFrom.d.ts +5 -0
  247. package/dist/types/functions/FnFrom.d.ts.map +1 -1
  248. package/dist/types/functions/{Fn.d.ts → FnWithDescription.d.ts} +2 -2
  249. package/dist/types/functions/FnWithDescription.d.ts.map +1 -0
  250. package/dist/types/functions/FnWithDescription.js +1 -0
  251. package/dist/types/functions/WrapperFn.d.ts +23 -0
  252. package/dist/types/functions/WrapperFn.d.ts.map +1 -0
  253. package/dist/types/functions/WrapperFn.js +1 -0
  254. package/dist/types/functions/index.d.ts +2 -1
  255. package/dist/types/functions/index.d.ts.map +1 -1
  256. package/dist/types/functions/index.js +2 -1
  257. package/dist/types/lists/ConvertSet.d.ts +2 -2
  258. package/dist/types/lists/ConvertSet.d.ts.map +1 -1
  259. package/dist/types/lists/Find.d.ts +7 -18
  260. package/dist/types/lists/Find.d.ts.map +1 -1
  261. package/dist/types/literals/DoneFnTuple.d.ts +3 -3
  262. package/dist/types/literals/DoneFnTuple.d.ts.map +1 -1
  263. package/dist/types/literals/Unset.d.ts +13 -0
  264. package/dist/types/literals/Unset.d.ts.map +1 -0
  265. package/dist/types/literals/Unset.js +1 -0
  266. package/dist/types/literals/index.d.ts +1 -0
  267. package/dist/types/literals/index.d.ts.map +1 -1
  268. package/dist/types/literals/index.js +1 -0
  269. package/dist/types/numeric-literals/NumberLike.d.ts +1 -1
  270. package/dist/types/numeric-literals/NumberLike.d.ts.map +1 -1
  271. package/dist/types/string-literals/Proxmox.d.ts +7 -0
  272. package/dist/types/string-literals/Proxmox.d.ts.map +1 -0
  273. package/dist/types/string-literals/Proxmox.js +1 -0
  274. package/dist/types/string-literals/RetainUntil.d.ts +33 -0
  275. package/dist/types/string-literals/RetainUntil.d.ts.map +1 -0
  276. package/dist/types/string-literals/RetainUntil.js +1 -0
  277. package/dist/types/string-literals/Split.d.ts +3 -3
  278. package/dist/types/string-literals/Split.d.ts.map +1 -1
  279. package/dist/types/string-literals/StripAfter.d.ts +2 -2
  280. package/dist/types/string-literals/StripAfter.d.ts.map +1 -1
  281. package/dist/types/string-literals/StripBefore.d.ts +2 -2
  282. package/dist/types/string-literals/StripBefore.d.ts.map +1 -1
  283. package/dist/types/string-literals/StripLeading.d.ts +2 -2
  284. package/dist/types/string-literals/StripLeading.d.ts.map +1 -1
  285. package/dist/types/string-literals/StripUntil.d.ts +18 -0
  286. package/dist/types/string-literals/StripUntil.d.ts.map +1 -0
  287. package/dist/types/string-literals/StripUntil.js +1 -0
  288. package/dist/types/string-literals/character-sets/DomainName.d.ts +17 -18
  289. package/dist/types/string-literals/character-sets/DomainName.d.ts.map +1 -1
  290. package/dist/types/string-literals/character-sets/IpAddress.d.ts +28 -4
  291. package/dist/types/string-literals/character-sets/IpAddress.d.ts.map +1 -1
  292. package/dist/types/string-literals/character-sets/Optional.d.ts +14 -0
  293. package/dist/types/string-literals/character-sets/Optional.d.ts.map +1 -0
  294. package/dist/types/string-literals/character-sets/Optional.js +1 -0
  295. package/dist/types/string-literals/character-sets/Repos.d.ts.map +1 -1
  296. package/dist/types/string-literals/character-sets/Url.d.ts +85 -37
  297. package/dist/types/string-literals/character-sets/Url.d.ts.map +1 -1
  298. package/dist/types/string-literals/character-sets/Url.js +1 -0
  299. package/dist/types/string-literals/character-sets/Whitespace.d.ts +3 -1
  300. package/dist/types/string-literals/character-sets/Whitespace.d.ts.map +1 -1
  301. package/dist/types/string-literals/character-sets/YouTube.d.ts +127 -0
  302. package/dist/types/string-literals/character-sets/YouTube.d.ts.map +1 -0
  303. package/dist/types/string-literals/character-sets/YouTube.js +1 -0
  304. package/dist/types/string-literals/character-sets/index.d.ts +3 -0
  305. package/dist/types/string-literals/character-sets/index.d.ts.map +1 -1
  306. package/dist/types/string-literals/character-sets/index.js +3 -0
  307. package/dist/types/string-literals/character-sets/phone.d.ts +192 -0
  308. package/dist/types/string-literals/character-sets/phone.d.ts.map +1 -0
  309. package/dist/types/string-literals/character-sets/phone.js +1 -0
  310. package/dist/types/string-literals/index.d.ts +2 -0
  311. package/dist/types/string-literals/index.d.ts.map +1 -1
  312. package/dist/types/string-literals/index.js +2 -0
  313. package/dist/types/tsconfig.tsbuildinfo +1 -1
  314. package/dist/types/type-conversion/ReduceValues.d.ts +19 -0
  315. package/dist/types/type-conversion/ReduceValues.d.ts.map +1 -0
  316. package/dist/types/type-conversion/ReduceValues.js +1 -0
  317. package/dist/types/type-conversion/ReturnValues.d.ts +10 -6
  318. package/dist/types/type-conversion/ReturnValues.d.ts.map +1 -1
  319. package/dist/types/type-conversion/Trim.d.ts +3 -1
  320. package/dist/types/type-conversion/Trim.d.ts.map +1 -1
  321. package/dist/types/type-conversion/UnionFilter.d.ts +2 -2
  322. package/dist/types/type-conversion/UnionFilter.d.ts.map +1 -1
  323. package/dist/types/type-conversion/form-fields.d.ts +5 -1
  324. package/dist/types/type-conversion/form-fields.d.ts.map +1 -1
  325. package/dist/types/type-conversion/index.d.ts +1 -0
  326. package/dist/types/type-conversion/index.d.ts.map +1 -1
  327. package/dist/types/type-conversion/index.js +1 -0
  328. package/package.json +17 -11
  329. package/dist/constants/Network.d.ts +0 -22
  330. package/dist/constants/Network.d.ts.map +0 -1
  331. package/dist/constants/Network.js +0 -21
  332. package/dist/runtime/boolean-logic/handleDoneFn.d.ts.map +0 -1
  333. package/dist/types/boolean-logic/operators/IsHexadecimal.d.ts +0 -9
  334. package/dist/types/boolean-logic/operators/IsHexadecimal.d.ts.map +0 -1
  335. package/dist/types/dictionary/PrivateKeys.d.ts +0 -17
  336. package/dist/types/dictionary/PrivateKeys.d.ts.map +0 -1
  337. package/dist/types/dictionary/PublicKeys.d.ts +0 -10
  338. package/dist/types/dictionary/PublicKeys.d.ts.map +0 -1
  339. package/dist/types/functions/Fn.d.ts.map +0 -1
  340. /package/dist/runtime/{boolean-logic → api}/handleDoneFn.d.ts +0 -0
  341. /package/dist/runtime/{boolean-logic → api}/handleDoneFn.js +0 -0
  342. /package/dist/types/{boolean-logic/operators/IsHexadecimal.js → base-types/fns/EscapeFunction.js} +0 -0
  343. /package/dist/types/{dictionary/PrivateKeys.js → base-types/fns/OptionalParamFn.js} +0 -0
  344. /package/dist/types/{dictionary/PublicKeys.js → boolean-logic/branching/IfUnset.js} +0 -0
  345. /package/dist/types/{functions/Fn.js → boolean-logic/branching/WhenNever.js} +0 -0
@@ -1,4 +1,4 @@
1
- import { AlphaNumericChar, As, AsString, ExpandUnion, IsStringLiteral, IsTrue, StripAfter, StripBefore, StripChars, StripLeading, StripTrailing, TupleToUnion, DnsName, DomainName, Ip4Address, Mutable, Values, Flatten, EmptyObject } from "../../index";
1
+ import { AlphaNumericChar, AsString, ExpandUnion, IsStringLiteral, StripAfter, StripChars, StripLeading, StripTrailing, TupleToUnion, DnsName, DomainName, Ip4Address, Mutable, Values, Flatten, EmptyObject, IsEqual, NumericChar, RetainWhile, AsNumber, StripWhile } from "../../index";
2
2
  import { NETWORK_PROTOCOL_LOOKUP } from "../../../constants/index";
3
3
  export type NetworkProtocol = Exclude<TupleToUnion<Mutable<Flatten<Values<typeof NETWORK_PROTOCOL_LOOKUP>>>>, "">;
4
4
  /**
@@ -20,9 +20,22 @@ export type PortSpecifierOptions = {
20
20
  portRequirement?: "optional" | "required" | "not-allowed";
21
21
  ports?: number;
22
22
  };
23
+ /**
24
+ * **GetUrlProtocol**`<T>`
25
+ *
26
+ * Gets the network protocol used in the URL string passed into `T`.
27
+ */
28
+ export type GetUrlProtocol<T> = T extends string ? T extends `${NetworkProtocolPrefix}${string}` ? StripAfter<T, "://"> : IsEqual<T, string> extends true ? string : never : never;
29
+ /**
30
+ * **GetUrlProtocolPrefix**`<T>`
31
+ *
32
+ * Just like `GetUrlProtocol` but adds in the `://` so long
33
+ * as there's a protocol found.
34
+ */
35
+ export type GetUrlProtocolPrefix<T> = T extends string ? GetUrlProtocol<T> extends NetworkProtocol ? NetworkProtocolPrefix<GetUrlProtocol<T>> : "" : "";
23
36
  type _Ports<TOpt extends PortSpecifierOptions> = TOpt["ports"] extends number ? `${TOpt["ports"]}` : `${number}`;
24
37
  /**
25
- * **PortSpecifier**`<TOpt>`
38
+ * **UrlPort**`<TOpt>`
26
39
  *
27
40
  * Produces a string literal for the _port_ designation of
28
41
  * many protocols. Basically just a `:${number}` and
@@ -33,49 +46,55 @@ type _Ports<TOpt extends PortSpecifierOptions> = TOpt["ports"] extends number ?
33
46
  * - `required`
34
47
  * - or `not-allowed`
35
48
  */
36
- export type PortSpecifier<TOpt extends PortSpecifierOptions = {
49
+ export type UrlPort<TOpt extends PortSpecifierOptions = {
37
50
  portRequirement: "not-allowed";
38
51
  ports: number;
39
52
  }> = [TOpt["portRequirement"]] extends ["required"] ? `:${_Ports<TOpt>}` : [TOpt["portRequirement"]] extends ["optional"] ? "" | `:${_Ports<TOpt>}` : ``;
53
+ /**
54
+ * **GetUrlPort**`<T>`
55
+ *
56
+ * Returns the port designated in the URL passed in if found.
57
+ *
58
+ * - if `T` is a literal string and port not found then value is "default"
59
+ * - if `T` is a wide string then the value will be `number | "default"`
60
+ * - all non-string based values result in `never`
61
+ */
62
+ export type GetUrlPort<T> = T extends string ? IsStringLiteral<T> extends true ? RemoveNetworkProtocol<T> extends `${string}:${infer Port extends number}${infer Rest}` ? AsNumber<RetainWhile<`${Port}${Rest}`, NumericChar>> : "default" : number | "default" : never;
63
+ /**
64
+ * **RemoveUrlPort**`<T,[TOpt]>`
65
+ *
66
+ * Removes a _port specification_ in a URL if found otherwise returns string literal
67
+ * as it was.
68
+ */
69
+ export type RemoveUrlPort<T> = T extends string ? IsStringLiteral<T> extends true ? RemoveNetworkProtocol<T> extends `${infer Before}:${infer _Port extends `${number}`}${infer After}` ? `${GetUrlProtocolPrefix<T>}${Before}${StripWhile<After, NumericChar>}` : T : string : never;
40
70
  export type ProtocolOptions = {
41
71
  /**
42
72
  * whether the protocol prefix should be optional
43
73
  * @default false
44
74
  */
45
- optional?: boolean;
75
+ protocolOptional?: boolean;
46
76
  /**
47
- * whether to allow for `http://` along with `https://`
48
- * @default false
77
+ * The Network Protocols to use.
49
78
  */
50
- allowInsecure?: boolean;
51
- protocol?: "http" | "ws" | "both";
79
+ protocols?: NetworkProtocol[];
80
+ };
81
+ export type UrlOptions = {
82
+ /**
83
+ * Specify how you'd like to allow for queryParameters in the URL's
84
+ * you're generating.
85
+ *
86
+ * - you may choose "any", "none"
87
+ *
88
+ * @default "any"
89
+ */
90
+ queryParameters?: "any" | "none";
52
91
  };
53
- /**
54
- * **HttpProtocol**`<[TOpt]>`
55
- *
56
- * A utility which provides different ways of
57
- * requiring an **HTTP** based protocol string.
58
- *
59
- * - by default this only allows `https://`
60
- * - you can choose to make the protocol _optional_
61
- * or enable insure `http://` too.
62
- */
63
- export type WebsocketProtocol<TOpt extends ProtocolOptions = EmptyObject> = IsTrue<TOpt["allowInsecure"]> extends true ? IsTrue<TOpt["optional"]> extends true ? `wss://` | `ws://` | "" : `wss://` | `ws://` : IsTrue<TOpt["optional"]> extends true ? `wss://` | "" : `wss://`;
64
- /**
65
- * **HttpProtocol**`<[TOpt]>`
66
- *
67
- * A utility which provides different ways of
68
- * requiring an **HTTP** based protocol string.
69
- *
70
- * - by default this only allows `https://`
71
- * - you can choose to make the protocol _optional_
72
- * or enable insure `http://` too.
73
- */
74
- export type HttpProtocol<TOpt extends ProtocolOptions = EmptyObject> = IsTrue<TOpt["allowInsecure"]> extends true ? IsTrue<TOpt["optional"]> extends true ? `https://` | `http://` | "" : `https://` | `http://` : IsTrue<TOpt["optional"]> extends true ? `https://` | "" : `https://`;
75
92
  /**
76
93
  * **RemoveHttpProtocol**`<T>`
77
94
  *
78
95
  * Removes both `http://` and `https://` prefixes to a string.
96
+ *
97
+ * **Related:** `RemoveNetworkProtocol`
79
98
  */
80
99
  export type RemoveHttpProtocol<T extends string> = T extends `http://${infer Insecure}` ? Insecure : T extends `https://${infer Secure}` ? Secure : T;
81
100
  /**
@@ -88,6 +107,7 @@ export type RemoveHttpProtocol<T extends string> = T extends `http://${infer Ins
88
107
  * `TProtocol`
89
108
  */
90
109
  export type RemoveNetworkProtocol<TContent extends string, TProtocol extends NetworkProtocol = NetworkProtocol> = TContent extends `${NetworkProtocolPrefix<TProtocol>}${infer Rest}` ? Rest : TContent;
110
+ type UrlPathChars = AlphaNumericChar | "_" | "@" | "." | "-";
91
111
  /**
92
112
  * **UrlPath**`<T>`
93
113
  *
@@ -101,7 +121,7 @@ export type RemoveNetworkProtocol<TContent extends string, TProtocol extends Net
101
121
  * pass in a string to `T` and it will be validated and return
102
122
  * `never` when an invalid character is used.
103
123
  */
104
- export type UrlPath<T extends string | null = null> = T extends null ? "" | `/${AlphaNumericChar | "_"}${string}` : T extends string ? IsStringLiteral<T> extends true ? T extends `${string}/` ? never : StripChars<T, AlphaNumericChar | "/" | "_" | "." | "-"> extends "" ? T : never : never : never;
124
+ export type UrlPath<T extends string | null = null> = T extends null ? "" | `/${UrlPathChars}${string}` : T extends string ? IsStringLiteral<T> extends true ? T extends `${string}/` ? never : StripChars<T, UrlPathChars | "/"> extends "" ? T : never : never : never;
105
125
  /**
106
126
  * **GetUrlSource**`<T>`
107
127
  *
@@ -110,8 +130,17 @@ export type UrlPath<T extends string | null = null> = T extends null ? "" | `/${
110
130
  * - if _not_ a string literal then just proxies through `string`
111
131
  * - if not able to find it then it returns the literal ''
112
132
  */
113
- export type GetUrlSource<T extends string> = IsStringLiteral<T> extends true ? RemoveNetworkProtocol<T> extends `${infer Domain extends DnsName | Ip4Address}${"" | `/${string}`}` ? StripAfter<Domain, "/"> : "" : string;
114
- type _GetUrlPath<T extends string> = StripAfter<As<StripBefore<RemoveNetworkProtocol<T>, "/">, string>, "?"> extends string ? StripAfter<As<StripBefore<RemoveNetworkProtocol<T>, "/">, string>, "?"> : never;
133
+ export type GetUrlSource<T extends string> = IsStringLiteral<T> extends true ? StripAfter<StripAfter<RemoveNetworkProtocol<T>, "/">, ":"> extends `${infer Domain extends DnsName | Ip4Address}` ? Domain : never : string;
134
+ /**
135
+ * **RemoveUrlSource**`<T>`
136
+ *
137
+ * Removes the URL source (aka, domain name or IP address) from a URL string when
138
+ * it can be identified.
139
+ */
140
+ export type RemoveUrlSource<T extends string> = IsStringLiteral<T> extends true ? GetUrlSource<T> extends string ? IsStringLiteral<GetUrlSource<T>> extends true ? T extends `${infer Before}${GetUrlSource<T>}${infer After}` ? `${Before}${After}` : T : T : T : string;
141
+ type _GetUrlPath<T extends string> = [
142
+ T
143
+ ] extends [`${string}//${string}`] ? never : T extends "" ? "" : StripAfter<T, "?"> extends "/" ? "" : T extends `/${string}` ? StripAfter<T, "?"> : never;
115
144
  /**
116
145
  * **GetUrlPath**`<T>`
117
146
  *
@@ -121,7 +150,25 @@ type _GetUrlPath<T extends string> = StripAfter<As<StripBefore<RemoveNetworkProt
121
150
  * - removes the domain name or IP address
122
151
  * - removes any trailing query parameters
123
152
  */
124
- export type GetUrlPath<T extends string> = IsStringLiteral<T> extends true ? RemoveNetworkProtocol<T> extends `${string}/${string}` ? _GetUrlPath<RemoveNetworkProtocol<T>> extends "" ? "" : `/${_GetUrlPath<RemoveNetworkProtocol<T>>}` : "" : string;
153
+ export type GetUrlPath<T extends string> = [IsStringLiteral<T>] extends [true] ? _GetUrlPath<RemoveUrlSource<RemoveNetworkProtocol<RemoveUrlPort<T>>>> : string;
154
+ /**
155
+ * **GetUrlQueryParams**`<T>`
156
+ *
157
+ * Given a URL passed into `T`, this utility will extract the
158
+ * query parameters portion of the URL or `""` if none exists.
159
+ */
160
+ export type GetUrlQueryParams<T extends string> = T extends `${string}?${infer QP}` ? `?${QP}` : "";
161
+ /**
162
+ * **AnyQueryParams**
163
+ *
164
+ * A type which represents any string value for query parameters
165
+ * or no query parameters at all.
166
+ *
167
+ * Can be quite useful for creating pattern matching types where
168
+ * you don't want to be blocked by someone having put some silly
169
+ * marketing QP at the end of a URL.
170
+ */
171
+ export type AnyQueryParams = `?${string}` | "";
125
172
  type RelativeStart = `../` | `./`;
126
173
  /**
127
174
  * **RelativeUrl**
@@ -148,8 +195,9 @@ export type Uri<T extends NetworkProtocol = NetworkProtocol> = `${T}://${string}
148
195
  */
149
196
  export type AddUrlPathSegment<TExisting extends string, TAdd extends string> = TExisting extends `${string}/` ? `${TExisting}${StripTrailing<StripLeading<TAdd, "/">, "/">}` : `${TExisting}/${StripTrailing<StripLeading<TAdd, "/">, "/">}`;
150
197
  type _Path<T extends string> = GetUrlPath<T> extends UrlPath ? GetUrlPath<T> : never;
151
- type _UrlsFromProtocol<TContent extends string, TProto extends WebsocketProtocol<TOpt> | HttpProtocol<TOpt>, TOpt extends ProtocolOptions & PortSpecifierOptions> = `${TProto}${GetUrlSource<TContent>}${PortSpecifier<TOpt>}${AddUrlPathSegment<_Path<TContent>, `${string}`>}` | `${TProto}${GetUrlSource<TContent>}${PortSpecifier<TOpt>}${_Path<TContent>}`;
152
- type _UrlsFrom<T extends string, TOpt extends ProtocolOptions & PortSpecifierOptions = EmptyObject> = TOpt["protocol"] extends "ws" ? _UrlsFromProtocol<T, WebsocketProtocol<TOpt>, TOpt> : TOpt["protocol"] extends "both" ? _UrlsFromProtocol<T, WebsocketProtocol<TOpt>, TOpt> | _UrlsFromProtocol<T, HttpProtocol<TOpt>, TOpt> : _UrlsFromProtocol<T, HttpProtocol<TOpt>, TOpt>;
198
+ type _Proto<TOpt extends ProtocolOptions & PortSpecifierOptions & UrlOptions> = NetworkProtocolPrefix<[] extends TOpt["protocols"] ? "https" : TupleToUnion<TOpt["protocols"]>>;
199
+ type _QP<TOpt extends ProtocolOptions & PortSpecifierOptions & UrlOptions> = TOpt["queryParameters"] extends "none" ? "" : `${AnyQueryParams}`;
200
+ type _UrlsFrom<TContent extends string, TOpt extends ProtocolOptions & PortSpecifierOptions & UrlOptions> = [TOpt["protocolOptional"]] extends [true] ? `${_Proto<TOpt>}${GetUrlSource<TContent>}${UrlPort<TOpt>}${AddUrlPathSegment<_Path<TContent>, `${string}`>}` | `${_Proto<TOpt>}${GetUrlSource<TContent>}${UrlPort<TOpt>}${_Path<TContent>}${_QP<TOpt>}` | `${GetUrlSource<TContent>}${UrlPort<TOpt>}${_Path<TContent>}${_QP<TOpt>}` | `${GetUrlSource<TContent>}${UrlPort<TOpt>}${AddUrlPathSegment<_Path<TContent>, `${string}`>}` : `${_Proto<TOpt>}${GetUrlSource<TContent>}${UrlPort<TOpt>}${AddUrlPathSegment<_Path<TContent>, `${string}`>}` | `${_Proto<TOpt>}${GetUrlSource<TContent>}${UrlPort<TOpt>}${_Path<TContent>}${_QP<TOpt>}`;
153
201
  /**
154
202
  * **UrlsFrom**`<T, [TOpt]>`
155
203
  *
@@ -161,7 +209,7 @@ type _UrlsFrom<T extends string, TOpt extends ProtocolOptions & PortSpecifierOpt
161
209
  * - you can also switch the protocol between `http`,`ws`, or `both`
162
210
  * - the default protocol is `http`
163
211
  */
164
- export type UrlsFrom<T extends string | readonly string[], TOpt extends ProtocolOptions & PortSpecifierOptions = EmptyObject> = T extends string ? ExpandUnion<_UrlsFrom<T, TOpt>> : T extends readonly string[] ? TupleToUnion<{
212
+ export type UrlsFrom<T extends string | readonly string[], TOpt extends ProtocolOptions & PortSpecifierOptions & UrlOptions = EmptyObject> = T extends string ? ExpandUnion<_UrlsFrom<T, TOpt>> : T extends readonly string[] ? TupleToUnion<{
165
213
  [K in keyof T]: IsStringLiteral<T[K]> extends true ? ExpandUnion<_UrlsFrom<AsString<T[K]>, TOpt>> : never;
166
214
  }> : never;
167
215
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"Url.d.ts","sourceRoot":"","sources":["../../../../src/types/string-literals/character-sets/Url.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAChB,EAAE,EACF,QAAQ,EACR,WAAW,EACX,eAAe,EACf,MAAM,EACN,UAAU,EACV,WAAW,EACX,UAAU,EACV,YAAY,EACZ,aAAa,EACb,YAAY,EACZ,OAAO,EAAE,UAAU,EACnB,UAAU,EACV,OAAO,EACP,MAAM,EACN,OAAO,EACP,WAAW,EACZ,oBAAwB;AACzB,OAAO,EAAE,uBAAuB,EAAE,iCAA4B;AAE9D,MAAM,MAAM,eAAe,GAAG,OAAO,CAAC,YAAY,CAChD,OAAO,CACL,OAAO,CAAC,MAAM,CAAC,OAAO,uBAAuB,CAAC,CAAC,CAChD,CACF,EAAE,EAAE,CAAC,CAAC;AAEP;;;;;GAKG;AACH,MAAM,MAAM,qBAAqB,CAC/B,CAAC,SAAS,eAAe,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C,QAAQ,CAAC,EAAE,GAAG,MAAM,EAAE,CAAC,EAAE,GAE7F,GAAG,MAAM,CAAC,IAAI,CAAC,GAAG,YAAY,CAAC,QAAQ,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,GAAG,iBAAiB,CAAC,KAAK,CAAC,QAAQ,CAAC,EAAE,GAAG,MAAM,EAAE,CAAC,EAAE,GAC9G,GAAG,MAAM,CAAC,IAAI,CAAC,GAAG,YAAY,CAAC,QAAQ,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,GAAG,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC;AAGzF;;;;;;;;;;GAUG;AACH,MAAM,MAAM,QAAQ,CAClB,CAAC,SAAS,MAAM,GAAG,SAAS,MAAM,EAAE,EACpC,IAAI,SAAS,eAAe,GAAG,oBAAoB,GAAG,UAAU,GAAG,WAAW,IAC5E,CAAC,SAAS,MAAM,GAClB,WAAW,CAAC,SAAS,CAAC,CAAC,EAAC,IAAI,CAAC,CAAC,GAC9B,CAAC,SAAS,SAAS,MAAM,EAAE,GACzB,YAAY,CACZ;KACG,CAAC,IAAI,MAAM,CAAC,GAAG,eAAe,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,IAAI,GAC9C,WAAW,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,GAC5C,KAAK;CACV,CACF,GACC,KAAK,CAAC"}
@@ -1 +1,2 @@
1
+ ;
1
2
  export {};
@@ -1,7 +1,9 @@
1
+ import { WHITESPACE_CHARS } from "../../../constants/index";
2
+ import { Mutable, TupleToUnion } from "../../index";
1
3
  /**
2
4
  * **Whitespace**
3
5
  *
4
6
  * Characters typically representing "white space"
5
7
  */
6
- export type Whitespace = " " | "\n" | "\t";
8
+ export type Whitespace = TupleToUnion<Mutable<typeof WHITESPACE_CHARS>>;
7
9
  //# sourceMappingURL=Whitespace.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Whitespace.d.ts","sourceRoot":"","sources":["../../../../src/types/string-literals/character-sets/Whitespace.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,MAAM,UAAU,GAAG,GAAG,GAAG,IAAI,GAAG,IAAI,CAAC"}
1
+ {"version":3,"file":"Whitespace.d.ts","sourceRoot":"","sources":["../../../../src/types/string-literals/character-sets/Whitespace.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,iCAA4B;AACvD,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,oBAAwB;AAExD;;;;GAIG;AACH,MAAM,MAAM,UAAU,GAAG,YAAY,CAAC,OAAO,CAAC,OAAO,gBAAgB,CAAC,CAAC,CAAC"}
@@ -0,0 +1,127 @@
1
+ import { AsString, Contains, HasQueryParameter, IsEqual, IsUnion, Last, Split, TupleToUnion, UnionToTuple, AnyQueryParams, GetUrlPath, UrlsFrom, Optional } from "../../index";
2
+ /**
3
+ * **YouTubePageType**
4
+ *
5
+ * A union type enumeration of the _types_ of pages on YouTube.
6
+ */
7
+ export type YouTubePageType = "home" | "play::video::solo" | "play::video::solo::share-link" | "play::video::solo::share-link::with-timestamp" | "play::video::in-list" | "play::video::in-list::share-link" | "play::video::in-list::share-link::with-timestamp" | "playlist::show" | "creator::featured" | "creator::videos" | "creator::playlists" | "creator::other" | "feed::history" | "feed::playlists" | "feed::liked" | "feed::subscriptions" | "feed::trending" | "feed::other" | "other";
8
+ export type YouTubeFeedType = "history" | "playlists" | "liked" | "subscriptions" | "trending" | "other";
9
+ /**
10
+ * **YouTubeUrl**
11
+ *
12
+ * A type which should match all URL's pointing to YouTube
13
+ */
14
+ export type YouTubeUrl = UrlsFrom<["www.youtube.com", "youtube.com", "youtu.be"]>;
15
+ /**
16
+ * **YouTubeHome**
17
+ *
18
+ * The URLs representing the home page of YouTube
19
+ */
20
+ export type YouTubeHome = `https://www.youtube.com${AnyQueryParams}` | `https://youtube.com${AnyQueryParams}`;
21
+ /**
22
+ * **YouTubeShareUrl**
23
+ *
24
+ * a URL which comes from YouTube's _URL shortened_ `https://youtu.be` site.
25
+ */
26
+ export type YouTubeShareUrl = UrlsFrom<"youtu.be">;
27
+ /**
28
+ * **YouTubeVideo**
29
+ *
30
+ * Type pattern which will match all URL's which relate to
31
+ * a YouTubeVideo.
32
+ *
33
+ * **Note:** there can be some _false positives_ when the query parameters
34
+ * may state that this is a video to watch in a list of videos. You can avoid
35
+ * this ambiguity with the `IsYouTubeVideo` and `IsYouTubeList` operators.
36
+ */
37
+ export type YouTubeVideoUrl = UrlsFrom<[
38
+ "www.youtube.com/watch",
39
+ "youtube.com/watch"
40
+ ]> | YouTubeShareUrl;
41
+ /**
42
+ * **YouTubeCreatorUrl**
43
+ *
44
+ * Pages associated with a YouTube creator. This can include your own
45
+ * pages even if you don't consider yourself a full creator (yet).
46
+ */
47
+ export type YouTubeCreatorUrl = UrlsFrom<[
48
+ `www.youtube.com/channel/${string}`,
49
+ `youtube.com/channel/${string}`
50
+ ]> | `https://www.youtube.com/@${string}${Optional<"/featured" | "/videos" | "/playlists">}`;
51
+ /**
52
+ * **YouTubePlaylistUrl**
53
+ *
54
+ * A URL pattern which should match all playlist URL's on YouTube.
55
+ * That includes both the logged in user's as well as other peoples.
56
+ *
57
+ * **Related:** `YouTubeUsersPlaylistUrl`
58
+ */
59
+ export type YouTubePlaylistUrl = UrlsFrom<[
60
+ `www.youtube.com/channel/playlists`,
61
+ `www.youtube.com/@${string}/playlists`,
62
+ `youtube.com/channel/playlists`,
63
+ `youtube.com/@${string}/playlists`
64
+ ]> | YouTubeUsersPlaylistUrl;
65
+ type _FeedMap<T extends YouTubeFeedType> = IsEqual<T, YouTubeFeedType> extends true ? `feed` : T extends "liked" ? `playlist?list=LL` : Contains<["history", "playlists", "trending", "subscriptions"], T> extends true ? `feed/${T}` : `feed/${string}`;
66
+ /**
67
+ * Maps the feed type to a URL path
68
+ */
69
+ type FeedMap<T extends YouTubeFeedType> = IsUnion<T> extends true ? TupleToUnion<{
70
+ [K in keyof UnionToTuple<T>]: UnionToTuple<T>[K] extends YouTubeFeedType ? _FeedMap<UnionToTuple<T>[K]> : never;
71
+ }> : _FeedMap<T>;
72
+ /**
73
+ * **YouTubeFeedUrl**`<[T]>`
74
+ *
75
+ * A URL pattern which matches all "feeds" on YouTube where
76
+ * "feeds" are pages that organize videos/content for a logged
77
+ * in user based on their configuration.
78
+ *
79
+ * By default, all feed URLs are matched but you can narrow
80
+ * this matching down by choosing a value for `T` in the
81
+ * `YouTubeFeedType` union.
82
+ */
83
+ export type YouTubeFeedUrl<T extends YouTubeFeedType = YouTubeFeedType> = `https://www.youtube.com/${AsString<FeedMap<T>>}${string}` | `https://youtube.com/${AsString<FeedMap<T>>}${string}`;
84
+ /**
85
+ * **YouTubeUsersPlaylistUrl**
86
+ *
87
+ * The URL which brings a logged in user to their own playlists.
88
+ *
89
+ * **Related:** `YouTubePlaylistUrl`
90
+ */
91
+ export type YouTubeUsersPlaylistUrl = `https://www.youtube.com/feed/playlists${AnyQueryParams}`;
92
+ /**
93
+ * **YouTubeLikedPlaylistUrl**
94
+ *
95
+ * The URL which brings a logged in user to a playlist of their _liked_
96
+ * videos.
97
+ */
98
+ export type YouTubeLikedPlaylistUrl = `https://www.youtube.com/playlist?${string}list=LL${string}`;
99
+ /**
100
+ * **YouTubeVideosInPlaylist**
101
+ *
102
+ * A URL which shows all the videos in a given playlist
103
+ */
104
+ export type YouTubeVideosInPlaylist = `https://www.youtube.com/playlist?${string}list=${string}`;
105
+ /**
106
+ * **YouTubeHistoryUrl**
107
+ *
108
+ * The URL which brings a logged in user to a list of their previously watched
109
+ * videos.
110
+ */
111
+ export type YouTubeHistoryUrl = `https://www.youtube.com/feed/history${AnyQueryParams}`;
112
+ /**
113
+ * **YouTubeSubscriptionsUrl**
114
+ *
115
+ * The URL which brings a logged in user to their list of subscriptions.
116
+ */
117
+ export type YouTubeSubscriptionsUrl = `https://www.youtube.com/feed/subscriptions${AnyQueryParams}`;
118
+ /**
119
+ * **GetYouTubePageType**`<T>`
120
+ *
121
+ * Given a URL passed into `T`, this utility will give you an indication
122
+ * of what type of YouTube content you'll find at this location (or return
123
+ * _never_ if it's not a YouTube URL).
124
+ */
125
+ export type GetYouTubePageType<T> = T extends YouTubeUrl ? T extends YouTubeHome ? "home" : T extends YouTubeVideoUrl ? HasQueryParameter<T, "list"> extends true ? T extends YouTubeShareUrl ? HasQueryParameter<T, "t"> extends true ? "play::video::in-list::share-link::with-timestamp" : "play::video::in-list::share-link" : "play::video::in-list" : T extends YouTubeShareUrl ? HasQueryParameter<T, "t"> extends true ? "play::video::solo::share-link::with-timestamp" : "play::video::solo::share-link" : "play::video::solo" : T extends YouTubeCreatorUrl ? GetUrlPath<T> extends `${string}/videos` ? "creator::videos" : GetUrlPath<T> extends `${string}/playlists` ? "creator::playlists" : Last<Split<GetUrlPath<T>, "/">> extends `@${string}` ? "creator::featured" : GetUrlPath<T> extends `${string}/featured` ? "creator::featured" : "creator::other" : T extends YouTubeFeedUrl ? T extends YouTubeFeedUrl<"history"> ? "feed::history" : T extends YouTubeFeedUrl<"playlists"> ? "feed::playlists" : T extends YouTubeFeedUrl<"liked"> ? "feed::liked" : T extends YouTubeFeedUrl<"subscriptions"> ? "feed::subscriptions" : T extends YouTubeFeedUrl<"trending"> ? "feed::trending" : "feed::other" : T extends YouTubeVideosInPlaylist ? "playlist::show" : "other" : never;
126
+ export {};
127
+ //# sourceMappingURL=YouTube.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"YouTube.d.ts","sourceRoot":"","sources":["../../../../src/types/string-literals/character-sets/YouTube.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EACR,QAAQ,EACR,iBAAiB,EACjB,OAAO,EACP,OAAO,EACP,IAAI,EACJ,KAAK,EACL,YAAY,EACZ,YAAY,EACZ,cAAc,EACd,UAAU,EACV,QAAQ,EACR,QAAQ,EACT,oBAAwB;AAIzB;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K,CAAC"}
@@ -25,6 +25,9 @@ export * from "./CSS";
25
25
  export * from "./InlineSvg";
26
26
  export * from "./Repos";
27
27
  export * from "./Variable";
28
+ export * from "./Optional";
29
+ export * from "./YouTube";
30
+ export * from "./phone";
28
31
  export * from "./brackets/index";
29
32
  export * from "./quotation-marks/index";
30
33
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/types/string-literals/character-sets/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,OAAO,CAAC;AACtB,cAAc,OAAO,CAAC;AACtB,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,OAAO,CAAC;AACtB,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC;AACxB,cAAc,YAAY,CAAC;AAE3B,cAAc,kBAAkB,CAAC;AACjC,cAAc,yBAAyB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/types/string-literals/character-sets/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,OAAO,CAAC;AACtB,cAAc,OAAO,CAAC;AACtB,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,OAAO,CAAC;AACtB,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC;AACxB,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AAExB,cAAc,kBAAkB,CAAC;AACjC,cAAc,yBAAyB,CAAC"}
@@ -25,5 +25,8 @@ export * from "./CSS.js";
25
25
  export * from "./InlineSvg.js";
26
26
  export * from "./Repos.js";
27
27
  export * from "./Variable.js";
28
+ export * from "./Optional.js";
29
+ export * from "./YouTube.js";
30
+ export * from "./phone.js";
28
31
  export * from "./brackets/index.js";
29
32
  export * from "./quotation-marks/index.js";
@@ -0,0 +1,192 @@
1
+ import { PHONE_COUNTRY_CODES, PHONE_FORMAT } from "../../../constants/index";
2
+ import { AsString, FirstOfEach, IsLessThan, IsStringLiteral, Length, NumericChar, RetainChars, StartsWith, StripChars, Trim, TupleToUnion, Whitespace, Mutable, HasPhoneCountryCode, Optional, RetainUntil, Not, And, Throw, IsGreaterThan, HasCharacters, Extends, Or, OnPass, ErrorCondition, Unset, If, IsLength, Contains } from "../../index";
3
+ /**
4
+ * delimiter characters commonly used to separate digits in phone numbers
5
+ */
6
+ export type PhoneNumberDelimiter = " " | "-" | ".";
7
+ /**
8
+ * **PhoneFormat**
9
+ *
10
+ * A union type of _formats_ used for telephone numbers
11
+ */
12
+ export type PhoneFormat = TupleToUnion<typeof PHONE_FORMAT>;
13
+ /**
14
+ * **PhoneCountryCode**
15
+ *
16
+ * The official list of _phone_ country codes
17
+ *
18
+ * **Related:** `DialCountryCode`
19
+ */
20
+ export type PhoneCountryCode = FirstOfEach<Mutable<typeof PHONE_COUNTRY_CODES>>;
21
+ /**
22
+ * **DialCountryCode**
23
+ *
24
+ * A simplified representation of `PhoneCountryCode` so as to not make other
25
+ * phone patterns too complex.
26
+ */
27
+ export type DialCountryCode = `${"+" | "00"}${`1-${number}` | `${Exclude<NumericChar, "0">}`}${Optional<`${number}`>}`;
28
+ /**
29
+ * **LocalPhoneNumber**`<[TDelimiter]>`
30
+ *
31
+ * Provides a shape for phone numbers local a region of country that do
32
+ * not have a _country code_ designation nor what is referred to as the
33
+ * "area code" in the USA.
34
+ *
35
+ * **Related:** `CountryPhoneNumber`, `InternationalPhoneNumber`, `PhoneNumber`
36
+ */
37
+ export type LocalPhoneNumber<TDelimiter extends PhoneNumberDelimiter = PhoneNumberDelimiter> = `${NumericChar}${number}${TDelimiter}${number}`;
38
+ /**
39
+ * **PhoneAreaCode**
40
+ */
41
+ export type PhoneAreaCode = `(${number})` | `${NumericChar}${number}`;
42
+ /**
43
+ * **PhoneShortCode**`<[T]>`
44
+ *
45
+ * A [phone short code](https://en.wikipedia.org/wiki/Short_code) is a short numeric
46
+ * phone number typically used for SMS/MMS purposes but can be call based too.
47
+ *
48
+ * There are regional variances but typically are always _less_ digits than a regional
49
+ * phone number of 7 digits.
50
+ *
51
+ * This utility -- when used without a generic `T` -- will just give a basic shape
52
+ * for the short code but not really validate it.
53
+ *
54
+ * If you want validation, pass it the value you're testing in as `T`. If `T` is a
55
+ * valid short code then it will be proxied through "as is" but if it is not, it
56
+ * will be converted to an `ErrorCondition<"invalid-short-code">`
57
+ */
58
+ export type PhoneShortCode<T extends string | null = null> = T extends null ? `${NumericChar}${number}${NumericChar}` : T extends string ? IsStringLiteral<T> extends true ? T extends `${number}` ? IsGreaterThan<Length<T>, 6> extends true ? Throw<"invalid-short-code", `Short codes must be less than 7 digits [${Length<T>}]`> : T : Throw<"invalid-short-code", `Short codes may vary from region to region but they must always contain only numbers: ${T}!`> : string : never;
59
+ /**
60
+ * **CountryPhoneNumber**`<[TDelimiter]>`
61
+ *
62
+ * Provides a shape phone number meant for use within a country. It includes
63
+ * the local number plus what would be referred to as the "area code" in the
64
+ * USA.
65
+ *
66
+ * **Related:** `InternationalPhoneNumber`, `LocalPhoneNumber`, `PhoneNumber`
67
+ */
68
+ export type CountryPhoneNumber<TDelimiter extends PhoneNumberDelimiter = PhoneNumberDelimiter> = `${PhoneAreaCode}${TDelimiter}${LocalPhoneNumber<TDelimiter>}`;
69
+ /**
70
+ * **InternationalPhoneNumber**`<[TDelimiter]>`
71
+ *
72
+ * A phone number which explicitly leads by expressing the _country_ that the number belongs to.
73
+ *
74
+ * - uses `+` or `00` prefix to mark as a country code
75
+ *
76
+ * **Related:** `CountryPhoneNumber`, `LocalPhoneNumber`, `PhoneNumber`
77
+ */
78
+ export type InternationalPhoneNumber<TDelimiter extends PhoneNumberDelimiter = PhoneNumberDelimiter> = `${DialCountryCode}${TDelimiter}${CountryPhoneNumber<TDelimiter>}`;
79
+ type _RightLength<T extends string> = If<StartsWith<T, "+">, If<Contains<T, "1-">, // using 1- for country code nomenclature
80
+ If<IsLength<T, 16>, T, ErrorCondition<"invalid-raw-phone-number", `Wrong number of characters for international number: ${T}`>>, If<IsLength<T, 15>, T, ErrorCondition<"invalid-raw-phone-number", `Wrong number of characters for international number: ${T}`>>>, If<StartsWith<T, "00">, If<Contains<T, "1-">, // using 1- for country code nomenclature
81
+ If<IsLength<T, 15>, T, ErrorCondition<"invalid-raw-phone-number", `Wrong number of characters for international number: ${T}`>>, If<IsLength<T, 14>, T, ErrorCondition<"invalid-raw-phone-number", `Wrong number of characters for international number: ${T}`>>>, If<Or<[IsLength<T, 10>, IsLength<T, 12>]>, T, If<And<[IsGreaterThan<Length<T>, 2>, IsLessThan<Length<T>, 8>]>, T, ErrorCondition<"invalid-raw-phone-number">>>>>;
82
+ type _RightChars<T extends string> = StripChars<T, NumericChar | "+" | "-"> extends "" ? T : ErrorCondition<"invalid-raw-phone-number", `The only valid characters in a raw phone number is numeric characters with the rare exception of a "+" or "-" when used in the right manner`>;
83
+ /**
84
+ * **RawPhoneNumber**`<[T]>`
85
+ *
86
+ * This is the most compact form of phone number storage as it has no delimiters
87
+ * but still can contain a number representing an international,
88
+ * country or regional phone number and even a `PhoneShortCode`.
89
+ *
90
+ * **Generic Use**
91
+ *
92
+ * - without using the generic, you'll get a very basic shape that can be used as in input
93
+ * type but it will by no means ensure this _is_ a RawPhone number
94
+ * - to get real validation that a type is a `RawPhoneNumber` pass it in as `T`
95
+ * - valid values are:
96
+ * - numeric only characters with the exception of:
97
+ * - possible start of `+`
98
+ * - possible inclusion of `1-${number}` in country code area
99
+ * - length of 3-7, 10, 12 digits
100
+ * - 14 digits if it leads with `00` or `+`
101
+ */
102
+ export type RawPhoneNumber<T extends string | Unset = Unset> = T extends Unset ? `${Optional<"+">}${number}${NumericChar}${NumericChar}` : T extends string ? IsStringLiteral<T> extends true ? OnPass<[
103
+ _RightChars<T>,
104
+ _RightLength<T>
105
+ ], T> : T | ErrorCondition<"invalid-raw-phone-number"> : never;
106
+ /** T or ErrorCondition */
107
+ type _AppropriateNumerics<T extends string> = HasPhoneCountryCode<T> extends true ? IsLessThan<Length<RetainChars<RemovePhoneCountryCode<T>, NumericChar>>, 10> extends true ? Throw<"invalid-phone-number", `Invalid international phone number; international numbers require at least 10 numeric digits beyond the country code: ${T}`, `PhoneNumber`> : T : HasCharacters<Trim<T>, PhoneNumberDelimiter> extends true ? Not<Or<[
108
+ Extends<Length<RetainChars<RemovePhoneCountryCode<T>, NumericChar>>, 10>,
109
+ Extends<Length<RetainChars<RemovePhoneCountryCode<T>, NumericChar>>, 7>
110
+ ]>> extends true ? Throw<"invalid-phone-number", `Phone numbers which have " ", "-", or "." delimiters can not be short codes and therefore must have a length of 7 or 10 digits not ${Length<RetainChars<RemovePhoneCountryCode<T>, NumericChar>>}!`> : T : Trim<T> extends "" ? Throw<"invalid-phone-number", "No numeric characters found!"> : T;
111
+ /** T or ErrorCondition */
112
+ type _ValidChars<T extends string> = StripChars<T, IsGreaterThan<Length<T>, 6> extends true ? NumericChar | "(" | ")" | Whitespace | "-" | "." : NumericChar> extends "" ? true : Throw<"invalid-phone-number", IsGreaterThan<Length<T>, 6> extends true ? `Excluding any country code references, the only valid characters in a phone number are numeric characters and '-', '.', and parenthesis but other characters were found: ${Trim<T>}` : `The phone number passed in has less than 7 numeric digits which means that it is either a short code or this is an invalid number ... short codes can only accept numeric digits though and we found more than that: ${Trim<T>}`>;
113
+ type _InvalidCountryCode<T extends string> = And<[
114
+ HasPhoneCountryCode<T, false>,
115
+ Not<HasPhoneCountryCode<T, true>>
116
+ ]> extends true ? Throw<"invalid-phone-number", `This looked like an international number but the country code ${GetPhoneCountryCode<T>} is not a valid country code!`> : true;
117
+ /**
118
+ * **PhoneNumber**`<[T]>`
119
+ *
120
+ * Without use of the generic `T`, provides a basic shape for phone
121
+ * numbers which should keep people on good behavior when
122
+ * accepting phone numbers.
123
+ *
124
+ * When passing a string into `T`, this utility will do a lot more
125
+ * validity checking on the value.
126
+ *
127
+ * - Only valid characters (numeric, whitespace, `+`, `-`, `.`, and parenthesis)
128
+ * - all _leading_ and _trailing_ whitespace removed for remaining comparisons
129
+ * - at least 7 numeric characters
130
+ * - 8 if `+` character used as leading character (after whitespace)
131
+ * - 10 if `00` are leading characters
132
+ * - leading character (after whitespace) must be numeric, `(` or `+`
133
+ */
134
+ export type PhoneNumber<T extends string | null = null, TDelimiter extends PhoneNumberDelimiter = PhoneNumberDelimiter> = T extends null ? LocalPhoneNumber<TDelimiter> | CountryPhoneNumber<TDelimiter> | InternationalPhoneNumber<TDelimiter> : T extends string ? IsStringLiteral<T> extends true ? OnPass<[
135
+ _ValidChars<RemovePhoneCountryCode<T>>,
136
+ _InvalidCountryCode<T>,
137
+ _AppropriateNumerics<T>
138
+ ], T> : string : never;
139
+ /**
140
+ * GetPhoneCountryCode`<T>`
141
+ *
142
+ * Attempts to find a country code signature in a phone number.
143
+ *
144
+ * - it returns the country code without the leading `+` or `00` prefix
145
+ * - if there is no delimiter or prefix for the country code then, then it
146
+ * will use a _real_ list of country codes to try to extract this value
147
+ * - if not found it returns an empty string (`""`)
148
+ * - if `T` is a _wide_ string string then this will return `string` back
149
+ */
150
+ export type GetPhoneCountryCode<T> = T extends string ? [IsStringLiteral<T>] extends [true] ? StartsWith<Trim<T>, "+" | "00"> extends true ? [Trim<T>] extends [`${"+" | "00"}${infer CC}${PhoneNumberDelimiter}${string}`] ? RetainUntil<CC, " "> : "" : "" : string : never;
151
+ /**
152
+ * **RemoveCountryCode**`<T,[TExplicitCountryCode]>`
153
+ *
154
+ * Removes the country code -- where present -- to reveal
155
+ * just a country-based number.
156
+ *
157
+ * **Note:** there are two approaches this utility can take toward
158
+ * removal of the country code:
159
+ *
160
+ * - the default relies on a space delimiter being present between
161
+ * the country code and the remaining phone number; use this if
162
+ * this is a reasonable assumption as it is more type performant.
163
+ * - if you might have a string of numbers -- even possibly without
164
+ * the `+` or `00` prefixes -- then you can set `TExplicitCountryCode`
165
+ * to `true`
166
+ * - when set to true, it will still be able to extract _real_ country codes
167
+ * from the string but if an _imagined_ country code has been entered it will
168
+ * fail.
169
+ * - if it is an _imagined_ country code which does have a `+` or `00` prefix
170
+ * then the type will be `ErrorCondition<"invalid-country-code">`
171
+ * - if no country code prefix then you'll likely get a
172
+ * `ErrorCondition<"too-many-digits">` error (unless of course your have _other_
173
+ * problems).
174
+ */
175
+ export type RemovePhoneCountryCode<T> = T extends string ? IsStringLiteral<T> extends true ? GetPhoneCountryCode<Trim<T>> extends "" ? T : Trim<T> extends `+${GetPhoneCountryCode<Trim<T>>} ${infer Rest}` ? Rest : T : string : never;
176
+ export type PhoneNumberType = "international" | "country" | "regional" | "short-code";
177
+ /**
178
+ * **GetPhoneNumberType**`<T>`
179
+ *
180
+ * Indicates whether the phone number is "international", "country", or "regional"
181
+ * based on the shape and number of digits
182
+ */
183
+ export type GetPhoneNumberType<T> = T extends string ? IsStringLiteral<T> extends true ? HasPhoneCountryCode<T, false> extends true ? "international" : IsLessThan<Length<RetainChars<Trim<AsString<T>>, NumericChar>>, 8> extends true ? Length<RetainChars<Trim<AsString<T>>, NumericChar>> extends 7 ? "regional" : "short-code" : "country" : string : never;
184
+ type FormatLookup<T extends string> = {
185
+ "Dashed (e.g., 456-555-1212)": HasPhoneCountryCode<T> extends true ? `+${GetPhoneCountryCode<T>} ${number}-${number}-${number}` : GetPhoneNumberType<T> extends "regional" ? `${number}-${number}` : `${number}-${number}-${number}`;
186
+ "Dotted (e.g., 456.555.1212)": HasPhoneCountryCode<T> extends true ? `+${GetPhoneCountryCode<T>} ${number}.${number}.${number}` : GetPhoneNumberType<T> extends "regional" ? `${number}.${number}` : `${number}.${number}-${number}`;
187
+ "ParaSpaced (e.g., (456) 555 1212)": "";
188
+ "ParaDashed (e.g., (456) 555-1212)": "";
189
+ } & Record<PhoneFormat, any>;
190
+ export type ToPhoneFormat<TPhone extends string, TFormat extends PhoneFormat> = IsStringLiteral<TPhone> extends true ? PhoneNumber<TPhone> extends string ? Trim<TPhone> & FormatLookup<TPhone>[TFormat] : PhoneNumber<TPhone> : FormatLookup<TPhone>[TFormat] | ErrorCondition<"invalid-phone-number">;
191
+ export {};
192
+ //# sourceMappingURL=phone.d.ts.map