//#region ../constants/dist/index.d.mts //#region src/Alpha.d.ts /** * An array of all the lower-cased alphabetic characters */ declare const LOWER_ALPHA_CHARS: ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"]; /** * An array of all the upper-cased alphabetic characters */ declare const UPPER_ALPHA_CHARS: ["A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"]; /** * An array of all alphabetic characters (upper and lower) */ declare const ALPHA_CHARS: ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"]; //#endregion //#region src/Books.d.ts declare const AMAZON_BOOKS: readonly ["https://www.amazon.com/{{ string }}storeType=ebooks{{ string }}", "https://www.amazon.com/{{ string }}ref=tmm_hrd_swatch{{ string }}", "https://www.amazon.com/{{ string }}ref=tmm_pap_swatch{{ string }}", "https://www.amazon.com/{{ string }}ref=tmm_aud_swatch{{ string }}", "https://www.amazon.com/books-used-books-textbooks/{{ string }}"]; //#endregion //#region src/Characters.d.ts declare const WHITESPACE_CHARS: readonly [" ", "\n", "\t", "\b"]; //#endregion //#region src/colors.d.ts declare const CSS_NAMED_COLORS: ["aliceblue", "antiquewhite", "aqua", "aquamarine", "azure", "beige", "bisque", "black", "blanchedalmond", "blue", "blueviolet", "brown", "burlywood", "cadetblue", "chartreuse", "chocolate", "coral", "cornflowerblue", "cornsilk", "crimson", "cyan", "darkblue", "darkcyan", "darkgoldenrod", "darkgray", "darkgreen", "darkgrey", "darkkhaki", "darkmagenta", "darkolivegreen", "darkorange", "darkorchid", "darkred", "darksalmon", "darkseagreen", "darkslateblue", "darkslategray", "darkslategrey", "darkturquoise", "darkviolet", "deeppink", "deepskyblue", "dimgray", "dimgrey", "dodgerblue", "firebrick", "floralwhite", "forestgreen", "fuchsia", "gainsboro", "ghostwhite", "gold", "goldenrod", "gray", "green", "greenyellow", "grey", "honeydew", "hotpink", "indianred", "indigo", "ivory", "khaki", "lavender", "lavenderblush", "lawngreen", "lemonchiffon", "lightblue", "lightcoral", "lightcyan", "lightgoldenrodyellow", "lightgray", "lightgreen", "lightgrey", "lightpink", "lightsalmon", "lightseagreen", "lightskyblue", "lightslategray", "lightslategrey", "lightsteelblue", "lightyellow", "lime", "limegreen", "linen", "magenta", "maroon", "mediumaquamarine", "mediumblue", "mediumorchid", "mediumpurple", "mediumseagreen", "mediumslateblue", "mediumspringgreen", "mediumturquoise", "mediumvioletred", "midnightblue", "mintcream", "mistyrose", "moccasin", "navajowhite", "navy", "oldlace", "olive", "olivedrab", "orange", "orangered", "orchid", "palegoldenrod", "palegreen", "paleturquoise", "palevioletred", "papayawhip", "peachpuff", "peru", "pink", "plum", "powderblue", "purple", "rebeccapurple", "red", "rosybrown", "royalblue", "saddlebrown", "salmon", "sandybrown", "seagreen", "seashell", "sienna", "silver", "skyblue", "slateblue", "slategray", "slategrey", "snow", "springgreen", "steelblue", "tan", "teal", "thistle", "tomato", "turquoise", "violet", "wheat", "white", "whitesmoke", "yellow", "yellowgreen"]; declare const CSS_COLOR_LOOKUP: { aliceblue: "rgb(240,248,255)"; antiquewhite: "rgb(250,235,215)"; aqua: "rgb(0,255,255)"; aquamarine: "rgb(127,255,212)"; azure: "rgb(240,255,255)"; beige: "rgb(245,245,220)"; bisque: "rgb(255,228,196)"; black: "rgb(0,0,0)"; blanchedalmond: "rgb(255,235,205)"; blue: "rgb(0,0,255)"; blueviolet: "rgb(138,43,226)"; brown: "rgb(165,42,42)"; burlywood: "rgb(222,184,135)"; cadetblue: "rgb(95,158,160)"; chartreuse: "rgb(127,255,0)"; chocolate: "rgb(210,105,30)"; coral: "rgb(255,127,80)"; cornflowerblue: "rgb(100,149,237)"; cornsilk: "rgb(255,248,220)"; crimson: "rgb(220,20,60)"; cyan: "rgb(0,255,255)"; darkblue: "rgb(0,0,139)"; darkcyan: "rgb(0,139,139)"; darkgoldenrod: "rgb(184,134,11)"; darkgray: "rgb(169,169,169)"; darkgreen: "rgb(0,100,0)"; darkgrey: "rgb(169,169,169)"; darkkhaki: "rgb(189,183,107)"; darkmagenta: "rgb(139,0,139)"; darkolivegreen: "rgb(85,107,47)"; darkorange: "rgb(255,140,0)"; darkorchid: "rgb(153,50,204)"; darkred: "rgb(139,0,0)"; darksalmon: "rgb(233,150,122)"; darkseagreen: "rgb(143,188,143)"; darkslateblue: "rgb(72,61,139)"; darkslategray: "rgb(47,79,79)"; darkslategrey: "rgb(47,79,79)"; darkturquoise: "rgb(0,206,209)"; darkviolet: "rgb(148,0,211)"; deeppink: "rgb(255,20,147)"; deepskyblue: "rgb(0,191,255)"; dimgray: "rgb(105,105,105)"; dimgrey: "rgb(105,105,105)"; dodgerblue: "rgb(30,144,255)"; firebrick: "rgb(178,34,34)"; floralwhite: "rgb(255,250,240)"; forestgreen: "rgb(34,139,34)"; fuchsia: "rgb(255,0,255)"; gainsboro: "rgb(220,220,220)"; ghostwhite: "rgb(248,248,255)"; gold: "rgb(255,215,0)"; goldenrod: "rgb(218,165,32)"; gray: "rgb(128,128,128)"; green: "rgb(0,128,0)"; greenyellow: "rgb(173,255,47)"; grey: "rgb(128,128,128)"; honeydew: "rgb(240,255,240)"; hotpink: "rgb(255,105,180)"; indianred: "rgb(205,92,92)"; indigo: "rgb(75,0,130)"; ivory: "rgb(255,255,240)"; khaki: "rgb(240,230,140)"; lavender: "rgb(230,230,250)"; lavenderblush: "rgb(255,240,245)"; lawngreen: "rgb(124,252,0)"; lemonchiffon: "rgb(255,250,205)"; lightblue: "rgb(173,216,230)"; lightcoral: "rgb(240,128,128)"; lightcyan: "rgb(224,255,255)"; lightgoldenrodyellow: "rgb(250,250,210)"; lightgray: "rgb(211,211,211)"; lightgreen: "rgb(144,238,144)"; lightgrey: "rgb(211,211,211)"; lightpink: "rgb(255,182,193)"; lightsalmon: "rgb(255,160,122)"; lightseagreen: "rgb(32,178,170)"; lightskyblue: "rgb(135,206,250)"; lightslategray: "rgb(119,136,153)"; lightslategrey: "rgb(119,136,153)"; lightsteelblue: "rgb(176,196,222)"; lightyellow: "rgb(255,255,224)"; lime: "rgb(0,255,0)"; limegreen: "rgb(50,205,50)"; linen: "rgb(250,240,230)"; magenta: "rgb(255,0,255)"; maroon: "rgb(128,0,0)"; mediumaquamarine: "rgb(102,205,170)"; mediumblue: "rgb(0,0,205)"; mediumorchid: "rgb(186,85,211)"; mediumpurple: "rgb(147,112,219)"; mediumseagreen: "rgb(60,179,113)"; mediumslateblue: "rgb(123,104,238)"; mediumspringgreen: "rgb(0,250,154)"; mediumturquoise: "rgb(72,209,204)"; mediumvioletred: "rgb(199,21,133)"; midnightblue: "rgb(25,25,112)"; mintcream: "rgb(245,255,250)"; mistyrose: "rgb(255,228,225)"; moccasin: "rgb(255,228,181)"; navajowhite: "rgb(255,222,173)"; navy: "rgb(0,0,128)"; oldlace: "rgb(253,245,230)"; olive: "rgb(128,128,0)"; olivedrab: "rgb(107,142,35)"; orange: "rgb(255,165,0)"; orangered: "rgb(255,69,0)"; orchid: "rgb(218,112,214)"; palegoldenrod: "rgb(238,232,170)"; palegreen: "rgb(152,251,152)"; paleturquoise: "rgb(175,238,238)"; palevioletred: "rgb(219,112,147)"; papayawhip: "rgb(255,239,213)"; peachpuff: "rgb(255,218,185)"; peru: "rgb(205,133,63)"; pink: "rgb(255,192,203)"; plum: "rgb(221,160,221)"; powderblue: "rgb(176,224,230)"; purple: "rgb(128,0,128)"; rebeccapurple: "rgb(102,51,153)"; red: "rgb(255,0,0)"; rosybrown: "rgb(188,143,143)"; royalblue: "rgb(65,105,225)"; saddlebrown: "rgb(139,69,19)"; salmon: "rgb(250,128,114)"; sandybrown: "rgb(244,164,96)"; seagreen: "rgb(46,139,87)"; seashell: "rgb(255,245,238)"; sienna: "rgb(160,82,45)"; silver: "rgb(192,192,192)"; skyblue: "rgb(135,206,235)"; slateblue: "rgb(106,90,205)"; slategray: "rgb(112,128,144)"; slategrey: "rgb(112,128,144)"; snow: "rgb(255,250,250)"; springgreen: "rgb(0,255,127)"; steelblue: "rgb(70,130,180)"; tan: "rgb(210,180,140)"; teal: "rgb(0,128,128)"; thistle: "rgb(216,191,216)"; tomato: "rgb(255,99,71)"; turquoise: "rgb(64,224,208)"; violet: "rgb(238,130,238)"; wheat: "rgb(245,222,179)"; white: "rgb(255,255,255)"; whitesmoke: "rgb(245,245,245)"; yellow: "rgb(255,255,0)"; yellowgreen: "rgb(154,205,50)"; }; //#endregion //#region src/Comma.d.ts /** * **COMMA** * * A constant used for serializing a comma in cases * where a comma has special meaning (for instance * CSV data where a raw comma is considered a * separator) */ declare const COMMA: Constant<"comma", unknown>; /** * **SerializedComma** * * A serialized representation of a `,` value. */ type SerializedComma = typeof COMMA; //#endregion //#region src/CommonObjProps.d.ts type CommonObjProps = ["id", "type", "kind", "_type", "_kind", "key", "value", "name"]; declare const COMMON_OBJ_PROPS: readonly ["id", "type", "kind", "_type", "_kind", "key", "value", "name"]; //#endregion //#region src/Comparisons.d.ts declare const COMPARISON_OPERATIONS: readonly ["extends", "startsWith", "endsWith", "endsWithNumber", "startsWithNumber", "onlyNumbers", "alphaNumeric", "onlyLetters", "contains", "containsSome", "containsAll", "greaterThan", "greaterThanOrEqual", "lessThan", "lessThanOrEqual", "objectKeyGreaterThan", "objectKeyGreaterThanOrEqual", "objectKeyLessThan", "objectKeyLessThanOrEqual", "objectKeyEquals", "objectKeyExtends", "objectKeyStartsWith", "betweenInclusively", "betweenExclusively", "equals", "equalsSome", "errors", "errorsOfType", "before", "after", "sameDay", "sameMonth", "sameMonthYear", "sameYear", "truthy", "falsy", "true", "false", "returnEquals", "returnExtends", "isTemplateLiteral", "hasLength"]; //#endregion //#region src/Consonants.d.ts declare const CONSONANTS: readonly ["b", "c", "d", "f", "g", "h", "j", "k", "l", "m", "n", "p", "q", "r", "s", "t", "v", "w", "x", "z", "y"]; //#endregion //#region src/Constant.d.ts /** * **Constant**`` * * A static value of a particular _kind_. */ interface Constant { _type: "Constant"; kind: TKind; value: TVal; } //#endregion //#region src/Currencies.d.ts declare const CURRENCY_LOOKUP: { readonly AED: { readonly name: "UAE Dirham"; readonly family: "dirham"; readonly symbol: "د.إ"; readonly country: "United Arab Emirates"; readonly country_abbrev: "ARE"; }; readonly ARS: { readonly name: "Argentine Peso"; readonly family: "peso"; readonly symbol: "$"; readonly country: "Argentina"; readonly country_abbrev: "ARG"; }; readonly AUD: { readonly name: "Australian Dollar"; readonly family: "dollar"; readonly symbol: "$"; readonly country: "Australia"; readonly country_abbrev: "AUS"; }; readonly AZN: { readonly name: "Azerbaijani Manat"; readonly family: null; readonly symbol: "₼"; readonly country: "Azerbaijan"; readonly country_abbrev: "AZE"; }; readonly BDT: { readonly name: "Bangladeshi Taka"; readonly family: null; readonly symbol: "৳"; readonly country: "Bangladesh"; readonly country_abbrev: "BGD"; }; readonly BRL: { readonly name: "Brazilian Real"; readonly family: null; readonly symbol: "R$"; readonly country: "Brazil"; readonly country_abbrev: "BRA"; }; readonly BTC: { readonly name: "Bitcoin"; readonly family: "crypto"; readonly symbol: "₿"; readonly country: "Global"; readonly country_abbrev: "ZZZ"; }; readonly CAD: { readonly name: "Canadian Dollar"; readonly family: "dollar"; readonly symbol: "$"; readonly country: "Canada"; readonly country_abbrev: "CAN"; }; readonly CHF: { readonly name: "Swiss Franc"; readonly family: "franc"; readonly symbol: "₣"; readonly country: "Switzerland"; readonly country_abbrev: "CHE"; }; readonly CLP: { readonly name: "Chilean Peso"; readonly family: "peso"; readonly symbol: "$"; readonly country: "Chile"; readonly country_abbrev: "CHL"; }; readonly CNY: { readonly name: "Chinese Yuan"; readonly family: "yuan"; readonly symbol: "¥"; readonly country: "China"; readonly country_abbrev: "CHN"; }; readonly COP: { readonly name: "Colombian Peso"; readonly family: "peso"; readonly symbol: "$"; readonly country: "Colombia"; readonly country_abbrev: "COL"; }; readonly CRC: { readonly name: "Costa Rican Colón"; readonly family: "colon"; readonly symbol: "₡"; readonly country: "Costa Rica"; readonly country_abbrev: "CRI"; }; readonly DKK: { readonly name: "Danish Krone"; readonly family: "krone"; readonly symbol: "kr"; readonly country: "Denmark"; readonly country_abbrev: "DNK"; }; readonly EGP: { readonly name: "Egyptian Pound"; readonly family: "pound"; readonly symbol: "£"; readonly country: "Egypt"; readonly country_abbrev: "EGY"; }; readonly EUR: { readonly name: "Euro"; readonly family: null; readonly symbol: "€"; readonly country: "European Union"; readonly country_abbrev: "EUR"; }; readonly GBP: { readonly name: "British Pound"; readonly family: "pound"; readonly symbol: "£"; readonly country: "United Kingdom"; readonly country_abbrev: "GBR"; }; readonly GEL: { readonly name: "Georgian Lari"; readonly family: null; readonly symbol: "₾"; readonly country: "Georgia"; readonly country_abbrev: "GEO"; }; readonly GHS: { readonly name: "Ghanaian Cedi"; readonly family: "cedi"; readonly symbol: "₵"; readonly country: "Ghana"; readonly country_abbrev: "GHA"; }; readonly HKD: { readonly name: "Hong Kong Dollar"; readonly family: "dollar"; readonly symbol: "$"; readonly country: "Hong Kong"; readonly country_abbrev: "HKG"; }; readonly IDR: { readonly name: "Indonesian Rupiah"; readonly family: "rupiah"; readonly symbol: "Rp"; readonly country: "Indonesia"; readonly country_abbrev: "IDN"; }; readonly ILS: { readonly name: "Israeli Shekel"; readonly family: "shekel"; readonly symbol: "₪"; readonly country: "Israel"; readonly country_abbrev: "ISR"; }; readonly INR: { readonly name: "Indian Rupee"; readonly family: "rupee"; readonly symbol: "₹"; readonly country: "India"; readonly country_abbrev: "IND"; }; readonly IRR: { readonly name: "Iranian Rial"; readonly family: "rial"; readonly symbol: "﷼"; readonly country: "Iran"; readonly country_abbrev: "IRN"; }; readonly JPY: { readonly name: "Japanese Yen"; readonly family: "yen"; readonly symbol: "¥"; readonly country: "Japan"; readonly country_abbrev: "JPN"; }; readonly KES: { readonly name: "Kenyan Shilling"; readonly family: "shilling"; readonly symbol: "KSh"; readonly country: "Kenya"; readonly country_abbrev: "KEN"; }; readonly KRW: { readonly name: "South Korean Won"; readonly family: "won"; readonly symbol: "₩"; readonly country: "South Korea"; readonly country_abbrev: "KOR"; }; readonly KZT: { readonly name: "Kazakhstani Tenge"; readonly family: null; readonly symbol: "₸"; readonly country: "Kazakhstan"; readonly country_abbrev: "KAZ"; }; readonly LKR: { readonly name: "Sri Lankan Rupee"; readonly family: "rupee"; readonly symbol: "₨"; readonly country: "Sri Lanka"; readonly country_abbrev: "LKA"; }; readonly MXN: { readonly name: "Mexican Peso"; readonly family: "peso"; readonly symbol: "$"; readonly country: "Mexico"; readonly country_abbrev: "MEX"; }; readonly MYR: { readonly name: "Malaysian Ringgit"; readonly family: "ringgit"; readonly symbol: "RM"; readonly country: "Malaysia"; readonly country_abbrev: "MYS"; }; readonly NGN: { readonly name: "Nigerian Naira"; readonly family: null; readonly symbol: "₦"; readonly country: "Nigeria"; readonly country_abbrev: "NGA"; }; readonly NOK: { readonly name: "Norwegian Krone"; readonly family: "krone"; readonly symbol: "kr"; readonly country: "Norway"; readonly country_abbrev: "NOR"; }; readonly NZD: { readonly name: "New Zealand Dollar"; readonly family: "dollar"; readonly symbol: "$"; readonly country: "New Zealand"; readonly country_abbrev: "NZL"; }; readonly OMR: { readonly name: "Omani Rial"; readonly family: "rial"; readonly symbol: "﷼"; readonly country: "Oman"; readonly country_abbrev: "OMN"; }; readonly PEN: { readonly name: "Peruvian Sol"; readonly family: null; readonly symbol: "S/"; readonly country: "Peru"; readonly country_abbrev: "PER"; }; readonly PKR: { readonly name: "Pakistani Rupee"; readonly family: "rupee"; readonly symbol: "₨"; readonly country: "Pakistan"; readonly country_abbrev: "PAK"; }; readonly PLN: { readonly name: "Polish Złoty"; readonly family: null; readonly symbol: "zł"; readonly country: "Poland"; readonly country_abbrev: "POL"; }; readonly PYG: { readonly name: "Paraguayan Guaraní"; readonly family: "guarani"; readonly symbol: "₲"; readonly country: "Paraguay"; readonly country_abbrev: "PRY"; }; readonly QAR: { readonly name: "Qatari Riyal"; readonly family: "rial"; readonly symbol: "﷼"; readonly country: "Qatar"; readonly country_abbrev: "QAT"; }; readonly RUB: { readonly name: "Russian Ruble"; readonly family: null; readonly symbol: "₽"; readonly country: "Russia"; readonly country_abbrev: "RUS"; }; readonly SAR: { readonly name: "Saudi Riyal"; readonly family: "rial"; readonly symbol: "﷼"; readonly country: "Saudi Arabia"; readonly country_abbrev: "SAU"; }; readonly SEK: { readonly name: "Swedish Krona"; readonly family: "krone"; readonly symbol: "kr"; readonly country: "Sweden"; readonly country_abbrev: "SWE"; }; readonly SGD: { readonly name: "Singapore Dollar"; readonly family: "dollar"; readonly symbol: "$"; readonly country: "Singapore"; readonly country_abbrev: "SGP"; }; readonly THB: { readonly name: "Thai Baht"; readonly family: null; readonly symbol: "฿"; readonly country: "Thailand"; readonly country_abbrev: "THA"; }; readonly TRY: { readonly name: "Turkish Lira"; readonly family: null; readonly symbol: "₺"; readonly country: "Turkey"; readonly country_abbrev: "TUR"; }; readonly UAH: { readonly name: "Ukrainian Hryvnia"; readonly family: null; readonly symbol: "₴"; readonly country: "Ukraine"; readonly country_abbrev: "UKR"; }; readonly USD: { readonly name: "US Dollar"; readonly family: "dollar"; readonly symbol: "$"; readonly country: "United States"; readonly country_abbrev: "USA"; }; readonly UYU: { readonly name: "Uruguayan Peso"; readonly family: "peso"; readonly symbol: "$U"; readonly country: "Uruguay"; readonly country_abbrev: "URY"; }; readonly UZS: { readonly name: "Uzbekistani Som"; readonly family: null; readonly symbol: "so'm"; readonly country: "Uzbekistan"; readonly country_abbrev: "UZB"; }; readonly VND: { readonly name: "Vietnamese Dong"; readonly family: null; readonly symbol: "₫"; readonly country: "Vietnam"; readonly country_abbrev: "VNM"; }; readonly ZAR: { readonly name: "South African Rand"; readonly family: "rand"; readonly symbol: "R"; readonly country: "South Africa"; readonly country_abbrev: "ZAF"; }; }; //#endregion //#region src/DateTime.d.ts /** * **MONTH_NAME** * * Full month names. */ declare const MONTH_NAME: readonly ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"]; /** * **MONTH_ABBR** * * Abbreviated month names. */ declare const MONTH_ABBR: readonly ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]; declare const MONTH_NAME_LOOKUP: { readonly January: { readonly abbrev: "Jan"; readonly num: 1; readonly twoDigitStr: "01"; }; readonly February: { readonly abbrev: "Feb"; readonly num: 2; readonly twoDigitStr: "02"; }; readonly March: { readonly abbrev: "Mar"; readonly num: 3; readonly twoDigitStr: "03"; }; readonly April: { readonly abbrev: "Apr"; readonly num: 4; readonly twoDigitStr: "04"; }; readonly May: { readonly abbrev: "May"; readonly num: 5; readonly twoDigitStr: "05"; }; readonly June: { readonly abbrev: "Jun"; readonly num: 6; readonly twoDigitStr: "06"; }; readonly July: { readonly abbrev: "Jul"; readonly num: 7; readonly twoDigitStr: "07"; }; readonly August: { readonly abbrev: "Aug"; readonly num: 8; readonly twoDigitStr: "08"; }; readonly September: { readonly abbrev: "Sep"; readonly num: 9; readonly twoDigitStr: "09"; }; readonly October: { readonly abbrev: "Oct"; readonly num: 10; readonly twoDigitStr: "10"; }; readonly November: { readonly abbrev: "Nov"; readonly num: 11; readonly twoDigitStr: "11"; }; readonly December: { readonly abbrev: "Dec"; readonly num: 12; readonly twoDigitStr: "12"; }; }; declare const MONTH_ABBREV_LOOKUP: { readonly Jan: { readonly name: "January"; readonly num: 1; readonly twoDigitStr: "01"; }; readonly Feb: { readonly name: "February"; readonly num: 2; readonly twoDigitStr: "02"; }; readonly Mar: { readonly name: "March"; readonly num: 3; readonly twoDigitStr: "03"; }; readonly Apr: { readonly name: "April"; readonly num: 4; readonly twoDigitStr: "04"; }; readonly May: { readonly name: "May"; readonly num: 5; readonly twoDigitStr: "05"; }; readonly Jun: { readonly name: "June"; readonly num: 6; readonly twoDigitStr: "06"; }; readonly Jul: { readonly name: "July"; readonly num: 7; readonly twoDigitStr: "07"; }; readonly Aug: { readonly name: "August"; readonly num: 8; readonly twoDigitStr: "08"; }; readonly Sep: { readonly name: "September"; readonly num: 9; readonly twoDigitStr: "09"; }; readonly Oct: { readonly name: "October"; readonly num: 10; readonly twoDigitStr: "10"; }; readonly Nov: { readonly name: "November"; readonly num: 11; readonly twoDigitStr: "11"; }; readonly Dec: { readonly name: "December"; readonly num: 12; readonly twoDigitStr: "12"; }; }; /** the seasons in a year */ declare const SEASONS: readonly ["Summer", "Spring", "Fall", "Winter"]; type Season$3 = typeof SEASONS[number]; type MonthAbbr$2 = typeof MONTH_ABBR[number]; type Hemisphere$3 = "northern" | "southern"; /** * Maps each season to the months which represent that season (by * hemisphere). */ declare const SEASON_TO_MONTH_LOOKUP: Record; declare const MONTH_TO_SEASON_LOOKUP: Record>; declare const WEEK_DAY_ABBREV: readonly ["Mon", "Tue", "Wed", "Thu", "Fri"]; declare const WEEK_DAY: readonly ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday"]; declare const WEEKEND_DAY_ABBREV: readonly ["Sat", "Sun"]; declare const WEEKEND_DAY: readonly ["Saturday", "Sunday"]; declare const DAYS_OF_WEEK__Sun: readonly ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"]; declare const DAYS_OF_WEEK__Mon: readonly ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"]; declare const DATE_TYPE: readonly ["datetime", "date", "year-independent", "year-month", "year"]; /** * months with 30 days */ declare const ISO_DATE_30: readonly ["04", "06", "09", "11"]; /** * months with 31 days */ declare const ISO_DATE_31: readonly ["01", "03", "05", "07", "08", "10", "12"]; //#endregion //#region src/DoubleLeap_Exotic.d.ts /** * Double Leap Years for 1st Millennium */ declare const DOUBLE_LEAP_M1: readonly [8, 16, 24, 32, 40, 48, 76, 84, 92, 108, 116, 124, 152, 160, 168, 176, 184, 192, 228, 236, 244, 252, 260, 268, 276, 304, 312, 320, 328, 336, 344, 352, 380, 388, 396, 404, 412, 420, 428, 456, 464, 472, 480, 488, 496, 504, 532, 540, 548, 556, 564, 572, 580, 608, 616, 624, 632, 640, 648, 656, 684, 692, 708, 716, 724, 732, 760, 768, 776, 784, 792, 800, 808, 836, 844, 852, 860, 868, 876, 884, 912, 920, 928, 936, 944, 952, 960, 988, 996]; /** * Double Leap Years for 4th Millennium */ declare const DOUBLE_LEAP_M4: readonly [3004, 3012, 3020, 3028, 3036, 3044, 3052, 3080, 3088, 3096, 3104, 3112, 3120, 3128, 3156, 3164, 3172, 3180, 3188, 3196, 3204, 3232, 3240, 3248, 3256, 3264, 3272, 3280, 3308, 3316, 3324, 3332, 3340, 3348, 3356, 3384, 3392, 3400, 3408, 3416, 3424, 3432, 3460, 3468, 3476, 3484, 3492, 3500, 3508, 3516, 3524, 3532, 3560, 3568, 3576, 3584, 3592, 3600, 3608, 3616, 3624, 3632, 3640, 3648, 3676, 3684, 3692, 3700, 3728, 3736, 3744, 3752, 3760, 3768, 3796, 3804, 3812, 3820, 3828, 3836, 3864, 3872, 3880, 3888, 3896, 3904, 3912, 3920, 3928, 3936, 3964, 3972, 3980, 3988]; /** * Double Leap Years for 1st Millennium */ declare const DOUBLE_LEAP_M5: readonly [4004, 4012, 4020, 4028, 4036, 4044, 4052, 4060, 4068, 4076, 4104, 4112, 4120, 4128, 4136, 4144, 4152, 4180, 4188, 4196, 4204, 4212, 4220, 4228, 4256, 4264, 4272, 4280, 4288, 4296, 4304, 4332, 4340, 4348, 4356, 4364, 4372, 4380, 4408, 4416, 4424, 4432, 4440, 4448, 4456, 4484, 4492, 4500, 4508, 4516, 4524, 4532, 4560, 4568, 4576, 4584, 4592, 4600, 4608, 4636, 4644, 4652, 4660, 4668, 4676, 4684, 4712, 4720, 4728, 4736, 4744, 4752, 4760, 4788, 4796, 4804, 4812, 4820, 4828, 4836, 4864, 4872, 4880, 4888, 4896, 4904, 4912, 4940, 4948, 4956, 4964, 4972, 4980, 4988]; //#endregion //#region src/DoubleLeap_Typical.d.ts /** * Double Leap Years for 2nd Millennium (1000-1999) */ declare const DOUBLE_LEAP_M2: readonly [1004, 1012, 1020, 1028, 1036, 1064, 1072, 1080, 1088, 1096, 1104, 1112, 1140, 1148, 1156, 1164, 1172, 1180, 1188, 1216, 1224, 1232, 1240, 1248, 1256, 1264, 1292, 1308, 1316, 1324, 1332, 1340, 1368, 1376, 1384, 1392, 1408, 1416, 1444, 1452, 1460, 1468, 1476, 1484, 1492, 1520, 1528, 1536, 1544, 1552, 1560, 1568, 1596, 1604, 1612, 1620, 1628, 1636, 1644, 1672, 1680, 1688, 1696, 1704, 1712, 1720, 1748, 1756, 1764, 1772, 1780, 1788, 1796, 1824, 1832, 1840, 1848, 1856, 1864, 1872, 1908, 1916, 1924, 1932, 1940, 1948, 1976, 1984, 1992, 2000]; /** * Double Leap Years for 3rd Millennium (2000-2999) */ declare const DOUBLE_LEAP_M3: readonly [2008, 2016, 2024, 2052, 2060, 2068, 2076, 2084, 2092, 2128, 2136, 2144, 2152, 2160, 2168, 2176, 2204, 2212, 2220, 2228, 2236, 2244, 2252, 2280, 2288, 2296, 2304, 2312, 2320, 2328, 2356, 2364, 2372, 2380, 2388, 2396, 2404, 2432, 2440, 2448, 2456, 2464, 2472, 2480, 2508, 2516, 2524, 2532, 2540, 2548, 2556, 2564, 2592, 2600, 2608, 2616, 2624, 2632, 2640, 2668, 2676, 2684, 2692, 2700, 2708, 2716, 2744, 2752, 2760, 2768, 2776, 2784, 2792, 2820, 2828, 2836, 2844, 2852, 2860, 2888, 2896, 2904, 2912, 2920, 2928, 2936, 2964, 2972, 2980, 2988, 2996]; /** * Double Leap Years for modern times (1400-2300) */ declare const DOUBLE_LEAP_MODERN: readonly [1408, 1416, 1444, 1452, 1460, 1468, 1476, 1484, 1492, 1520, 1528, 1536, 1544, 1552, 1560, 1568, 1596, 1604, 1612, 1620, 1628, 1636, 1644, 1672, 1680, 1688, 1696, 1704, 1712, 1720, 1748, 1756, 1764, 1772, 1780, 1788, 1796, 1824, 1832, 1840, 1848, 1856, 1864, 1872, 1908, 1916, 1924, 1932, 1940, 1948, 1976, 1984, 1992, 2000, 2008, 2016, 2024, 2052, 2060, 2068, 2076, 2084, 2092, 2128, 2136, 2144, 2152, 2160, 2168, 2176, 2204, 2212, 2220, 2228, 2236, 2244, 2252, 2280, 2288, 2296]; //#endregion //#region src/Editor.d.ts declare const EDITORS: readonly [{ readonly name: "Atom"; readonly exec: "atom"; readonly console: false; readonly os: readonly ["win", "mac", "linux"]; }, { readonly name: "Brackets"; readonly exec: "brackets"; readonly console: false; readonly os: readonly ["win", "mac", "linux"]; }, { readonly name: "Eclipse"; readonly exec: "eclipse"; readonly console: false; readonly os: readonly ["win", "mac", "linux"]; }, { readonly name: "Emacs"; readonly exec: "emacs"; readonly console: false; readonly os: readonly ["win", "mac", "linux"]; }, { readonly name: "gedit"; readonly exec: "gedit"; readonly console: false; readonly os: readonly ["linux"]; }, { readonly name: "IntelliJ IDEA"; readonly exec: "indea"; readonly console: false; readonly os: readonly ["win", "mac", "linux"]; }, { readonly name: "Kate"; readonly exec: "kate"; readonly console: false; readonly os: readonly ["win", "mac", "linux"]; }, { readonly name: "Nano"; readonly exec: "nano"; readonly console: true; readonly os: readonly ["win", "mac", "linux"]; }, { readonly name: "Neovim"; readonly exec: "neovim"; readonly console: true; readonly os: readonly ["win", "mac", "linux"]; }, { readonly name: "Vim"; readonly exec: "vim"; readonly console: true; readonly os: readonly ["win", "mac", "linux"]; }, { readonly name: "Vi"; readonly exec: "vi"; readonly console: true; readonly os: readonly ["win", "mac", "linux"]; }, { readonly name: "Notepad"; readonly exec: "notepad"; readonly console: false; readonly os: readonly ["win"]; }, { readonly name: "Notepad++"; readonly exec: "notepad++"; readonly console: false; readonly os: readonly ["win"]; }, { readonly name: "PyCharm"; readonly exec: "pycharm"; readonly console: false; readonly os: readonly ["win", "mac", "linux"]; }, { readonly name: "TextEdit"; readonly exec: "open -e"; readonly console: false; readonly os: readonly ["mac"]; }, { readonly name: "Sublime Text"; readonly exec: "subl"; readonly console: false; readonly os: readonly ["win", "mac", "linux"]; }, { readonly name: "Textmate"; readonly exec: "mate"; readonly console: false; readonly os: readonly ["win", "mac", "linux"]; }, { readonly name: "Zed"; readonly exec: "zed"; readonly console: false; readonly os: readonly ["win", "mac", "linux"]; }]; //#endregion //#region src/EscapeCodes.d.ts /** * The hexadecimal escape sequence used in Typescript * * - represents decimal `27` * - can also be represented as the `u001B` unicode character */ declare const ESCAPE_CODE: "\u001B"; /** * The **BEL** code can often be substituted as a terminal character. * * - often an alternative to `${TERMINATOR}` */ declare const BEL: "\u0007"; /** Backspace character */ declare const BACKSPACE: "\b"; /** Horizontal tab character */ declare const HORIZONTAL_TAB: "\t"; /** Line feed character */ declare const LINE_FEED: "\n"; /** Carriage return character */ declare const CARRIAGE_RETURN: "\r"; /** Vertical tab character */ declare const VERTICAL_TAB: "\v"; /** Form feed character */ declare const FORM_FEED: "\f"; /** Null character */ declare const NULL_CHAR: "\0"; /** Delete character */ declare const DELETE: ""; /** File separator */ declare const FILE_SEPARATOR: "\u001C"; /** Group separator */ declare const GROUP_SEPARATOR: "\u001D"; /** Record separator */ declare const RECORD_SEPARATOR: "\u001E"; /** Unit separator */ declare const UNIT_SEPARATOR: "\u001F"; /** Standard, breakable space character */ declare const SPACE: " "; /** Non-breaking space keeps words on the same line */ declare const NON_BREAKING_SPACE: "\u00A0"; /** * En space * * a half an em wide, often used for moderate separation */ declare const EN_SPACE: "\u2002"; /** * **Em space** * * roughly the width of an M, used for strong separation */ declare const EM_SPACE: "\u2003"; /** * **Thin space** * * narrow separation, commonly around punctuation/symbols */ declare const THIN_SPACE: "\u2009"; /** * **Hair space** * * ultra-thin spacing for fine typographic tweaks */ declare const HAIR_SPACE: "\u200A"; /** Narrow no-break space — thin space that also prevents line breaks */ declare const NARROW_NO_BREAK_SPACE: "\u202F"; /** * **Ideographic space** * * full-width space used in CJK typography. Used in * Chinese, Japanese, and Korean scripts. These languages * use thousands of logographic/phonetic characters that * occupy full-width “ideographic” space. */ declare const IDEOGRAPHIC_SPACE: "\u3000"; /** * All of the "space" characters include the normal `SPACE` but also: * * - `NON_BREAKING_SPACE`, * - `EN_SPACE`, * - `EM_SPACE`, * - `THIN_SPACE`, * - `HAIR_SPACE`, * - `NARROW_NO_BREAK_SPACE`, * - and `IDEOGRAPHIC_SPACE` * */ declare const SPACE_CHARS: [" ", " ", " ", " ", " ", " ", " ", " "]; /** * Escape Code Characters * * Includes: * - `ESCAPE_CODE`, * - `BEL`, * - `NON_BREAKING_SPACE`, * - `LINE_FEED`, * - `FORM_FEED`, * - `HORIZONTAL_TAB`, * - `CARRIAGE_RETURN`, * - `FILE_SEPARATOR` * - `GROUP_SEPARATOR`, * - `RECORD_SEPARATOR`, * - `UNIT_SEPARATOR`, * - `NULL_CHAR`, * - Unicode _space_ characters with differing widths/behaviors * - _and more_ */ declare const ESCAPE_CODE_CHARS: ["\u001B", "\u0007", "\b", "\t", "\n", "\r", "\v", "\f", "\0", "", "\u001C", "\u001D", "\u001E", "\u001F", " ", " ", " ", " ", " ", " ", " "]; //#endregion //#region src/FalsyValues.d.ts /** * **FALSY_VALUES** * * A tuple which contains all values which are considered _falsy_ in * Javascript. */ declare const FALSY_VALUES: readonly [false, 0, 0, "", null, undefined, number]; //#endregion //#region src/Functional.d.ts /** * **RESULT** * * Concrete values for `Ok` and `Err` states. */ declare const RESULT: { readonly Ok: "ok"; readonly Err: "err"; }; /** * **OPTION** * * Concrete values for `Some` and `None` states. */ declare const OPTION: { readonly Some: 1; readonly None: 0; }; //#endregion //#region src/Geo.d.ts declare const HEMISPHERE: readonly ["northern", "southern"]; /** * The continents on planet earth */ declare const CONTINENTS: readonly ["Africa", "Australia", "Antarctica", "Asia", "Europe", "North America", "South America"]; /** * The 50 US states: `[name, abbrev, true]` */ declare const US_STATE_LOOKUP_STRICT: readonly [{ readonly name: "Alabama"; readonly abbrev: "AL"; }, { readonly name: "Alaska"; readonly abbrev: "AK"; }, { readonly name: "Arizona"; readonly abbrev: "AZ"; }, { readonly name: "Arkansas"; readonly abbrev: "AR"; }, { readonly name: "California"; readonly abbrev: "CA"; }, { readonly name: "Colorado"; readonly abbrev: "CO"; }, { readonly name: "Connecticut"; readonly abbrev: "CT"; }, { readonly name: "Delaware"; readonly abbrev: "DE"; }, { readonly name: "Florida"; readonly abbrev: "FL"; }, { readonly name: "Georgia"; readonly abbrev: "GA"; }, { readonly name: "Hawaii"; readonly abbrev: "HI"; }, { readonly name: "Idaho"; readonly abbrev: "ID"; }, { readonly name: "Illinois"; readonly abbrev: "IL"; }, { readonly name: "Indiana"; readonly abbrev: "IN"; }, { readonly name: "Iowa"; readonly abbrev: "IA"; }, { readonly name: "Kansas"; readonly abbrev: "KS"; }, { readonly name: "Kentucky"; readonly abbrev: "KY"; }, { readonly name: "Louisiana"; readonly abbrev: "LA"; }, { readonly name: "Maine"; readonly abbrev: "ME"; }, { readonly name: "Maryland"; readonly abbrev: "MD"; }, { readonly name: "Massachusetts"; readonly abbrev: "MA"; }, { readonly name: "Michigan"; readonly abbrev: "MI"; }, { readonly name: "Minnesota"; readonly abbrev: "MN"; }, { readonly name: "Mississippi"; readonly abbrev: "MS"; }, { readonly name: "Missouri"; readonly abbrev: "MO"; }, { readonly name: "Montana"; readonly abbrev: "MT"; }, { readonly name: "Nebraska"; readonly abbrev: "NE"; }, { readonly name: "Nevada"; readonly abbrev: "NV"; }, { readonly name: "New Hampshire"; readonly abbrev: "NH"; }, { readonly name: "New Jersey"; readonly abbrev: "NJ"; }, { readonly name: "New Mexico"; readonly abbrev: "NM"; }, { readonly name: "New York"; readonly abbrev: "NY"; }, { readonly name: "North Carolina"; readonly abbrev: "NC"; }, { readonly name: "North Dakota"; readonly abbrev: "ND"; }, { readonly name: "Ohio"; readonly abbrev: "OH"; }, { readonly name: "Oklahoma"; readonly abbrev: "OK"; }, { readonly name: "Oregon"; readonly abbrev: "OR"; }, { readonly name: "Pennsylvania"; readonly abbrev: "PA"; }, { readonly name: "Rhode Island"; readonly abbrev: "RI"; }, { readonly name: "South Carolina"; readonly abbrev: "SC"; }, { readonly name: "South Dakota"; readonly abbrev: "SD"; }, { readonly name: "Tennessee"; readonly abbrev: "TN"; }, { readonly name: "Texas"; readonly abbrev: "TX"; }, { readonly name: "Utah"; readonly abbrev: "UT"; }, { readonly name: "Vermont"; readonly abbrev: "VT"; }, { readonly name: "Virginia"; readonly abbrev: "VA"; }, { readonly name: "Washington"; readonly abbrev: "WA"; }, { readonly name: "West Virginia"; readonly abbrev: "WV"; }, { readonly name: "Wisconsin"; readonly abbrev: "WI"; }, { readonly name: "Wyoming"; readonly abbrev: "WY"; }]; /** * The 9 provinces to the US which are granted State codes. */ declare const US_STATE_LOOKUP_PROVINCES: readonly [{ readonly name: "Puerto Rico"; readonly abbrev: "PR"; }, { readonly name: "Virgin Islands"; readonly abbrev: "VI"; }, { readonly name: "Palau"; readonly abbrev: "PW"; }, { readonly name: "Federated States of Micronesia"; readonly abbrev: "FM"; }, { readonly name: "Northern Mariana Islands"; readonly abbrev: "MP"; }, { readonly name: "District of Columbia"; readonly abbrev: "DC"; }, { readonly name: "Marshall Islands"; readonly abbrev: "MH"; }, { readonly name: "American Samoa"; readonly abbrev: "AS"; }, { readonly name: "Guam"; readonly abbrev: "GU"; }]; /** * All 50 states and 9 provinces which have State abbreviations. * * Data format is: `[name, abbrev, flag]` where the boolean flag * indicates whether the line item is one of the 50 true states. */ declare const US_STATE_LOOKUP: readonly [{ readonly name: "Alabama"; readonly abbrev: "AL"; }, { readonly name: "Alaska"; readonly abbrev: "AK"; }, { readonly name: "Arizona"; readonly abbrev: "AZ"; }, { readonly name: "Arkansas"; readonly abbrev: "AR"; }, { readonly name: "California"; readonly abbrev: "CA"; }, { readonly name: "Colorado"; readonly abbrev: "CO"; }, { readonly name: "Connecticut"; readonly abbrev: "CT"; }, { readonly name: "Delaware"; readonly abbrev: "DE"; }, { readonly name: "Florida"; readonly abbrev: "FL"; }, { readonly name: "Georgia"; readonly abbrev: "GA"; }, { readonly name: "Hawaii"; readonly abbrev: "HI"; }, { readonly name: "Idaho"; readonly abbrev: "ID"; }, { readonly name: "Illinois"; readonly abbrev: "IL"; }, { readonly name: "Indiana"; readonly abbrev: "IN"; }, { readonly name: "Iowa"; readonly abbrev: "IA"; }, { readonly name: "Kansas"; readonly abbrev: "KS"; }, { readonly name: "Kentucky"; readonly abbrev: "KY"; }, { readonly name: "Louisiana"; readonly abbrev: "LA"; }, { readonly name: "Maine"; readonly abbrev: "ME"; }, { readonly name: "Maryland"; readonly abbrev: "MD"; }, { readonly name: "Massachusetts"; readonly abbrev: "MA"; }, { readonly name: "Michigan"; readonly abbrev: "MI"; }, { readonly name: "Minnesota"; readonly abbrev: "MN"; }, { readonly name: "Mississippi"; readonly abbrev: "MS"; }, { readonly name: "Missouri"; readonly abbrev: "MO"; }, { readonly name: "Montana"; readonly abbrev: "MT"; }, { readonly name: "Nebraska"; readonly abbrev: "NE"; }, { readonly name: "Nevada"; readonly abbrev: "NV"; }, { readonly name: "New Hampshire"; readonly abbrev: "NH"; }, { readonly name: "New Jersey"; readonly abbrev: "NJ"; }, { readonly name: "New Mexico"; readonly abbrev: "NM"; }, { readonly name: "New York"; readonly abbrev: "NY"; }, { readonly name: "North Carolina"; readonly abbrev: "NC"; }, { readonly name: "North Dakota"; readonly abbrev: "ND"; }, { readonly name: "Ohio"; readonly abbrev: "OH"; }, { readonly name: "Oklahoma"; readonly abbrev: "OK"; }, { readonly name: "Oregon"; readonly abbrev: "OR"; }, { readonly name: "Pennsylvania"; readonly abbrev: "PA"; }, { readonly name: "Rhode Island"; readonly abbrev: "RI"; }, { readonly name: "South Carolina"; readonly abbrev: "SC"; }, { readonly name: "South Dakota"; readonly abbrev: "SD"; }, { readonly name: "Tennessee"; readonly abbrev: "TN"; }, { readonly name: "Texas"; readonly abbrev: "TX"; }, { readonly name: "Utah"; readonly abbrev: "UT"; }, { readonly name: "Vermont"; readonly abbrev: "VT"; }, { readonly name: "Virginia"; readonly abbrev: "VA"; }, { readonly name: "Washington"; readonly abbrev: "WA"; }, { readonly name: "West Virginia"; readonly abbrev: "WV"; }, { readonly name: "Wisconsin"; readonly abbrev: "WI"; }, { readonly name: "Wyoming"; readonly abbrev: "WY"; }, { readonly name: "Puerto Rico"; readonly abbrev: "PR"; }, { readonly name: "Virgin Islands"; readonly abbrev: "VI"; }, { readonly name: "Palau"; readonly abbrev: "PW"; }, { readonly name: "Federated States of Micronesia"; readonly abbrev: "FM"; }, { readonly name: "Northern Mariana Islands"; readonly abbrev: "MP"; }, { readonly name: "District of Columbia"; readonly abbrev: "DC"; }, { readonly name: "Marshall Islands"; readonly abbrev: "MH"; }, { readonly name: "American Samoa"; readonly abbrev: "AS"; }, { readonly name: "Guam"; readonly abbrev: "GU"; }]; /** * A lookup which provides a list of state abbreviations associated * with the first digit of the zip code. */ declare const ZIP_TO_STATE: { readonly 0: readonly ["CT", "MA", "ME", "NH", "NJ", "NY", "PR", "RI", "VT", "VI"]; readonly 1: readonly ["DE", "NY", "PA"]; readonly 2: readonly ["DC", "MD", "NC", "SC", "VA", "WV"]; readonly 3: readonly ["AL", "FL", "GA", "MS", "TN"]; readonly 4: readonly ["IN", "KY", "MI", "OH"]; readonly 5: readonly ["IA", "MN", "MT", "ND", "SD", "WI"]; readonly 6: readonly ["IL", "KS", "MO", "NE"]; readonly 7: readonly ["AR", "LA", "OK", "TX"]; readonly 8: readonly ["AZ", "CO", "ID", "NM", "NV", "UT", "WY"]; readonly 9: readonly ["AK", "AS", "CA", "GU", "HI", "MH", "FM", "MP", "OR", "PW", "WA"]; }; /** * Languages with current ISO 639 Set 1 (two-letter) codes, ordered by Set 1 code. * Set 2 uses the terminological (ISO 639-2/T) code where variants exist. * * @see https://www.loc.gov/standards/iso639-2/ISO-639-2_utf-8.txt */ declare const LOCALES: [{ readonly set1: "aa"; readonly set2: "aar"; readonly language: "Afar"; }, { readonly set1: "ab"; readonly set2: "abk"; readonly language: "Abkhazian"; }, { readonly set1: "ae"; readonly set2: "ave"; readonly language: "Avestan"; }, { readonly set1: "af"; readonly set2: "afr"; readonly language: "Afrikaans"; }, { readonly set1: "ak"; readonly set2: "aka"; readonly language: "Akan"; }, { readonly set1: "am"; readonly set2: "amh"; readonly language: "Amharic"; }, { readonly set1: "an"; readonly set2: "arg"; readonly language: "Aragonese"; }, { readonly set1: "ar"; readonly set2: "ara"; readonly language: "Arabic"; }, { readonly set1: "as"; readonly set2: "asm"; readonly language: "Assamese"; }, { readonly set1: "av"; readonly set2: "ava"; readonly language: "Avaric"; }, { readonly set1: "ay"; readonly set2: "aym"; readonly language: "Aymara"; }, { readonly set1: "az"; readonly set2: "aze"; readonly language: "Azerbaijani"; }, { readonly set1: "ba"; readonly set2: "bak"; readonly language: "Bashkir"; }, { readonly set1: "be"; readonly set2: "bel"; readonly language: "Belarusian"; }, { readonly set1: "bg"; readonly set2: "bul"; readonly language: "Bulgarian"; }, { readonly set1: "bi"; readonly set2: "bis"; readonly language: "Bislama"; }, { readonly set1: "bm"; readonly set2: "bam"; readonly language: "Bambara"; }, { readonly set1: "bn"; readonly set2: "ben"; readonly language: "Bengali"; }, { readonly set1: "bo"; readonly set2: "bod"; readonly language: "Tibetan"; }, { readonly set1: "br"; readonly set2: "bre"; readonly language: "Breton"; }, { readonly set1: "bs"; readonly set2: "bos"; readonly language: "Bosnian"; }, { readonly set1: "ca"; readonly set2: "cat"; readonly language: "Catalan; Valencian"; }, { readonly set1: "ce"; readonly set2: "che"; readonly language: "Chechen"; }, { readonly set1: "ch"; readonly set2: "cha"; readonly language: "Chamorro"; }, { readonly set1: "co"; readonly set2: "cos"; readonly language: "Corsican"; }, { readonly set1: "cr"; readonly set2: "cre"; readonly language: "Cree"; }, { readonly set1: "cs"; readonly set2: "ces"; readonly language: "Czech"; }, { readonly set1: "cu"; readonly set2: "chu"; readonly language: "Church Slavic; Old Slavonic; Church Slavonic; Old Bulgarian; Old Church Slavonic"; }, { readonly set1: "cv"; readonly set2: "chv"; readonly language: "Chuvash"; }, { readonly set1: "cy"; readonly set2: "cym"; readonly language: "Welsh"; }, { readonly set1: "da"; readonly set2: "dan"; readonly language: "Danish"; }, { readonly set1: "de"; readonly set2: "deu"; readonly language: "German"; }, { readonly set1: "dv"; readonly set2: "div"; readonly language: "Divehi; Dhivehi; Maldivian"; }, { readonly set1: "dz"; readonly set2: "dzo"; readonly language: "Dzongkha"; }, { readonly set1: "ee"; readonly set2: "ewe"; readonly language: "Ewe"; }, { readonly set1: "el"; readonly set2: "ell"; readonly language: "Modern Greek (1453-)"; }, { readonly set1: "en"; readonly set2: "eng"; readonly language: "English"; }, { readonly set1: "eo"; readonly set2: "epo"; readonly language: "Esperanto"; }, { readonly set1: "es"; readonly set2: "spa"; readonly language: "Spanish; Castilian"; }, { readonly set1: "et"; readonly set2: "est"; readonly language: "Estonian"; }, { readonly set1: "eu"; readonly set2: "eus"; readonly language: "Basque"; }, { readonly set1: "fa"; readonly set2: "fas"; readonly language: "Persian"; }, { readonly set1: "ff"; readonly set2: "ful"; readonly language: "Fulah"; }, { readonly set1: "fi"; readonly set2: "fin"; readonly language: "Finnish"; }, { readonly set1: "fj"; readonly set2: "fij"; readonly language: "Fijian"; }, { readonly set1: "fo"; readonly set2: "fao"; readonly language: "Faroese"; }, { readonly set1: "fr"; readonly set2: "fra"; readonly language: "French"; }, { readonly set1: "fy"; readonly set2: "fry"; readonly language: "Western Frisian"; }, { readonly set1: "ga"; readonly set2: "gle"; readonly language: "Irish"; }, { readonly set1: "gd"; readonly set2: "gla"; readonly language: "Gaelic; Scottish Gaelic"; }, { readonly set1: "gl"; readonly set2: "glg"; readonly language: "Galician"; }, { readonly set1: "gn"; readonly set2: "grn"; readonly language: "Guarani"; }, { readonly set1: "gu"; readonly set2: "guj"; readonly language: "Gujarati"; }, { readonly set1: "gv"; readonly set2: "glv"; readonly language: "Manx"; }, { readonly set1: "ha"; readonly set2: "hau"; readonly language: "Hausa"; }, { readonly set1: "he"; readonly set2: "heb"; readonly language: "Hebrew"; }, { readonly set1: "hi"; readonly set2: "hin"; readonly language: "Hindi"; }, { readonly set1: "ho"; readonly set2: "hmo"; readonly language: "Hiri Motu"; }, { readonly set1: "hr"; readonly set2: "hrv"; readonly language: "Croatian"; }, { readonly set1: "ht"; readonly set2: "hat"; readonly language: "Haitian; Haitian Creole"; }, { readonly set1: "hu"; readonly set2: "hun"; readonly language: "Hungarian"; }, { readonly set1: "hy"; readonly set2: "hye"; readonly language: "Armenian"; }, { readonly set1: "hz"; readonly set2: "her"; readonly language: "Herero"; }, { readonly set1: "ia"; readonly set2: "ina"; readonly language: "Interlingua (International Auxiliary Language Association)"; }, { readonly set1: "id"; readonly set2: "ind"; readonly language: "Indonesian"; }, { readonly set1: "ie"; readonly set2: "ile"; readonly language: "Interlingue; Occidental"; }, { readonly set1: "ig"; readonly set2: "ibo"; readonly language: "Igbo"; }, { readonly set1: "ii"; readonly set2: "iii"; readonly language: "Sichuan Yi; Nuosu"; }, { readonly set1: "ik"; readonly set2: "ipk"; readonly language: "Inupiaq"; }, { readonly set1: "io"; readonly set2: "ido"; readonly language: "Ido"; }, { readonly set1: "is"; readonly set2: "isl"; readonly language: "Icelandic"; }, { readonly set1: "it"; readonly set2: "ita"; readonly language: "Italian"; }, { readonly set1: "iu"; readonly set2: "iku"; readonly language: "Inuktitut"; }, { readonly set1: "ja"; readonly set2: "jpn"; readonly language: "Japanese"; }, { readonly set1: "jv"; readonly set2: "jav"; readonly language: "Javanese"; }, { readonly set1: "ka"; readonly set2: "kat"; readonly language: "Georgian"; }, { readonly set1: "kg"; readonly set2: "kon"; readonly language: "Kongo"; }, { readonly set1: "ki"; readonly set2: "kik"; readonly language: "Kikuyu; Gikuyu"; }, { readonly set1: "kj"; readonly set2: "kua"; readonly language: "Kuanyama; Kwanyama"; }, { readonly set1: "kk"; readonly set2: "kaz"; readonly language: "Kazakh"; }, { readonly set1: "kl"; readonly set2: "kal"; readonly language: "Kalaallisut; Greenlandic"; }, { readonly set1: "km"; readonly set2: "khm"; readonly language: "Central Khmer"; }, { readonly set1: "kn"; readonly set2: "kan"; readonly language: "Kannada"; }, { readonly set1: "ko"; readonly set2: "kor"; readonly language: "Korean"; }, { readonly set1: "kr"; readonly set2: "kau"; readonly language: "Kanuri"; }, { readonly set1: "ks"; readonly set2: "kas"; readonly language: "Kashmiri"; }, { readonly set1: "ku"; readonly set2: "kur"; readonly language: "Kurdish"; }, { readonly set1: "kv"; readonly set2: "kom"; readonly language: "Komi"; }, { readonly set1: "kw"; readonly set2: "cor"; readonly language: "Cornish"; }, { readonly set1: "ky"; readonly set2: "kir"; readonly language: "Kirghiz; Kyrgyz"; }, { readonly set1: "la"; readonly set2: "lat"; readonly language: "Latin"; }, { readonly set1: "lb"; readonly set2: "ltz"; readonly language: "Luxembourgish; Letzeburgesch"; }, { readonly set1: "lg"; readonly set2: "lug"; readonly language: "Ganda"; }, { readonly set1: "li"; readonly set2: "lim"; readonly language: "Limburgan; Limburger; Limburgish"; }, { readonly set1: "ln"; readonly set2: "lin"; readonly language: "Lingala"; }, { readonly set1: "lo"; readonly set2: "lao"; readonly language: "Lao"; }, { readonly set1: "lt"; readonly set2: "lit"; readonly language: "Lithuanian"; }, { readonly set1: "lu"; readonly set2: "lub"; readonly language: "Luba-Katanga"; }, { readonly set1: "lv"; readonly set2: "lav"; readonly language: "Latvian"; }, { readonly set1: "mg"; readonly set2: "mlg"; readonly language: "Malagasy"; }, { readonly set1: "mh"; readonly set2: "mah"; readonly language: "Marshallese"; }, { readonly set1: "mi"; readonly set2: "mri"; readonly language: "Maori"; }, { readonly set1: "mk"; readonly set2: "mkd"; readonly language: "Macedonian"; }, { readonly set1: "ml"; readonly set2: "mal"; readonly language: "Malayalam"; }, { readonly set1: "mn"; readonly set2: "mon"; readonly language: "Mongolian"; }, { readonly set1: "mr"; readonly set2: "mar"; readonly language: "Marathi"; }, { readonly set1: "ms"; readonly set2: "msa"; readonly language: "Malay"; }, { readonly set1: "mt"; readonly set2: "mlt"; readonly language: "Maltese"; }, { readonly set1: "my"; readonly set2: "mya"; readonly language: "Burmese"; }, { readonly set1: "na"; readonly set2: "nau"; readonly language: "Nauru"; }, { readonly set1: "nb"; readonly set2: "nob"; readonly language: "Norwegian Bokmål"; }, { readonly set1: "nd"; readonly set2: "nde"; readonly language: "North Ndebele"; }, { readonly set1: "ne"; readonly set2: "nep"; readonly language: "Nepali"; }, { readonly set1: "ng"; readonly set2: "ndo"; readonly language: "Ndonga"; }, { readonly set1: "nl"; readonly set2: "nld"; readonly language: "Dutch; Flemish"; }, { readonly set1: "nn"; readonly set2: "nno"; readonly language: "Norwegian Nynorsk"; }, { readonly set1: "no"; readonly set2: "nor"; readonly language: "Norwegian"; }, { readonly set1: "nr"; readonly set2: "nbl"; readonly language: "South Ndebele"; }, { readonly set1: "nv"; readonly set2: "nav"; readonly language: "Navajo; Navaho"; }, { readonly set1: "ny"; readonly set2: "nya"; readonly language: "Chichewa; Chewa; Nyanja"; }, { readonly set1: "oc"; readonly set2: "oci"; readonly language: "Occitan (post 1500)"; }, { readonly set1: "oj"; readonly set2: "oji"; readonly language: "Ojibwa"; }, { readonly set1: "om"; readonly set2: "orm"; readonly language: "Oromo"; }, { readonly set1: "or"; readonly set2: "ori"; readonly language: "Oriya"; }, { readonly set1: "os"; readonly set2: "oss"; readonly language: "Ossetian; Ossetic"; }, { readonly set1: "pa"; readonly set2: "pan"; readonly language: "Panjabi; Punjabi"; }, { readonly set1: "pi"; readonly set2: "pli"; readonly language: "Pali"; }, { readonly set1: "pl"; readonly set2: "pol"; readonly language: "Polish"; }, { readonly set1: "ps"; readonly set2: "pus"; readonly language: "Pushto; Pashto"; }, { readonly set1: "pt"; readonly set2: "por"; readonly language: "Portuguese"; }, { readonly set1: "qu"; readonly set2: "que"; readonly language: "Quechua"; }, { readonly set1: "rm"; readonly set2: "roh"; readonly language: "Romansh"; }, { readonly set1: "rn"; readonly set2: "run"; readonly language: "Rundi"; }, { readonly set1: "ro"; readonly set2: "ron"; readonly language: "Romanian; Moldavian; Moldovan"; }, { readonly set1: "ru"; readonly set2: "rus"; readonly language: "Russian"; }, { readonly set1: "rw"; readonly set2: "kin"; readonly language: "Kinyarwanda"; }, { readonly set1: "sa"; readonly set2: "san"; readonly language: "Sanskrit"; }, { readonly set1: "sc"; readonly set2: "srd"; readonly language: "Sardinian"; }, { readonly set1: "sd"; readonly set2: "snd"; readonly language: "Sindhi"; }, { readonly set1: "se"; readonly set2: "sme"; readonly language: "Northern Sami"; }, { readonly set1: "sg"; readonly set2: "sag"; readonly language: "Sango"; }, { readonly set1: "si"; readonly set2: "sin"; readonly language: "Sinhala; Sinhalese"; }, { readonly set1: "sk"; readonly set2: "slk"; readonly language: "Slovak"; }, { readonly set1: "sl"; readonly set2: "slv"; readonly language: "Slovenian"; }, { readonly set1: "sm"; readonly set2: "smo"; readonly language: "Samoan"; }, { readonly set1: "sn"; readonly set2: "sna"; readonly language: "Shona"; }, { readonly set1: "so"; readonly set2: "som"; readonly language: "Somali"; }, { readonly set1: "sq"; readonly set2: "sqi"; readonly language: "Albanian"; }, { readonly set1: "sr"; readonly set2: "srp"; readonly language: "Serbian"; }, { readonly set1: "ss"; readonly set2: "ssw"; readonly language: "Swati"; }, { readonly set1: "st"; readonly set2: "sot"; readonly language: "Sotho, Southern"; }, { readonly set1: "su"; readonly set2: "sun"; readonly language: "Sundanese"; }, { readonly set1: "sv"; readonly set2: "swe"; readonly language: "Swedish"; }, { readonly set1: "sw"; readonly set2: "swa"; readonly language: "Swahili"; }, { readonly set1: "ta"; readonly set2: "tam"; readonly language: "Tamil"; }, { readonly set1: "te"; readonly set2: "tel"; readonly language: "Telugu"; }, { readonly set1: "tg"; readonly set2: "tgk"; readonly language: "Tajik"; }, { readonly set1: "th"; readonly set2: "tha"; readonly language: "Thai"; }, { readonly set1: "ti"; readonly set2: "tir"; readonly language: "Tigrinya"; }, { readonly set1: "tk"; readonly set2: "tuk"; readonly language: "Turkmen"; }, { readonly set1: "tl"; readonly set2: "tgl"; readonly language: "Tagalog"; }, { readonly set1: "tn"; readonly set2: "tsn"; readonly language: "Tswana"; }, { readonly set1: "to"; readonly set2: "ton"; readonly language: "Tonga (Tonga Islands)"; }, { readonly set1: "tr"; readonly set2: "tur"; readonly language: "Turkish"; }, { readonly set1: "ts"; readonly set2: "tso"; readonly language: "Tsonga"; }, { readonly set1: "tt"; readonly set2: "tat"; readonly language: "Tatar"; }, { readonly set1: "tw"; readonly set2: "twi"; readonly language: "Twi"; }, { readonly set1: "ty"; readonly set2: "tah"; readonly language: "Tahitian"; }, { readonly set1: "ug"; readonly set2: "uig"; readonly language: "Uighur; Uyghur"; }, { readonly set1: "uk"; readonly set2: "ukr"; readonly language: "Ukrainian"; }, { readonly set1: "ur"; readonly set2: "urd"; readonly language: "Urdu"; }, { readonly set1: "uz"; readonly set2: "uzb"; readonly language: "Uzbek"; }, { readonly set1: "ve"; readonly set2: "ven"; readonly language: "Venda"; }, { readonly set1: "vi"; readonly set2: "vie"; readonly language: "Vietnamese"; }, { readonly set1: "vo"; readonly set2: "vol"; readonly language: "Volapük"; }, { readonly set1: "wa"; readonly set2: "wln"; readonly language: "Walloon"; }, { readonly set1: "wo"; readonly set2: "wol"; readonly language: "Wolof"; }, { readonly set1: "xh"; readonly set2: "xho"; readonly language: "Xhosa"; }, { readonly set1: "yi"; readonly set2: "yid"; readonly language: "Yiddish"; }, { readonly set1: "yo"; readonly set2: "yor"; readonly language: "Yoruba"; }, { readonly set1: "za"; readonly set2: "zha"; readonly language: "Zhuang; Chuang"; }, { readonly set1: "zh"; readonly set2: "zho"; readonly language: "Chinese"; }, { readonly set1: "zu"; readonly set2: "zul"; readonly language: "Zulu"; }]; //#endregion //#region src/HashTable.d.ts declare const HASH_TABLE_WIDE: { readonly string: "318"; readonly number: "523"; readonly boolean: "21"; readonly never: "!!!"; readonly unknown: "ed"; readonly undefined: "ce"; readonly null: "cc"; readonly symbol: "78"; readonly object: "fe8"; readonly array: "17"; readonly record: "ee"; readonly map: "e65"; readonly weakMap: "e64"; readonly set: "f62"; readonly union: "f61"; }; declare const HASH_TABLE_ALPHA_LOWER: { readonly a: "8"; readonly b: "~"; readonly c: "^"; readonly d: "."; readonly e: "82"; readonly f: "89"; readonly g: ","; readonly h: "!"; readonly i: "-7"; readonly j: "-8"; readonly k: "88"; readonly l: "8f"; readonly m: "8e"; readonly n: "6e"; readonly o: "44"; readonly p: "60"; readonly q: "61"; readonly r: "71"; readonly s: ":"; readonly t: "-45"; readonly u: "-5"; readonly v: "-9"; readonly w: "-f"; readonly x: "+1"; readonly y: ";"; readonly z: "*1"; }; declare const HASH_TABLE_SPECIAL: { readonly "!": "1"; readonly "@": "8"; readonly "#": "5"; readonly $: "4"; readonly "%": "3"; readonly "^": "2"; readonly "&": "9"; readonly "*": "7"; readonly "(": "6"; readonly ")": "12"; readonly "{": "33"; readonly "}": "54"; readonly "[": "x8"; readonly "]": "y4"; readonly ":": "z2"; readonly ";": "e88"; readonly "\"": "c11"; readonly "'": "c12"; readonly "<": "p3"; readonly ",": "45"; readonly ">": "e9"; readonly ".": "f2"; readonly "?": "ee"; readonly "/": "u9"; readonly "\\": "f9"; readonly "|": "q1"; readonly "~": "fe"; readonly "`": "8e"; }; declare const HASH_TABLE_DIGIT: { readonly 0: "-2"; readonly 1: "-9"; readonly 2: "ff"; readonly 3: "fe"; readonly 4: "2e"; readonly 5: "cd"; readonly 6: "54"; readonly 7: "27"; readonly 8: "49"; readonly 9: "51"; }; declare const HASH_TABLE_ALPHA_UPPER: { readonly A: "b8"; readonly B: "~9"; readonly C: "6^"; readonly D: ".8"; readonly E: "5<"; readonly F: ">7"; readonly G: "1,"; readonly H: "!7"; readonly I: "8#"; readonly J: "@9"; readonly K: "1*"; readonly L: "4&"; readonly M: "+5"; readonly N: "j|"; readonly O: "-l"; readonly P: "q{"; readonly Q: "]9"; readonly R: "f%"; readonly S: ":3"; readonly T: "?+"; readonly U: "}5"; readonly V: "'4"; readonly W: "1@g"; readonly X: "0+1"; readonly Y: "4;"; readonly Z: "a*1"; }; declare const HASH_TABLE_CHAR: { readonly "!": "1"; readonly "@": "8"; readonly "#": "5"; readonly $: "4"; readonly "%": "3"; readonly "^": "2"; readonly "&": "9"; readonly "*": "7"; readonly "(": "6"; readonly ")": "12"; readonly "{": "33"; readonly "}": "54"; readonly "[": "x8"; readonly "]": "y4"; readonly ":": "z2"; readonly ";": "e88"; readonly "\"": "c11"; readonly "'": "c12"; readonly "<": "p3"; readonly ",": "45"; readonly ">": "e9"; readonly ".": "f2"; readonly "?": "ee"; readonly "/": "u9"; readonly "\\": "f9"; readonly "|": "q1"; readonly "~": "fe"; readonly "`": "8e"; readonly A: "b8"; readonly B: "~9"; readonly C: "6^"; readonly D: ".8"; readonly E: "5<"; readonly F: ">7"; readonly G: "1,"; readonly H: "!7"; readonly I: "8#"; readonly J: "@9"; readonly K: "1*"; readonly L: "4&"; readonly M: "+5"; readonly N: "j|"; readonly O: "-l"; readonly P: "q{"; readonly Q: "]9"; readonly R: "f%"; readonly S: ":3"; readonly T: "?+"; readonly U: "}5"; readonly V: "'4"; readonly W: "1@g"; readonly X: "0+1"; readonly Y: "4;"; readonly Z: "a*1"; readonly a: "8"; readonly b: "~"; readonly c: "^"; readonly d: "."; readonly e: "82"; readonly f: "89"; readonly g: ","; readonly h: "!"; readonly i: "-7"; readonly j: "-8"; readonly k: "88"; readonly l: "8f"; readonly m: "8e"; readonly n: "6e"; readonly o: "44"; readonly p: "60"; readonly q: "61"; readonly r: "71"; readonly s: ":"; readonly t: "-45"; readonly u: "-5"; readonly v: "-9"; readonly w: "-f"; readonly x: "+1"; readonly y: ";"; readonly z: "*1"; }; declare const HASH_TABLE_OTHER: "999"; //#endregion //#region src/HTML.d.ts /** * An array of all valid HTML tags that have both opening and closing tags. */ declare const HTML_BLOCK_TAGS: readonly ["a", "abbr", "address", "article", "aside", "b", "bdi", "bdo", "blockquote", "body", "button", "canvas", "caption", "cite", "code", "colgroup", "data", "datalist", "dd", "del", "details", "dfn", "dialog", "div", "dl", "dt", "em", "fieldset", "figcaption", "figure", "footer", "form", "h1", "h2", "h3", "h4", "h5", "h6", "head", "header", "html", "i", "iframe", "ins", "kbd", "label", "legend", "li", "main", "map", "mark", "menu", "meter", "nav", "noscript", "object", "ol", "optgroup", "option", "output", "p", "picture", "pre", "progress", "q", "rp", "rt", "ruby", "s", "samp", "script", "section", "select", "small", "span", "strong", "style", "sub", "summary", "sup", "svg", "table", "tbody", "td", "template", "textarea", "tfoot", "th", "thead", "time", "title", "tr", "u", "ul", "var", "video"]; /** * An array of all valid HTML tags that are self-closing (do not have closing tags). */ declare const HTML_ATOMIC_TAGS: readonly ["area", "base", "br", "col", "embed", "hr", "img", "input", "link", "meta", "param", "source", "track", "wbr"]; //#endregion //#region src/Http.d.ts /** * A constant array containing a comprehensive list of common MIME (Multipurpose Internet Mail Extensions) types. * This array is marked as `const` to enable TypeScript to infer literal types for each element. * * @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types */ declare const MIME_TYPES: readonly ["application/json", "application/xml", "application/javascript", "application/pdf", "application/ld+json", "application/octet-stream", "application/x-www-form-urlencoded", "application/vnd.api+json", "application/msword", "application/grpc", "application/vnd.openxmlformats-officedocument.wordprocessingml.document", "application/vnd.ms-excel", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", "application/vnd.ms-powerpoint", "application/vnd.openxmlformats-officedocument.presentationml.presentation", "text/plain", "text/html", "text/css", "text/csv", "text/javascript", "text/markdown", "image/jpeg", "image/png", "image/gif", "image/bmp", "image/webp", "image/svg+xml", "image/tiff", "audio/mpeg", "audio/ogg", "audio/wav", "audio/webm", "audio/flac", "video/mp4", "video/mpeg", "video/ogg", "video/webm", "video/quicktime", "multipart/form-data", "multipart/mixed", "multipart/alternative", "multipart/related", "font/woff", "font/woff2", "font/ttf", "font/otf", "application/rss+xml", "application/atom+xml", "application/x-pkcs12", "application/x-shockwave-flash", "application/x-www-form-urlencoded", "application/x-font-ttf", "application/x-font-opentype", "application/x-font-woff", "application/x-font-woff2", "application/vnd.rar", "application/zip", "application/x-7z-compressed"]; //#endregion //#region src/Images.d.ts declare const IMAGE_FORMAT_LOOKUP: [{ readonly ext: "jpg"; readonly webFormat: true; readonly other_ext: ["jpeg"]; }, { readonly ext: "png"; readonly webFormat: true; readonly other_ext: []; }, { readonly ext: "gif"; readonly webFormat: true; readonly other_ext: []; }, { readonly ext: "heif"; readonly webFormat: true; readonly other_ext: []; }, { readonly ext: "svg"; readonly webFormat: true; readonly other_ext: []; }, { readonly ext: "raw"; readonly webFormat: false; readonly other_ext: []; }, { readonly ext: "dng"; readonly webFormat: false; readonly other_ext: []; }, { readonly ext: "avif"; readonly webFormat: true; readonly other_ext: []; }, { readonly ext: "webp"; readonly webFormat: true; readonly other_ext: []; }, { readonly ext: "tiff"; readonly webFormat: false; readonly other_ext: ["tif"]; }]; //#endregion //#region src/InputTokenConstants.d.ts declare const IT_ATOMIC_TOKENS: readonly ["string", "number", "boolean", "true", "false", "undefined", "unknown", "any", "null", "void", "bigint", "object", "Object", "function"]; /** * All literal token declarations from a base type */ declare const IT_LITERAL_TOKENS: readonly ["String({{string}})", "Number({{number}})", "Boolean({{boolean}})"]; declare const IT_CONTAINER_TOKENS: readonly ["Map<{{string}},{{string}}>", "WeakMap<{{string}},{{string}}>", "Set<{{string}}>", "Record<{{string}},{{string}}", "Array<{{string}}>", "Fn({{string}})=>{{string}}", "Fn({{string}})=>{{string}} & {{{string}}}", "[{{string}}]", "{{{string}}}"]; //#endregion //#region src/Interpolation.d.ts /** * Static text blocks which can be used to interpolate into dynamic * string literal sections. */ declare const INTERPOLATION_BLOCKS: readonly ["{{string}}", "{{number}}", "{{boolean}}"]; //#endregion //#region src/ISO3166.d.ts /** * All country codes (name, alpha-2, country-code) */ declare const ISO3166_1: readonly [{ readonly name: "Afghanistan"; readonly alpha2: "AF"; readonly countryCode: "004"; readonly alpha3: "AFG"; }, { readonly name: "Albania"; readonly alpha2: "AL"; readonly countryCode: "008"; readonly alpha3: "ALB"; }, { readonly name: "Algeria"; readonly alpha2: "DZ"; readonly countryCode: "012"; readonly alpha3: "DZA"; }, { readonly name: "Andorra"; readonly alpha2: "AD"; readonly countryCode: "020"; readonly alpha3: "AND"; }, { readonly name: "Angola"; readonly alpha2: "AO"; readonly countryCode: "024"; readonly alpha3: "AGO"; }, { readonly name: "Argentina"; readonly alpha2: "AR"; readonly countryCode: "032"; readonly alpha3: "ARG"; }, { readonly name: "Australia"; readonly alpha2: "AU"; readonly countryCode: "036"; readonly alpha3: "AUS"; }, { readonly name: "Austria"; readonly alpha2: "AT"; readonly countryCode: "040"; readonly alpha3: "AUT"; }, { readonly name: "Azerbaijan"; readonly alpha2: "AZ"; readonly countryCode: "031"; readonly alpha3: "AZE"; }, { readonly name: "Bahamas"; readonly alpha2: "BS"; readonly countryCode: "044"; readonly alpha3: "BHS"; }, { readonly name: "Bangladesh"; readonly alpha2: "BD"; readonly countryCode: "050"; readonly alpha3: "BGD"; }, { readonly name: "Belgium"; readonly alpha2: "BE"; readonly countryCode: "056"; readonly alpha3: "BEL"; }, { readonly name: "Belize"; readonly alpha2: "BZ"; readonly countryCode: "084"; readonly alpha3: "BLZ"; }, { readonly name: "Benin"; readonly alpha2: "BJ"; readonly countryCode: "204"; readonly alpha3: "BEN"; }, { readonly name: "Bhutan"; readonly alpha2: "BT"; readonly countryCode: "064"; readonly alpha3: "BTN"; }, { readonly name: "Bolivia"; readonly alpha2: "BO"; readonly countryCode: "068"; readonly alpha3: "BOL"; }, { readonly name: "Bosnia and Herzegovina"; readonly alpha2: "BA"; readonly countryCode: "070"; readonly alpha3: "BIH"; }, { readonly name: "Botswana"; readonly alpha2: "BW"; readonly countryCode: "072"; readonly alpha3: "BWA"; }, { readonly name: "Brazil"; readonly alpha2: "BR"; readonly countryCode: "076"; readonly alpha3: "BRA"; }, { readonly name: "Brunei Darussalam"; readonly alpha2: "BN"; readonly countryCode: "096"; readonly alpha3: "BRN"; }, { readonly name: "Bulgaria"; readonly alpha2: "BG"; readonly countryCode: "100"; readonly alpha3: "BGR"; }, { readonly name: "Burkina Faso"; readonly alpha2: "BF"; readonly countryCode: "854"; readonly alpha3: "BFA"; }, { readonly name: "Burundi"; readonly alpha2: "BI"; readonly countryCode: "108"; readonly alpha3: "BDI"; }, { readonly name: "Cambodia"; readonly alpha2: "KH"; readonly countryCode: "116"; readonly alpha3: "KHM"; }, { readonly name: "Cameroon"; readonly alpha2: "CM"; readonly countryCode: "120"; readonly alpha3: "CMR"; }, { readonly name: "Canada"; readonly alpha2: "CA"; readonly countryCode: "124"; readonly alpha3: "CAN"; }, { readonly name: "Afghanistan"; readonly alpha2: "AF"; readonly countryCode: "004"; readonly alpha3: "AFG"; }, { readonly name: "Albania"; readonly alpha2: "AL"; readonly countryCode: "008"; readonly alpha3: "ALB"; }, { readonly name: "Algeria"; readonly alpha2: "DZ"; readonly countryCode: "012"; readonly alpha3: "DZA"; }, { readonly name: "Andorra"; readonly alpha2: "AD"; readonly countryCode: "020"; readonly alpha3: "AND"; }, { readonly name: "Angola"; readonly alpha2: "AO"; readonly countryCode: "024"; readonly alpha3: "AGO"; }, { readonly name: "Argentina"; readonly alpha2: "AR"; readonly countryCode: "032"; readonly alpha3: "ARG"; }, { readonly name: "Australia"; readonly alpha2: "AU"; readonly countryCode: "036"; readonly alpha3: "AUS"; }, { readonly name: "Austria"; readonly alpha2: "AT"; readonly countryCode: "040"; readonly alpha3: "AUT"; }, { readonly name: "Azerbaijan"; readonly alpha2: "AZ"; readonly countryCode: "031"; readonly alpha3: "AZE"; }, { readonly name: "Bahamas"; readonly alpha2: "BS"; readonly countryCode: "044"; readonly alpha3: "BHS"; }, { readonly name: "Bangladesh"; readonly alpha2: "BD"; readonly countryCode: "050"; readonly alpha3: "BGD"; }, { readonly name: "Belgium"; readonly alpha2: "BE"; readonly countryCode: "056"; readonly alpha3: "BEL"; }, { readonly name: "Belize"; readonly alpha2: "BZ"; readonly countryCode: "084"; readonly alpha3: "BLZ"; }, { readonly name: "Benin"; readonly alpha2: "BJ"; readonly countryCode: "204"; readonly alpha3: "BEN"; }, { readonly name: "Bhutan"; readonly alpha2: "BT"; readonly countryCode: "064"; readonly alpha3: "BTN"; }, { readonly name: "Bolivia"; readonly alpha2: "BO"; readonly countryCode: "068"; readonly alpha3: "BOL"; }, { readonly name: "Bosnia and Herzegovina"; readonly alpha2: "BA"; readonly countryCode: "070"; readonly alpha3: "BIH"; }, { readonly name: "Botswana"; readonly alpha2: "BW"; readonly countryCode: "072"; readonly alpha3: "BWA"; }, { readonly name: "Brazil"; readonly alpha2: "BR"; readonly countryCode: "076"; readonly alpha3: "BRA"; }, { readonly name: "Brunei Darussalam"; readonly alpha2: "BN"; readonly countryCode: "096"; readonly alpha3: "BRN"; }, { readonly name: "Bulgaria"; readonly alpha2: "BG"; readonly countryCode: "100"; readonly alpha3: "BGR"; }, { readonly name: "Burkina Faso"; readonly alpha2: "BF"; readonly countryCode: "854"; readonly alpha3: "BFA"; }, { readonly name: "Burundi"; readonly alpha2: "BI"; readonly countryCode: "108"; readonly alpha3: "BDI"; }, { readonly name: "Cambodia"; readonly alpha2: "KH"; readonly countryCode: "116"; readonly alpha3: "KHM"; }, { readonly name: "Cameroon"; readonly alpha2: "CM"; readonly countryCode: "120"; readonly alpha3: "CMR"; }, { readonly name: "Canada"; readonly alpha2: "CA"; readonly countryCode: "124"; readonly alpha3: "CAN"; }, { readonly name: "Maldives"; readonly alpha2: "MV"; readonly countryCode: "462"; readonly alpha3: "MDV"; }, { readonly name: "Mali"; readonly alpha2: "ML"; readonly countryCode: "466"; readonly alpha3: "MLI"; }, { readonly name: "Malta"; readonly alpha2: "MT"; readonly countryCode: "470"; readonly alpha3: "MLT"; }, { readonly name: "Marshall Islands"; readonly alpha2: "MH"; readonly countryCode: "584"; readonly alpha3: "MHL"; }, { readonly name: "Mauritania"; readonly alpha2: "MR"; readonly countryCode: "478"; readonly alpha3: "MRT"; }, { readonly name: "Mauritius"; readonly alpha2: "MU"; readonly countryCode: "480"; readonly alpha3: "MUS"; }, { readonly name: "Mexico"; readonly alpha2: "MX"; readonly countryCode: "484"; readonly alpha3: "MEX"; }, { readonly name: "Micronesia (Federated States of)"; readonly alpha2: "FM"; readonly countryCode: "583"; readonly alpha3: "FSM"; }, { readonly name: "Moldova (Republic of)"; readonly alpha2: "MD"; readonly countryCode: "498"; readonly alpha3: "MDA"; }, { readonly name: "Monaco"; readonly alpha2: "MC"; readonly countryCode: "492"; readonly alpha3: "MCO"; }, { readonly name: "Mongolia"; readonly alpha2: "MN"; readonly countryCode: "496"; readonly alpha3: "MNG"; }, { readonly name: "Montenegro"; readonly alpha2: "ME"; readonly countryCode: "499"; readonly alpha3: "MNE"; }, { readonly name: "Morocco"; readonly alpha2: "MA"; readonly countryCode: "504"; readonly alpha3: "MAR"; }, { readonly name: "Mozambique"; readonly alpha2: "MZ"; readonly countryCode: "508"; readonly alpha3: "MOZ"; }, { readonly name: "Myanmar"; readonly alpha2: "MM"; readonly countryCode: "104"; readonly alpha3: "MMR"; }, { readonly name: "Namibia"; readonly alpha2: "NA"; readonly countryCode: "516"; readonly alpha3: "NAM"; }, { readonly name: "Nauru"; readonly alpha2: "NR"; readonly countryCode: "520"; readonly alpha3: "NRU"; }, { readonly name: "Nepal"; readonly alpha2: "NP"; readonly countryCode: "524"; readonly alpha3: "NPL"; }, { readonly name: "Netherlands"; readonly alpha2: "NL"; readonly countryCode: "528"; readonly alpha3: "NLD"; }, { readonly name: "New Zealand"; readonly alpha2: "NZ"; readonly countryCode: "554"; readonly alpha3: "NZL"; }, { readonly name: "Nicaragua"; readonly alpha2: "NI"; readonly countryCode: "558"; readonly alpha3: "NIC"; }, { readonly name: "Niger"; readonly alpha2: "NE"; readonly countryCode: "562"; readonly alpha3: "NER"; }, { readonly name: "Nigeria"; readonly alpha2: "NG"; readonly countryCode: "566"; readonly alpha3: "NGA"; }, { readonly name: "North Macedonia"; readonly alpha2: "MK"; readonly countryCode: "807"; readonly alpha3: "MKD"; }, { readonly name: "Norway"; readonly alpha2: "NO"; readonly countryCode: "578"; readonly alpha3: "NOR"; }, { readonly name: "Oman"; readonly alpha2: "OM"; readonly countryCode: "512"; readonly alpha3: "OMN"; }, { readonly name: "Pakistan"; readonly alpha2: "PK"; readonly countryCode: "586"; readonly alpha3: "PAK"; }, { readonly name: "Palau"; readonly alpha2: "PW"; readonly countryCode: "585"; readonly alpha3: "PLW"; }, { readonly name: "Panama"; readonly alpha2: "PA"; readonly countryCode: "591"; readonly alpha3: "PAN"; }, { readonly name: "Papua New Guinea"; readonly alpha2: "PG"; readonly countryCode: "598"; readonly alpha3: "PNG"; }, { readonly name: "Paraguay"; readonly alpha2: "PY"; readonly countryCode: "600"; readonly alpha3: "PRY"; }, { readonly name: "Peru"; readonly alpha2: "PE"; readonly countryCode: "604"; readonly alpha3: "PER"; }, { readonly name: "Philippines"; readonly alpha2: "PH"; readonly countryCode: "608"; readonly alpha3: "PHL"; }, { readonly name: "Poland"; readonly alpha2: "PL"; readonly countryCode: "616"; readonly alpha3: "POL"; }, { readonly name: "Portugal"; readonly alpha2: "PT"; readonly countryCode: "620"; readonly alpha3: "PRT"; }, { readonly name: "Qatar"; readonly alpha2: "QA"; readonly countryCode: "634"; readonly alpha3: "QAT"; }, { readonly name: "Romania"; readonly alpha2: "RO"; readonly countryCode: "642"; readonly alpha3: "ROU"; }, { readonly name: "Russian Federation"; readonly alpha2: "RU"; readonly countryCode: "643"; readonly alpha3: "RUS"; }, { readonly name: "Rwanda"; readonly alpha2: "RW"; readonly countryCode: "646"; readonly alpha3: "RWA"; }, { readonly name: "Saint Kitts and Nevis"; readonly alpha2: "KN"; readonly countryCode: "659"; readonly alpha3: "KNA"; }, { readonly name: "Saint Lucia"; readonly alpha2: "LC"; readonly countryCode: "662"; readonly alpha3: "LCA"; }, { readonly name: "Saint Vincent and the Grenadines"; readonly alpha2: "VC"; readonly countryCode: "670"; readonly alpha3: "VCT"; }, { readonly name: "Samoa"; readonly alpha2: "WS"; readonly countryCode: "882"; readonly alpha3: "WSM"; }, { readonly name: "San Marino"; readonly alpha2: "SM"; readonly countryCode: "674"; readonly alpha3: "SMR"; }, { readonly name: "Sao Tome and Principe"; readonly alpha2: "ST"; readonly countryCode: "678"; readonly alpha3: "STP"; }, { readonly name: "Saudi Arabia"; readonly alpha2: "SA"; readonly countryCode: "682"; readonly alpha3: "SAU"; }, { readonly name: "Senegal"; readonly alpha2: "SN"; readonly countryCode: "686"; readonly alpha3: "SEN"; }, { readonly name: "Serbia"; readonly alpha2: "RS"; readonly countryCode: "688"; readonly alpha3: "SRB"; }, { readonly name: "Seychelles"; readonly alpha2: "SC"; readonly countryCode: "690"; readonly alpha3: "SYC"; }, { readonly name: "Sierra Leone"; readonly alpha2: "SL"; readonly countryCode: "694"; readonly alpha3: "SLE"; }, { readonly name: "Singapore"; readonly alpha2: "SG"; readonly countryCode: "702"; readonly alpha3: "SGP"; }, { readonly name: "Slovakia"; readonly alpha2: "SK"; readonly countryCode: "703"; readonly alpha3: "SVK"; }, { readonly name: "Slovenia"; readonly alpha2: "SI"; readonly countryCode: "705"; readonly alpha3: "SVN"; }, { readonly name: "Solomon Islands"; readonly alpha2: "SB"; readonly countryCode: "090"; readonly alpha3: "SLB"; }, { readonly name: "Somalia"; readonly alpha2: "SO"; readonly countryCode: "706"; readonly alpha3: "SOM"; }, { readonly name: "South Africa"; readonly alpha2: "ZA"; readonly countryCode: "710"; readonly alpha3: "ZAF"; }, { readonly name: "South Sudan"; readonly alpha2: "SS"; readonly countryCode: "728"; readonly alpha3: "SSD"; }, { readonly name: "Spain"; readonly alpha2: "ES"; readonly countryCode: "724"; readonly alpha3: "ESP"; }, { readonly name: "Sri Lanka"; readonly alpha2: "LK"; readonly countryCode: "144"; readonly alpha3: "LKA"; }, { readonly name: "Sudan"; readonly alpha2: "SD"; readonly countryCode: "729"; readonly alpha3: "SDN"; }, { readonly name: "Suriname"; readonly alpha2: "SR"; readonly countryCode: "740"; readonly alpha3: "SUR"; }, { readonly name: "Sweden"; readonly alpha2: "SE"; readonly countryCode: "752"; readonly alpha3: "SWE"; }, { readonly name: "Switzerland"; readonly alpha2: "CH"; readonly countryCode: "756"; readonly alpha3: "CHE"; }, { readonly name: "Syrian Arab Republic"; readonly alpha2: "SY"; readonly countryCode: "760"; readonly alpha3: "SYR"; }, { readonly name: "Taiwan"; readonly alpha2: "TW"; readonly countryCode: "158"; readonly alpha3: "TWN"; }, { readonly name: "Tajikistan"; readonly alpha2: "TJ"; readonly countryCode: "762"; readonly alpha3: "TJK"; }, { readonly name: "Tanzania"; readonly alpha2: "TZ"; readonly countryCode: "834"; readonly alpha3: "TZA"; }, { readonly name: "Thailand"; readonly alpha2: "TH"; readonly countryCode: "764"; readonly alpha3: "THA"; }, { readonly name: "Timor-Leste"; readonly alpha2: "TL"; readonly countryCode: "626"; readonly alpha3: "TLS"; }, { readonly name: "Togo"; readonly alpha2: "TG"; readonly countryCode: "768"; readonly alpha3: "TGO"; }, { readonly name: "Tonga"; readonly alpha2: "TO"; readonly countryCode: "776"; readonly alpha3: "TON"; }, { readonly name: "Tonga"; readonly alpha2: "TO"; readonly countryCode: "776"; readonly alpha3: "TON"; }, { readonly name: "Trinidad and Tobago"; readonly alpha2: "TT"; readonly countryCode: "780"; readonly alpha3: "TTO"; }, { readonly name: "Tunisia"; readonly alpha2: "TN"; readonly countryCode: "788"; readonly alpha3: "TUN"; }, { readonly name: "Turkey"; readonly alpha2: "TR"; readonly countryCode: "792"; readonly alpha3: "TUR"; }, { readonly name: "Turkmenistan"; readonly alpha2: "TM"; readonly countryCode: "795"; readonly alpha3: "TKM"; }, { readonly name: "Tuvalu"; readonly alpha2: "TV"; readonly countryCode: "798"; readonly alpha3: "TUV"; }, { readonly name: "Uganda"; readonly alpha2: "UG"; readonly countryCode: "800"; readonly alpha3: "UGA"; }, { readonly name: "Ukraine"; readonly alpha2: "UA"; readonly countryCode: "804"; readonly alpha3: "UKR"; }, { readonly name: "United Arab Emirates"; readonly alpha2: "AE"; readonly countryCode: "784"; readonly alpha3: "ARE"; }, { readonly name: "United Kingdom"; readonly alpha2: "GB"; readonly countryCode: "826"; readonly alpha3: "GBR"; }, { readonly name: "United States of America"; readonly alpha2: "US"; readonly countryCode: "840"; readonly alpha3: "USA"; }, { readonly name: "Uruguay"; readonly alpha2: "UY"; readonly countryCode: "858"; readonly alpha3: "URY"; }, { readonly name: "Uzbekistan"; readonly alpha2: "UZ"; readonly countryCode: "860"; readonly alpha3: "UZB"; }, { readonly name: "Vanuatu"; readonly alpha2: "VU"; readonly countryCode: "548"; readonly alpha3: "VUT"; }, { readonly name: "Venezuela"; readonly alpha2: "VE"; readonly countryCode: "862"; readonly alpha3: "VEN"; }, { readonly name: "Viet Nam"; readonly alpha2: "VN"; readonly countryCode: "704"; readonly alpha3: "VNM"; }, { readonly name: "Yemen"; readonly alpha2: "YE"; readonly countryCode: "887"; readonly alpha3: "YEM"; }, { readonly name: "Zambia"; readonly alpha2: "ZM"; readonly countryCode: "894"; readonly alpha3: "ZMB"; }, { readonly name: "Zimbabwe"; readonly alpha2: "ZW"; readonly countryCode: "716"; readonly alpha3: "ZWE"; }]; //#endregion //#region src/Marked.d.ts declare const MARKED: Constant<"Marked", unknown>; /** * **Marked** * * A constant that indicates that an item has been marked for * some ongoing operation. */ type Marked = typeof MARKED; //#endregion //#region src/Markers.d.ts declare const BLOOD_MARKERS_LOOKUP: readonly [{ readonly abbrev: "Hb"; readonly name: "hemoglobin"; readonly measurements: readonly ["g/dL", "mmol/L"]; }, { readonly abbrev: "WBC"; readonly name: "white blood cell count"; readonly measurements: readonly ["cells/µL"]; }, { readonly abbrev: "RBC"; readonly name: "red blood cell count"; readonly measurements: readonly ["million cells/µL", "trillion cells/L"]; }, { readonly abbrev: "PLT"; readonly name: "platelet count"; readonly measurements: readonly ["thousand/µL", "million/L"]; }, { readonly abbrev: "Hct"; readonly name: "hematocrit"; readonly measurements: readonly ["%"]; }, { readonly abbrev: "MCV"; readonly name: "mean corpuscular volume"; readonly measurements: readonly ["fL"]; }, { readonly abbrev: "MCH"; readonly name: "mean corpuscular hemoglobin"; readonly measurements: readonly ["pg/cell"]; }, { readonly abbrev: "MCHC"; readonly name: "mean corpuscular hemoglobin concentration"; readonly measurements: readonly ["g/dL"]; }, { readonly abbrev: "RDW"; readonly name: "red cell distribution width"; readonly measurements: readonly ["%"]; }, { readonly abbrev: "Glucose"; readonly name: "blood glucose"; readonly measurements: readonly ["mg/dL", "mmol/L"]; }, { readonly abbrev: "ALT"; readonly name: "alanine aminotransferase"; readonly measurements: readonly ["U/L"]; }, { readonly abbrev: "AST"; readonly name: "aspartate aminotransferase"; readonly measurements: readonly ["U/L"]; }, { readonly abbrev: "LDL"; readonly name: "low-density lipoprotein"; readonly measurements: readonly ["mg/dL", "mmol/L"]; }, { readonly abbrev: "HDL"; readonly name: "high-density lipoprotein"; readonly measurements: readonly ["mg/dL", "mmol/L"]; }, { readonly abbrev: "Triglycerides"; readonly name: "triglycerides"; readonly measurements: readonly ["mg/dL", "mmol/L"]; }, { readonly abbrev: "CRP"; readonly name: "C-reactive protein"; readonly measurements: readonly ["mg/L"]; }, { readonly abbrev: "TSH"; readonly name: "thyroid-stimulating hormone"; readonly measurements: readonly ["mIU/L"]; }, { readonly abbrev: "BUN"; readonly name: "blood urea nitrogen"; readonly measurements: readonly ["mg/dL", "mmol/L"]; }, { readonly abbrev: "Creatinine"; readonly name: "creatinine"; readonly measurements: readonly ["mg/dL", "µmol/L"]; }, { readonly abbrev: "Bilirubin"; readonly name: "bilirubin"; readonly measurements: readonly ["mg/dL", "µmol/L"]; }]; //#endregion //#region src/Metrics.d.ts declare const DISTANCE_METRICS_LOOKUP: readonly [{ readonly abbrev: "km"; readonly name: "kilometer"; }, { readonly abbrev: "mi"; readonly name: "mile"; }, { readonly abbrev: "mm"; readonly name: "millimeter"; }, { readonly abbrev: "cm"; readonly name: "centimeter"; }, { readonly abbrev: "yd"; readonly name: "yard"; }, { readonly abbrev: "ft"; readonly name: "foot"; }, { readonly abbrev: "in"; readonly name: "inch"; }, { readonly abbrev: "m"; readonly name: "meter"; }, { readonly abbrev: "nm"; readonly name: "nautical mile"; }, { readonly abbrev: "nmi"; readonly name: "nanometer"; }, { readonly abbrev: "µm"; readonly name: "micrometer"; }, { readonly abbrev: "dm"; readonly name: "decimeter"; }, { readonly abbrev: "AU"; readonly name: "astronomical unit"; }, { readonly abbrev: "ly"; readonly name: "light year"; }, { readonly abbrev: "pc"; readonly name: "parsec"; }]; declare const MASS_METRICS_LOOKUP: readonly [{ readonly abbrev: "g"; readonly name: "gram"; }, { readonly abbrev: "kg"; readonly name: "kilogram"; }, { readonly abbrev: "mg"; readonly name: "milligram"; }, { readonly abbrev: "µg"; readonly name: "microgram"; }, { readonly abbrev: "t"; readonly name: "tonne"; }, { readonly abbrev: "lb"; readonly name: "pound"; }, { readonly abbrev: "oz"; readonly name: "ounce"; }, { readonly abbrev: "st"; readonly name: "stone"; }, { readonly abbrev: "ct"; readonly name: "carat"; }, { readonly abbrev: "Mt"; readonly name: "megatonne"; }, { readonly abbrev: "gt"; readonly name: "gigatonne"; }, { readonly abbrev: "slug"; readonly name: "slug"; }, { readonly abbrev: "dr"; readonly name: "dram"; }, { readonly abbrev: "gr"; readonly name: "grain"; }, { readonly abbrev: "q"; readonly name: "quintal"; }]; declare const SPEED_METRICS_LOOKUP: readonly [{ readonly abbrev: "m/s"; readonly name: "meters per second"; }, { readonly abbrev: "km/h"; readonly name: "kilometers per hour"; }, { readonly abbrev: "mph"; readonly name: "miles per hour"; }, { readonly abbrev: "kn"; readonly name: "knot"; }, { readonly abbrev: "ft/s"; readonly name: "feet per second"; }, { readonly abbrev: "c"; readonly name: "speed of light"; }, { readonly abbrev: "mach"; readonly name: "mach"; }, { readonly abbrev: "cm/s"; readonly name: "centimeters per second"; }, { readonly abbrev: "in/s"; readonly name: "inches per second"; }, { readonly abbrev: "ly/y"; readonly name: "light years per year"; }]; declare const ACCELERATION_METRICS_LOOKUP: readonly [{ readonly abbrev: "m/s²"; readonly name: "meters per second squared"; }, { readonly abbrev: "ft/s²"; readonly name: "feet per second squared"; }, { readonly abbrev: "g"; readonly name: "g-force"; }, { readonly abbrev: "Gal"; readonly name: "galileo"; }, { readonly abbrev: "cm/s²"; readonly name: "centimeters per second squared"; }, { readonly abbrev: "km/h²"; readonly name: "kilometers per hour squared"; }, { readonly abbrev: "in/s²"; readonly name: "inches per second squared"; }, { readonly abbrev: "mi/h²"; readonly name: "miles per hour squared"; }, { readonly abbrev: "kn/s²"; readonly name: "knots per second squared"; }]; declare const VOLUME_METRICS_LOOKUP: readonly [{ readonly abbrev: "L"; readonly name: "liter"; }, { readonly abbrev: "dL"; readonly name: "deciliter"; }, { readonly abbrev: "mL"; readonly name: "milliliter"; }, { readonly abbrev: "µL"; readonly name: "microliter"; }, { readonly abbrev: "cm³"; readonly name: "cubic centimeter"; }, { readonly abbrev: "m³"; readonly name: "cubic meter"; }, { readonly abbrev: "ft³"; readonly name: "cubic foot"; }, { readonly abbrev: "in³"; readonly name: "cubic inch"; }, { readonly abbrev: "gallon"; readonly name: "gallon"; }, { readonly abbrev: "qt"; readonly name: "quart"; }, { readonly abbrev: "pt"; readonly name: "pint"; }, { readonly abbrev: "fl oz"; readonly name: "fluid ounce"; }, { readonly abbrev: "barrel"; readonly name: "barrel"; }, { readonly abbrev: "tbsp"; readonly name: "tablespoon"; }, { readonly abbrev: "tsp"; readonly name: "teaspoon"; }]; declare const TEMPERATURE_METRICS_LOOKUP: readonly [{ readonly abbrev: "°C"; readonly name: "celsius"; }, { readonly abbrev: "°F"; readonly name: "fahrenheit"; }, { readonly abbrev: "K"; readonly name: "kelvin"; }]; declare const PRESSURE_METRICS_LOOKUP: readonly [{ readonly abbrev: "Pa"; readonly name: "pascal"; }, { readonly abbrev: "bar"; readonly name: "bar"; }, { readonly abbrev: "atm"; readonly name: "atmosphere"; }, { readonly abbrev: "mmHg"; readonly name: "millimeters of mercury"; }, { readonly abbrev: "psi"; readonly name: "pounds per square inch"; }]; declare const ENERGY_METRICS_LOOKUP: readonly [{ readonly abbrev: "J"; readonly name: "joule"; }, { readonly abbrev: "cal"; readonly name: "calorie"; }, { readonly abbrev: "kcal"; readonly name: "kilocalorie"; }, { readonly abbrev: "kWh"; readonly name: "kilowatt-hour"; }, { readonly abbrev: "BTU"; readonly name: "british thermal unit"; }, { readonly abbrev: "eV"; readonly name: "electronvolt"; }]; declare const TIME_METRICS_LOOKUP: readonly [{ readonly abbrev: "s"; readonly name: "second"; }, { readonly abbrev: "m"; readonly name: "minute"; }, { readonly abbrev: "h"; readonly name: "hour"; }, { readonly abbrev: "day"; readonly name: "day"; }, { readonly abbrev: "week"; readonly name: "week"; }, { readonly abbrev: "mo"; readonly name: "month"; }, { readonly abbrev: "ms"; readonly name: "millisecond"; }, { readonly abbrev: "µs"; readonly name: "microsecond"; }, { readonly abbrev: "ns"; readonly name: "nanosecond"; }]; declare const POWER_METRICS_LOOKUP: readonly [{ readonly abbrev: "W"; readonly name: "Watt"; }, { readonly abbrev: "kW"; readonly name: "kilowatt"; }, { readonly abbrev: "MW"; readonly name: "megawatt"; }, { readonly abbrev: "hp"; readonly name: "horsepower"; }, { readonly abbrev: "GW"; readonly name: "gigawatt"; }]; declare const FREQUENCY_METRICS_LOOKUP: readonly [{ readonly abbrev: "Hz"; readonly name: "hertz"; }, { readonly abbrev: "kHz"; readonly name: "kilohertz"; }, { readonly abbrev: "MHz"; readonly name: "megahertz"; }, { readonly abbrev: "GHz"; readonly name: "gigahertz"; }, { readonly abbrev: "THz"; readonly name: "terahertz"; }]; declare const VOLTAGE_METRICS_LOOKUP: readonly [{ readonly abbrev: "V"; readonly name: "volt"; }, { readonly abbrev: "kV"; readonly name: "kilovolt"; }, { readonly abbrev: "mV"; readonly name: "millivolt"; }, { readonly abbrev: "µV"; readonly name: "microvolt"; }]; declare const CURRENT_METRICS_LOOKUP: readonly [{ readonly abbrev: "A"; readonly name: "ampere"; }, { readonly abbrev: "mA"; readonly name: "milliampere"; }, { readonly abbrev: "µA"; readonly name: "microampere"; }, { readonly abbrev: "kA"; readonly name: "kiloampere"; }]; declare const RESISTANCE_METRICS_LOOKUP: readonly [{ readonly abbrev: "Ω"; readonly name: "ohm"; }, { readonly abbrev: "kΩ"; readonly name: "kiloohm"; }, { readonly abbrev: "MΩ"; readonly name: "megaohm"; }]; declare const LUMINOSITY_METRICS_LOOKUP: readonly [{ readonly abbrev: "cd"; readonly name: "candela"; }, { readonly abbrev: "lm"; readonly name: "lumen"; }, { readonly abbrev: "lx"; readonly name: "lux"; }]; declare const AREA_METRICS_LOOKUP: readonly [{ readonly abbrev: "m²"; readonly name: "square meter"; }, { readonly abbrev: "cm²"; readonly name: "square centimeter"; }, { readonly abbrev: "mm²"; readonly name: "square millimeter"; }, { readonly abbrev: "km²"; readonly name: "square kilometer"; }, { readonly abbrev: "ft²"; readonly name: "square foot"; }, { readonly abbrev: "in²"; readonly name: "square inch"; }, { readonly abbrev: "acre"; readonly name: "acre"; }, { readonly abbrev: "ha"; readonly name: "hectare"; }]; //#endregion //#region src/Nesting.d.ts /** * the named nested configuration defined in this repo */ declare const KNOWN_NESTING_CONFIGURATIONS: ["brackets", "quotes", "brackets-and-quotes", "shallow-brackets", "shallow-brackets-and-quotes", "shallow-quotes"]; /** * A paired bracketing strategy which matches on * bracket characters: * * - parenthesis: `(` -> `)` * - square brackets: `[` -> `]` * - angle brackets: `<` -> `>` * - and curlies: `{` -> `}` */ declare const BRACKET_NESTING: { "{": "}"; "[": "]"; "<": ">"; "(": ")"; }; /** * A paired bracketing strategy which includes the three * main quotation symbols: * * - single quote (**'**), * - double quote (**"**), * - and backtick (**`**) */ declare const QUOTE_NESTING: { "\"": "\""; "'": "'"; "`": "`"; }; /** * A paired bracketing strategy which includes: * * - all bracket characters * - all quote characters */ declare const BRACKET_AND_QUOTE_NESTING: { "\"": "\""; "'": "'"; "`": "`"; "{": "}"; "[": "]"; "<": ">"; "(": ")"; }; /** * **Shallow Bracket Nesting** * * A hierarchical nesting configuration where bracket characters * are recognized at level 0, but inside brackets no further * nesting is recognized (empty config `{}`). * * This prevents "unbalanced" errors in utilities that only * care about the root level. */ declare const SHALLOW_BRACKET_NESTING: { "(": { exit: ")"; children: {}; }; "[": { exit: "]"; children: {}; }; "{": { exit: "}"; children: {}; }; "<": { exit: ">"; children: {}; }; }; /** * **Shallow Quote Nesting** * * A hierarchical nesting configuration where quote characters * are recognized at level 0, but inside quotes no further * nesting is recognized (empty config `{}`). * * This allows treating quoted content as literals, preventing * split characters inside quotes from being recognized. */ declare const SHALLOW_QUOTE_NESTING: { "\"": { exit: "\""; children: {}; }; "'": { exit: "'"; children: {}; }; "`": { exit: "`"; children: {}; }; }; /** * **Shallow Bracket and Quote Nesting** * * Combines shallow bracket and quote nesting strategies. * Both brackets and quotes are recognized at level 0, but * inside either, no further nesting is recognized. */ declare const SHALLOW_BRACKET_AND_QUOTE_NESTING: { "\"": { exit: "\""; children: {}; }; "'": { exit: "'"; children: {}; }; "`": { exit: "`"; children: {}; }; "(": { exit: ")"; children: {}; }; "[": { exit: "]"; children: {}; }; "{": { exit: "}"; children: {}; }; "<": { exit: ">"; children: {}; }; }; //#endregion //#region src/NetworkConstants.d.ts declare const IPv6: { readonly Loopback: "::1/128"; readonly Multicast: "ff00::/8"; readonly IPv4MappedAddresses: "::FFFF:0:0/96"; readonly Unicast: "fe80::/10"; readonly DocumentationAddresses: "2001:db8::/32"; }; declare const IPv4: { readonly Loopback: "127.0.0.1"; }; declare const NETWORK_PROTOCOL_INSECURE: readonly ["http", "ftp", "ws", "dns", "telnet", "imap", "pop3", "smtp"]; declare const NETWORK_PROTOCOL_SECURE: readonly ["https", "sftp", "wss", "sdns", "ssh"]; declare const NETWORK_PROTOCOL: readonly ["http", "ftp", "ws", "dns", "telnet", "imap", "pop3", "smtp", "https", "sftp", "wss", "sdns", "ssh"]; /** * Lookup of protocols which provides a tuple of: `[insecure,secure]` */ declare const NETWORK_PROTOCOL_LOOKUP: { readonly http: readonly ["http", "https"]; readonly ftp: readonly ["ftp", "sftp"]; readonly file: readonly ["", "file"]; readonly ws: readonly ["ws", "wss"]; readonly ssh: readonly ["", "ssh"]; readonly scp: readonly ["", "scp"]; readonly telnet: readonly ["telnet", ""]; readonly dns: readonly ["dns", "sdns"]; }; declare const PROTOCOL_DEFAULT_PORTS: { readonly http: 80; readonly https: 443; readonly ws: 80; readonly wss: 443; readonly ssh: 22; readonly telnet: 23; readonly dns: 53; readonly sdns: 853; readonly smtp: 25; readonly imap: 142; readonly pop3: 110; readonly ftp: 21; readonly sftp: 22; }; /** * **TLD** * * Top level domains in DNS. This is not a comprehensive list but * takes the core ones and adds in some popular choices. */ declare const TOP_LEVEL_DOMAINS: readonly ["com", "org", "net", "int", "edu", "gov", "io", "mil", "arpa", "academy", "agency", "analytics", "app", "art", "bet", "beer", "book", "coffee", "dot", "doctor", "dog", "family", "game", "guide", "guru", "info", "inc", "news", "new", "ninja", "now", "online", "page", "photos", "place", "pub", "room", "show", "technology", "tel", "tech", "team", "talk", "travel", "website", "work", "works", "wow", "uk", "us", "fr", "de", "eu", "london"]; //#endregion //#region src/Never.d.ts /** * **Never** * * A runtime constant that is meant to represent the `never` type. * * **Related:** you can use the `never()` runtime utility to give a * runtime value but force it's type to `never`. */ declare const Never: never; //#endregion //#region src/News.d.ts declare const US_NEWS: readonly [{ readonly company: "New York Times"; readonly baseUrls: readonly ["www.nytimes.com"]; }, { readonly company: "CNN"; readonly baseUrls: readonly ["www.cnn.com"]; }, { readonly company: "Fox News"; readonly baseUrls: readonly ["www.foxnews.com"]; }, { readonly company: "NBC News"; readonly baseUrls: readonly ["www.nbcnews.com", "www.msnbc.com"]; }, { readonly company: "ABC News"; readonly baseUrls: readonly ["abcnews.go.com"]; }, { readonly company: "The Washington Post"; readonly baseUrls: readonly ["www.washingtonpost.com"]; }, { readonly company: "USA Today"; readonly baseUrls: readonly ["www.usatoday.com"]; }, { readonly company: "Bloomberg"; readonly baseUrls: readonly ["www.bloomberg.com"]; }, { readonly company: "NPR"; readonly baseUrls: readonly ["www.npr.org"]; }, { readonly company: "CBS News"; readonly baseUrls: readonly ["www.cbsnews.com"]; }, { readonly company: "The Wall Street Journal"; readonly baseUrls: readonly ["www.wsj.com"]; }, { readonly company: "Associated Press (AP)"; readonly baseUrls: readonly ["www.apnews.com", "www.ap.org"]; }, { readonly company: "Reuters"; readonly baseUrls: readonly ["www.reuters.com"]; }, { readonly company: "Newsweek"; readonly baseUrls: readonly ["www.newsweek.com"]; }, { readonly company: "Politico"; readonly baseUrls: readonly ["www.politico.com"]; }, { readonly company: "The Atlantic"; readonly baseUrls: readonly ["www.theatlantic.com"]; }, { readonly company: "Nexstar Media Group"; readonly baseUrls: readonly ["www.nexstar.tv"]; }, { readonly company: "PBS News"; readonly baseUrls: readonly ["www.pbs.org"]; }, { readonly company: "HuffPost"; readonly baseUrls: readonly ["www.huffpost.com"]; }, { readonly company: "The Boston Globe"; readonly baseUrls: readonly ["www.bostonglobe.com"]; }]; declare const UK_NEWS: readonly [{ readonly company: "BBC"; readonly baseUrls: readonly ["www.bbc.co.uk", "www.bbc.com"]; }, { readonly company: "The Guardian"; readonly baseUrls: readonly ["www.theguardian.com/uk"]; }, { readonly company: "The Daily Mail"; readonly baseUrls: readonly ["www.dailymail.co.uk"]; }, { readonly company: "The Sun"; readonly baseUrls: readonly ["www.thesun.co.uk"]; }, { readonly company: "The Times"; readonly baseUrls: readonly ["www.thetimes.co.uk"]; }, { readonly company: "Sky News"; readonly baseUrls: readonly ["news.sky.com"]; }, { readonly company: "The Telegraph"; readonly baseUrls: readonly ["www.telegraph.co.uk"]; }, { readonly company: "ITV News"; readonly baseUrls: readonly ["www.itv.com/news"]; }, { readonly company: "Financial Times"; readonly baseUrls: readonly ["www.ft.com"]; }, { readonly company: "Metro"; readonly baseUrls: readonly ["www.metro.co.uk"]; }, { readonly company: "The Independent"; readonly baseUrls: readonly ["www.independent.co.uk"]; }, { readonly company: "Evening Standard"; readonly baseUrls: readonly ["www.standard.co.uk"]; }, { readonly company: "Daily Mirror"; readonly baseUrls: readonly ["www.mirror.co.uk"]; }, { readonly company: "Channel 4 News"; readonly baseUrls: readonly ["www.channel4.com/news"]; }, { readonly company: "LBC"; readonly baseUrls: readonly ["www.lbc.co.uk"]; }, { readonly company: "Daily Express"; readonly baseUrls: readonly ["www.express.co.uk"]; }, { readonly company: "Birmingham Mail"; readonly baseUrls: readonly ["www.birminghammail.co.uk"]; }, { readonly company: "Manchester Evening News"; readonly baseUrls: readonly ["www.manchestereveningnews.co.uk"]; }, { readonly company: "The Scotsman"; readonly baseUrls: readonly ["www.scotsman.com"]; }, { readonly company: "Daily Record"; readonly baseUrls: readonly ["www.dailyrecord.co.uk"]; }]; declare const GERMAN_NEWS: readonly [{ readonly company: "BILD"; readonly baseUrls: readonly ["www.bild.de"]; }, { readonly company: "Die Zeit"; readonly baseUrls: readonly ["www.zeit.de"]; }, { readonly company: "Frankfurter Allgemeine Zeitung"; readonly baseUrls: readonly ["www.faz.net"]; }, { readonly company: "Süddeutsche Zeitung"; readonly baseUrls: readonly ["www.sueddeutsche.de"]; }, { readonly company: "Der Spiegel"; readonly baseUrls: readonly ["www.spiegel.de"]; }, { readonly company: "Die Welt"; readonly baseUrls: readonly ["www.welt.de"]; }, { readonly company: "Tagesschau"; readonly baseUrls: readonly ["www.tagesschau.de"]; }, { readonly company: "t-online"; readonly baseUrls: readonly ["www.t-online.de"]; }, { readonly company: "n-tv"; readonly baseUrls: readonly ["www.n-tv.de"]; }, { readonly company: "Handelsblatt"; readonly baseUrls: readonly ["www.handelsblatt.com"]; }, { readonly company: "Focus Online"; readonly baseUrls: readonly ["www.focus.de"]; }, { readonly company: "Frankfurter Rundschau"; readonly baseUrls: readonly ["www.fr.de", "www.fr-online.de"]; }, { readonly company: "taz - die tageszeitung"; readonly baseUrls: readonly ["www.taz.de"]; }, { readonly company: "Der Tagesspiegel"; readonly baseUrls: readonly ["www.tagesspiegel.de"]; }, { readonly company: "Rheinische Post"; readonly baseUrls: readonly ["www.rp-online.de"]; }, { readonly company: "Express"; readonly baseUrls: readonly ["www.express.de"]; }, { readonly company: "Münchner Merkur"; readonly baseUrls: readonly ["www.merkur.de"]; }, { readonly company: "Stuttgarter Zeitung"; readonly baseUrls: readonly ["www.stuttgarter-zeitung.de"]; }, { readonly company: "Hamburger Abendblatt"; readonly baseUrls: readonly ["www.abendblatt.de"]; }, { readonly company: "Deutsche Welle"; readonly baseUrls: readonly ["www.dw.com"]; }]; declare const FRENCH_NEWS: readonly [{ readonly company: "Le Figaro"; readonly baseUrls: readonly ["www.lefigaro.fr"]; }, { readonly company: "Le Monde"; readonly baseUrls: readonly ["www.lemonde.fr"]; }, { readonly company: "France 24"; readonly baseUrls: readonly ["www.france24.com"]; }, { readonly company: "Libération"; readonly baseUrls: readonly ["www.liberation.fr"]; }, { readonly company: "Les Echos"; readonly baseUrls: readonly ["www.lesechos.fr"]; }, { readonly company: "Ouest-France"; readonly baseUrls: readonly ["www.ouest-france.fr"]; }, { readonly company: "Le Parisien"; readonly baseUrls: readonly ["www.leparisien.fr"]; }, { readonly company: "Mediapart"; readonly baseUrls: readonly ["www.mediapart.fr"]; }, { readonly company: "L'Express"; readonly baseUrls: readonly ["www.lexpress.fr"]; }, { readonly company: "La Croix"; readonly baseUrls: readonly ["www.la-croix.com"]; }, { readonly company: "20 Minutes"; readonly baseUrls: readonly ["www.20minutes.fr"]; }, { readonly company: "Courrier International"; readonly baseUrls: readonly ["www.courrierinternational.com"]; }, { readonly company: "Le Point"; readonly baseUrls: readonly ["www.lepoint.fr"]; }, { readonly company: "Marianne"; readonly baseUrls: readonly ["www.marianne.net"]; }, { readonly company: "BFM TV"; readonly baseUrls: readonly ["www.bfmtv.com"]; }, { readonly company: "RTL France"; readonly baseUrls: readonly ["www.rtl.fr"]; }, { readonly company: "Charlie Hebdo"; readonly baseUrls: readonly ["www.charliehebdo.fr"]; }, { readonly company: "Challenges"; readonly baseUrls: readonly ["www.challenges.fr"]; }, { readonly company: "Télérama"; readonly baseUrls: readonly ["www.telerama.fr"]; }, { readonly company: "L'Obs"; readonly baseUrls: readonly ["www.nouvelobs.com"]; }]; declare const CANADIAN_NEWS: readonly [{ readonly company: "CBC News"; readonly baseUrls: readonly ["www.cbc.ca"]; }, { readonly company: "CTV News"; readonly baseUrls: readonly ["www.ctvnews.ca"]; }, { readonly company: "The Globe and Mail"; readonly baseUrls: readonly ["www.theglobeandmail.com"]; }, { readonly company: "Global News"; readonly baseUrls: readonly ["www.globalnews.ca"]; }, { readonly company: "Toronto Star"; readonly baseUrls: readonly ["www.thestar.com"]; }, { readonly company: "National Post"; readonly baseUrls: readonly ["www.nationalpost.com"]; }, { readonly company: "La Presse"; readonly baseUrls: readonly ["www.lapresse.ca"]; }, { readonly company: "Radio-Canada"; readonly baseUrls: readonly ["ici.radio-canada.ca"]; }, { readonly company: "The Canadian Press"; readonly baseUrls: readonly ["www.thecanadianpress.com"]; }, { readonly company: "Financial Post"; readonly baseUrls: readonly ["financialpost.com"]; }, { readonly company: "The Weather Network"; readonly baseUrls: readonly ["www.theweathernetwork.com"]; }, { readonly company: "Le Devoir"; readonly baseUrls: readonly ["www.ledevoir.com"]; }, { readonly company: "TVA Nouvelles"; readonly baseUrls: readonly ["www.tvanouvelles.ca"]; }, { readonly company: "Journal de Montréal"; readonly baseUrls: readonly ["www.journaldemontreal.com"]; }, { readonly company: "CityNews"; readonly baseUrls: readonly ["www.citynews.ca"]; }, { readonly company: "BNN Bloomberg"; readonly baseUrls: readonly ["www.bnnbloomberg.ca"]; }, { readonly company: "The Hamilton Spectator"; readonly baseUrls: readonly ["www.thespec.com"]; }, { readonly company: "Ottawa Citizen"; readonly baseUrls: readonly ["ottawacitizen.com"]; }, { readonly company: "Windsor Star"; readonly baseUrls: readonly ["windsorstar.com"]; }, { readonly company: "Edmonton Journal"; readonly baseUrls: readonly ["edmontonjournal.com"]; }]; declare const DUTCH_NEWS: readonly [{ readonly company: "Algemeen Dagblad (AD)"; readonly baseUrls: readonly ["www.ad.nl"]; }, { readonly company: "NOS"; readonly baseUrls: readonly ["www.nos.nl"]; }, { readonly company: "De Telegraaf"; readonly baseUrls: readonly ["www.telegraaf.nl"]; }, { readonly company: "NU.nl"; readonly baseUrls: readonly ["www.nu.nl"]; }, { readonly company: "Volkskrant"; readonly baseUrls: readonly ["www.volkskrant.nl"]; }, { readonly company: "NRC Handelsblad"; readonly baseUrls: readonly ["www.nrc.nl"]; }, { readonly company: "Trouw"; readonly baseUrls: readonly ["www.trouw.nl"]; }, { readonly company: "Het Parool"; readonly baseUrls: readonly ["www.parool.nl"]; }, { readonly company: "RTL Nieuws"; readonly baseUrls: readonly ["www.rtlnieuws.nl"]; }, { readonly company: "BNR Nieuwsradio"; readonly baseUrls: readonly ["www.bnr.nl"]; }, { readonly company: "Emerce"; readonly baseUrls: readonly ["www.emerce.nl"]; }, { readonly company: "VPRO"; readonly baseUrls: readonly ["www.vpro.nl"]; }, { readonly company: "De Gelderlander"; readonly baseUrls: readonly ["www.gelderlander.nl"]; }, { readonly company: "Friesch Dagblad"; readonly baseUrls: readonly ["www.frieschdagblad.nl"]; }, { readonly company: "De Stentor"; readonly baseUrls: readonly ["www.destentor.nl"]; }, { readonly company: "Metro Nieuws"; readonly baseUrls: readonly ["www.metronieuws.nl"]; }, { readonly company: "ANP"; readonly baseUrls: readonly ["www.anp.nl"]; }, { readonly company: "Dagblad van het Noorden"; readonly baseUrls: readonly ["www.dvhn.nl"]; }, { readonly company: "Reformatorisch Dagblad"; readonly baseUrls: readonly ["www.rd.nl"]; }, { readonly company: "Financieele Dagblad"; readonly baseUrls: readonly ["www.fd.nl"]; }]; declare const ITALIAN_NEWS: readonly [{ readonly company: "ANSA"; readonly baseUrls: readonly ["www.ansa.it", "www.ansamed.info"]; }, { readonly company: "Corriere della Sera"; readonly baseUrls: readonly ["www.corriere.it"]; }, { readonly company: "la Repubblica"; readonly baseUrls: readonly ["www.repubblica.it"]; }, { readonly company: "Il Sole 24 Ore"; readonly baseUrls: readonly ["www.ilsole24ore.com"]; }, { readonly company: "La Stampa"; readonly baseUrls: readonly ["www.lastampa.it"]; }, { readonly company: "Il Messaggero"; readonly baseUrls: readonly ["www.ilmessaggero.it"]; }, { readonly company: "Il Giornale"; readonly baseUrls: readonly ["www.ilgiornale.it"]; }, { readonly company: "Avvenire"; readonly baseUrls: readonly ["www.avvenire.it"]; }, { readonly company: "Il Fatto Quotidiano"; readonly baseUrls: readonly ["www.ilfattoquotidiano.it"]; }, { readonly company: "La Nazione"; readonly baseUrls: readonly ["www.lanazione.it"]; }, { readonly company: "TgCom24"; readonly baseUrls: readonly ["www.tgcom24.mediaset.it"]; }, { readonly company: "Sky TG24"; readonly baseUrls: readonly ["tg24.sky.it"]; }, { readonly company: "Rai News"; readonly baseUrls: readonly ["www.rainews.it"]; }, { readonly company: "Gazzetta dello Sport"; readonly baseUrls: readonly ["www.gazzetta.it"]; }, { readonly company: "Il Resto del Carlino"; readonly baseUrls: readonly ["www.ilrestodelcarlino.it"]; }, { readonly company: "Il Mattino"; readonly baseUrls: readonly ["www.ilmattino.it"]; }, { readonly company: "Il Secolo XIX"; readonly baseUrls: readonly ["www.ilsecoloxix.it"]; }, { readonly company: "Italia Oggi"; readonly baseUrls: readonly ["www.italiaoggi.it"]; }, { readonly company: "Libero"; readonly baseUrls: readonly ["www.liberoquotidiano.it"]; }, { readonly company: "Il Tirreno"; readonly baseUrls: readonly ["www.iltirreno.it"]; }]; declare const BELGIUM_NEWS: readonly [{ readonly company: "Het Laatste Nieuws (HLN)"; readonly baseUrls: readonly ["www.hln.be"]; }, { readonly company: "Nieuwsblad"; readonly baseUrls: readonly ["www.nieuwsblad.be"]; }, { readonly company: "RTBF"; readonly baseUrls: readonly ["www.rtbf.be"]; }, { readonly company: "Sudinfo"; readonly baseUrls: readonly ["www.sudinfo.be"]; }, { readonly company: "7sur7"; readonly baseUrls: readonly ["www.7sur7.be"]; }, { readonly company: "Le Soir"; readonly baseUrls: readonly ["www.lesoir.be"]; }, { readonly company: "De Standaard"; readonly baseUrls: readonly ["www.standaard.be"]; }, { readonly company: "VRT NWS"; readonly baseUrls: readonly ["www.vrt.be"]; }, { readonly company: "La Libre"; readonly baseUrls: readonly ["www.lalibre.be"]; }, { readonly company: "Gazet van Antwerpen"; readonly baseUrls: readonly ["www.gva.be"]; }, { readonly company: "Het Belang van Limburg"; readonly baseUrls: readonly ["www.hbvl.be"]; }, { readonly company: "De Morgen"; readonly baseUrls: readonly ["www.demorgen.be"]; }, { readonly company: "L'Avenir"; readonly baseUrls: readonly ["www.lavenir.net"]; }, { readonly company: "The Brussels Times"; readonly baseUrls: readonly ["www.brusselstimes.com"]; }, { readonly company: "Metro Belgique"; readonly baseUrls: readonly ["nl.metrotime.be"]; }, { readonly company: "Sudpresse"; readonly baseUrls: readonly ["www.sudpress.be"]; }, { readonly company: "Flamish Radio and TV Broadcasting Organization (VRT)"; readonly baseUrls: readonly ["www.vrt.be"]; }, { readonly company: "Knack"; readonly baseUrls: readonly ["www.knack.be"]; }, { readonly company: "De Tijd"; readonly baseUrls: readonly ["www.tijd.be"]; }, { readonly company: "BX1"; readonly baseUrls: readonly ["www.bx1.be"]; }]; declare const MEXICAN_NEWS: readonly [{ readonly company: "Televisa"; readonly baseUrls: readonly ["www.televisa.news"]; }, { readonly company: "El Universal"; readonly baseUrls: readonly ["www.eluniversal.com.mx"]; }, { readonly company: "Milenio"; readonly baseUrls: readonly ["www.milenio.com"]; }, { readonly company: "Excélsior"; readonly baseUrls: readonly ["www.excelsior.com.mx"]; }, { readonly company: "Reforma"; readonly baseUrls: readonly ["www.reforma.com"]; }, { readonly company: "La Jornada"; readonly baseUrls: readonly ["www.jornada.com.mx"]; }, { readonly company: "El Financiero"; readonly baseUrls: readonly ["www.elfinanciero.com.mx"]; }, { readonly company: "Proceso"; readonly baseUrls: readonly ["www.proceso.com.mx"]; }, { readonly company: "SDP Noticias"; readonly baseUrls: readonly ["www.sdpnoticias.com"]; }, { readonly company: "Diario de Yucatán"; readonly baseUrls: readonly ["www.yucatan.com.mx"]; }, { readonly company: "El Economista"; readonly baseUrls: readonly ["www.eleconomista.com.mx"]; }, { readonly company: "El Heraldo de México"; readonly baseUrls: readonly ["www.heraldodemexico.com.mx"]; }, { readonly company: "Noticieros Televisa"; readonly baseUrls: readonly ["noticieros.televisa.com"]; }, { readonly company: "Expansión"; readonly baseUrls: readonly ["expansion.mx"]; }, { readonly company: "La Razón"; readonly baseUrls: readonly ["www.razon.com.mx"]; }, { readonly company: "Noroeste"; readonly baseUrls: readonly ["www.noroeste.com.mx"]; }, { readonly company: "Uniradio Noticias"; readonly baseUrls: readonly ["www.uniradionoticias.com"]; }, { readonly company: "El Imparcial"; readonly baseUrls: readonly ["www.elimparcial.com"]; }, { readonly company: "Publimetro México"; readonly baseUrls: readonly ["www.publimetro.com.mx"]; }, { readonly company: "Notimex"; readonly baseUrls: readonly ["www.notimex.gob.mx"]; }]; declare const SPANISH_NEWS: readonly [{ readonly company: "El País"; readonly baseUrls: readonly ["www.elpais.com"]; }, { readonly company: "El Mundo"; readonly baseUrls: readonly ["www.elmundo.es"]; }, { readonly company: "ABC"; readonly baseUrls: readonly ["www.abc.es"]; }, { readonly company: "La Vanguardia"; readonly baseUrls: readonly ["www.lavanguardia.com"]; }, { readonly company: "El Confidencial"; readonly baseUrls: readonly ["www.elconfidencial.com"]; }, { readonly company: "La Razón"; readonly baseUrls: readonly ["www.larazon.es"]; }, { readonly company: "20 Minutos"; readonly baseUrls: readonly ["www.20minutos.es"]; }, { readonly company: "Agencia EFE"; readonly baseUrls: readonly ["www.efe.com"]; }, { readonly company: "Europa Press"; readonly baseUrls: readonly ["www.europapress.es"]; }, { readonly company: "Diario AS"; readonly baseUrls: readonly ["www.as.com"]; }, { readonly company: "Mundo Deportivo"; readonly baseUrls: readonly ["www.mundodeportivo.com"]; }, { readonly company: "El Periódico"; readonly baseUrls: readonly ["www.elperiodico.com"]; }, { readonly company: "Cinco Días"; readonly baseUrls: readonly ["www.cincodias.com"]; }, { readonly company: "Expansión"; readonly baseUrls: readonly ["www.expansion.com"]; }, { readonly company: "La Información"; readonly baseUrls: readonly ["www.lainformacion.com"]; }, { readonly company: "OK Diario"; readonly baseUrls: readonly ["www.okdiario.com"]; }, { readonly company: "Heraldo de Aragón"; readonly baseUrls: readonly ["www.heraldo.es"]; }, { readonly company: "Faro de Vigo"; readonly baseUrls: readonly ["www.farodevigo.es"]; }, { readonly company: "El Correo"; readonly baseUrls: readonly ["www.elcorreo.com"]; }, { readonly company: "Diario Sur"; readonly baseUrls: readonly ["www.diariosur.es"]; }]; declare const INDIAN_NEWS: readonly [{ readonly company: "The Times of India"; readonly baseUrls: readonly ["timesofindia.indiatimes.com"]; }, { readonly company: "The Hindu"; readonly baseUrls: readonly ["www.thehindu.com"]; }, { readonly company: "Hindustan Times"; readonly baseUrls: readonly ["www.hindustantimes.com"]; }, { readonly company: "NDTV"; readonly baseUrls: readonly ["www.ndtv.com"]; }, { readonly company: "India Today"; readonly baseUrls: readonly ["www.indiatoday.in"]; }, { readonly company: "Zee News"; readonly baseUrls: readonly ["zeenews.india.com"]; }, { readonly company: "Indian Express"; readonly baseUrls: readonly ["indianexpress.com"]; }, { readonly company: "The Economic Times"; readonly baseUrls: readonly ["economictimes.indiatimes.com"]; }, { readonly company: "Deccan Herald"; readonly baseUrls: readonly ["www.deccanherald.com"]; }, { readonly company: "DNA India"; readonly baseUrls: readonly ["www.dnaindia.com"]; }, { readonly company: "The Print"; readonly baseUrls: readonly ["theprint.in"]; }, { readonly company: "News18"; readonly baseUrls: readonly ["www.news18.com"]; }, { readonly company: "Scroll.in"; readonly baseUrls: readonly ["scroll.in"]; }, { readonly company: "Asian News International (ANI)"; readonly baseUrls: readonly ["www.aninews.in"]; }, { readonly company: "Outlook India"; readonly baseUrls: readonly ["www.outlookindia.com"]; }, { readonly company: "Business Standard"; readonly baseUrls: readonly ["www.business-standard.com"]; }, { readonly company: "Mint"; readonly baseUrls: readonly ["www.livemint.com"]; }, { readonly company: "OneIndia"; readonly baseUrls: readonly ["www.oneindia.com"]; }, { readonly company: "Quint"; readonly baseUrls: readonly ["www.thequint.com"]; }, { readonly company: "Free Press Journal"; readonly baseUrls: readonly ["www.freepressjournal.in"]; }]; declare const CHINESE_NEWS: readonly [{ readonly company: "Xinhua News Agency"; readonly baseUrls: readonly ["www.xinhuanet.com"]; }, { readonly company: "China Central Television (CCTV)"; readonly baseUrls: readonly ["www.cctv.com"]; }, { readonly company: "China Daily"; readonly baseUrls: readonly ["www.chinadaily.com.cn"]; }, { readonly company: "CGTN (China Global Television Network)"; readonly baseUrls: readonly ["www.cgtn.com"]; }, { readonly company: "People's Daily"; readonly baseUrls: readonly ["www.people.cn"]; }, { readonly company: "Global Times"; readonly baseUrls: readonly ["www.globaltimes.cn"]; }, { readonly company: "South China Morning Post"; readonly baseUrls: readonly ["www.scmp.com"]; }, { readonly company: "Shanghai Daily"; readonly baseUrls: readonly ["www.shanghaidaily.com"]; }, { readonly company: "China News Service"; readonly baseUrls: readonly ["www.ecns.cn"]; }, { readonly company: "Caixin"; readonly baseUrls: readonly ["www.caixinglobal.com"]; }, { readonly company: "The Paper"; readonly baseUrls: readonly ["www.thepaper.cn"]; }, { readonly company: "Yicai Global"; readonly baseUrls: readonly ["www.yicaiglobal.com"]; }, { readonly company: "Economic Daily"; readonly baseUrls: readonly ["www.ce.cn"]; }, { readonly company: "21st Century Business Herald"; readonly baseUrls: readonly ["www.21jingji.com"]; }, { readonly company: "Beijing Review"; readonly baseUrls: readonly ["www.bjreview.com"]; }, { readonly company: "China Economic Net"; readonly baseUrls: readonly ["www.ce.cn"]; }, { readonly company: "Tencent News"; readonly baseUrls: readonly ["news.qq.com"]; }, { readonly company: "Sina News"; readonly baseUrls: readonly ["news.sina.com.cn"]; }, { readonly company: "NetEase News"; readonly baseUrls: readonly ["news.163.com"]; }, { readonly company: "Phoenix TV"; readonly baseUrls: readonly ["www.ifeng.com"]; }]; /** news sites in Denmark */ declare const DANISH_NEWS: readonly [{ readonly company: "Politiken"; readonly baseUrls: readonly ["www.politiken.dk"]; }, { readonly company: "Berlingske"; readonly baseUrls: readonly ["www.berlingske.dk"]; }, { readonly company: "Jyllands-Posten"; readonly baseUrls: readonly ["jyllands-posten.dk"]; }, { readonly company: "Ekstra Bladet"; readonly baseUrls: readonly ["ekstrabladet.dk"]; }, { readonly company: "Information"; readonly baseUrls: readonly ["www.information.dk"]; }, { readonly company: "BT"; readonly baseUrls: readonly ["www.bt.dk"]; }, { readonly company: "Weekendavisen"; readonly baseUrls: readonly ["www.weekendavisen.dk"]; }, { readonly company: "Fyens Stiftstidende"; readonly baseUrls: readonly ["fyens.dk"]; }, { readonly company: "Kristeligt Dagblad"; readonly baseUrls: readonly ["www.kristeligt-dagblad.dk"]; }, { readonly company: "Copenhagen Post"; readonly baseUrls: readonly ["cphpost.dk"]; }, { readonly company: "Nordjyske Stiftstidende"; readonly baseUrls: readonly ["nordjyske.dk"]; }, { readonly company: "Århus Stiftstidende"; readonly baseUrls: readonly ["stiften.dk"]; }, { readonly company: "Dagbladet Børsen"; readonly baseUrls: readonly ["borsen.dk"]; }, { readonly company: "Lokalavisen"; readonly baseUrls: readonly ["lokalavisen.dk"]; }, { readonly company: "TV2 Nyheder"; readonly baseUrls: readonly ["tv2.dk"]; }, { readonly company: "DR Nyheder"; readonly baseUrls: readonly ["dr.dk"]; }, { readonly company: "Avisen Danmark"; readonly baseUrls: readonly ["avisen.dk"]; }, { readonly company: "Fagbladet 3F"; readonly baseUrls: readonly ["fagbladet3f.dk"]; }, { readonly company: "Herning Folkeblad"; readonly baseUrls: readonly ["herningfolkeblad.dk"]; }, { readonly company: "Midtjyllands Avis"; readonly baseUrls: readonly ["midtjyllandsavis.dk"]; }]; declare const SWISS_NEWS: readonly [{ readonly company: "Neue Zürcher Zeitung (NZZ)"; readonly baseUrls: readonly ["www.nzz.ch"]; readonly type: readonly ["newspaper", "digital"]; }, { readonly company: "Swissinfo"; readonly baseUrls: readonly ["www.swissinfo.ch"]; readonly type: readonly ["digital-first"]; }, { readonly company: "20 Minuten"; readonly baseUrls: readonly ["www.20min.ch"]; readonly type: readonly ["newspaper", "digital"]; }, { readonly company: "Blick"; readonly baseUrls: readonly ["www.blick.ch"]; readonly type: readonly ["newspaper", "digital"]; }, { readonly company: "Le Temps"; readonly baseUrls: readonly ["www.letemps.ch"]; readonly type: readonly ["newspaper", "digital"]; }, { readonly company: "Tages-Anzeiger"; readonly baseUrls: readonly ["www.tagesanzeiger.ch"]; readonly type: readonly ["newspaper", "digital"]; }, { readonly company: "SRF News"; readonly baseUrls: readonly ["www.srf.ch"]; readonly type: readonly ["television", "radio", "digital"]; }, { readonly company: "Luzerner Zeitung"; readonly baseUrls: readonly ["www.luzernerzeitung.ch"]; readonly type: readonly ["newspaper", "digital"]; }, { readonly company: "La Tribune de Genève"; readonly baseUrls: readonly ["www.tdg.ch"]; readonly type: readonly ["newspaper", "digital"]; }, { readonly company: "Aargauer Zeitung"; readonly baseUrls: readonly ["www.aargauerzeitung.ch"]; readonly type: readonly ["newspaper", "digital"]; }, { readonly company: "24 Heures"; readonly baseUrls: readonly ["www.24heures.ch"]; readonly type: readonly ["newspaper", "digital"]; }, { readonly company: "Radio Télévision Suisse (RTS)"; readonly baseUrls: readonly ["www.rts.ch"]; readonly type: readonly ["television", "radio", "digital"]; }, { readonly company: "Der Bund"; readonly baseUrls: readonly ["www.derbund.ch"]; readonly type: readonly ["newspaper", "digital"]; }, { readonly company: "Schweizer Radio und Fernsehen (SRF)"; readonly baseUrls: readonly ["www.srf.ch"]; readonly type: readonly ["television", "radio", "digital"]; }, { readonly company: "Basler Zeitung"; readonly baseUrls: readonly ["www.bazonline.ch"]; readonly type: readonly ["newspaper", "digital"]; }, { readonly company: "Handelszeitung"; readonly baseUrls: readonly ["www.handelszeitung.ch"]; readonly type: readonly ["newspaper", "digital"]; }, { readonly company: "Watson"; readonly baseUrls: readonly ["www.watson.ch"]; readonly type: readonly ["digital-first"]; }, { readonly company: "Le Matin"; readonly baseUrls: readonly ["www.lematin.ch"]; readonly type: readonly ["newspaper", "digital"]; }, { readonly company: "La Liberté"; readonly baseUrls: readonly ["www.laliberte.ch"]; readonly type: readonly ["newspaper", "digital"]; }, { readonly company: "The Swiss Times"; readonly baseUrls: readonly ["www.theswisstimes.ch"]; readonly type: readonly ["digital-first"]; }]; declare const AUSTRALIAN_NEWS: readonly [{ readonly company: "ABC News"; readonly baseUrls: readonly ["www.abc.net.au"]; readonly type: readonly ["television", "radio", "digital"]; }, { readonly company: "The Sydney Morning Herald"; readonly baseUrls: readonly ["www.smh.com.au"]; readonly type: readonly ["newspaper", "digital"]; }, { readonly company: "The Australian"; readonly baseUrls: readonly ["www.theaustralian.com.au"]; readonly type: readonly ["newspaper", "digital"]; }, { readonly company: "Herald Sun"; readonly baseUrls: readonly ["www.heraldsun.com.au"]; readonly type: readonly ["newspaper", "digital"]; }, { readonly company: "9News"; readonly baseUrls: readonly ["www.9news.com.au"]; readonly type: readonly ["television", "digital"]; }, { readonly company: "SBS News"; readonly baseUrls: readonly ["www.sbs.com.au"]; readonly type: readonly ["television", "digital", "multicultural"]; }, { readonly company: "The Age"; readonly baseUrls: readonly ["www.theage.com.au"]; readonly type: readonly ["newspaper", "digital"]; }, { readonly company: "Sky News Australia"; readonly baseUrls: readonly ["www.skynews.com.au"]; readonly type: readonly ["television", "digital"]; }, { readonly company: "Australian Financial Review"; readonly baseUrls: readonly ["www.afr.com"]; readonly type: readonly ["newspaper", "digital"]; }, { readonly company: "news.com.au"; readonly baseUrls: readonly ["www.news.com.au"]; readonly type: readonly ["digital-first"]; }, { readonly company: "The Courier-Mail"; readonly baseUrls: readonly ["www.couriermail.com.au"]; readonly type: readonly ["newspaper", "digital"]; }, { readonly company: "7NEWS"; readonly baseUrls: readonly ["7news.com.au"]; readonly type: readonly ["television", "digital"]; }, { readonly company: "The West Australian"; readonly baseUrls: readonly ["www.thewest.com.au"]; readonly type: readonly ["newspaper", "digital"]; }, { readonly company: "Daily Telegraph"; readonly baseUrls: readonly ["www.dailytelegraph.com.au"]; readonly type: readonly ["newspaper", "digital"]; }, { readonly company: "Guardian Australia"; readonly baseUrls: readonly ["www.theguardian.com/au"]; readonly type: readonly ["digital-first"]; }, { readonly company: "Crikey"; readonly baseUrls: readonly ["www.crikey.com.au"]; readonly type: readonly ["digital-first", "independent"]; }, { readonly company: "AAP (Australian Associated Press)"; readonly baseUrls: readonly ["www.aap.com.au"]; readonly type: readonly ["news agency", "digital"]; }, { readonly company: "NT News"; readonly baseUrls: readonly ["www.ntnews.com.au"]; readonly type: readonly ["newspaper", "digital"]; }, { readonly company: "The Canberra Times"; readonly baseUrls: readonly ["www.canberratimes.com.au"]; readonly type: readonly ["newspaper", "digital"]; }, { readonly company: "Brisbane Times"; readonly baseUrls: readonly ["www.brisbanetimes.com.au"]; readonly type: readonly ["digital-first"]; }]; declare const JAPANESE_NEWS: readonly [{ readonly company: "The Asahi Shimbun"; readonly baseUrls: readonly ["www.asahi.com"]; readonly type: readonly ["newspaper", "digital"]; }, { readonly company: "Yomiuri Shimbun"; readonly baseUrls: readonly ["www.yomiuri.co.jp"]; readonly type: readonly ["newspaper", "digital"]; }, { readonly company: "Nikkei"; readonly baseUrls: readonly ["www.nikkei.com"]; readonly type: readonly ["newspaper", "digital"]; }, { readonly company: "Mainichi Shimbun"; readonly baseUrls: readonly ["mainichi.jp"]; readonly type: readonly ["newspaper", "digital"]; }, { readonly company: "Kyodo News"; readonly baseUrls: readonly ["www.kyodonews.jp"]; readonly type: readonly ["news agency", "digital"]; }, { readonly company: "Japan Times"; readonly baseUrls: readonly ["www.japantimes.co.jp"]; readonly type: readonly ["newspaper", "digital"]; }, { readonly company: "NHK"; readonly baseUrls: readonly ["www.nhk.or.jp"]; readonly type: readonly ["television", "radio", "digital"]; }, { readonly company: "Fuji News Network (FNN)"; readonly baseUrls: readonly ["www.fnn.jp"]; readonly type: readonly ["television", "digital"]; }, { readonly company: "Sankei Shimbun"; readonly baseUrls: readonly ["www.sankei.com"]; readonly type: readonly ["newspaper", "digital"]; }, { readonly company: "Toyo Keizai"; readonly baseUrls: readonly ["www.toyokeizai.net"]; readonly type: readonly ["digital", "business magazine"]; }, { readonly company: "Hokkaido Shimbun"; readonly baseUrls: readonly ["www.hokkaido-np.co.jp"]; readonly type: readonly ["newspaper", "digital"]; }, { readonly company: "Shizuoka Shimbun"; readonly baseUrls: readonly ["www.at-s.com"]; readonly type: readonly ["newspaper", "digital"]; }, { readonly company: "Tokyo Shimbun"; readonly baseUrls: readonly ["www.tokyo-np.co.jp"]; readonly type: readonly ["newspaper", "digital"]; }, { readonly company: "Yahoo Japan News"; readonly baseUrls: readonly ["news.yahoo.co.jp"]; readonly type: readonly ["digital-first"]; }, { readonly company: "TBS News"; readonly baseUrls: readonly ["news.tbs.co.jp"]; readonly type: readonly ["television", "digital"]; }, { readonly company: "Nippon TV News 24 Japan"; readonly baseUrls: readonly ["www.news24.jp"]; readonly type: readonly ["television", "digital"]; }, { readonly company: "Jiji Press"; readonly baseUrls: readonly ["www.jiji.com"]; readonly type: readonly ["news agency", "digital"]; }, { readonly company: "TV Asahi News"; readonly baseUrls: readonly ["news.tv-asahi.co.jp"]; readonly type: readonly ["television", "digital"]; }, { readonly company: "WOWOW Prime News"; readonly baseUrls: readonly ["www.wowow.co.jp"]; readonly type: readonly ["television", "digital"]; }, { readonly company: "Kansai Telecasting Corporation (KTV)"; readonly baseUrls: readonly ["www.ktv.jp"]; readonly type: readonly ["television", "digital"]; }]; declare const SOUTH_KOREAN_NEWS: readonly [{ readonly company: "Yonhap News Agency"; readonly baseUrls: readonly ["www.yonhapnews.co.kr"]; readonly type: readonly ["news agency", "digital"]; }, { readonly company: "The Korea Herald"; readonly baseUrls: readonly ["www.koreaherald.com"]; readonly type: readonly ["newspaper", "digital"]; }, { readonly company: "The Korea Times"; readonly baseUrls: readonly ["www.koreatimes.co.kr"]; readonly type: readonly ["newspaper", "digital"]; }, { readonly company: "Chosun Ilbo"; readonly baseUrls: readonly ["www.chosun.com"]; readonly type: readonly ["newspaper", "digital"]; }, { readonly company: "JoongAng Ilbo"; readonly baseUrls: readonly ["www.joongang.co.kr"]; readonly type: readonly ["newspaper", "digital"]; }, { readonly company: "Dong-A Ilbo"; readonly baseUrls: readonly ["www.donga.com"]; readonly type: readonly ["newspaper", "digital"]; }, { readonly company: "MBC News"; readonly baseUrls: readonly ["www.imnews.imbc.com"]; readonly type: readonly ["television", "digital"]; }, { readonly company: "SBS News"; readonly baseUrls: readonly ["news.sbs.co.kr"]; readonly type: readonly ["television", "digital"]; }, { readonly company: "KBS News"; readonly baseUrls: readonly ["news.kbs.co.kr"]; readonly type: readonly ["television", "radio", "digital"]; }, { readonly company: "Hankyoreh"; readonly baseUrls: readonly ["english.hani.co.kr"]; readonly type: readonly ["newspaper", "digital"]; }, { readonly company: "Maeil Business Newspaper"; readonly baseUrls: readonly ["www.mk.co.kr"]; readonly type: readonly ["newspaper", "digital"]; }, { readonly company: "MoneyToday"; readonly baseUrls: readonly ["www.mt.co.kr"]; readonly type: readonly ["digital-first", "business"]; }, { readonly company: "Seoul Shinmun"; readonly baseUrls: readonly ["www.seoul.co.kr"]; readonly type: readonly ["newspaper", "digital"]; }, { readonly company: "OhmyNews"; readonly baseUrls: readonly ["www.ohmynews.com"]; readonly type: readonly ["digital-first"]; }, { readonly company: "News1 Korea"; readonly baseUrls: readonly ["www.news1.kr"]; readonly type: readonly ["news agency", "digital"]; }, { readonly company: "Asia Business Daily"; readonly baseUrls: readonly ["www.asiae.co.kr"]; readonly type: readonly ["newspaper", "digital"]; }, { readonly company: "Herald Business"; readonly baseUrls: readonly ["biz.heraldcorp.com"]; readonly type: readonly ["newspaper", "digital"]; }, { readonly company: "eDaily"; readonly baseUrls: readonly ["www.edaily.co.kr"]; readonly type: readonly ["digital-first", "business"]; }, { readonly company: "Seoul Economic Daily"; readonly baseUrls: readonly ["www.sedaily.com"]; readonly type: readonly ["newspaper", "digital"]; }, { readonly company: "JTBC News"; readonly baseUrls: readonly ["news.jtbc.co.kr"]; readonly type: readonly ["television", "digital"]; }]; declare const TURKISH_NEWS: readonly [{ readonly company: "Anadolu Agency (AA)"; readonly baseUrls: readonly ["www.aa.com.tr"]; readonly type: readonly ["news agency", "digital"]; }, { readonly company: "Hürriyet"; readonly baseUrls: readonly ["www.hurriyet.com.tr"]; readonly type: readonly ["newspaper", "digital"]; }, { readonly company: "Sabah"; readonly baseUrls: readonly ["www.sabah.com.tr"]; readonly type: readonly ["newspaper", "digital"]; }, { readonly company: "Milliyet"; readonly baseUrls: readonly ["www.milliyet.com.tr"]; readonly type: readonly ["newspaper", "digital"]; }, { readonly company: "TRT World"; readonly baseUrls: readonly ["www.trtworld.com"]; readonly type: readonly ["television", "digital"]; }, { readonly company: "CNN Türk"; readonly baseUrls: readonly ["www.cnnturk.com"]; readonly type: readonly ["television", "digital"]; }, { readonly company: "Sozcu"; readonly baseUrls: readonly ["www.sozcu.com.tr"]; readonly type: readonly ["newspaper", "digital"]; }, { readonly company: "Daily Sabah"; readonly baseUrls: readonly ["www.dailysabah.com"]; readonly type: readonly ["newspaper", "digital"]; }, { readonly company: "Yeni Şafak"; readonly baseUrls: readonly ["www.yenisafak.com"]; readonly type: readonly ["newspaper", "digital"]; }, { readonly company: "Habertürk"; readonly baseUrls: readonly ["www.haberturk.com"]; readonly type: readonly ["television", "digital"]; }, { readonly company: "BirGün"; readonly baseUrls: readonly ["www.birgun.net"]; readonly type: readonly ["newspaper", "digital"]; }, { readonly company: "Türkiye Gazetesi"; readonly baseUrls: readonly ["www.turkiyegazetesi.com.tr"]; readonly type: readonly ["newspaper", "digital"]; }, { readonly company: "Cumhuriyet"; readonly baseUrls: readonly ["www.cumhuriyet.com.tr"]; readonly type: readonly ["newspaper", "digital"]; }, { readonly company: "Diken"; readonly baseUrls: readonly ["www.diken.com.tr"]; readonly type: readonly ["digital-first"]; }, { readonly company: "NTV"; readonly baseUrls: readonly ["www.ntv.com.tr"]; readonly type: readonly ["television", "digital"]; }, { readonly company: "Ensonhaber"; readonly baseUrls: readonly ["www.ensonhaber.com"]; readonly type: readonly ["digital-first"]; }, { readonly company: "T24"; readonly baseUrls: readonly ["www.t24.com.tr"]; readonly type: readonly ["digital-first"]; }, { readonly company: "Karar"; readonly baseUrls: readonly ["www.karar.com"]; readonly type: readonly ["newspaper", "digital"]; }, { readonly company: "Gazete Duvar"; readonly baseUrls: readonly ["www.gazeteduvar.com.tr"]; readonly type: readonly ["digital-first"]; }, { readonly company: "Bloomberg HT"; readonly baseUrls: readonly ["www.bloomberght.com"]; readonly type: readonly ["television", "digital"]; }]; declare const NORWEGIAN_NEWS: readonly [{ readonly company: "Aftenposten"; readonly baseUrls: readonly ["www.aftenposten.no"]; readonly type: readonly ["newspaper", "digital"]; }, { readonly company: "Verdens Gang (VG)"; readonly baseUrls: readonly ["www.vg.no"]; readonly type: readonly ["newspaper", "digital"]; }, { readonly company: "Dagbladet"; readonly baseUrls: readonly ["www.dagbladet.no"]; readonly type: readonly ["newspaper", "digital"]; }, { readonly company: "NRK"; readonly baseUrls: readonly ["www.nrk.no"]; readonly type: readonly ["television", "radio", "digital"]; }, { readonly company: "Dagens Næringsliv"; readonly baseUrls: readonly ["www.dn.no"]; readonly type: readonly ["newspaper", "digital"]; }, { readonly company: "Nettavisen"; readonly baseUrls: readonly ["www.nettavisen.no"]; readonly type: readonly ["digital-first"]; }, { readonly company: "Klassekampen"; readonly baseUrls: readonly ["www.klassekampen.no"]; readonly type: readonly ["newspaper", "digital"]; }, { readonly company: "Morgenbladet"; readonly baseUrls: readonly ["www.morgenbladet.no"]; readonly type: readonly ["newspaper", "digital"]; }, { readonly company: "E24"; readonly baseUrls: readonly ["www.e24.no"]; readonly type: readonly ["digital-first", "business"]; }, { readonly company: "TV2"; readonly baseUrls: readonly ["www.tv2.no"]; readonly type: readonly ["television", "digital"]; }, { readonly company: "Bergens Tidende"; readonly baseUrls: readonly ["www.bt.no"]; readonly type: readonly ["newspaper", "digital"]; }, { readonly company: "Adresseavisen"; readonly baseUrls: readonly ["www.adressa.no"]; readonly type: readonly ["newspaper", "digital"]; }, { readonly company: "Stavanger Aftenblad"; readonly baseUrls: readonly ["www.aftenbladet.no"]; readonly type: readonly ["newspaper", "digital"]; }, { readonly company: "Fædrelandsvennen"; readonly baseUrls: readonly ["www.fvn.no"]; readonly type: readonly ["newspaper", "digital"]; }, { readonly company: "ABC Nyheter"; readonly baseUrls: readonly ["www.abcnyheter.no"]; readonly type: readonly ["digital-first"]; }, { readonly company: "Romerikes Blad"; readonly baseUrls: readonly ["www.rb.no"]; readonly type: readonly ["newspaper", "digital"]; }, { readonly company: "Sunnmørsposten"; readonly baseUrls: readonly ["www.smp.no"]; readonly type: readonly ["newspaper", "digital"]; }, { readonly company: "Finansavisen"; readonly baseUrls: readonly ["www.finansavisen.no"]; readonly type: readonly ["newspaper", "digital"]; }, { readonly company: "Nordlys"; readonly baseUrls: readonly ["www.nordlys.no"]; readonly type: readonly ["newspaper", "digital"]; }, { readonly company: "Hamar Arbeiderblad"; readonly baseUrls: readonly ["www.h-a.no"]; readonly type: readonly ["newspaper", "digital"]; }]; //#endregion //#region src/NoDefaultValue.d.ts /** * A constant which indicates that a particular * type/property was not given a _default value_. */ declare const NO_DEFAULT_VALUE: Constant<"no-default-value", unknown>; /** * A unique symbol which indicates that a particular * type was not given a "default value". */ type NoDefaultValue = typeof NO_DEFAULT_VALUE; //#endregion //#region src/NotApplicable.d.ts declare const NOT_APPLICABLE: unique symbol; /** * A unique symbol which indicates that a particular * type was "not applicable". */ type NotApplicable = [kind: "not-applicable", reason: Why, uniqueness: typeof NOT_APPLICABLE]; //#endregion //#region src/NotDefined.d.ts /** * **NOT_DEFINED** * * A runtime constant which indicates that some value has not been defined (yet). */ declare const NOT_DEFINED: Constant<"not-defined", unknown>; type NotDefined = typeof NOT_DEFINED; //#endregion //#region src/NumericChar.d.ts /** * **NUMERIC_CHAR** * * A tuple containing all numeric characters. * * **Related:** `NumericChar` */ declare const NUMERIC_CHAR: ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]; declare const NON_ZERO_NUMERIC_CHAR: ["1", "2", "3", "4", "5", "6", "7", "8", "9"]; /** * **HEXADECIMAL_CHAR** * * All numeric and alpha (upper and lower) characters used to represent * a **hexadecimal** number. */ declare const HEXADECIMAL_CHAR: ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "A", "b", "B", "c", "C", "d", "D", "e", "E", "f", "F"]; //#endregion //#region src/NumericDigit.d.ts /** * **NUMERIC_DIGIT** * * A tuple of all numeric digits. * * **Related:** `Digit` */ declare const NUMERIC_DIGIT: readonly [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; //#endregion //#region src/Phone.d.ts declare const PHONE_FORMAT: readonly ["Dashed (e.g., 456-555-1212)", "Dotted (e.g., 456.555.1212)", "ParaSpaced (e.g., (456) 555 1212)", "ParaDashed (e.g., (456) 555-1212)"]; /** * **PHONE_COUNTRY_CODES** * * `[code, 3 letter country code, 2 letter country code]` */ declare const PHONE_COUNTRY_CODES: readonly [readonly ["886", "TWN", "TW"], readonly ["93", "AFG", "AF"], readonly ["355", "ALB", "AL"], readonly ["213", "DZA", "DZ"], readonly ["1-684", "ASM", "AS"], readonly ["376", "AND", "AD"], readonly ["244", "AGO", "AO"], readonly ["1-264", "AIA", "AI"], readonly ["672", "ATA", "AQ"], readonly ["1-268", "ATG", "AG"], readonly ["54", "ARG", "AR"], readonly ["374", "ARM", "AM"], readonly ["297", "ABW", "AW"], readonly ["61", "AUS", "AU"], readonly ["43", "AUT", "AT"], readonly ["994", "AZE", "AZ"], readonly ["1-242", "BHS", "BS"], readonly ["973", "BHR", "BH"], readonly ["880", "BGD", "BD"], readonly ["1-246", "BRB", "BB"], readonly ["375", "BLR", "BY"], readonly ["32", "BEL", "BE"], readonly ["501", "BLZ", "BZ"], readonly ["229", "BEN", "BJ"], readonly ["1-441", "BMU", "BM"], readonly ["975", "BTN", "BT"], readonly ["591", "BOL", "BO"], readonly ["599", "BES", "BQ"], readonly ["387", "BIH", "BA"], readonly ["267", "BWA", "BW"], readonly ["47", "BVT", "BV"], readonly ["55", "BRA", "BR"], readonly ["246", "IOT", "IO"], readonly ["1-284", "VGB", "VG"], readonly ["673", "BRN", "BN"], readonly ["359", "BGR", "BG"], readonly ["226", "BFA", "BF"], readonly ["257", "BDI", "BI"], readonly ["238", "CPV", "CV"], readonly ["855", "KHM", "KH"], readonly ["237", "CMR", "CM"], readonly ["1", "CAN", "CA"], readonly ["1-345", "CYM", "KY"], readonly ["236", "CAF", "CF"], readonly ["235", "TCD", "TD"], readonly ["56", "CHL", "CL"], readonly ["86", "CHN", "CN"], readonly ["852", "HKG", "HK"], readonly ["853", "MAC", "MO"], readonly ["61", "CXR", "CX"], readonly ["61", "CCK", "CC"], readonly ["57", "COL", "CO"], readonly ["269", "COM", "KM"], readonly ["242", "COG", "CG"], readonly ["682", "COK", "CK"], readonly ["506", "CRI", "CR"], readonly ["385", "HRV", "HR"], readonly ["53", "CUB", "CU"], readonly ["599", "CUW", "CW"], readonly ["357", "CYP", "CY"], readonly ["420", "CZE", "CZ"], readonly ["225", "CIV", "CI"], readonly ["850", "PRK", "KP"], readonly ["243", "COD", "CD"], readonly ["45", "DNK", "DK"], readonly ["253", "DJI", "DJ"], readonly ["1-767", "DMA", "DM"], readonly ["1-809", "DOM", "DO"], readonly ["1-829", "DOM", "DO"], readonly ["1-849", "DOM", "DO"], readonly ["593", "ECU", "EC"], readonly ["20", "EGY", "EG"], readonly ["503", "SLV", "SV"], readonly ["240", "GNQ", "GQ"], readonly ["291", "ERI", "ER"], readonly ["372", "EST", "EE"], readonly ["268", "SWZ", "SZ"], readonly ["251", "ETH", "ET"], readonly ["500", "FLK", "FK"], readonly ["298", "FRO", "FO"], readonly ["679", "FJI", "FJ"], readonly ["358", "FIN", "FI"], readonly ["33", "FRA", "FR"], readonly ["594", "GUF", "GF"], readonly ["689", "PYF", "PF"], readonly ["262", "ATF", "TF"], readonly ["241", "GAB", "GA"], readonly ["220", "GMB", "GM"], readonly ["995", "GEO", "GE"], readonly ["49", "DEU", "DE"], readonly ["233", "GHA", "GH"], readonly ["350", "GIB", "GI"], readonly ["30", "GRC", "GR"], readonly ["299", "GRL", "GL"], readonly ["1-473", "GRD", "GD"], readonly ["590", "GLP", "GP"], readonly ["1-671", "GUM", "GU"], readonly ["502", "GTM", "GT"], readonly ["44", "GGY", "GG"], readonly ["224", "GIN", "GN"], readonly ["245", "GNB", "GW"], readonly ["592", "GUY", "GY"], readonly ["509", "HTI", "HT"], readonly ["672", "HMD", "HM"], readonly ["39-06", "VAT", "VA"], readonly ["504", "HND", "HN"], readonly ["36", "HUN", "HU"], readonly ["354", "ISL", "IS"], readonly ["91", "IND", "IN"], readonly ["62", "IDN", "ID"], readonly ["98", "IRN", "IR"], readonly ["964", "IRQ", "IQ"], readonly ["353", "IRL", "IE"], readonly ["44", "IMN", "IM"], readonly ["972", "ISR", "IL"], readonly ["39", "ITA", "IT"], readonly ["1-876", "JAM", "JM"], readonly ["81", "JPN", "JP"], readonly ["44", "JEY", "JE"], readonly ["962", "JOR", "JO"], readonly ["7", "KAZ", "KZ"], readonly ["254", "KEN", "KE"], readonly ["686", "KIR", "KI"], readonly ["965", "KWT", "KW"], readonly ["996", "KGZ", "KG"], readonly ["856", "LAO", "LA"], readonly ["371", "LVA", "LV"], readonly ["961", "LBN", "LB"], readonly ["266", "LSO", "LS"], readonly ["231", "LBR", "LR"], readonly ["218", "LBY", "LY"], readonly ["423", "LIE", "LI"], readonly ["370", "LTU", "LT"], readonly ["352", "LUX", "LU"], readonly ["261", "MDG", "MG"], readonly ["265", "MWI", "MW"], readonly ["60", "MYS", "MY"], readonly ["960", "MDV", "MV"], readonly ["223", "MLI", "ML"], readonly ["356", "MLT", "MT"], readonly ["692", "MHL", "MH"], readonly ["596", "MTQ", "MQ"], readonly ["222", "MRT", "MR"], readonly ["230", "MUS", "MU"], readonly ["262", "MYT", "YT"], readonly ["52", "MEX", "MX"], readonly ["691", "FSM", "FM"], readonly ["377", "MCO", "MC"], readonly ["976", "MNG", "MN"], readonly ["382", "MNE", "ME"], readonly ["1-664", "MSR", "MS"], readonly ["212", "MAR", "MA"], readonly ["258", "MOZ", "MZ"], readonly ["95", "MMR", "MM"], readonly ["264", "NAM", "NA"], readonly ["674", "NRU", "NR"], readonly ["977", "NPL", "NP"], readonly ["31", "NLD", "NL"], readonly ["687", "NCL", "NC"], readonly ["64", "NZL", "NZ"], readonly ["505", "NIC", "NI"], readonly ["227", "NER", "NE"], readonly ["234", "NGA", "NG"], readonly ["683", "NIU", "NU"], readonly ["672", "NFK", "NF"], readonly ["1-670", "MNP", "MP"], readonly ["47", "NOR", "NO"], readonly ["968", "OMN", "OM"], readonly ["92", "PAK", "PK"], readonly ["680", "PLW", "PW"], readonly ["507", "PAN", "PA"], readonly ["675", "PNG", "PG"], readonly ["595", "PRY", "PY"], readonly ["51", "PER", "PE"], readonly ["63", "PHL", "PH"], readonly ["870", "PCN", "PN"], readonly ["48", "POL", "PL"], readonly ["351", "PRT", "PT"], readonly ["974", "QAT", "QA"], readonly ["82", "KOR", "KR"], readonly ["373", "MDA", "MD"], readonly ["40", "ROU", "RO"], readonly ["7", "RUS", "RU"], readonly ["250", "RWA", "RW"], readonly ["262", "REU", "RE"], readonly ["590", "BLM", "BL"], readonly ["290", "SHN", "SH"], readonly ["1-869", "KNA", "KN"], readonly ["1-758", "LCA", "LC"], readonly ["590", "MAF", "MF"], readonly ["508", "SPM", "PM"], readonly ["1-784", "VCT", "VC"], readonly ["685", "WSM", "WS"], readonly ["378", "SMR", "SM"], readonly ["239", "STP", "ST"], readonly ["966", "SAU", "SA"], readonly ["221", "SEN", "SN"], readonly ["381", "SRB", "RS"], readonly ["248", "SYC", "SC"], readonly ["232", "SLE", "SL"], readonly ["65", "SGP", "SG"], readonly ["1-721", "SXM", "SX"], readonly ["421", "SVK", "SK"], readonly ["386", "SVN", "SI"], readonly ["677", "SLB", "SB"], readonly ["252", "SOM", "SO"], readonly ["27", "ZAF", "ZA"], readonly ["500", "SGS", "GS"], readonly ["211", "SSD", "SS"], readonly ["34", "ESP", "ES"], readonly ["94", "LKA", "LK"], readonly ["970", "PSE", "PS"], readonly ["249", "SDN", "SD"], readonly ["597", "SUR", "SR"], readonly ["47", "SJM", "SJ"], readonly ["46", "SWE", "SE"], readonly ["41", "CHE", "CH"], readonly ["963", "SYR", "SY"], readonly ["992", "TJK", "TJ"], readonly ["66", "THA", "TH"], readonly ["389", "MKD", "MK"], readonly ["670", "TLS", "TL"], readonly ["228", "TGO", "TG"], readonly ["690", "TKL", "TK"], readonly ["676", "TON", "TO"], readonly ["1-868", "TTO", "TT"], readonly ["216", "TUN", "TN"], readonly ["90", "TUR", "TR"], readonly ["993", "TKM", "TM"], readonly ["1-649", "TCA", "TC"], readonly ["688", "TUV", "TV"], readonly ["256", "UGA", "UG"], readonly ["380", "UKR", "UA"], readonly ["971", "ARE", "AE"], readonly ["44", "GBR", "GB"], readonly ["255", "TZA", "TZ"], readonly ["1-340", "VIR", "VI"], readonly ["1", "USA", "US"], readonly ["598", "URY", "UY"], readonly ["998", "UZB", "UZ"], readonly ["678", "VUT", "VU"], readonly ["58", "VEN", "VE"], readonly ["84", "VNM", "VN"], readonly ["681", "WLF", "WF"], readonly ["212", "ESH", "EH"], readonly ["967", "YEM", "YE"], readonly ["260", "ZMB", "ZM"], readonly ["263", "ZWE", "ZW"], readonly ["358", "ALA", "AX"]]; //#endregion //#region src/PluralExceptions.d.ts /** * **PLURAL_EXCEPTIONS** * * An array of tuples of the form `[singular, plural]`. */ declare const PLURAL_EXCEPTIONS_OLD: readonly [readonly ["photo", "photos"], readonly ["piano", "pianos"], readonly ["halo", "halos"], readonly ["foot", "feet"], readonly ["man", "men"], readonly ["woman", "women"], readonly ["person", "people"], readonly ["mouse", "mice"], readonly ["series", "series"], readonly ["sheep", "sheep"], readonly ["money", "monies"], readonly ["deer", "deer"]]; /** * **PluralExceptions** * * A dictionary of key/value pairs which map singular words to their * plural counterpart. This can be used in conjunction with the the * `pluralize()` and `Pluralize` utilities to extend the known * irregular conversions. */ type PluralExceptions = Record; /** * **PLURAL_EXCEPTIONS** * * A lookup table that maps singular words to their _plural_ counterpart. */ declare const PLURAL_EXCEPTIONS: { readonly photo: "photos"; readonly piano: "pianos"; readonly halo: "halos"; readonly foot: "feet"; readonly man: "men"; readonly woman: "women"; readonly person: "people"; readonly mouse: "mice"; readonly series: "series"; readonly sheep: "sheep"; readonly money: "monies"; readonly deer: "deer"; readonly goose: "geese"; readonly child: "children"; readonly tooth: "teeth"; readonly ox: "oxen"; readonly basis: "bases"; readonly radius: "radii"; readonly syllabus: "syllabi"; readonly ice: "ice"; readonly fish: "fish"; readonly means: "means"; readonly phenomenon: "phenomena"; readonly criterion: "criteria"; readonly datum: "data"; readonly memorandum: "memoranda"; readonly bacterium: "bacteria"; readonly stratum: "strata"; readonly curriculum: "curricula"; readonly index: "indices"; readonly appendix: "appendices"; readonly vortex: "vortices"; readonly bison: "bison"; readonly axis: "axes"; readonly antenna: "antennas"; readonly cactus: "cacti"; readonly corpus: "corpora"; readonly beau: "beaux"; readonly die: "dice"; readonly ellipsis: "ellipses"; readonly erratum: "errata"; readonly focus: "foci"; readonly formula: "formulas"; readonly fungus: "fungi"; readonly genus: "genera"; readonly graffito: "graffiti"; readonly grouse: "grouses"; readonly half: "halves"; readonly hoof: "hooves"; readonly hypothesis: "hypothesis"; readonly larva: "larvae"; readonly libretto: "libretti"; readonly loaf: "loaves"; readonly locus: "loci"; readonly medium: "mediums"; readonly minutia: "minutiae"; readonly nucleus: "nuclei"; readonly oasis: "oases"; readonly opus: "opuses"; readonly ovum: "ova"; readonly parenthesis: "parentheses"; readonly phylum: "phyla"; readonly quiz: "quizzes"; readonly referendum: "referendums"; readonly self: "selves"; readonly species: "species"; readonly stimulus: "stimuli"; readonly swine: "swine"; readonly synopsis: "synopses"; readonly thesis: "theses"; readonly thief: "thieves"; readonly vertex: "vertexes"; readonly wife: "wives"; readonly wolf: "wolves"; }; //#endregion //#region src/ProxmoxConstants.d.ts declare const PROXMOX_CT_STATE: readonly ["started", "stopped", "enabled", "disabled", "ignored"]; //#endregion //#region src/RepoConstants.d.ts /** * common sources for source code repositories */ declare const REPO_SOURCES: readonly ["github", "bitbucket", "gitlab", "codecommit", "local"]; /** * page types you'd expect to find in a source code repository. */ declare const REPO_PAGE_TYPES: readonly ["repo", "commits", "author", "org", "profile", "issues", "actions", "followers", "following", "docs", "unknown"]; declare const REPO_SOURCE_LOOKUP: { readonly github: readonly ["https://github.com", "https://github.io"]; readonly bitbucket: readonly ["https://bitbucket.org"]; readonly gitlab: readonly ["https://gitlab.com"]; readonly codecommit: readonly ["https://aws.amazon.com/codecommit/"]; readonly local: readonly []; }; declare const GITHUB_INSIGHT_CATEGORY_LOOKUP: { readonly pulse: "pulse"; readonly contributors: "graphs/contributors"; readonly community: "graphs/community"; readonly standards: "community"; readonly traffic: "graphs/traffic"; readonly commits: "graphs/commit-activity"; readonly code_frequency: "graphs/code-frequency"; readonly dependencies: "network/dependencies"; readonly dependents: "network/dependents"; readonly dependabot: "network/updates"; readonly network: "network"; readonly forks: "forks"; readonly people: "people"; }; //#endregion //#region src/Retail.d.ts /** * Amazon's DNS entries (for retail business) */ declare const AMAZON_DNS: readonly ["www.amazon.com", "www.amazon.co.uk", "www.amazon.fr", "www.amazon.de", "www.amazon.it", "www.amazon.es"]; declare const WALMART_DNS: readonly ["www.walmart.com", "www.walmart.ca", "www.walmart.com.mx"]; declare const APPLE_DNS: readonly ["store.apple.com", "www.apple.com"]; declare const HOME_DEPOT_DNS: readonly ["www.homedepot.com", "www.homedepot.ca"]; declare const EBAY_DNS: readonly ["www.ebay.com", "www.ebay.co.uk", "www.ebay.fr", "www.ebay.de", "www.ebay.it"]; declare const TARGET_DNS: readonly ["www.target.com"]; declare const ETSY_DNS: readonly ["www.etsy.com"]; declare const COSTCO_DNS: readonly ["www.costco.com", "www.costco.co.uk", "www.costco.ca"]; declare const CHEWY_DNS: readonly ["www.chewy.com"]; declare const BEST_BUY_DNS: readonly ["www.bestbuy.com", "www.bestbuy.ca"]; declare const WAYFAIR_DNS: readonly ["www.wayfair.com", "www.wayfair.ca", "www.wayfair.co.uk"]; declare const NIKE_DNS: readonly ["www.nike.com"]; declare const MACYS_DNS: readonly ["www.macys.com"]; declare const LOWES_DNS: readonly ["www.lowes.com"]; declare const IKEA_DNS: readonly ["www.ikea.com"]; declare const DELL_DNS: readonly ["www.dell.com"]; /** DNS for H&M retailer */ declare const HM_DNS: readonly ["www2.hm.com"]; declare const ZARA_DNS: readonly ["www.zara.com"]; declare const KROGER_DNS: readonly ["www.kroger.com"]; declare const WALGREENS_DNS: readonly ["www.walgreens.com"]; declare const CVS_DNS: readonly ["www.cvs.com"]; declare const WHOLE_FOODS_DNS: readonly ["www.wholefoodsmarket.com", "www.wholefoodsmarket.co.uk"]; //#endregion //#region src/SafeEncoding.d.ts declare const SAFE_ENCODING__QUOTES: { readonly "\"": "^"; readonly "'": "^"; readonly "`": "^"; }; declare const SAFE_ENCODING__WHITESPACE: { readonly " ": "^"; readonly "\t": "^"; readonly "\n": "^"; readonly "\r": "^"; }; declare const SAFE_ENCODING__BRACKETS: { readonly "[": "^"; readonly "]": "^"; readonly "(": "^"; readonly ")": "^"; readonly "{": "^"; readonly "}": "^"; }; declare const SAFE_ENCODING_KEYS: { readonly " ": "^"; readonly "\t": "^"; readonly "\n": "^"; readonly "\r": "^"; readonly "\"": "^"; readonly "'": "^"; readonly "`": "^"; readonly "[": "^"; readonly "]": "^"; readonly "(": "^"; readonly ")": "^"; readonly "{": "^"; readonly "}": "^"; }; //#endregion //#region src/Shape.d.ts declare const SHAPE_PREFIXES: readonly ["string", "number", "boolean", "null", "undefined", "unknown", "opt::", "union::", "tuple::", "array::", "object", "record::"]; declare const SHAPE_DELIMITER: "||,||"; //#endregion //#region src/SimpleTokens.d.ts declare const SIMPLE_DICT_VALUES: readonly ["string", "number", "boolean", "unknown", "Opt", "Opt", "Opt", "Opt"]; declare const SIMPLE_SET_TYPES: readonly ["string", "number", "boolean", "unknown", "Opt", "Opt", "Opt", "Opt"]; declare const SIMPLE_SCALAR_TOKENS: readonly ["string", "number", `string(${string})`, `number(${number})` | `number(${number},${string})`, "boolean", "true", "false", "null", "undefined", "unknown", "any", "never"]; declare const SIMPLE_OPT_SCALAR_TOKENS: readonly ["Opt", "Opt", "Opt", "Opt", "Opt", "Opt", "Opt", "Opt", "Opt", `Opt` | `Opt`, `Opt"]; declare const SIMPLE_FN_TOKENS: readonly ["Fn => Unknown", "Fn => Unknown", "Fn => Unknown", "Fn => Unknown"]; declare const SIMPLE_UNION_TOKENS: readonly [`union(${string})` | `union(${string},${string})`]; declare const SIMPLE_MAP_KEYS: readonly ["string", "number", "Dict", "Dict", "Dict", "Dict", "Dict", "Dict>", "Dict>", "Dict>"]; declare const SIMPLE_MAP_VALUES: readonly ["string", "number", "Dict", "Dict", "Dict", "Dict", "Dict", "Dict>", "Dict>", "Dict>", "boolean", "unknown", "undefined", "Dict", "Array", "Dict>", "Dict>", "Dict>", "Dict>"]; declare const SIMPLE_DICT_TOKENS: readonly ["Dict", "Dict", "Dict", "Dict", "Dict", "Dict>", "Dict>", "Dict>", "Dict>", `Dict<{${string}: string}>` | `Dict<{${string}: number}>` | `Dict<{${string}: boolean}>` | `Dict<{${string}: undefined}>` | `Dict<{${string}: true}>` | `Dict<{${string}: false}>` | `Dict<{${string}: unknown}>` | `Dict<{${string}: any}>` | `Dict<{${string}: null}>` | `Dict<{${string}: Opt}>` | `Dict<{${string}: Opt}>` | `Dict<{${string}: Opt}>` | `Dict<{${string}: Opt}>` | `Dict<{${string}: string(${string})}>` | `Dict<{${string}: number(${number})}>` | `Dict<{${string}: number(${number},${string})}>` | `Dict<{${string}: never}>` | `Dict<{${string}: Opt}>` | `Dict<{${string}: Opt}>` | `Dict<{${string}: Opt}>` | `Dict<{${string}: Opt}>` | `Dict<{${string}: Opt}>` | `Dict<{${string}: Opt}>` | `Dict<{${string}: Opt}>` | `Dict<{${string}: Opt` | `Dict<{${string}: Opt`, `Dict<{${string}: string, ${string}: ${string}}` | `Dict<{${string}: number, ${string}: ${string}}` | `Dict<{${string}: boolean, ${string}: ${string}}` | `Dict<{${string}: undefined, ${string}: ${string}}` | `Dict<{${string}: true, ${string}: ${string}}` | `Dict<{${string}: false, ${string}: ${string}}` | `Dict<{${string}: unknown, ${string}: ${string}}` | `Dict<{${string}: any, ${string}: ${string}}` | `Dict<{${string}: null, ${string}: ${string}}` | `Dict<{${string}: Opt, ${string}: ${string}}` | `Dict<{${string}: Opt, ${string}: ${string}}` | `Dict<{${string}: Opt, ${string}: ${string}}` | `Dict<{${string}: Opt, ${string}: ${string}}` | `Dict<{${string}: string(${string}), ${string}: ${string}}` | `Dict<{${string}: number(${number}), ${string}: ${string}}` | `Dict<{${string}: number(${number},${string}), ${string}: ${string}}` | `Dict<{${string}: never, ${string}: ${string}}` | `Dict<{${string}: Opt, ${string}: ${string}}` | `Dict<{${string}: Opt, ${string}: ${string}}` | `Dict<{${string}: Opt, ${string}: ${string}}` | `Dict<{${string}: Opt, ${string}: ${string}}` | `Dict<{${string}: Opt, ${string}: ${string}}` | `Dict<{${string}: Opt, ${string}: ${string}}` | `Dict<{${string}: Opt, ${string}: ${string}}` | `Dict<{${string}: Opt", `Array`, "Array", `Array` | `Array`, "Array", "Array", "Array", "Array", "Array"]; declare const SIMPLE_MAP_TOKENS: readonly ["Map", "Map" | "Map" | "Map" | "Map" | "Map" | "Map" | "Map>" | "Map>" | "Map>" | "Map>" | "Map>>" | "Map>>" | "Map>>" | "Map" | "Map>>" | "Map" | "Map" | "Map" | "Map" | "Map" | "Map" | "Map>" | "Map>" | "Map>" | "Map>" | "Map>>" | "Map>>" | "Map>>" | "Map" | "Map>>" | "Map" | "Map" | "Map" | "Map" | "Map" | "Map" | "Map>" | "Map>" | "Map>" | "Map>" | "Map>>" | "Map>>" | "Map>>" | "Map" | "Map>>" | "Map, string>" | "Map, number>" | "Map, boolean>" | "Map, undefined>" | "Map, unknown>" | "Map, Dict>" | "Map, Dict>" | "Map, Dict>" | "Map, Dict>" | "Map, Dict>" | "Map, Dict>>" | "Map, Dict>>" | "Map, Dict>>" | "Map, Array>" | "Map, Dict>>" | "Map, string>" | "Map, number>" | "Map, boolean>" | "Map, undefined>" | "Map, unknown>" | "Map, Dict>" | "Map, Dict>" | "Map, Dict>" | "Map, Dict>" | "Map, Dict>" | "Map, Dict>>" | "Map, Dict>>" | "Map, Dict>>" | "Map, Array>" | "Map, Dict>>" | "Map, string>" | "Map, number>" | "Map, boolean>" | "Map, undefined>" | "Map, unknown>" | "Map, Dict>" | "Map, Dict>" | "Map, Dict>" | "Map, Dict>" | "Map, Dict>" | "Map, Dict>>" | "Map, Dict>>" | "Map, Dict>>" | "Map, Array>" | "Map, Dict>>" | "Map, string>" | "Map, number>" | "Map, boolean>" | "Map, undefined>" | "Map, unknown>" | "Map, Dict>" | "Map, Dict>" | "Map, Dict>" | "Map, Dict>" | "Map, Dict>" | "Map, Dict>>" | "Map, Dict>>" | "Map, Dict>>" | "Map, Array>" | "Map, Dict>>" | "Map>, string>" | "Map>, number>" | "Map>, boolean>" | "Map>, undefined>" | "Map>, unknown>" | "Map>, Dict>" | "Map>, Dict>" | "Map>, Dict>" | "Map>, Dict>" | "Map>, Dict>" | "Map>, Dict>>" | "Map>, Dict>>" | "Map>, Dict>>" | "Map>, Array>" | "Map>, Dict>>" | "Map>, string>" | "Map>, number>" | "Map>, boolean>" | "Map>, undefined>" | "Map>, unknown>" | "Map>, Dict>" | "Map>, Dict>" | "Map>, Dict>" | "Map>, Dict>" | "Map>, Dict>" | "Map>, Dict>>" | "Map>, Dict>>" | "Map>, Dict>>" | "Map>, Array>" | "Map>, Dict>>" | "Map>, string>" | "Map>, number>" | "Map>, boolean>" | "Map>, undefined>" | "Map>, unknown>" | "Map>, Dict>" | "Map>, Dict>" | "Map>, Dict>" | "Map>, Dict>" | "Map>, Dict>" | "Map>, Dict>>" | "Map>, Dict>>" | "Map>, Dict>>" | "Map>, Array>" | "Map>, Dict>>", "WeakMap"]; declare const SIMPLE_SET_TOKENS: readonly ["Set", "Set" | "Set" | "Set" | "Set" | "Set>" | "Set>" | "Set>" | "Set>"]; declare const SIMPLE_CONTAINER_TOKENS: readonly ["Dict", "Dict", "Dict", "Dict", "Dict", "Dict>", "Dict>", "Dict>", "Dict>", `Dict<{${string}: string}>` | `Dict<{${string}: number}>` | `Dict<{${string}: boolean}>` | `Dict<{${string}: undefined}>` | `Dict<{${string}: true}>` | `Dict<{${string}: false}>` | `Dict<{${string}: unknown}>` | `Dict<{${string}: any}>` | `Dict<{${string}: null}>` | `Dict<{${string}: Opt}>` | `Dict<{${string}: Opt}>` | `Dict<{${string}: Opt}>` | `Dict<{${string}: Opt}>` | `Dict<{${string}: string(${string})}>` | `Dict<{${string}: number(${number})}>` | `Dict<{${string}: number(${number},${string})}>` | `Dict<{${string}: never}>` | `Dict<{${string}: Opt}>` | `Dict<{${string}: Opt}>` | `Dict<{${string}: Opt}>` | `Dict<{${string}: Opt}>` | `Dict<{${string}: Opt}>` | `Dict<{${string}: Opt}>` | `Dict<{${string}: Opt}>` | `Dict<{${string}: Opt` | `Dict<{${string}: Opt`, `Dict<{${string}: string, ${string}: ${string}}` | `Dict<{${string}: number, ${string}: ${string}}` | `Dict<{${string}: boolean, ${string}: ${string}}` | `Dict<{${string}: undefined, ${string}: ${string}}` | `Dict<{${string}: true, ${string}: ${string}}` | `Dict<{${string}: false, ${string}: ${string}}` | `Dict<{${string}: unknown, ${string}: ${string}}` | `Dict<{${string}: any, ${string}: ${string}}` | `Dict<{${string}: null, ${string}: ${string}}` | `Dict<{${string}: Opt, ${string}: ${string}}` | `Dict<{${string}: Opt, ${string}: ${string}}` | `Dict<{${string}: Opt, ${string}: ${string}}` | `Dict<{${string}: Opt, ${string}: ${string}}` | `Dict<{${string}: string(${string}), ${string}: ${string}}` | `Dict<{${string}: number(${number}), ${string}: ${string}}` | `Dict<{${string}: number(${number},${string}), ${string}: ${string}}` | `Dict<{${string}: never, ${string}: ${string}}` | `Dict<{${string}: Opt, ${string}: ${string}}` | `Dict<{${string}: Opt, ${string}: ${string}}` | `Dict<{${string}: Opt, ${string}: ${string}}` | `Dict<{${string}: Opt, ${string}: ${string}}` | `Dict<{${string}: Opt, ${string}: ${string}}` | `Dict<{${string}: Opt, ${string}: ${string}}` | `Dict<{${string}: Opt, ${string}: ${string}}` | `Dict<{${string}: Opt", `Array`, "Array", `Array` | `Array`, "Array", "Array", "Array", "Array", "Array", "Map", "Map" | "Map" | "Map" | "Map" | "Map" | "Map" | "Map>" | "Map>" | "Map>" | "Map>" | "Map>>" | "Map>>" | "Map>>" | "Map" | "Map>>" | "Map" | "Map" | "Map" | "Map" | "Map" | "Map" | "Map>" | "Map>" | "Map>" | "Map>" | "Map>>" | "Map>>" | "Map>>" | "Map" | "Map>>" | "Map" | "Map" | "Map" | "Map" | "Map" | "Map" | "Map>" | "Map>" | "Map>" | "Map>" | "Map>>" | "Map>>" | "Map>>" | "Map" | "Map>>" | "Map, string>" | "Map, number>" | "Map, boolean>" | "Map, undefined>" | "Map, unknown>" | "Map, Dict>" | "Map, Dict>" | "Map, Dict>" | "Map, Dict>" | "Map, Dict>" | "Map, Dict>>" | "Map, Dict>>" | "Map, Dict>>" | "Map, Array>" | "Map, Dict>>" | "Map, string>" | "Map, number>" | "Map, boolean>" | "Map, undefined>" | "Map, unknown>" | "Map, Dict>" | "Map, Dict>" | "Map, Dict>" | "Map, Dict>" | "Map, Dict>" | "Map, Dict>>" | "Map, Dict>>" | "Map, Dict>>" | "Map, Array>" | "Map, Dict>>" | "Map, string>" | "Map, number>" | "Map, boolean>" | "Map, undefined>" | "Map, unknown>" | "Map, Dict>" | "Map, Dict>" | "Map, Dict>" | "Map, Dict>" | "Map, Dict>" | "Map, Dict>>" | "Map, Dict>>" | "Map, Dict>>" | "Map, Array>" | "Map, Dict>>" | "Map, string>" | "Map, number>" | "Map, boolean>" | "Map, undefined>" | "Map, unknown>" | "Map, Dict>" | "Map, Dict>" | "Map, Dict>" | "Map, Dict>" | "Map, Dict>" | "Map, Dict>>" | "Map, Dict>>" | "Map, Dict>>" | "Map, Array>" | "Map, Dict>>" | "Map>, string>" | "Map>, number>" | "Map>, boolean>" | "Map>, undefined>" | "Map>, unknown>" | "Map>, Dict>" | "Map>, Dict>" | "Map>, Dict>" | "Map>, Dict>" | "Map>, Dict>" | "Map>, Dict>>" | "Map>, Dict>>" | "Map>, Dict>>" | "Map>, Array>" | "Map>, Dict>>" | "Map>, string>" | "Map>, number>" | "Map>, boolean>" | "Map>, undefined>" | "Map>, unknown>" | "Map>, Dict>" | "Map>, Dict>" | "Map>, Dict>" | "Map>, Dict>" | "Map>, Dict>" | "Map>, Dict>>" | "Map>, Dict>>" | "Map>, Dict>>" | "Map>, Array>" | "Map>, Dict>>" | "Map>, string>" | "Map>, number>" | "Map>, boolean>" | "Map>, undefined>" | "Map>, unknown>" | "Map>, Dict>" | "Map>, Dict>" | "Map>, Dict>" | "Map>, Dict>" | "Map>, Dict>" | "Map>, Dict>>" | "Map>, Dict>>" | "Map>, Dict>>" | "Map>, Array>" | "Map>, Dict>>", "WeakMap", "Set", "Set" | "Set" | "Set" | "Set" | "Set>" | "Set>" | "Set>" | "Set>"]; /** * **SIMPLE_TOKENS** * * A list of strings literals which can be used * to express the type of a variable or token * in relatively course granularity */ declare const SIMPLE_TOKENS: readonly ["string", "number", `string(${string})`, `number(${number})` | `number(${number},${string})`, "boolean", "true", "false", "null", "undefined", "unknown", "any", "never", "Opt", "Opt", "Opt", "Opt", "Opt", "Opt", "Opt", "Opt", "Opt", `Opt` | `Opt`, `Opt", "Dict", "Dict", "Dict", "Dict", "Dict", "Dict>", "Dict>", "Dict>", "Dict>", `Dict<{${string}: string}>` | `Dict<{${string}: number}>` | `Dict<{${string}: boolean}>` | `Dict<{${string}: undefined}>` | `Dict<{${string}: true}>` | `Dict<{${string}: false}>` | `Dict<{${string}: unknown}>` | `Dict<{${string}: any}>` | `Dict<{${string}: null}>` | `Dict<{${string}: Opt}>` | `Dict<{${string}: Opt}>` | `Dict<{${string}: Opt}>` | `Dict<{${string}: Opt}>` | `Dict<{${string}: string(${string})}>` | `Dict<{${string}: number(${number})}>` | `Dict<{${string}: number(${number},${string})}>` | `Dict<{${string}: never}>` | `Dict<{${string}: Opt}>` | `Dict<{${string}: Opt}>` | `Dict<{${string}: Opt}>` | `Dict<{${string}: Opt}>` | `Dict<{${string}: Opt}>` | `Dict<{${string}: Opt}>` | `Dict<{${string}: Opt}>` | `Dict<{${string}: Opt` | `Dict<{${string}: Opt`, `Dict<{${string}: string, ${string}: ${string}}` | `Dict<{${string}: number, ${string}: ${string}}` | `Dict<{${string}: boolean, ${string}: ${string}}` | `Dict<{${string}: undefined, ${string}: ${string}}` | `Dict<{${string}: true, ${string}: ${string}}` | `Dict<{${string}: false, ${string}: ${string}}` | `Dict<{${string}: unknown, ${string}: ${string}}` | `Dict<{${string}: any, ${string}: ${string}}` | `Dict<{${string}: null, ${string}: ${string}}` | `Dict<{${string}: Opt, ${string}: ${string}}` | `Dict<{${string}: Opt, ${string}: ${string}}` | `Dict<{${string}: Opt, ${string}: ${string}}` | `Dict<{${string}: Opt, ${string}: ${string}}` | `Dict<{${string}: string(${string}), ${string}: ${string}}` | `Dict<{${string}: number(${number}), ${string}: ${string}}` | `Dict<{${string}: number(${number},${string}), ${string}: ${string}}` | `Dict<{${string}: never, ${string}: ${string}}` | `Dict<{${string}: Opt, ${string}: ${string}}` | `Dict<{${string}: Opt, ${string}: ${string}}` | `Dict<{${string}: Opt, ${string}: ${string}}` | `Dict<{${string}: Opt, ${string}: ${string}}` | `Dict<{${string}: Opt, ${string}: ${string}}` | `Dict<{${string}: Opt, ${string}: ${string}}` | `Dict<{${string}: Opt, ${string}: ${string}}` | `Dict<{${string}: Opt", `Array`, "Array", `Array` | `Array`, "Array", "Array", "Array", "Array", "Array", "Map", "Map" | "Map" | "Map" | "Map" | "Map" | "Map" | "Map>" | "Map>" | "Map>" | "Map>" | "Map>>" | "Map>>" | "Map>>" | "Map" | "Map>>" | "Map" | "Map" | "Map" | "Map" | "Map" | "Map" | "Map>" | "Map>" | "Map>" | "Map>" | "Map>>" | "Map>>" | "Map>>" | "Map" | "Map>>" | "Map" | "Map" | "Map" | "Map" | "Map" | "Map" | "Map>" | "Map>" | "Map>" | "Map>" | "Map>>" | "Map>>" | "Map>>" | "Map" | "Map>>" | "Map, string>" | "Map, number>" | "Map, boolean>" | "Map, undefined>" | "Map, unknown>" | "Map, Dict>" | "Map, Dict>" | "Map, Dict>" | "Map, Dict>" | "Map, Dict>" | "Map, Dict>>" | "Map, Dict>>" | "Map, Dict>>" | "Map, Array>" | "Map, Dict>>" | "Map, string>" | "Map, number>" | "Map, boolean>" | "Map, undefined>" | "Map, unknown>" | "Map, Dict>" | "Map, Dict>" | "Map, Dict>" | "Map, Dict>" | "Map, Dict>" | "Map, Dict>>" | "Map, Dict>>" | "Map, Dict>>" | "Map, Array>" | "Map, Dict>>" | "Map, string>" | "Map, number>" | "Map, boolean>" | "Map, undefined>" | "Map, unknown>" | "Map, Dict>" | "Map, Dict>" | "Map, Dict>" | "Map, Dict>" | "Map, Dict>" | "Map, Dict>>" | "Map, Dict>>" | "Map, Dict>>" | "Map, Array>" | "Map, Dict>>" | "Map, string>" | "Map, number>" | "Map, boolean>" | "Map, undefined>" | "Map, unknown>" | "Map, Dict>" | "Map, Dict>" | "Map, Dict>" | "Map, Dict>" | "Map, Dict>" | "Map, Dict>>" | "Map, Dict>>" | "Map, Dict>>" | "Map, Array>" | "Map, Dict>>" | "Map>, string>" | "Map>, number>" | "Map>, boolean>" | "Map>, undefined>" | "Map>, unknown>" | "Map>, Dict>" | "Map>, Dict>" | "Map>, Dict>" | "Map>, Dict>" | "Map>, Dict>" | "Map>, Dict>>" | "Map>, Dict>>" | "Map>, Dict>>" | "Map>, Array>" | "Map>, Dict>>" | "Map>, string>" | "Map>, number>" | "Map>, boolean>" | "Map>, undefined>" | "Map>, unknown>" | "Map>, Dict>" | "Map>, Dict>" | "Map>, Dict>" | "Map>, Dict>" | "Map>, Dict>" | "Map>, Dict>>" | "Map>, Dict>>" | "Map>, Dict>>" | "Map>, Array>" | "Map>, Dict>>" | "Map>, string>" | "Map>, number>" | "Map>, boolean>" | "Map>, undefined>" | "Map>, unknown>" | "Map>, Dict>" | "Map>, Dict>" | "Map>, Dict>" | "Map>, Dict>" | "Map>, Dict>" | "Map>, Dict>>" | "Map>, Dict>>" | "Map>, Dict>>" | "Map>, Array>" | "Map>, Dict>>", "WeakMap", "Set", "Set" | "Set" | "Set" | "Set" | "Set>" | "Set>" | "Set>" | "Set>", `union(${string})` | `union(${string},${string})`]; //#endregion //#region src/SingularNounEnding.d.ts /** * Singular nouns typically end in the characters represented by this array. * * **Related:** `SingularNounEnding` */ declare const SINGULAR_NOUN_ENDINGS: readonly ["s", "sh", "ch", "x", "z", "o"]; //#endregion //#region src/Social.d.ts declare const SOCIAL_MEDIA: [{ readonly name: "Facebook"; readonly description: "Connect with friends, family, and communities worldwide on one of the largest social networks."; readonly baseUrls: ["https://www.facebook.com"]; readonly profileUrl: "https://www.facebook.com/:user_id"; readonly approximateUserSize: 3000000000; readonly tickerSymbol: "META"; }, { readonly name: "YouTube"; readonly description: "A platform for sharing and watching videos, connecting creators with audiences globally."; readonly baseUrls: ["https://www.youtube.com"]; readonly profileUrl: "https://www.youtube.com/user/:user_id"; readonly approximateUserSize: 2500000000; readonly tickerSymbol: "GOOGL"; }, { readonly name: "WhatsApp"; readonly description: "A secure messaging app for personal and business communication."; readonly baseUrls: ["https://www.whatsapp.com", "https://wa.me"]; readonly profileUrl: "https://wa.me/:user_id"; readonly approximateUserSize: 2000000000; readonly tickerSymbol: "META"; }, { readonly name: "Instagram"; readonly description: "Share photos and videos with friends and followers through posts, stories, and reels."; readonly baseUrls: ["https://www.instagram.com"]; readonly profileUrl: "https://www.instagram.com/:user_id"; readonly approximateUserSize: 2000000000; readonly tickerSymbol: "META"; }, { readonly name: "TikTok"; readonly description: "A short-form video platform known for its highly engaging content and viral trends."; readonly baseUrls: ["https://www.tiktok.com"]; readonly profileUrl: "https://www.tiktok.com/@:user_id"; readonly approximateUserSize: 1600000000; }, { readonly name: "WeChat"; readonly description: "China's popular messaging and lifestyle app, integrating social media and mobile payments."; readonly baseUrls: ["https://www.wechat.com"]; readonly profileUrl: "https://www.wechat.com/:user_id"; readonly approximateUserSize: 1300000000; }, { readonly name: "Facebook Messenger"; readonly description: "A messaging app used for personal and business interactions, seamlessly integrated with Facebook."; readonly baseUrls: ["https://www.messenger.com"]; readonly profileUrl: "https://www.messenger.com/t/:user_id"; readonly approximateUserSize: 1000000000; readonly tickerSymbol: "META"; }, { readonly name: "Telegram"; readonly description: "A messaging platform focused on privacy, with channels and group capabilities."; readonly baseUrls: ["https://www.telegram.org", "https://t.me"]; readonly profileUrl: "https://t.me/:user_id"; readonly approximateUserSize: 900000000; }, { readonly name: "Snapchat"; readonly description: "A multimedia app popular for its disappearing messages and creative filters."; readonly baseUrls: ["https://www.snapchat.com"]; readonly profileUrl: "https://www.snapchat.com/add/:user_id"; readonly approximateUserSize: 800000000; readonly tickerSymbol: "SNAP"; }, { readonly name: "Douyin"; readonly description: "The Chinese version of TikTok, with similar short-form video content tailored for China."; readonly baseUrls: ["https://www.douyin.com"]; readonly profileUrl: "https://www.douyin.com/user/:user_id"; readonly approximateUserSize: 750000000; }, { readonly name: "LinkedIn"; readonly description: "The largest professional networking platform, where users connect for career opportunities, insights, and business networking."; readonly baseUrls: ["https://www.linkedin.com"]; readonly profileUrl: "https://www.linkedin.com/in/:user_id"; readonly approximateUserSize: 930000000; readonly tickerSymbol: "MSFT"; }, { readonly name: "X (formerly Twitter)"; readonly description: "A platform for real-time updates, news sharing, and public discourse with a focus on brief, impactful posts."; readonly baseUrls: ["https://www.twitter.com", "https://x.com"]; readonly profileUrl: "https://twitter.com/:user_id"; readonly approximateUserSize: 540000000; }, { readonly name: "Pinterest"; readonly description: "A visually-driven platform for sharing ideas, DIY projects, fashion, and more."; readonly baseUrls: ["https://www.pinterest.com"]; readonly profileUrl: "https://www.pinterest.com/:user_id"; readonly approximateUserSize: 460000000; readonly tickerSymbol: "PINS"; }, { readonly name: "Reddit"; readonly description: "A community-driven platform organized into niche forums or 'subreddits' focused on various topics."; readonly baseUrls: ["https://www.reddit.com"]; readonly profileUrl: "https://www.reddit.com/user/:user_id"; readonly approximateUserSize: 430000000; }, { readonly name: "Clubhouse"; readonly description: "A voice-based social network where users engage in live audio conversations on various topics."; readonly baseUrls: ["https://www.clubhouse.com"]; readonly profileUrl: "https://www.clubhouse.com/:user_id"; readonly approximateUserSize: 10000000; }, { readonly name: "Discord"; readonly description: "Originally aimed at gamers, Discord is now widely used by various communities for group chat, video, and voice calls."; readonly baseUrls: ["https://www.discord.com", "https://discord.com"]; readonly profileUrl: "https://discord.com/users/:user_id"; readonly approximateUserSize: 300000000; }]; //#endregion //#region src/Tailwind.d.ts declare const TW_HUE_NEUTRAL: { readonly slate: 262; readonly gray: 270; readonly zinc: 269; readonly neutral: 270; readonly stone: 273; }; declare const TW_HUE_VIBRANT: { readonly red: 24; readonly orange: 44; readonly amber: 79; readonly yellow: 100; readonly lime: 132; readonly green: 144; readonly emerald: 159; readonly teal: 182; readonly cyan: 192; readonly sky: 219; readonly blue: 240; readonly indigo: 268; readonly violet: 283; readonly purple: 294; readonly fuchsia: 319; readonly pink: 334; readonly rose: 15; }; declare const TW_HUE_STATIC: { readonly black: 0; readonly white: 106.37411429114086; }; /** * **TW_COLOR_HUE** * * The _hue_ values for [TailwindCSS](https://tailwindcss.com/docs/customizing-colors) * when moved into the **oklch** color space. */ declare const TW_HUE: { readonly black: 0; readonly white: 106.37411429114086; readonly red: 24; readonly orange: 44; readonly amber: 79; readonly yellow: 100; readonly lime: 132; readonly green: 144; readonly emerald: 159; readonly teal: 182; readonly cyan: 192; readonly sky: 219; readonly blue: 240; readonly indigo: 268; readonly violet: 283; readonly purple: 294; readonly fuchsia: 319; readonly pink: 334; readonly rose: 15; readonly slate: 262; readonly gray: 270; readonly zinc: 269; readonly neutral: 270; readonly stone: 273; }; declare const TW_LUMINOSITY: { readonly 50: 97.78; readonly 100: 93.56; readonly 200: 88.11; readonly 300: 82.67; readonly 400: 74.22; readonly 500: 64.78; readonly 600: 57.33; readonly 700: 46.89; readonly 800: 39.44; readonly 900: 32; readonly 950: 23.78; }; declare const TW_LUMIN_50: 97.78; declare const TW_LUMIN_100: 93.56; declare const TW_LUMIN_200: 88.11; declare const TW_LUMIN_300: 82.67; declare const TW_LUMIN_400: 74.22; declare const TW_LUMIN_500: 64.78; declare const TW_LUMIN_600: 57.33; declare const TW_LUMIN_700: 46.89; declare const TW_LUMIN_800: 39.44; declare const TW_LUMIN_900: 32; declare const TW_LUMIN_950: 23.78; /** * **TW_CHROMA** * * The possible chroma values from Tailwind CSS when using * the **okhsl** color model. * * **Related:** `TW_CHROMA_50`, `TW_CHROMA_100`, ... */ declare const TW_CHROMA: { readonly 50: 0.0108; readonly 100: 0.0321; readonly 200: 0.0609; readonly 300: 0.0908; readonly 400: 0.1398; readonly 500: 0.1472; readonly 600: 0.1299; readonly 700: 0.1067; readonly 800: 0.0898; readonly 900: 0.0726; readonly 950: 0.054; }; declare const TW_CHROMA_50: 0.0108; declare const TW_CHROMA_100: 0.0321; declare const TW_CHROMA_200: 0.0609; declare const TW_CHROMA_300: 0.0908; declare const TW_CHROMA_400: 0.1398; declare const TW_CHROMA_500: 0.1472; declare const TW_CHROMA_600: 0.1299; declare const TW_CHROMA_700: 0.1067; declare const TW_CHROMA_800: 0.0898; declare const TW_CHROMA_900: 0.0726; declare const TW_CHROMA_950: 0.054; /** * The list of "targets" where Tailwind color string references * can be applied to. These domains are prefixes to the color string * when used (e.g., `bg-green-500`) */ declare const TW_COLOR_TARGETS: readonly ["bg", "text", "border", "ring", "shadow", "border"]; declare const TW_MODIFIERS_CORE: readonly ["dark", "focus", "hover", "active", "visited", "disabled"]; declare const TW_MODIFIERS_ORDER: readonly ["first", "last", "odd", "even"]; declare const TW_MODIFIERS_RELN: readonly ["focus-within", "focus-visible", "checked", "peer-invalid", "peer-checked/{{string}}"]; /** * The list of page size prefixes which Tailwind provides for adjusting to * device size. These are the defaults and can be customized. */ declare const TW_MODIFIERS_SIZING: readonly ["sm", "md", "lg", "xl", "2xl"]; /** * The list of _modifiers_ which you can target as a prefix to a Tailwind * class (e.g., `focus:...`, `hover:...`). */ declare const TW_MODIFIERS: readonly ["dark", "focus", "hover", "active", "visited", "disabled", "first", "last", "odd", "even", "sm", "md", "lg", "xl", "2xl", "focus-within", "focus-visible", "checked", "peer-invalid", "peer-checked/{{string}}"]; //#endregion //#region src/Timezones.d.ts declare const IANA_TIMEZONES__AFRICA: readonly ["Africa/Abidjan", "Africa/Accra", "Africa/Addis_Ababa", "Africa/Algiers", "Africa/Asmara", "Africa/Bamako", "Africa/Bangui", "Africa/Banjul", "Africa/Bissau", "Africa/Blantyre", "Africa/Brazzaville", "Africa/Bujumbura", "Africa/Cairo", "Africa/Casablanca", "Africa/Ceuta", "Africa/Conakry", "Africa/Dakar", "Africa/Dar_es_Salaam", "Africa/Djibouti", "Africa/Douala", "Africa/El_Aaiun", "Africa/Freetown", "Africa/Gaborone", "Africa/Harare", "Africa/Johannesburg", "Africa/Juba", "Africa/Kampala", "Africa/Khartoum", "Africa/Kigali", "Africa/Kinshasa", "Africa/Lagos", "Africa/Libreville", "Africa/Lome", "Africa/Luanda", "Africa/Lubumbashi", "Africa/Lusaka", "Africa/Malabo", "Africa/Maputo", "Africa/Maseru", "Africa/Mbabane", "Africa/Mogadishu", "Africa/Monrovia", "Africa/Nairobi", "Africa/Ndjamena", "Africa/Niamey", "Africa/Nouakchott", "Africa/Ouagadougou", "Africa/Porto-Novo", "Africa/Sao_Tome", "Africa/Tripoli", "Africa/Tunis", "Africa/Windhoek"]; declare const IANA_TIMEZONES__AMERICA: readonly ["America/Adak", "America/Anchorage", "America/Anguilla", "America/Antigua", "America/Araguaina", "America/Argentina/Buenos_Aires", "America/Argentina/Catamarca", "America/Argentina/Cordoba", "America/Argentina/Jujuy", "America/Argentina/La_Rioja", "America/Argentina/Mendoza", "America/Argentina/Rio_Gallegos", "America/Argentina/Salta", "America/Argentina/San_Juan", "America/Argentina/San_Luis", "America/Argentina/Tucuman", "America/Argentina/Ushuaia", "America/Aruba", "America/Asuncion", "America/Atikokan", "America/Atka", "America/Bahia", "America/Bahia_Banderas", "America/Barbados", "America/Belem", "America/Belize", "America/Blanc-Sablon", "America/Boa_Vista", "America/Bogota", "America/Boise", "America/Cambridge_Bay", "America/Campo_Grande", "America/Cancun", "America/Caracas", "America/Cayenne", "America/Cayman", "America/Chicago", "America/Chihuahua", "America/Creston", "America/Cuiaba", "America/Curacao", "America/Danmarkshavn", "America/Dawson", "America/Dawson_Creek", "America/Denver", "America/Detroit", "America/Dominica", "America/Edmonton", "America/Eirunepe", "America/El_Salvador", "America/Fort_Nelson", "America/Fortaleza", "America/Glace_Bay", "America/Godthab", "America/Goose_Bay", "America/Grand_Turk", "America/Grenada", "America/Guadeloupe", "America/Guatemala", "America/Guayaquil", "America/Guyana", "America/Halifax", "America/Havana", "America/Hermosillo", "America/Indiana/Indianapolis", "America/Indiana/Knox", "America/Indiana/Marengo", "America/Indiana/Petersburg", "America/Indiana/Tell_City", "America/Indiana/Vevay", "America/Indiana/Vincennes", "America/Indiana/Winamac", "America/Inuvik", "America/Iqaluit", "America/Jamaica", "America/Juneau", "America/Kentucky/Louisville", "America/Kentucky/Monticello", "America/Kralendijk", "America/La_Paz", "America/Lima", "America/Los_Angeles", "America/Lower_Princes", "America/Maceio", "America/Managua", "America/Manaus", "America/Marigot", "America/Martinique", "America/Matamoros", "America/Mazatlan", "America/Menominee", "America/Merida", "America/Metlakatla", "America/Mexico_City", "America/Miquelon", "America/Moncton", "America/Monterrey", "America/Montevideo", "America/Montserrat", "America/Nassau", "America/New_York", "America/Nipigon", "America/Nome", "America/Noronha", "America/North_Dakota/Beulah", "America/North_Dakota/Center", "America/North_Dakota/New_Salem", "America/Ojinaga", "America/Panama", "America/Pangnirtung", "America/Paramaribo", "America/Phoenix", "America/Port-au-Prince", "America/Port_of_Spain", "America/Porto_Velho", "America/Puerto_Rico", "America/Punta_Arenas", "America/Rainy_River", "America/Rankin_Inlet", "America/Recife", "America/Regina", "America/Resolute", "America/Rio_Branco", "America/Santarem", "America/Santiago", "America/Santo_Domingo", "America/Sao_Paulo", "America/Scoresbysund", "America/Sitka", "America/St_Barthelemy", "America/St_Johns", "America/St_Kitts", "America/St_Lucia", "America/St_Thomas", "America/St_Vincent", "America/Swift_Current", "America/Tegucigalpa", "America/Thule", "America/Thunder_Bay", "America/Tijuana", "America/Toronto", "America/Tortola", "America/Vancouver", "America/Whitehorse", "America/Winnipeg", "America/Yakutat", "America/Yellowknife"]; declare const IANA_TIMEZONES__ANTARCTICA: readonly ["Antarctica/Casey", "Antarctica/Davis", "Antarctica/DumontDUrville", "Antarctica/Macquarie", "Antarctica/Mawson", "Antarctica/McMurdo", "Antarctica/Palmer", "Antarctica/Rothera", "Antarctica/South_Pole", "Antarctica/Syowa", "Antarctica/Troll", "Antarctica/Vostok", "Arctic/Longyearbyen"]; declare const IANA_TIMEZONES__ASIA: readonly ["Asia/Almaty", "Asia/Amman", "Asia/Anadyr", "Asia/Aqtau", "Asia/Aqtobe", "Asia/Ashgabat", "Asia/Atyrau", "Asia/Baghdad", "Asia/Baku", "Asia/Bangkok", "Asia/Barnaul", "Asia/Beirut", "Asia/Bishkek", "Asia/Brunei", "Asia/Chita", "Asia/Choibalsan", "Asia/Colombo", "Asia/Damascus", "Asia/Dhaka", "Asia/Dili", "Asia/Dubai", "Asia/Dushanbe", "Asia/Famagusta", "Asia/Gaza", "Asia/Hebron", "Asia/Ho_Chi_Minh", "Asia/Hong_Kong", "Asia/Hovd", "Asia/Irkutsk", "Asia/Jakarta", "Asia/Jayapura", "Asia/Jerusalem", "Asia/Kabul", "Asia/Kamchatka", "Asia/Karachi", "Asia/Kathmandu", "Asia/Khandyga", "Asia/Kolkata", "Asia/Krasnoyarsk", "Asia/Kuala_Lumpur", "Asia/Kuching", "Asia/Kuwait", "Asia/Macau", "Asia/Magadan", "Asia/Makassar", "Asia/Manila", "Asia/Muscat", "Asia/Nicosia", "Asia/Novokuznetsk", "Asia/Novosibirsk", "Asia/Omsk", "Asia/Oral", "Asia/Phnom_Penh", "Asia/Pontianak", "Asia/Pyongyang", "Asia/Qatar", "Asia/Qostanay", "Asia/Qyzylorda", "Asia/Riyadh", "Asia/Sakhalin", "Asia/Samarkand", "Asia/Seoul", "Asia/Shanghai", "Asia/Singapore", "Asia/Srednekolymsk", "Asia/Taipei", "Asia/Tashkent", "Asia/Tbilisi", "Asia/Tehran", "Asia/Thimphu", "Asia/Tokyo", "Asia/Tomsk", "Asia/Ulaanbaatar", "Asia/Urumqi", "Asia/Ust-Nera", "Asia/Vientiane", "Asia/Vladivostok", "Asia/Yakutsk", "Asia/Yangon", "Asia/Yekaterinburg", "Asia/Yerevan"]; declare const IANA_TIMEZONES__ATLANTIC: readonly ["Atlantic/Azores", "Atlantic/Bermuda", "Atlantic/Canary", "Atlantic/Cape_Verde", "Atlantic/Faroe", "Atlantic/Madeira", "Atlantic/Reykjavik", "Atlantic/South_Georgia", "Atlantic/St_Helena", "Atlantic/Stanley"]; declare const IANA_TIMEZONES__AUSTRALIA: readonly ["Australia/Adelaide", "Australia/Brisbane", "Australia/Broken_Hill", "Australia/Currie", "Australia/Darwin", "Australia/Eucla", "Australia/Hobart", "Australia/Lindeman", "Australia/Lord_Howe", "Australia/Melbourne", "Australia/Perth", "Australia/Sydney"]; declare const IANA_TIMEZONES__EUROPE: readonly ["Europe/Amsterdam", "Europe/Andorra", "Europe/Astrakhan", "Europe/Athens", "Europe/Belgrade", "Europe/Berlin", "Europe/Brussels", "Europe/Bucharest", "Europe/Budapest", "Europe/Chisinau", "Europe/Copenhagen", "Europe/Dublin", "Europe/Gibraltar", "Europe/Guernsey", "Europe/Helsinki", "Europe/Isle_of_Man", "Europe/Istanbul", "Europe/Jersey", "Europe/Kaliningrad", "Europe/Kiev", "Europe/Kirov", "Europe/Lisbon", "Europe/Ljubljana", "Europe/London", "Europe/Luxembourg", "Europe/Madrid", "Europe/Malta", "Europe/Mariehamn", "Europe/Minsk", "Europe/Monaco", "Europe/Moscow", "Europe/Oslo", "Europe/Paris", "Europe/Podgorica", "Europe/Prague", "Europe/Riga", "Europe/Rome", "Europe/Samara", "Europe/San_Marino", "Europe/Sarajevo", "Europe/Simferopol", "Europe/Skopje", "Europe/Sofia", "Europe/Stockholm", "Europe/Tallinn", "Europe/Tirane", "Europe/Ulyanovsk", "Europe/Uzhgorod", "Europe/Vaduz", "Europe/Vatican", "Europe/Vienna", "Europe/Vilnius", "Europe/Volgograd", "Europe/Warsaw", "Europe/Zagreb", "Europe/Zaporozhye", "Europe/Zurich"]; declare const IANA_TIMEZONES__INDIAN: readonly ["Indian/Antananarivo", "Indian/Chagos", "Indian/Christmas", "Indian/Cocos", "Indian/Comoro", "Indian/Kerguelen", "Indian/Mahe", "Indian/Maldives", "Indian/Mauritius", "Indian/Mayotte", "Indian/Reunion"]; declare const IANA_TIMEZONES__PACIFIC: readonly ["Pacific/Apia", "Pacific/Auckland", "Pacific/Bougainville", "Pacific/Chatham", "Pacific/Chuuk", "Pacific/Easter", "Pacific/Efate", "Pacific/Enderbury", "Pacific/Fakaofo", "Pacific/Fiji", "Pacific/Funafuti", "Pacific/Galapagos", "Pacific/Gambier", "Pacific/Guadalcanal", "Pacific/Guam", "Pacific/Honolulu", "Pacific/Kiritimati", "Pacific/Kosrae", "Pacific/Kwajalein", "Pacific/Majuro", "Pacific/Marquesas", "Pacific/Midway", "Pacific/Nauru", "Pacific/Niue", "Pacific/Norfolk", "Pacific/Noumea", "Pacific/Pago_Pago", "Pacific/Palau", "Pacific/Pitcairn", "Pacific/Pohnpei", "Pacific/Port_Moresby", "Pacific/Rarotonga", "Pacific/Saipan", "Pacific/Tahiti", "Pacific/Tarawa", "Pacific/Tongatapu", "Pacific/Wake", "Pacific/Wallis"]; declare const IANA_TIMEZONES__OTHER: readonly ["UTC", "Zulu"]; declare const IANA_TIMEZONES: readonly ["Africa/Abidjan", "Africa/Accra", "Africa/Addis_Ababa", "Africa/Algiers", "Africa/Asmara", "Africa/Bamako", "Africa/Bangui", "Africa/Banjul", "Africa/Bissau", "Africa/Blantyre", "Africa/Brazzaville", "Africa/Bujumbura", "Africa/Cairo", "Africa/Casablanca", "Africa/Ceuta", "Africa/Conakry", "Africa/Dakar", "Africa/Dar_es_Salaam", "Africa/Djibouti", "Africa/Douala", "Africa/El_Aaiun", "Africa/Freetown", "Africa/Gaborone", "Africa/Harare", "Africa/Johannesburg", "Africa/Juba", "Africa/Kampala", "Africa/Khartoum", "Africa/Kigali", "Africa/Kinshasa", "Africa/Lagos", "Africa/Libreville", "Africa/Lome", "Africa/Luanda", "Africa/Lubumbashi", "Africa/Lusaka", "Africa/Malabo", "Africa/Maputo", "Africa/Maseru", "Africa/Mbabane", "Africa/Mogadishu", "Africa/Monrovia", "Africa/Nairobi", "Africa/Ndjamena", "Africa/Niamey", "Africa/Nouakchott", "Africa/Ouagadougou", "Africa/Porto-Novo", "Africa/Sao_Tome", "Africa/Tripoli", "Africa/Tunis", "Africa/Windhoek", "America/Adak", "America/Anchorage", "America/Anguilla", "America/Antigua", "America/Araguaina", "America/Argentina/Buenos_Aires", "America/Argentina/Catamarca", "America/Argentina/Cordoba", "America/Argentina/Jujuy", "America/Argentina/La_Rioja", "America/Argentina/Mendoza", "America/Argentina/Rio_Gallegos", "America/Argentina/Salta", "America/Argentina/San_Juan", "America/Argentina/San_Luis", "America/Argentina/Tucuman", "America/Argentina/Ushuaia", "America/Aruba", "America/Asuncion", "America/Atikokan", "America/Atka", "America/Bahia", "America/Bahia_Banderas", "America/Barbados", "America/Belem", "America/Belize", "America/Blanc-Sablon", "America/Boa_Vista", "America/Bogota", "America/Boise", "America/Cambridge_Bay", "America/Campo_Grande", "America/Cancun", "America/Caracas", "America/Cayenne", "America/Cayman", "America/Chicago", "America/Chihuahua", "America/Creston", "America/Cuiaba", "America/Curacao", "America/Danmarkshavn", "America/Dawson", "America/Dawson_Creek", "America/Denver", "America/Detroit", "America/Dominica", "America/Edmonton", "America/Eirunepe", "America/El_Salvador", "America/Fort_Nelson", "America/Fortaleza", "America/Glace_Bay", "America/Godthab", "America/Goose_Bay", "America/Grand_Turk", "America/Grenada", "America/Guadeloupe", "America/Guatemala", "America/Guayaquil", "America/Guyana", "America/Halifax", "America/Havana", "America/Hermosillo", "America/Indiana/Indianapolis", "America/Indiana/Knox", "America/Indiana/Marengo", "America/Indiana/Petersburg", "America/Indiana/Tell_City", "America/Indiana/Vevay", "America/Indiana/Vincennes", "America/Indiana/Winamac", "America/Inuvik", "America/Iqaluit", "America/Jamaica", "America/Juneau", "America/Kentucky/Louisville", "America/Kentucky/Monticello", "America/Kralendijk", "America/La_Paz", "America/Lima", "America/Los_Angeles", "America/Lower_Princes", "America/Maceio", "America/Managua", "America/Manaus", "America/Marigot", "America/Martinique", "America/Matamoros", "America/Mazatlan", "America/Menominee", "America/Merida", "America/Metlakatla", "America/Mexico_City", "America/Miquelon", "America/Moncton", "America/Monterrey", "America/Montevideo", "America/Montserrat", "America/Nassau", "America/New_York", "America/Nipigon", "America/Nome", "America/Noronha", "America/North_Dakota/Beulah", "America/North_Dakota/Center", "America/North_Dakota/New_Salem", "America/Ojinaga", "America/Panama", "America/Pangnirtung", "America/Paramaribo", "America/Phoenix", "America/Port-au-Prince", "America/Port_of_Spain", "America/Porto_Velho", "America/Puerto_Rico", "America/Punta_Arenas", "America/Rainy_River", "America/Rankin_Inlet", "America/Recife", "America/Regina", "America/Resolute", "America/Rio_Branco", "America/Santarem", "America/Santiago", "America/Santo_Domingo", "America/Sao_Paulo", "America/Scoresbysund", "America/Sitka", "America/St_Barthelemy", "America/St_Johns", "America/St_Kitts", "America/St_Lucia", "America/St_Thomas", "America/St_Vincent", "America/Swift_Current", "America/Tegucigalpa", "America/Thule", "America/Thunder_Bay", "America/Tijuana", "America/Toronto", "America/Tortola", "America/Vancouver", "America/Whitehorse", "America/Winnipeg", "America/Yakutat", "America/Yellowknife", "Antarctica/Casey", "Antarctica/Davis", "Antarctica/DumontDUrville", "Antarctica/Macquarie", "Antarctica/Mawson", "Antarctica/McMurdo", "Antarctica/Palmer", "Antarctica/Rothera", "Antarctica/South_Pole", "Antarctica/Syowa", "Antarctica/Troll", "Antarctica/Vostok", "Arctic/Longyearbyen", "Asia/Almaty", "Asia/Amman", "Asia/Anadyr", "Asia/Aqtau", "Asia/Aqtobe", "Asia/Ashgabat", "Asia/Atyrau", "Asia/Baghdad", "Asia/Baku", "Asia/Bangkok", "Asia/Barnaul", "Asia/Beirut", "Asia/Bishkek", "Asia/Brunei", "Asia/Chita", "Asia/Choibalsan", "Asia/Colombo", "Asia/Damascus", "Asia/Dhaka", "Asia/Dili", "Asia/Dubai", "Asia/Dushanbe", "Asia/Famagusta", "Asia/Gaza", "Asia/Hebron", "Asia/Ho_Chi_Minh", "Asia/Hong_Kong", "Asia/Hovd", "Asia/Irkutsk", "Asia/Jakarta", "Asia/Jayapura", "Asia/Jerusalem", "Asia/Kabul", "Asia/Kamchatka", "Asia/Karachi", "Asia/Kathmandu", "Asia/Khandyga", "Asia/Kolkata", "Asia/Krasnoyarsk", "Asia/Kuala_Lumpur", "Asia/Kuching", "Asia/Kuwait", "Asia/Macau", "Asia/Magadan", "Asia/Makassar", "Asia/Manila", "Asia/Muscat", "Asia/Nicosia", "Asia/Novokuznetsk", "Asia/Novosibirsk", "Asia/Omsk", "Asia/Oral", "Asia/Phnom_Penh", "Asia/Pontianak", "Asia/Pyongyang", "Asia/Qatar", "Asia/Qostanay", "Asia/Qyzylorda", "Asia/Riyadh", "Asia/Sakhalin", "Asia/Samarkand", "Asia/Seoul", "Asia/Shanghai", "Asia/Singapore", "Asia/Srednekolymsk", "Asia/Taipei", "Asia/Tashkent", "Asia/Tbilisi", "Asia/Tehran", "Asia/Thimphu", "Asia/Tokyo", "Asia/Tomsk", "Asia/Ulaanbaatar", "Asia/Urumqi", "Asia/Ust-Nera", "Asia/Vientiane", "Asia/Vladivostok", "Asia/Yakutsk", "Asia/Yangon", "Asia/Yekaterinburg", "Asia/Yerevan", "Atlantic/Azores", "Atlantic/Bermuda", "Atlantic/Canary", "Atlantic/Cape_Verde", "Atlantic/Faroe", "Atlantic/Madeira", "Atlantic/Reykjavik", "Atlantic/South_Georgia", "Atlantic/St_Helena", "Atlantic/Stanley", "Australia/Adelaide", "Australia/Brisbane", "Australia/Broken_Hill", "Australia/Currie", "Australia/Darwin", "Australia/Eucla", "Australia/Hobart", "Australia/Lindeman", "Australia/Lord_Howe", "Australia/Melbourne", "Australia/Perth", "Australia/Sydney", "Europe/Amsterdam", "Europe/Andorra", "Europe/Astrakhan", "Europe/Athens", "Europe/Belgrade", "Europe/Berlin", "Europe/Brussels", "Europe/Bucharest", "Europe/Budapest", "Europe/Chisinau", "Europe/Copenhagen", "Europe/Dublin", "Europe/Gibraltar", "Europe/Guernsey", "Europe/Helsinki", "Europe/Isle_of_Man", "Europe/Istanbul", "Europe/Jersey", "Europe/Kaliningrad", "Europe/Kiev", "Europe/Kirov", "Europe/Lisbon", "Europe/Ljubljana", "Europe/London", "Europe/Luxembourg", "Europe/Madrid", "Europe/Malta", "Europe/Mariehamn", "Europe/Minsk", "Europe/Monaco", "Europe/Moscow", "Europe/Oslo", "Europe/Paris", "Europe/Podgorica", "Europe/Prague", "Europe/Riga", "Europe/Rome", "Europe/Samara", "Europe/San_Marino", "Europe/Sarajevo", "Europe/Simferopol", "Europe/Skopje", "Europe/Sofia", "Europe/Stockholm", "Europe/Tallinn", "Europe/Tirane", "Europe/Ulyanovsk", "Europe/Uzhgorod", "Europe/Vaduz", "Europe/Vatican", "Europe/Vienna", "Europe/Vilnius", "Europe/Volgograd", "Europe/Warsaw", "Europe/Zagreb", "Europe/Zaporozhye", "Europe/Zurich", "Indian/Antananarivo", "Indian/Chagos", "Indian/Christmas", "Indian/Cocos", "Indian/Comoro", "Indian/Kerguelen", "Indian/Mahe", "Indian/Maldives", "Indian/Mauritius", "Indian/Mayotte", "Indian/Reunion", "UTC", "Zulu", "Pacific/Apia", "Pacific/Auckland", "Pacific/Bougainville", "Pacific/Chatham", "Pacific/Chuuk", "Pacific/Easter", "Pacific/Efate", "Pacific/Enderbury", "Pacific/Fakaofo", "Pacific/Fiji", "Pacific/Funafuti", "Pacific/Galapagos", "Pacific/Gambier", "Pacific/Guadalcanal", "Pacific/Guam", "Pacific/Honolulu", "Pacific/Kiritimati", "Pacific/Kosrae", "Pacific/Kwajalein", "Pacific/Majuro", "Pacific/Marquesas", "Pacific/Midway", "Pacific/Nauru", "Pacific/Niue", "Pacific/Norfolk", "Pacific/Noumea", "Pacific/Pago_Pago", "Pacific/Palau", "Pacific/Pitcairn", "Pacific/Pohnpei", "Pacific/Port_Moresby", "Pacific/Rarotonga", "Pacific/Saipan", "Pacific/Tahiti", "Pacific/Tarawa", "Pacific/Tongatapu", "Pacific/Wake", "Pacific/Wallis"]; //#endregion //#region src/TypeComparisons.d.ts type AnyObject$2 = Record | Record; type AnyFunction$2 = TProps extends Record ? (...args: TArgs) => TReturn : ((...args: TArgs) => TReturn) & TProps; /** * **wide** * * Provides a dictionary of _wide_ types; in most cases you should * prefer the **kind** API. */ declare const WideAssignment: { readonly boolean: () => boolean; readonly string: () => string; readonly number: () => number; readonly symbol: () => symbol; readonly null: () => null; readonly function: () => AnyFunction$2; readonly tuple: () => readonly unknown[]; readonly singularTuple: () => [readonly unknown[]]; readonly object: () => AnyObject$2; readonly emptyObject: () => Record; readonly undefined: () => undefined; /** * run-time value is a type token for `unknown` and type is of course `unknown` */ readonly unknown: () => unknown; readonly nothing: () => null | undefined; readonly something: () => {}; }; /** * **TYPE_COMPARISONS** * * A dictionary of all _comparison_ operations along with their `RefType`, description, * and `Params`. */ declare const TYPE_COMPARISONS: { readonly Extends: [unknown, "extends the type", [(t: { readonly boolean: () => boolean; readonly string: () => string; readonly number: () => number; readonly symbol: () => symbol; readonly null: () => null; readonly function: () => AnyFunction$2; readonly tuple: () => readonly unknown[]; readonly singularTuple: () => [readonly unknown[]]; readonly object: () => AnyObject$2; readonly emptyObject: () => Record; readonly undefined: () => undefined; /** * run-time value is a type token for `unknown` and type is of course `unknown` */ readonly unknown: () => unknown; readonly nothing: () => null | undefined; readonly something: () => {}; }) => unknown]]; readonly NotExtends: [unknown, "does not extent the type", [(t: { readonly boolean: () => boolean; readonly string: () => string; readonly number: () => number; readonly symbol: () => symbol; readonly null: () => null; readonly function: () => AnyFunction$2; readonly tuple: () => readonly unknown[]; readonly singularTuple: () => [readonly unknown[]]; readonly object: () => AnyObject$2; readonly emptyObject: () => Record; readonly undefined: () => undefined; /** * run-time value is a type token for `unknown` and type is of course `unknown` */ readonly unknown: () => unknown; readonly nothing: () => null | undefined; readonly something: () => {}; }) => unknown]]; readonly Equals: [unknown, "equals the type", [(t: { readonly boolean: () => boolean; readonly string: () => string; readonly number: () => number; readonly symbol: () => symbol; readonly null: () => null; readonly function: () => AnyFunction$2; readonly tuple: () => readonly unknown[]; readonly singularTuple: () => [readonly unknown[]]; readonly object: () => AnyObject$2; readonly emptyObject: () => Record; readonly undefined: () => undefined; /** * run-time value is a type token for `unknown` and type is of course `unknown` */ readonly unknown: () => unknown; readonly nothing: () => null | undefined; readonly something: () => {}; }) => unknown]]; readonly NotEqual: [unknown, "does not equal the type", [(t: { readonly boolean: () => boolean; readonly string: () => string; readonly number: () => number; readonly symbol: () => symbol; readonly null: () => null; readonly function: () => AnyFunction$2; readonly tuple: () => readonly unknown[]; readonly singularTuple: () => [readonly unknown[]]; readonly object: () => AnyObject$2; readonly emptyObject: () => Record; readonly undefined: () => undefined; /** * run-time value is a type token for `unknown` and type is of course `unknown` */ readonly unknown: () => unknown; readonly nothing: () => null | undefined; readonly something: () => {}; }) => unknown]]; readonly Truthy: [unknown, "must be a truthy value", []]; readonly Falsy: [unknown, "must be a falsy value", []]; readonly IsSomething: [unknown, "must be 'something' (aka, not null or undefined)", []]; readonly IsNothing: [unknown, "must be 'nothing' (aka, null or undefined)", []]; readonly IsString: [string, "must extend a string type", []]; readonly IsNumber: [number, "must extend a number type", []]; readonly IsBoolean: [boolean, "must extend a boolean type", []]; readonly GreaterThan: [number, "must be a numeric literal greater than [[0]]", [(t: { readonly boolean: () => boolean; readonly string: () => string; readonly number: () => number; readonly symbol: () => symbol; readonly null: () => null; readonly function: () => AnyFunction$2; readonly tuple: () => readonly unknown[]; readonly singularTuple: () => [readonly unknown[]]; readonly object: () => AnyObject$2; readonly emptyObject: () => Record; readonly undefined: () => undefined; /** * run-time value is a type token for `unknown` and type is of course `unknown` */ readonly unknown: () => unknown; readonly nothing: () => null | undefined; readonly something: () => {}; }) => number]]; readonly LessThan: [number, "must be a numeric literal less than [[0]]", [(t: { readonly boolean: () => boolean; readonly string: () => string; readonly number: () => number; readonly symbol: () => symbol; readonly null: () => null; readonly function: () => AnyFunction$2; readonly tuple: () => readonly unknown[]; readonly singularTuple: () => [readonly unknown[]]; readonly object: () => AnyObject$2; readonly emptyObject: () => Record; readonly undefined: () => undefined; /** * run-time value is a type token for `unknown` and type is of course `unknown` */ readonly unknown: () => unknown; readonly nothing: () => null | undefined; readonly something: () => {}; }) => number]]; readonly StartsWith: [string, "must be a string literal that starts with '[[0]]'", [(t: { readonly boolean: () => boolean; readonly string: () => string; readonly number: () => number; readonly symbol: () => symbol; readonly null: () => null; readonly function: () => AnyFunction$2; readonly tuple: () => readonly unknown[]; readonly singularTuple: () => [readonly unknown[]]; readonly object: () => AnyObject$2; readonly emptyObject: () => Record; readonly undefined: () => undefined; /** * run-time value is a type token for `unknown` and type is of course `unknown` */ readonly unknown: () => unknown; readonly nothing: () => null | undefined; readonly something: () => {}; }) => string]]; readonly EndsWith: [string, "must be a string literal that ends with '[[0]]'", [(t: { readonly boolean: () => boolean; readonly string: () => string; readonly number: () => number; readonly symbol: () => symbol; readonly null: () => null; readonly function: () => AnyFunction$2; readonly tuple: () => readonly unknown[]; readonly singularTuple: () => [readonly unknown[]]; readonly object: () => AnyObject$2; readonly emptyObject: () => Record; readonly undefined: () => undefined; /** * run-time value is a type token for `unknown` and type is of course `unknown` */ readonly unknown: () => unknown; readonly nothing: () => null | undefined; readonly something: () => {}; }) => string]]; readonly Includes: [string, "must be a string literal that includes the substring '[[0]]'", [(t: { readonly boolean: () => boolean; readonly string: () => string; readonly number: () => number; readonly symbol: () => symbol; readonly null: () => null; readonly function: () => AnyFunction$2; readonly tuple: () => readonly unknown[]; readonly singularTuple: () => [readonly unknown[]]; readonly object: () => AnyObject$2; readonly emptyObject: () => Record; readonly undefined: () => undefined; /** * run-time value is a type token for `unknown` and type is of course `unknown` */ readonly unknown: () => unknown; readonly nothing: () => null | undefined; readonly something: () => {}; }) => string]]; readonly ReturnsSomething: [(...args: unknown[]) => unknown, "must be a function which returns 'something' (aka, not null or undefined)", []]; readonly ReturnsNothing: [(...args: unknown[]) => unknown, "must be a function which returns 'nothing' (aka, null or undefined)", []]; readonly ReturnsTrue: [(...args: unknown[]) => unknown, "must be a function which returns 'true'", []]; readonly ReturnsFalse: [(...args: unknown[]) => unknown, "must be a function which returns 'false'", []]; readonly ReturnsTruthy: [(...args: unknown[]) => unknown, "must be a function which returns a 'truthy' value", []]; readonly ReturnsFalsy: [(...args: unknown[]) => unknown, "must be a function which returns a 'falsy' value", []]; readonly ReturnsExtends: [unknown, "must be a function which returns a value which extends [[0]]", [(t: { readonly boolean: () => boolean; readonly string: () => string; readonly number: () => number; readonly symbol: () => symbol; readonly null: () => null; readonly function: () => AnyFunction$2; readonly tuple: () => readonly unknown[]; readonly singularTuple: () => [readonly unknown[]]; readonly object: () => AnyObject$2; readonly emptyObject: () => Record; readonly undefined: () => undefined; /** * run-time value is a type token for `unknown` and type is of course `unknown` */ readonly unknown: () => unknown; readonly nothing: () => null | undefined; readonly something: () => {}; }) => unknown]]; readonly ReturnsEquals: [unknown, "must be a function which returns a value which equals [[0]]", [(t: { readonly boolean: () => boolean; readonly string: () => string; readonly number: () => number; readonly symbol: () => symbol; readonly null: () => null; readonly function: () => AnyFunction$2; readonly tuple: () => readonly unknown[]; readonly singularTuple: () => [readonly unknown[]]; readonly object: () => AnyObject$2; readonly emptyObject: () => Record; readonly undefined: () => undefined; /** * run-time value is a type token for `unknown` and type is of course `unknown` */ readonly unknown: () => unknown; readonly nothing: () => null | undefined; readonly something: () => {}; }) => unknown]]; readonly Contains: [readonly unknown[], "must be a tuple and have elements that extends the value [[0]]", [(t: { readonly boolean: () => boolean; readonly string: () => string; readonly number: () => number; readonly symbol: () => symbol; readonly null: () => null; readonly function: () => AnyFunction$2; readonly tuple: () => readonly unknown[]; readonly singularTuple: () => [readonly unknown[]]; readonly object: () => AnyObject$2; readonly emptyObject: () => Record; readonly undefined: () => undefined; /** * run-time value is a type token for `unknown` and type is of course `unknown` */ readonly unknown: () => unknown; readonly nothing: () => null | undefined; readonly something: () => {}; }) => unknown]]; readonly ContainsSome: [readonly unknown[], "must be a tuple and have elements that extends the value [[0]]", [(t: { readonly boolean: () => boolean; readonly string: () => string; readonly number: () => number; readonly symbol: () => symbol; readonly null: () => null; readonly function: () => AnyFunction$2; readonly tuple: () => readonly unknown[]; readonly singularTuple: () => [readonly unknown[]]; readonly object: () => AnyObject$2; readonly emptyObject: () => Record; readonly undefined: () => undefined; /** * run-time value is a type token for `unknown` and type is of course `unknown` */ readonly unknown: () => unknown; readonly nothing: () => null | undefined; readonly something: () => {}; }) => [readonly unknown[]]]]; }; //#endregion //#region src/TypeOf.d.ts /** * **TYPE_OF** * * The set of values which are possible results of the `typeof` command in Javascript. */ declare const TYPE_OF: readonly ["string", "number", "boolean", "undefined", "symbol", "bigint", "function", "object"]; //#endregion //#region src/Types.d.ts declare const FALSY_TYPE_KINDS: readonly ["undefined", "null"]; declare const LITERAL_TYPE_KINDS: readonly ["true", "false", "stringLiteral", "numericLiteral"]; declare const WIDE_TYPE_KINDS: readonly ["string", "number", "boolean"]; declare const NARROW_CONTAINER_TYPE_KINDS: readonly ["object", "explicitFunctions", "fnType", "fnWithDict", "tuple", "union", "intersection", "arrayOf"]; declare const WIDE_CONTAINER_TYPE_KINDS: readonly ["anyArray", "anyObject", "unknownObject", "anyFunction", "emptyObject"]; /** * A full list of the _types_ of types we have within the `Type` namespace. */ declare const TYPE_KINDS: readonly ["undefined", "null", "string", "number", "boolean", "true", "false", "stringLiteral", "numericLiteral", "object", "explicitFunctions", "fnType", "fnWithDict", "tuple", "union", "intersection", "arrayOf", "anyArray", "anyObject", "unknownObject", "anyFunction", "emptyObject"]; //#endregion //#region src/TypeTokens.d.ts /** * **Type Tokens** which have zero configuration elements. */ declare const TT_ATOMICS: readonly ["undefined", "null", "boolean", "true", "false"]; /** * **Type Tokens** which have a literal variant which represents * the _single_ configuration of this type which is available. */ declare const TT_SINGLETONS: readonly ["string", "number"]; declare const TT_SETS: readonly ["string-set", "numeric-set", "fn-set", "union-set"]; /** * **Type Tokens** which represent _functions_ (either the typical * variety or Generator functions). */ declare const TT_FUNCTIONS: readonly ["fn", "gen"]; /** * **Type Tokens** which _contain_ other **Type Tokens** to make up their * identity. */ declare const TT_CONTAINERS: readonly ["rec", "arr", "set", "map", "union", "obj", "tuple"]; declare const TT_KIND_VARIANTS: readonly ["undefined", "null", "boolean", "true", "false", "rec", "arr", "set", "map", "union", "obj", "tuple", "fn", "gen", "string-set", "numeric-set", "fn-set", "union-set", "string", "number"]; declare const TT_START: "<<"; declare const TT_STOP: ">>"; declare const TT_DELIMITER: "::"; //#endregion //#region src/TypeTokenVariants.d.ts declare const TYPE_TOKEN_REC_VARIANTS: readonly ["object-key", "string-key"]; declare const TYPE_TOKEN_REC_KEY_VARIANTS: readonly ["unknown", "any", "string", "number", "boolean", "truthy", "numberlike", "scalar", "object", "string|undefined", "number|undefined", "boolean|undefined", "object|undefined", "unknown[]", "any[]", "string[]", "number[]", "boolean[]"]; declare const TYPE_TOKEN_STRING_SET_VARIANTS: readonly ["endsWith::${string}", "startsWith::${string}", "contains::${string}", "civilianTime", "militaryTime", "ipv4Address", "ipv4Address::tight", "ipv4Address::loose", "ipv6Address", "ipv6Address::${string}", "numericString", "zipCode5", "zipCode5+4", "countryCode2", "countryCode3", "countryName", "capitalized", "url", "url::${string}", "isoDate", "isoDateTime", "usStateAbbrev", "usCitySuggestions", "metricCategory", "metric", "metric::${Metric}"]; declare const TYPE_TOKEN_UNION_SET_VARIANTS: string[]; //#endregion //#region src/TypeTransforms.d.ts /** * **TYPE_TRANSFORMS** * * A lookup table keyed with the available conversions `ConversionOp` and where * each row provides: * * 1. Reference Type * 2. Parameters * 3. Description */ declare const TYPE_TRANSFORMS: { readonly Identity: readonly [unknown, readonly [], "a transform which returns the same value passed in"]; readonly ToNever: readonly [unknown, readonly [], "converts all incoming types to the Never type"]; readonly ToString: readonly [unknown, readonly [], "ensures that any incoming type is converted to a string variant of that value"]; readonly ToBoolean: readonly [unknown, readonly [], "uses Javascript's \"truthiness\" to convert inputs to a boolean value; with functions it will use the return type"]; readonly Trim: readonly [string, readonly [], "Trims whitespace from start and end of string"]; readonly TrimStart: readonly [string, readonly [], "Trims whitespace from start of string"]; readonly TrimEnd: readonly [string, readonly [], "Trims whitespace from end of string"]; readonly Capitalize: readonly [string, readonly [], "Converts a string input to a capitalized variant"]; readonly UnCapitalize: readonly [string, readonly [], "Converts a string input to a un-capitalized variant"]; readonly AllCaps: readonly [string, readonly [], "Converts a string input to all uppercase characters"]; readonly Lowercase: readonly [string, readonly [], "Converts a string input to all lowercase characters"]; readonly ToCamelCase: readonly [string, readonly [], "Converts a string to use the camelCase naming convention"]; readonly ToKebabCase: readonly [string, readonly [], "Converts a string to use the kebab-case naming convention"]; readonly ToPascalCase: readonly [string, readonly [], "Converts a string to use the PascalCase naming convention"]; readonly ToSnakeCase: readonly [string, readonly [], "Converts a string to use the snake_case naming convention"]; readonly StripLeading: readonly [string, readonly [string], "Strips a string literal from the beginning of a string (if it exists)"]; readonly StripTrailing: readonly [string, readonly [string], "Strips a string literal from the end of a string (if it exists)"]; readonly EnsureLeading: readonly [string, readonly [string], "Ensures a string literal is at the beginning of a string (with no change if it already was)"]; readonly EnsureTrailing: readonly [string, readonly [string], "Ensures a string literal is at the end of a string (with no change if it already was)"]; readonly ToPlural: readonly [string, readonly [], "Pluralizes a word"]; readonly Surround: readonly [string, readonly [string, string], "Surrounds a string literal with a pre and post character or set of characters"]; readonly Prepend: readonly [string | readonly unknown[], readonly [unknown], "Takes a string or tuple and prepends a value to the start."]; readonly Append: readonly [string | readonly unknown[], readonly [unknown], "Takes a string or tuple and appends a value to the end."]; readonly Increment: readonly [number, readonly [], "Increments a numeric value by one"]; readonly Decrement: readonly [number, readonly [], "Decrements a numeric value by one"]; }; //#endregion //#endregion //#region ../runtime/dist/index.d.mts //#region ../types/src/api/api.d.ts /** * **ValueCallback**`` * * A type utility to build a simple "value callback". * * ```ts * // (v: V) => `hi ${string}`; * type T = ValueCallback; * ``` */ type ValueCallback$1 = (v: V) => TReturn; //#endregion //#region ../constants/src/Alpha.d.ts /** * An array of all the lower-cased alphabetic characters */ declare const LOWER_ALPHA_CHARS$2: ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"]; /** * An array of all the upper-cased alphabetic characters */ declare const UPPER_ALPHA_CHARS$2: ["A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"]; //#endregion //#region ../constants/src/Characters.d.ts declare const WHITESPACE_CHARS$2: readonly [" ", "\n", "\t", "\b"]; //#endregion //#region ../constants/src/colors.d.ts declare const CSS_NAMED_COLORS$2: ["aliceblue", "antiquewhite", "aqua", "aquamarine", "azure", "beige", "bisque", "black", "blanchedalmond", "blue", "blueviolet", "brown", "burlywood", "cadetblue", "chartreuse", "chocolate", "coral", "cornflowerblue", "cornsilk", "crimson", "cyan", "darkblue", "darkcyan", "darkgoldenrod", "darkgray", "darkgreen", "darkgrey", "darkkhaki", "darkmagenta", "darkolivegreen", "darkorange", "darkorchid", "darkred", "darksalmon", "darkseagreen", "darkslateblue", "darkslategray", "darkslategrey", "darkturquoise", "darkviolet", "deeppink", "deepskyblue", "dimgray", "dimgrey", "dodgerblue", "firebrick", "floralwhite", "forestgreen", "fuchsia", "gainsboro", "ghostwhite", "gold", "goldenrod", "gray", "green", "greenyellow", "grey", "honeydew", "hotpink", "indianred", "indigo", "ivory", "khaki", "lavender", "lavenderblush", "lawngreen", "lemonchiffon", "lightblue", "lightcoral", "lightcyan", "lightgoldenrodyellow", "lightgray", "lightgreen", "lightgrey", "lightpink", "lightsalmon", "lightseagreen", "lightskyblue", "lightslategray", "lightslategrey", "lightsteelblue", "lightyellow", "lime", "limegreen", "linen", "magenta", "maroon", "mediumaquamarine", "mediumblue", "mediumorchid", "mediumpurple", "mediumseagreen", "mediumslateblue", "mediumspringgreen", "mediumturquoise", "mediumvioletred", "midnightblue", "mintcream", "mistyrose", "moccasin", "navajowhite", "navy", "oldlace", "olive", "olivedrab", "orange", "orangered", "orchid", "palegoldenrod", "palegreen", "paleturquoise", "palevioletred", "papayawhip", "peachpuff", "peru", "pink", "plum", "powderblue", "purple", "rebeccapurple", "red", "rosybrown", "royalblue", "saddlebrown", "salmon", "sandybrown", "seagreen", "seashell", "sienna", "silver", "skyblue", "slateblue", "slategray", "slategrey", "snow", "springgreen", "steelblue", "tan", "teal", "thistle", "tomato", "turquoise", "violet", "wheat", "white", "whitesmoke", "yellow", "yellowgreen"]; declare const CSS_COLOR_LOOKUP$2: { aliceblue: "rgb(240,248,255)"; antiquewhite: "rgb(250,235,215)"; aqua: "rgb(0,255,255)"; aquamarine: "rgb(127,255,212)"; azure: "rgb(240,255,255)"; beige: "rgb(245,245,220)"; bisque: "rgb(255,228,196)"; black: "rgb(0,0,0)"; blanchedalmond: "rgb(255,235,205)"; blue: "rgb(0,0,255)"; blueviolet: "rgb(138,43,226)"; brown: "rgb(165,42,42)"; burlywood: "rgb(222,184,135)"; cadetblue: "rgb(95,158,160)"; chartreuse: "rgb(127,255,0)"; chocolate: "rgb(210,105,30)"; coral: "rgb(255,127,80)"; cornflowerblue: "rgb(100,149,237)"; cornsilk: "rgb(255,248,220)"; crimson: "rgb(220,20,60)"; cyan: "rgb(0,255,255)"; darkblue: "rgb(0,0,139)"; darkcyan: "rgb(0,139,139)"; darkgoldenrod: "rgb(184,134,11)"; darkgray: "rgb(169,169,169)"; darkgreen: "rgb(0,100,0)"; darkgrey: "rgb(169,169,169)"; darkkhaki: "rgb(189,183,107)"; darkmagenta: "rgb(139,0,139)"; darkolivegreen: "rgb(85,107,47)"; darkorange: "rgb(255,140,0)"; darkorchid: "rgb(153,50,204)"; darkred: "rgb(139,0,0)"; darksalmon: "rgb(233,150,122)"; darkseagreen: "rgb(143,188,143)"; darkslateblue: "rgb(72,61,139)"; darkslategray: "rgb(47,79,79)"; darkslategrey: "rgb(47,79,79)"; darkturquoise: "rgb(0,206,209)"; darkviolet: "rgb(148,0,211)"; deeppink: "rgb(255,20,147)"; deepskyblue: "rgb(0,191,255)"; dimgray: "rgb(105,105,105)"; dimgrey: "rgb(105,105,105)"; dodgerblue: "rgb(30,144,255)"; firebrick: "rgb(178,34,34)"; floralwhite: "rgb(255,250,240)"; forestgreen: "rgb(34,139,34)"; fuchsia: "rgb(255,0,255)"; gainsboro: "rgb(220,220,220)"; ghostwhite: "rgb(248,248,255)"; gold: "rgb(255,215,0)"; goldenrod: "rgb(218,165,32)"; gray: "rgb(128,128,128)"; green: "rgb(0,128,0)"; greenyellow: "rgb(173,255,47)"; grey: "rgb(128,128,128)"; honeydew: "rgb(240,255,240)"; hotpink: "rgb(255,105,180)"; indianred: "rgb(205,92,92)"; indigo: "rgb(75,0,130)"; ivory: "rgb(255,255,240)"; khaki: "rgb(240,230,140)"; lavender: "rgb(230,230,250)"; lavenderblush: "rgb(255,240,245)"; lawngreen: "rgb(124,252,0)"; lemonchiffon: "rgb(255,250,205)"; lightblue: "rgb(173,216,230)"; lightcoral: "rgb(240,128,128)"; lightcyan: "rgb(224,255,255)"; lightgoldenrodyellow: "rgb(250,250,210)"; lightgray: "rgb(211,211,211)"; lightgreen: "rgb(144,238,144)"; lightgrey: "rgb(211,211,211)"; lightpink: "rgb(255,182,193)"; lightsalmon: "rgb(255,160,122)"; lightseagreen: "rgb(32,178,170)"; lightskyblue: "rgb(135,206,250)"; lightslategray: "rgb(119,136,153)"; lightslategrey: "rgb(119,136,153)"; lightsteelblue: "rgb(176,196,222)"; lightyellow: "rgb(255,255,224)"; lime: "rgb(0,255,0)"; limegreen: "rgb(50,205,50)"; linen: "rgb(250,240,230)"; magenta: "rgb(255,0,255)"; maroon: "rgb(128,0,0)"; mediumaquamarine: "rgb(102,205,170)"; mediumblue: "rgb(0,0,205)"; mediumorchid: "rgb(186,85,211)"; mediumpurple: "rgb(147,112,219)"; mediumseagreen: "rgb(60,179,113)"; mediumslateblue: "rgb(123,104,238)"; mediumspringgreen: "rgb(0,250,154)"; mediumturquoise: "rgb(72,209,204)"; mediumvioletred: "rgb(199,21,133)"; midnightblue: "rgb(25,25,112)"; mintcream: "rgb(245,255,250)"; mistyrose: "rgb(255,228,225)"; moccasin: "rgb(255,228,181)"; navajowhite: "rgb(255,222,173)"; navy: "rgb(0,0,128)"; oldlace: "rgb(253,245,230)"; olive: "rgb(128,128,0)"; olivedrab: "rgb(107,142,35)"; orange: "rgb(255,165,0)"; orangered: "rgb(255,69,0)"; orchid: "rgb(218,112,214)"; palegoldenrod: "rgb(238,232,170)"; palegreen: "rgb(152,251,152)"; paleturquoise: "rgb(175,238,238)"; palevioletred: "rgb(219,112,147)"; papayawhip: "rgb(255,239,213)"; peachpuff: "rgb(255,218,185)"; peru: "rgb(205,133,63)"; pink: "rgb(255,192,203)"; plum: "rgb(221,160,221)"; powderblue: "rgb(176,224,230)"; purple: "rgb(128,0,128)"; rebeccapurple: "rgb(102,51,153)"; red: "rgb(255,0,0)"; rosybrown: "rgb(188,143,143)"; royalblue: "rgb(65,105,225)"; saddlebrown: "rgb(139,69,19)"; salmon: "rgb(250,128,114)"; sandybrown: "rgb(244,164,96)"; seagreen: "rgb(46,139,87)"; seashell: "rgb(255,245,238)"; sienna: "rgb(160,82,45)"; silver: "rgb(192,192,192)"; skyblue: "rgb(135,206,235)"; slateblue: "rgb(106,90,205)"; slategray: "rgb(112,128,144)"; slategrey: "rgb(112,128,144)"; snow: "rgb(255,250,250)"; springgreen: "rgb(0,255,127)"; steelblue: "rgb(70,130,180)"; tan: "rgb(210,180,140)"; teal: "rgb(0,128,128)"; thistle: "rgb(216,191,216)"; tomato: "rgb(255,99,71)"; turquoise: "rgb(64,224,208)"; violet: "rgb(238,130,238)"; wheat: "rgb(245,222,179)"; white: "rgb(255,255,255)"; whitesmoke: "rgb(245,245,245)"; yellow: "rgb(255,255,0)"; yellowgreen: "rgb(154,205,50)"; }; //#endregion //#region ../constants/src/Comparisons.d.ts declare const COMPARISON_OPERATIONS$2: readonly ["extends", "startsWith", "endsWith", "endsWithNumber", "startsWithNumber", "onlyNumbers", "alphaNumeric", "onlyLetters", "contains", "containsSome", "containsAll", "greaterThan", "greaterThanOrEqual", "lessThan", "lessThanOrEqual", "objectKeyGreaterThan", "objectKeyGreaterThanOrEqual", "objectKeyLessThan", "objectKeyLessThanOrEqual", "objectKeyEquals", "objectKeyExtends", "objectKeyStartsWith", "betweenInclusively", "betweenExclusively", "equals", "equalsSome", "errors", "errorsOfType", "before", "after", "sameDay", "sameMonth", "sameMonthYear", "sameYear", "truthy", "falsy", "true", "false", "returnEquals", "returnExtends", "isTemplateLiteral", "hasLength"]; //#endregion //#region ../constants/src/Constant.d.ts /** * **Constant**`` * * A static value of a particular _kind_. */ interface Constant$2 { _type: "Constant"; kind: TKind; value: TVal; } //#endregion //#region ../constants/src/DateTime.d.ts /** * **MONTH_NAME** * * Full month names. */ declare const MONTH_NAME$2: readonly ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"]; /** * **MONTH_ABBR** * * Abbreviated month names. */ declare const MONTH_ABBR$2: readonly ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]; declare const MONTH_NAME_LOOKUP$2: { readonly January: { readonly abbrev: "Jan"; readonly num: 1; readonly twoDigitStr: "01"; }; readonly February: { readonly abbrev: "Feb"; readonly num: 2; readonly twoDigitStr: "02"; }; readonly March: { readonly abbrev: "Mar"; readonly num: 3; readonly twoDigitStr: "03"; }; readonly April: { readonly abbrev: "Apr"; readonly num: 4; readonly twoDigitStr: "04"; }; readonly May: { readonly abbrev: "May"; readonly num: 5; readonly twoDigitStr: "05"; }; readonly June: { readonly abbrev: "Jun"; readonly num: 6; readonly twoDigitStr: "06"; }; readonly July: { readonly abbrev: "Jul"; readonly num: 7; readonly twoDigitStr: "07"; }; readonly August: { readonly abbrev: "Aug"; readonly num: 8; readonly twoDigitStr: "08"; }; readonly September: { readonly abbrev: "Sep"; readonly num: 9; readonly twoDigitStr: "09"; }; readonly October: { readonly abbrev: "Oct"; readonly num: 10; readonly twoDigitStr: "10"; }; readonly November: { readonly abbrev: "Nov"; readonly num: 11; readonly twoDigitStr: "11"; }; readonly December: { readonly abbrev: "Dec"; readonly num: 12; readonly twoDigitStr: "12"; }; }; declare const MONTH_ABBREV_LOOKUP$2: { readonly Jan: { readonly name: "January"; readonly num: 1; readonly twoDigitStr: "01"; }; readonly Feb: { readonly name: "February"; readonly num: 2; readonly twoDigitStr: "02"; }; readonly Mar: { readonly name: "March"; readonly num: 3; readonly twoDigitStr: "03"; }; readonly Apr: { readonly name: "April"; readonly num: 4; readonly twoDigitStr: "04"; }; readonly May: { readonly name: "May"; readonly num: 5; readonly twoDigitStr: "05"; }; readonly Jun: { readonly name: "June"; readonly num: 6; readonly twoDigitStr: "06"; }; readonly Jul: { readonly name: "July"; readonly num: 7; readonly twoDigitStr: "07"; }; readonly Aug: { readonly name: "August"; readonly num: 8; readonly twoDigitStr: "08"; }; readonly Sep: { readonly name: "September"; readonly num: 9; readonly twoDigitStr: "09"; }; readonly Oct: { readonly name: "October"; readonly num: 10; readonly twoDigitStr: "10"; }; readonly Nov: { readonly name: "November"; readonly num: 11; readonly twoDigitStr: "11"; }; readonly Dec: { readonly name: "December"; readonly num: 12; readonly twoDigitStr: "12"; }; }; /** the seasons in a year */ declare const SEASONS$2: readonly ["Summer", "Spring", "Fall", "Winter"]; type Season$1$1 = typeof SEASONS$2[number]; type MonthAbbr$1 = typeof MONTH_ABBR$2[number]; type Hemisphere$1$1 = "northern" | "southern"; /** * Maps each season to the months which represent that season (by * hemisphere). */ declare const MONTH_TO_SEASON_LOOKUP$2: Record>; declare const DATE_TYPE$2: readonly ["datetime", "date", "year-independent", "year-month", "year"]; /** * months with 30 days */ declare const ISO_DATE_30$2: readonly ["04", "06", "09", "11"]; //#endregion //#region ../constants/src/DoubleLeap_Typical.d.ts /** * Double Leap Years for modern times (1400-2300) */ declare const DOUBLE_LEAP_MODERN$2: readonly [1408, 1416, 1444, 1452, 1460, 1468, 1476, 1484, 1492, 1520, 1528, 1536, 1544, 1552, 1560, 1568, 1596, 1604, 1612, 1620, 1628, 1636, 1644, 1672, 1680, 1688, 1696, 1704, 1712, 1720, 1748, 1756, 1764, 1772, 1780, 1788, 1796, 1824, 1832, 1840, 1848, 1856, 1864, 1872, 1908, 1916, 1924, 1932, 1940, 1948, 1976, 1984, 1992, 2000, 2008, 2016, 2024, 2052, 2060, 2068, 2076, 2084, 2092, 2128, 2136, 2144, 2152, 2160, 2168, 2176, 2204, 2212, 2220, 2228, 2236, 2244, 2252, 2280, 2288, 2296]; //#endregion //#region ../constants/src/EscapeCodes.d.ts /** * Escape Code Characters * * Includes: * - `ESCAPE_CODE`, * - `BEL`, * - `NON_BREAKING_SPACE`, * - `LINE_FEED`, * - `FORM_FEED`, * - `HORIZONTAL_TAB`, * - `CARRIAGE_RETURN`, * - `FILE_SEPARATOR` * - `GROUP_SEPARATOR`, * - `RECORD_SEPARATOR`, * - `UNIT_SEPARATOR`, * - `NULL_CHAR`, * - Unicode _space_ characters with differing widths/behaviors * - _and more_ */ declare const ESCAPE_CODE_CHARS$2: ["\u001B", "\u0007", "\b", "\t", "\n", "\r", "\v", "\f", "\0", "", "\u001C", "\u001D", "\u001E", "\u001F", " ", " ", " ", " ", " ", " ", " "]; //#endregion //#region ../constants/src/Geo.d.ts declare const HEMISPHERE$2: readonly ["northern", "southern"]; /** * The 9 provinces to the US which are granted State codes. */ declare const US_STATE_LOOKUP_PROVINCES$2: readonly [{ readonly name: "Puerto Rico"; readonly abbrev: "PR"; }, { readonly name: "Virgin Islands"; readonly abbrev: "VI"; }, { readonly name: "Palau"; readonly abbrev: "PW"; }, { readonly name: "Federated States of Micronesia"; readonly abbrev: "FM"; }, { readonly name: "Northern Mariana Islands"; readonly abbrev: "MP"; }, { readonly name: "District of Columbia"; readonly abbrev: "DC"; }, { readonly name: "Marshall Islands"; readonly abbrev: "MH"; }, { readonly name: "American Samoa"; readonly abbrev: "AS"; }, { readonly name: "Guam"; readonly abbrev: "GU"; }]; /** * All 50 states and 9 provinces which have State abbreviations. * * Data format is: `[name, abbrev, flag]` where the boolean flag * indicates whether the line item is one of the 50 true states. */ declare const US_STATE_LOOKUP$2: readonly [{ readonly name: "Alabama"; readonly abbrev: "AL"; }, { readonly name: "Alaska"; readonly abbrev: "AK"; }, { readonly name: "Arizona"; readonly abbrev: "AZ"; }, { readonly name: "Arkansas"; readonly abbrev: "AR"; }, { readonly name: "California"; readonly abbrev: "CA"; }, { readonly name: "Colorado"; readonly abbrev: "CO"; }, { readonly name: "Connecticut"; readonly abbrev: "CT"; }, { readonly name: "Delaware"; readonly abbrev: "DE"; }, { readonly name: "Florida"; readonly abbrev: "FL"; }, { readonly name: "Georgia"; readonly abbrev: "GA"; }, { readonly name: "Hawaii"; readonly abbrev: "HI"; }, { readonly name: "Idaho"; readonly abbrev: "ID"; }, { readonly name: "Illinois"; readonly abbrev: "IL"; }, { readonly name: "Indiana"; readonly abbrev: "IN"; }, { readonly name: "Iowa"; readonly abbrev: "IA"; }, { readonly name: "Kansas"; readonly abbrev: "KS"; }, { readonly name: "Kentucky"; readonly abbrev: "KY"; }, { readonly name: "Louisiana"; readonly abbrev: "LA"; }, { readonly name: "Maine"; readonly abbrev: "ME"; }, { readonly name: "Maryland"; readonly abbrev: "MD"; }, { readonly name: "Massachusetts"; readonly abbrev: "MA"; }, { readonly name: "Michigan"; readonly abbrev: "MI"; }, { readonly name: "Minnesota"; readonly abbrev: "MN"; }, { readonly name: "Mississippi"; readonly abbrev: "MS"; }, { readonly name: "Missouri"; readonly abbrev: "MO"; }, { readonly name: "Montana"; readonly abbrev: "MT"; }, { readonly name: "Nebraska"; readonly abbrev: "NE"; }, { readonly name: "Nevada"; readonly abbrev: "NV"; }, { readonly name: "New Hampshire"; readonly abbrev: "NH"; }, { readonly name: "New Jersey"; readonly abbrev: "NJ"; }, { readonly name: "New Mexico"; readonly abbrev: "NM"; }, { readonly name: "New York"; readonly abbrev: "NY"; }, { readonly name: "North Carolina"; readonly abbrev: "NC"; }, { readonly name: "North Dakota"; readonly abbrev: "ND"; }, { readonly name: "Ohio"; readonly abbrev: "OH"; }, { readonly name: "Oklahoma"; readonly abbrev: "OK"; }, { readonly name: "Oregon"; readonly abbrev: "OR"; }, { readonly name: "Pennsylvania"; readonly abbrev: "PA"; }, { readonly name: "Rhode Island"; readonly abbrev: "RI"; }, { readonly name: "South Carolina"; readonly abbrev: "SC"; }, { readonly name: "South Dakota"; readonly abbrev: "SD"; }, { readonly name: "Tennessee"; readonly abbrev: "TN"; }, { readonly name: "Texas"; readonly abbrev: "TX"; }, { readonly name: "Utah"; readonly abbrev: "UT"; }, { readonly name: "Vermont"; readonly abbrev: "VT"; }, { readonly name: "Virginia"; readonly abbrev: "VA"; }, { readonly name: "Washington"; readonly abbrev: "WA"; }, { readonly name: "West Virginia"; readonly abbrev: "WV"; }, { readonly name: "Wisconsin"; readonly abbrev: "WI"; }, { readonly name: "Wyoming"; readonly abbrev: "WY"; }, { readonly name: "Puerto Rico"; readonly abbrev: "PR"; }, { readonly name: "Virgin Islands"; readonly abbrev: "VI"; }, { readonly name: "Palau"; readonly abbrev: "PW"; }, { readonly name: "Federated States of Micronesia"; readonly abbrev: "FM"; }, { readonly name: "Northern Mariana Islands"; readonly abbrev: "MP"; }, { readonly name: "District of Columbia"; readonly abbrev: "DC"; }, { readonly name: "Marshall Islands"; readonly abbrev: "MH"; }, { readonly name: "American Samoa"; readonly abbrev: "AS"; }, { readonly name: "Guam"; readonly abbrev: "GU"; }]; //#endregion //#region ../constants/src/HTML.d.ts /** * An array of all valid HTML tags that have both opening and closing tags. */ declare const HTML_BLOCK_TAGS$2: readonly ["a", "abbr", "address", "article", "aside", "b", "bdi", "bdo", "blockquote", "body", "button", "canvas", "caption", "cite", "code", "colgroup", "data", "datalist", "dd", "del", "details", "dfn", "dialog", "div", "dl", "dt", "em", "fieldset", "figcaption", "figure", "footer", "form", "h1", "h2", "h3", "h4", "h5", "h6", "head", "header", "html", "i", "iframe", "ins", "kbd", "label", "legend", "li", "main", "map", "mark", "menu", "meter", "nav", "noscript", "object", "ol", "optgroup", "option", "output", "p", "picture", "pre", "progress", "q", "rp", "rt", "ruby", "s", "samp", "script", "section", "select", "small", "span", "strong", "style", "sub", "summary", "sup", "svg", "table", "tbody", "td", "template", "textarea", "tfoot", "th", "thead", "time", "title", "tr", "u", "ul", "var", "video"]; /** * An array of all valid HTML tags that are self-closing (do not have closing tags). */ declare const HTML_ATOMIC_TAGS$2: readonly ["area", "base", "br", "col", "embed", "hr", "img", "input", "link", "meta", "param", "source", "track", "wbr"]; //#endregion //#region ../constants/src/ISO3166.d.ts /** * All country codes (name, alpha-2, country-code) */ declare const ISO3166_1$2: readonly [{ readonly name: "Afghanistan"; readonly alpha2: "AF"; readonly countryCode: "004"; readonly alpha3: "AFG"; }, { readonly name: "Albania"; readonly alpha2: "AL"; readonly countryCode: "008"; readonly alpha3: "ALB"; }, { readonly name: "Algeria"; readonly alpha2: "DZ"; readonly countryCode: "012"; readonly alpha3: "DZA"; }, { readonly name: "Andorra"; readonly alpha2: "AD"; readonly countryCode: "020"; readonly alpha3: "AND"; }, { readonly name: "Angola"; readonly alpha2: "AO"; readonly countryCode: "024"; readonly alpha3: "AGO"; }, { readonly name: "Argentina"; readonly alpha2: "AR"; readonly countryCode: "032"; readonly alpha3: "ARG"; }, { readonly name: "Australia"; readonly alpha2: "AU"; readonly countryCode: "036"; readonly alpha3: "AUS"; }, { readonly name: "Austria"; readonly alpha2: "AT"; readonly countryCode: "040"; readonly alpha3: "AUT"; }, { readonly name: "Azerbaijan"; readonly alpha2: "AZ"; readonly countryCode: "031"; readonly alpha3: "AZE"; }, { readonly name: "Bahamas"; readonly alpha2: "BS"; readonly countryCode: "044"; readonly alpha3: "BHS"; }, { readonly name: "Bangladesh"; readonly alpha2: "BD"; readonly countryCode: "050"; readonly alpha3: "BGD"; }, { readonly name: "Belgium"; readonly alpha2: "BE"; readonly countryCode: "056"; readonly alpha3: "BEL"; }, { readonly name: "Belize"; readonly alpha2: "BZ"; readonly countryCode: "084"; readonly alpha3: "BLZ"; }, { readonly name: "Benin"; readonly alpha2: "BJ"; readonly countryCode: "204"; readonly alpha3: "BEN"; }, { readonly name: "Bhutan"; readonly alpha2: "BT"; readonly countryCode: "064"; readonly alpha3: "BTN"; }, { readonly name: "Bolivia"; readonly alpha2: "BO"; readonly countryCode: "068"; readonly alpha3: "BOL"; }, { readonly name: "Bosnia and Herzegovina"; readonly alpha2: "BA"; readonly countryCode: "070"; readonly alpha3: "BIH"; }, { readonly name: "Botswana"; readonly alpha2: "BW"; readonly countryCode: "072"; readonly alpha3: "BWA"; }, { readonly name: "Brazil"; readonly alpha2: "BR"; readonly countryCode: "076"; readonly alpha3: "BRA"; }, { readonly name: "Brunei Darussalam"; readonly alpha2: "BN"; readonly countryCode: "096"; readonly alpha3: "BRN"; }, { readonly name: "Bulgaria"; readonly alpha2: "BG"; readonly countryCode: "100"; readonly alpha3: "BGR"; }, { readonly name: "Burkina Faso"; readonly alpha2: "BF"; readonly countryCode: "854"; readonly alpha3: "BFA"; }, { readonly name: "Burundi"; readonly alpha2: "BI"; readonly countryCode: "108"; readonly alpha3: "BDI"; }, { readonly name: "Cambodia"; readonly alpha2: "KH"; readonly countryCode: "116"; readonly alpha3: "KHM"; }, { readonly name: "Cameroon"; readonly alpha2: "CM"; readonly countryCode: "120"; readonly alpha3: "CMR"; }, { readonly name: "Canada"; readonly alpha2: "CA"; readonly countryCode: "124"; readonly alpha3: "CAN"; }, { readonly name: "Afghanistan"; readonly alpha2: "AF"; readonly countryCode: "004"; readonly alpha3: "AFG"; }, { readonly name: "Albania"; readonly alpha2: "AL"; readonly countryCode: "008"; readonly alpha3: "ALB"; }, { readonly name: "Algeria"; readonly alpha2: "DZ"; readonly countryCode: "012"; readonly alpha3: "DZA"; }, { readonly name: "Andorra"; readonly alpha2: "AD"; readonly countryCode: "020"; readonly alpha3: "AND"; }, { readonly name: "Angola"; readonly alpha2: "AO"; readonly countryCode: "024"; readonly alpha3: "AGO"; }, { readonly name: "Argentina"; readonly alpha2: "AR"; readonly countryCode: "032"; readonly alpha3: "ARG"; }, { readonly name: "Australia"; readonly alpha2: "AU"; readonly countryCode: "036"; readonly alpha3: "AUS"; }, { readonly name: "Austria"; readonly alpha2: "AT"; readonly countryCode: "040"; readonly alpha3: "AUT"; }, { readonly name: "Azerbaijan"; readonly alpha2: "AZ"; readonly countryCode: "031"; readonly alpha3: "AZE"; }, { readonly name: "Bahamas"; readonly alpha2: "BS"; readonly countryCode: "044"; readonly alpha3: "BHS"; }, { readonly name: "Bangladesh"; readonly alpha2: "BD"; readonly countryCode: "050"; readonly alpha3: "BGD"; }, { readonly name: "Belgium"; readonly alpha2: "BE"; readonly countryCode: "056"; readonly alpha3: "BEL"; }, { readonly name: "Belize"; readonly alpha2: "BZ"; readonly countryCode: "084"; readonly alpha3: "BLZ"; }, { readonly name: "Benin"; readonly alpha2: "BJ"; readonly countryCode: "204"; readonly alpha3: "BEN"; }, { readonly name: "Bhutan"; readonly alpha2: "BT"; readonly countryCode: "064"; readonly alpha3: "BTN"; }, { readonly name: "Bolivia"; readonly alpha2: "BO"; readonly countryCode: "068"; readonly alpha3: "BOL"; }, { readonly name: "Bosnia and Herzegovina"; readonly alpha2: "BA"; readonly countryCode: "070"; readonly alpha3: "BIH"; }, { readonly name: "Botswana"; readonly alpha2: "BW"; readonly countryCode: "072"; readonly alpha3: "BWA"; }, { readonly name: "Brazil"; readonly alpha2: "BR"; readonly countryCode: "076"; readonly alpha3: "BRA"; }, { readonly name: "Brunei Darussalam"; readonly alpha2: "BN"; readonly countryCode: "096"; readonly alpha3: "BRN"; }, { readonly name: "Bulgaria"; readonly alpha2: "BG"; readonly countryCode: "100"; readonly alpha3: "BGR"; }, { readonly name: "Burkina Faso"; readonly alpha2: "BF"; readonly countryCode: "854"; readonly alpha3: "BFA"; }, { readonly name: "Burundi"; readonly alpha2: "BI"; readonly countryCode: "108"; readonly alpha3: "BDI"; }, { readonly name: "Cambodia"; readonly alpha2: "KH"; readonly countryCode: "116"; readonly alpha3: "KHM"; }, { readonly name: "Cameroon"; readonly alpha2: "CM"; readonly countryCode: "120"; readonly alpha3: "CMR"; }, { readonly name: "Canada"; readonly alpha2: "CA"; readonly countryCode: "124"; readonly alpha3: "CAN"; }, { readonly name: "Maldives"; readonly alpha2: "MV"; readonly countryCode: "462"; readonly alpha3: "MDV"; }, { readonly name: "Mali"; readonly alpha2: "ML"; readonly countryCode: "466"; readonly alpha3: "MLI"; }, { readonly name: "Malta"; readonly alpha2: "MT"; readonly countryCode: "470"; readonly alpha3: "MLT"; }, { readonly name: "Marshall Islands"; readonly alpha2: "MH"; readonly countryCode: "584"; readonly alpha3: "MHL"; }, { readonly name: "Mauritania"; readonly alpha2: "MR"; readonly countryCode: "478"; readonly alpha3: "MRT"; }, { readonly name: "Mauritius"; readonly alpha2: "MU"; readonly countryCode: "480"; readonly alpha3: "MUS"; }, { readonly name: "Mexico"; readonly alpha2: "MX"; readonly countryCode: "484"; readonly alpha3: "MEX"; }, { readonly name: "Micronesia (Federated States of)"; readonly alpha2: "FM"; readonly countryCode: "583"; readonly alpha3: "FSM"; }, { readonly name: "Moldova (Republic of)"; readonly alpha2: "MD"; readonly countryCode: "498"; readonly alpha3: "MDA"; }, { readonly name: "Monaco"; readonly alpha2: "MC"; readonly countryCode: "492"; readonly alpha3: "MCO"; }, { readonly name: "Mongolia"; readonly alpha2: "MN"; readonly countryCode: "496"; readonly alpha3: "MNG"; }, { readonly name: "Montenegro"; readonly alpha2: "ME"; readonly countryCode: "499"; readonly alpha3: "MNE"; }, { readonly name: "Morocco"; readonly alpha2: "MA"; readonly countryCode: "504"; readonly alpha3: "MAR"; }, { readonly name: "Mozambique"; readonly alpha2: "MZ"; readonly countryCode: "508"; readonly alpha3: "MOZ"; }, { readonly name: "Myanmar"; readonly alpha2: "MM"; readonly countryCode: "104"; readonly alpha3: "MMR"; }, { readonly name: "Namibia"; readonly alpha2: "NA"; readonly countryCode: "516"; readonly alpha3: "NAM"; }, { readonly name: "Nauru"; readonly alpha2: "NR"; readonly countryCode: "520"; readonly alpha3: "NRU"; }, { readonly name: "Nepal"; readonly alpha2: "NP"; readonly countryCode: "524"; readonly alpha3: "NPL"; }, { readonly name: "Netherlands"; readonly alpha2: "NL"; readonly countryCode: "528"; readonly alpha3: "NLD"; }, { readonly name: "New Zealand"; readonly alpha2: "NZ"; readonly countryCode: "554"; readonly alpha3: "NZL"; }, { readonly name: "Nicaragua"; readonly alpha2: "NI"; readonly countryCode: "558"; readonly alpha3: "NIC"; }, { readonly name: "Niger"; readonly alpha2: "NE"; readonly countryCode: "562"; readonly alpha3: "NER"; }, { readonly name: "Nigeria"; readonly alpha2: "NG"; readonly countryCode: "566"; readonly alpha3: "NGA"; }, { readonly name: "North Macedonia"; readonly alpha2: "MK"; readonly countryCode: "807"; readonly alpha3: "MKD"; }, { readonly name: "Norway"; readonly alpha2: "NO"; readonly countryCode: "578"; readonly alpha3: "NOR"; }, { readonly name: "Oman"; readonly alpha2: "OM"; readonly countryCode: "512"; readonly alpha3: "OMN"; }, { readonly name: "Pakistan"; readonly alpha2: "PK"; readonly countryCode: "586"; readonly alpha3: "PAK"; }, { readonly name: "Palau"; readonly alpha2: "PW"; readonly countryCode: "585"; readonly alpha3: "PLW"; }, { readonly name: "Panama"; readonly alpha2: "PA"; readonly countryCode: "591"; readonly alpha3: "PAN"; }, { readonly name: "Papua New Guinea"; readonly alpha2: "PG"; readonly countryCode: "598"; readonly alpha3: "PNG"; }, { readonly name: "Paraguay"; readonly alpha2: "PY"; readonly countryCode: "600"; readonly alpha3: "PRY"; }, { readonly name: "Peru"; readonly alpha2: "PE"; readonly countryCode: "604"; readonly alpha3: "PER"; }, { readonly name: "Philippines"; readonly alpha2: "PH"; readonly countryCode: "608"; readonly alpha3: "PHL"; }, { readonly name: "Poland"; readonly alpha2: "PL"; readonly countryCode: "616"; readonly alpha3: "POL"; }, { readonly name: "Portugal"; readonly alpha2: "PT"; readonly countryCode: "620"; readonly alpha3: "PRT"; }, { readonly name: "Qatar"; readonly alpha2: "QA"; readonly countryCode: "634"; readonly alpha3: "QAT"; }, { readonly name: "Romania"; readonly alpha2: "RO"; readonly countryCode: "642"; readonly alpha3: "ROU"; }, { readonly name: "Russian Federation"; readonly alpha2: "RU"; readonly countryCode: "643"; readonly alpha3: "RUS"; }, { readonly name: "Rwanda"; readonly alpha2: "RW"; readonly countryCode: "646"; readonly alpha3: "RWA"; }, { readonly name: "Saint Kitts and Nevis"; readonly alpha2: "KN"; readonly countryCode: "659"; readonly alpha3: "KNA"; }, { readonly name: "Saint Lucia"; readonly alpha2: "LC"; readonly countryCode: "662"; readonly alpha3: "LCA"; }, { readonly name: "Saint Vincent and the Grenadines"; readonly alpha2: "VC"; readonly countryCode: "670"; readonly alpha3: "VCT"; }, { readonly name: "Samoa"; readonly alpha2: "WS"; readonly countryCode: "882"; readonly alpha3: "WSM"; }, { readonly name: "San Marino"; readonly alpha2: "SM"; readonly countryCode: "674"; readonly alpha3: "SMR"; }, { readonly name: "Sao Tome and Principe"; readonly alpha2: "ST"; readonly countryCode: "678"; readonly alpha3: "STP"; }, { readonly name: "Saudi Arabia"; readonly alpha2: "SA"; readonly countryCode: "682"; readonly alpha3: "SAU"; }, { readonly name: "Senegal"; readonly alpha2: "SN"; readonly countryCode: "686"; readonly alpha3: "SEN"; }, { readonly name: "Serbia"; readonly alpha2: "RS"; readonly countryCode: "688"; readonly alpha3: "SRB"; }, { readonly name: "Seychelles"; readonly alpha2: "SC"; readonly countryCode: "690"; readonly alpha3: "SYC"; }, { readonly name: "Sierra Leone"; readonly alpha2: "SL"; readonly countryCode: "694"; readonly alpha3: "SLE"; }, { readonly name: "Singapore"; readonly alpha2: "SG"; readonly countryCode: "702"; readonly alpha3: "SGP"; }, { readonly name: "Slovakia"; readonly alpha2: "SK"; readonly countryCode: "703"; readonly alpha3: "SVK"; }, { readonly name: "Slovenia"; readonly alpha2: "SI"; readonly countryCode: "705"; readonly alpha3: "SVN"; }, { readonly name: "Solomon Islands"; readonly alpha2: "SB"; readonly countryCode: "090"; readonly alpha3: "SLB"; }, { readonly name: "Somalia"; readonly alpha2: "SO"; readonly countryCode: "706"; readonly alpha3: "SOM"; }, { readonly name: "South Africa"; readonly alpha2: "ZA"; readonly countryCode: "710"; readonly alpha3: "ZAF"; }, { readonly name: "South Sudan"; readonly alpha2: "SS"; readonly countryCode: "728"; readonly alpha3: "SSD"; }, { readonly name: "Spain"; readonly alpha2: "ES"; readonly countryCode: "724"; readonly alpha3: "ESP"; }, { readonly name: "Sri Lanka"; readonly alpha2: "LK"; readonly countryCode: "144"; readonly alpha3: "LKA"; }, { readonly name: "Sudan"; readonly alpha2: "SD"; readonly countryCode: "729"; readonly alpha3: "SDN"; }, { readonly name: "Suriname"; readonly alpha2: "SR"; readonly countryCode: "740"; readonly alpha3: "SUR"; }, { readonly name: "Sweden"; readonly alpha2: "SE"; readonly countryCode: "752"; readonly alpha3: "SWE"; }, { readonly name: "Switzerland"; readonly alpha2: "CH"; readonly countryCode: "756"; readonly alpha3: "CHE"; }, { readonly name: "Syrian Arab Republic"; readonly alpha2: "SY"; readonly countryCode: "760"; readonly alpha3: "SYR"; }, { readonly name: "Taiwan"; readonly alpha2: "TW"; readonly countryCode: "158"; readonly alpha3: "TWN"; }, { readonly name: "Tajikistan"; readonly alpha2: "TJ"; readonly countryCode: "762"; readonly alpha3: "TJK"; }, { readonly name: "Tanzania"; readonly alpha2: "TZ"; readonly countryCode: "834"; readonly alpha3: "TZA"; }, { readonly name: "Thailand"; readonly alpha2: "TH"; readonly countryCode: "764"; readonly alpha3: "THA"; }, { readonly name: "Timor-Leste"; readonly alpha2: "TL"; readonly countryCode: "626"; readonly alpha3: "TLS"; }, { readonly name: "Togo"; readonly alpha2: "TG"; readonly countryCode: "768"; readonly alpha3: "TGO"; }, { readonly name: "Tonga"; readonly alpha2: "TO"; readonly countryCode: "776"; readonly alpha3: "TON"; }, { readonly name: "Tonga"; readonly alpha2: "TO"; readonly countryCode: "776"; readonly alpha3: "TON"; }, { readonly name: "Trinidad and Tobago"; readonly alpha2: "TT"; readonly countryCode: "780"; readonly alpha3: "TTO"; }, { readonly name: "Tunisia"; readonly alpha2: "TN"; readonly countryCode: "788"; readonly alpha3: "TUN"; }, { readonly name: "Turkey"; readonly alpha2: "TR"; readonly countryCode: "792"; readonly alpha3: "TUR"; }, { readonly name: "Turkmenistan"; readonly alpha2: "TM"; readonly countryCode: "795"; readonly alpha3: "TKM"; }, { readonly name: "Tuvalu"; readonly alpha2: "TV"; readonly countryCode: "798"; readonly alpha3: "TUV"; }, { readonly name: "Uganda"; readonly alpha2: "UG"; readonly countryCode: "800"; readonly alpha3: "UGA"; }, { readonly name: "Ukraine"; readonly alpha2: "UA"; readonly countryCode: "804"; readonly alpha3: "UKR"; }, { readonly name: "United Arab Emirates"; readonly alpha2: "AE"; readonly countryCode: "784"; readonly alpha3: "ARE"; }, { readonly name: "United Kingdom"; readonly alpha2: "GB"; readonly countryCode: "826"; readonly alpha3: "GBR"; }, { readonly name: "United States of America"; readonly alpha2: "US"; readonly countryCode: "840"; readonly alpha3: "USA"; }, { readonly name: "Uruguay"; readonly alpha2: "UY"; readonly countryCode: "858"; readonly alpha3: "URY"; }, { readonly name: "Uzbekistan"; readonly alpha2: "UZ"; readonly countryCode: "860"; readonly alpha3: "UZB"; }, { readonly name: "Vanuatu"; readonly alpha2: "VU"; readonly countryCode: "548"; readonly alpha3: "VUT"; }, { readonly name: "Venezuela"; readonly alpha2: "VE"; readonly countryCode: "862"; readonly alpha3: "VEN"; }, { readonly name: "Viet Nam"; readonly alpha2: "VN"; readonly countryCode: "704"; readonly alpha3: "VNM"; }, { readonly name: "Yemen"; readonly alpha2: "YE"; readonly countryCode: "887"; readonly alpha3: "YEM"; }, { readonly name: "Zambia"; readonly alpha2: "ZM"; readonly countryCode: "894"; readonly alpha3: "ZMB"; }, { readonly name: "Zimbabwe"; readonly alpha2: "ZW"; readonly countryCode: "716"; readonly alpha3: "ZWE"; }]; //#endregion //#region ../constants/src/Marked.d.ts declare const MARKED$2: Constant$2<"Marked", unknown>; /** * **Marked** * * A constant that indicates that an item has been marked for * some ongoing operation. */ type Marked$2$2 = typeof MARKED$2; //#endregion //#region ../constants/src/Metrics.d.ts declare const DISTANCE_METRICS_LOOKUP$2: readonly [{ readonly abbrev: "km"; readonly name: "kilometer"; }, { readonly abbrev: "mi"; readonly name: "mile"; }, { readonly abbrev: "mm"; readonly name: "millimeter"; }, { readonly abbrev: "cm"; readonly name: "centimeter"; }, { readonly abbrev: "yd"; readonly name: "yard"; }, { readonly abbrev: "ft"; readonly name: "foot"; }, { readonly abbrev: "in"; readonly name: "inch"; }, { readonly abbrev: "m"; readonly name: "meter"; }, { readonly abbrev: "nm"; readonly name: "nautical mile"; }, { readonly abbrev: "nmi"; readonly name: "nanometer"; }, { readonly abbrev: "µm"; readonly name: "micrometer"; }, { readonly abbrev: "dm"; readonly name: "decimeter"; }, { readonly abbrev: "AU"; readonly name: "astronomical unit"; }, { readonly abbrev: "ly"; readonly name: "light year"; }, { readonly abbrev: "pc"; readonly name: "parsec"; }]; declare const MASS_METRICS_LOOKUP$2: readonly [{ readonly abbrev: "g"; readonly name: "gram"; }, { readonly abbrev: "kg"; readonly name: "kilogram"; }, { readonly abbrev: "mg"; readonly name: "milligram"; }, { readonly abbrev: "µg"; readonly name: "microgram"; }, { readonly abbrev: "t"; readonly name: "tonne"; }, { readonly abbrev: "lb"; readonly name: "pound"; }, { readonly abbrev: "oz"; readonly name: "ounce"; }, { readonly abbrev: "st"; readonly name: "stone"; }, { readonly abbrev: "ct"; readonly name: "carat"; }, { readonly abbrev: "Mt"; readonly name: "megatonne"; }, { readonly abbrev: "gt"; readonly name: "gigatonne"; }, { readonly abbrev: "slug"; readonly name: "slug"; }, { readonly abbrev: "dr"; readonly name: "dram"; }, { readonly abbrev: "gr"; readonly name: "grain"; }, { readonly abbrev: "q"; readonly name: "quintal"; }]; declare const SPEED_METRICS_LOOKUP$2: readonly [{ readonly abbrev: "m/s"; readonly name: "meters per second"; }, { readonly abbrev: "km/h"; readonly name: "kilometers per hour"; }, { readonly abbrev: "mph"; readonly name: "miles per hour"; }, { readonly abbrev: "kn"; readonly name: "knot"; }, { readonly abbrev: "ft/s"; readonly name: "feet per second"; }, { readonly abbrev: "c"; readonly name: "speed of light"; }, { readonly abbrev: "mach"; readonly name: "mach"; }, { readonly abbrev: "cm/s"; readonly name: "centimeters per second"; }, { readonly abbrev: "in/s"; readonly name: "inches per second"; }, { readonly abbrev: "ly/y"; readonly name: "light years per year"; }]; declare const ACCELERATION_METRICS_LOOKUP$2: readonly [{ readonly abbrev: "m/s²"; readonly name: "meters per second squared"; }, { readonly abbrev: "ft/s²"; readonly name: "feet per second squared"; }, { readonly abbrev: "g"; readonly name: "g-force"; }, { readonly abbrev: "Gal"; readonly name: "galileo"; }, { readonly abbrev: "cm/s²"; readonly name: "centimeters per second squared"; }, { readonly abbrev: "km/h²"; readonly name: "kilometers per hour squared"; }, { readonly abbrev: "in/s²"; readonly name: "inches per second squared"; }, { readonly abbrev: "mi/h²"; readonly name: "miles per hour squared"; }, { readonly abbrev: "kn/s²"; readonly name: "knots per second squared"; }]; declare const VOLUME_METRICS_LOOKUP$2: readonly [{ readonly abbrev: "L"; readonly name: "liter"; }, { readonly abbrev: "dL"; readonly name: "deciliter"; }, { readonly abbrev: "mL"; readonly name: "milliliter"; }, { readonly abbrev: "µL"; readonly name: "microliter"; }, { readonly abbrev: "cm³"; readonly name: "cubic centimeter"; }, { readonly abbrev: "m³"; readonly name: "cubic meter"; }, { readonly abbrev: "ft³"; readonly name: "cubic foot"; }, { readonly abbrev: "in³"; readonly name: "cubic inch"; }, { readonly abbrev: "gallon"; readonly name: "gallon"; }, { readonly abbrev: "qt"; readonly name: "quart"; }, { readonly abbrev: "pt"; readonly name: "pint"; }, { readonly abbrev: "fl oz"; readonly name: "fluid ounce"; }, { readonly abbrev: "barrel"; readonly name: "barrel"; }, { readonly abbrev: "tbsp"; readonly name: "tablespoon"; }, { readonly abbrev: "tsp"; readonly name: "teaspoon"; }]; declare const TEMPERATURE_METRICS_LOOKUP$2: readonly [{ readonly abbrev: "°C"; readonly name: "celsius"; }, { readonly abbrev: "°F"; readonly name: "fahrenheit"; }, { readonly abbrev: "K"; readonly name: "kelvin"; }]; declare const PRESSURE_METRICS_LOOKUP$2: readonly [{ readonly abbrev: "Pa"; readonly name: "pascal"; }, { readonly abbrev: "bar"; readonly name: "bar"; }, { readonly abbrev: "atm"; readonly name: "atmosphere"; }, { readonly abbrev: "mmHg"; readonly name: "millimeters of mercury"; }, { readonly abbrev: "psi"; readonly name: "pounds per square inch"; }]; declare const ENERGY_METRICS_LOOKUP$2: readonly [{ readonly abbrev: "J"; readonly name: "joule"; }, { readonly abbrev: "cal"; readonly name: "calorie"; }, { readonly abbrev: "kcal"; readonly name: "kilocalorie"; }, { readonly abbrev: "kWh"; readonly name: "kilowatt-hour"; }, { readonly abbrev: "BTU"; readonly name: "british thermal unit"; }, { readonly abbrev: "eV"; readonly name: "electronvolt"; }]; declare const TIME_METRICS_LOOKUP$2: readonly [{ readonly abbrev: "s"; readonly name: "second"; }, { readonly abbrev: "m"; readonly name: "minute"; }, { readonly abbrev: "h"; readonly name: "hour"; }, { readonly abbrev: "day"; readonly name: "day"; }, { readonly abbrev: "week"; readonly name: "week"; }, { readonly abbrev: "mo"; readonly name: "month"; }, { readonly abbrev: "ms"; readonly name: "millisecond"; }, { readonly abbrev: "µs"; readonly name: "microsecond"; }, { readonly abbrev: "ns"; readonly name: "nanosecond"; }]; declare const POWER_METRICS_LOOKUP$2: readonly [{ readonly abbrev: "W"; readonly name: "Watt"; }, { readonly abbrev: "kW"; readonly name: "kilowatt"; }, { readonly abbrev: "MW"; readonly name: "megawatt"; }, { readonly abbrev: "hp"; readonly name: "horsepower"; }, { readonly abbrev: "GW"; readonly name: "gigawatt"; }]; declare const FREQUENCY_METRICS_LOOKUP$2: readonly [{ readonly abbrev: "Hz"; readonly name: "hertz"; }, { readonly abbrev: "kHz"; readonly name: "kilohertz"; }, { readonly abbrev: "MHz"; readonly name: "megahertz"; }, { readonly abbrev: "GHz"; readonly name: "gigahertz"; }, { readonly abbrev: "THz"; readonly name: "terahertz"; }]; declare const VOLTAGE_METRICS_LOOKUP$2: readonly [{ readonly abbrev: "V"; readonly name: "volt"; }, { readonly abbrev: "kV"; readonly name: "kilovolt"; }, { readonly abbrev: "mV"; readonly name: "millivolt"; }, { readonly abbrev: "µV"; readonly name: "microvolt"; }]; declare const CURRENT_METRICS_LOOKUP$2: readonly [{ readonly abbrev: "A"; readonly name: "ampere"; }, { readonly abbrev: "mA"; readonly name: "milliampere"; }, { readonly abbrev: "µA"; readonly name: "microampere"; }, { readonly abbrev: "kA"; readonly name: "kiloampere"; }]; declare const RESISTANCE_METRICS_LOOKUP$2: readonly [{ readonly abbrev: "Ω"; readonly name: "ohm"; }, { readonly abbrev: "kΩ"; readonly name: "kiloohm"; }, { readonly abbrev: "MΩ"; readonly name: "megaohm"; }]; declare const LUMINOSITY_METRICS_LOOKUP$2: readonly [{ readonly abbrev: "cd"; readonly name: "candela"; }, { readonly abbrev: "lm"; readonly name: "lumen"; }, { readonly abbrev: "lx"; readonly name: "lux"; }]; declare const AREA_METRICS_LOOKUP$2: readonly [{ readonly abbrev: "m²"; readonly name: "square meter"; }, { readonly abbrev: "cm²"; readonly name: "square centimeter"; }, { readonly abbrev: "mm²"; readonly name: "square millimeter"; }, { readonly abbrev: "km²"; readonly name: "square kilometer"; }, { readonly abbrev: "ft²"; readonly name: "square foot"; }, { readonly abbrev: "in²"; readonly name: "square inch"; }, { readonly abbrev: "acre"; readonly name: "acre"; }, { readonly abbrev: "ha"; readonly name: "hectare"; }]; //#endregion //#region ../constants/src/Nesting.d.ts /** * the named nested configuration defined in this repo */ declare const KNOWN_NESTING_CONFIGURATIONS$2: ["brackets", "quotes", "brackets-and-quotes", "shallow-brackets", "shallow-brackets-and-quotes", "shallow-quotes"]; /** * A paired bracketing strategy which matches on * bracket characters: * * - parenthesis: `(` -> `)` * - square brackets: `[` -> `]` * - angle brackets: `<` -> `>` * - and curlies: `{` -> `}` */ declare const BRACKET_NESTING$2: { "{": "}"; "[": "]"; "<": ">"; "(": ")"; }; /** * A paired bracketing strategy which includes the three * main quotation symbols: * * - single quote (**'**), * - double quote (**"**), * - and backtick (**`**) */ declare const QUOTE_NESTING$2: { "\"": "\""; "'": "'"; "`": "`"; }; /** * A paired bracketing strategy which includes: * * - all bracket characters * - all quote characters */ declare const BRACKET_AND_QUOTE_NESTING$2: { "\"": "\""; "'": "'"; "`": "`"; "{": "}"; "[": "]"; "<": ">"; "(": ")"; }; /** * **Shallow Bracket Nesting** * * A hierarchical nesting configuration where bracket characters * are recognized at level 0, but inside brackets no further * nesting is recognized (empty config `{}`). * * This prevents "unbalanced" errors in utilities that only * care about the root level. */ declare const SHALLOW_BRACKET_NESTING$2: { "(": { exit: ")"; children: {}; }; "[": { exit: "]"; children: {}; }; "{": { exit: "}"; children: {}; }; "<": { exit: ">"; children: {}; }; }; /** * **Shallow Quote Nesting** * * A hierarchical nesting configuration where quote characters * are recognized at level 0, but inside quotes no further * nesting is recognized (empty config `{}`). * * This allows treating quoted content as literals, preventing * split characters inside quotes from being recognized. */ declare const SHALLOW_QUOTE_NESTING$2: { "\"": { exit: "\""; children: {}; }; "'": { exit: "'"; children: {}; }; "`": { exit: "`"; children: {}; }; }; /** * **Shallow Bracket and Quote Nesting** * * Combines shallow bracket and quote nesting strategies. * Both brackets and quotes are recognized at level 0, but * inside either, no further nesting is recognized. */ declare const SHALLOW_BRACKET_AND_QUOTE_NESTING$2: { "\"": { exit: "\""; children: {}; }; "'": { exit: "'"; children: {}; }; "`": { exit: "`"; children: {}; }; "(": { exit: ")"; children: {}; }; "[": { exit: "]"; children: {}; }; "{": { exit: "}"; children: {}; }; "<": { exit: ">"; children: {}; }; }; //#endregion //#region ../constants/src/NetworkConstants.d.ts declare const NETWORK_PROTOCOL$2: readonly ["http", "ftp", "ws", "dns", "telnet", "imap", "pop3", "smtp", "https", "sftp", "wss", "sdns", "ssh"]; declare const PROTOCOL_DEFAULT_PORTS$2: { readonly http: 80; readonly https: 443; readonly ws: 80; readonly wss: 443; readonly ssh: 22; readonly telnet: 23; readonly dns: 53; readonly sdns: 853; readonly smtp: 25; readonly imap: 142; readonly pop3: 110; readonly ftp: 21; readonly sftp: 22; }; //#endregion //#region ../constants/src/News.d.ts declare const US_NEWS$2: readonly [{ readonly company: "New York Times"; readonly baseUrls: readonly ["www.nytimes.com"]; }, { readonly company: "CNN"; readonly baseUrls: readonly ["www.cnn.com"]; }, { readonly company: "Fox News"; readonly baseUrls: readonly ["www.foxnews.com"]; }, { readonly company: "NBC News"; readonly baseUrls: readonly ["www.nbcnews.com", "www.msnbc.com"]; }, { readonly company: "ABC News"; readonly baseUrls: readonly ["abcnews.go.com"]; }, { readonly company: "The Washington Post"; readonly baseUrls: readonly ["www.washingtonpost.com"]; }, { readonly company: "USA Today"; readonly baseUrls: readonly ["www.usatoday.com"]; }, { readonly company: "Bloomberg"; readonly baseUrls: readonly ["www.bloomberg.com"]; }, { readonly company: "NPR"; readonly baseUrls: readonly ["www.npr.org"]; }, { readonly company: "CBS News"; readonly baseUrls: readonly ["www.cbsnews.com"]; }, { readonly company: "The Wall Street Journal"; readonly baseUrls: readonly ["www.wsj.com"]; }, { readonly company: "Associated Press (AP)"; readonly baseUrls: readonly ["www.apnews.com", "www.ap.org"]; }, { readonly company: "Reuters"; readonly baseUrls: readonly ["www.reuters.com"]; }, { readonly company: "Newsweek"; readonly baseUrls: readonly ["www.newsweek.com"]; }, { readonly company: "Politico"; readonly baseUrls: readonly ["www.politico.com"]; }, { readonly company: "The Atlantic"; readonly baseUrls: readonly ["www.theatlantic.com"]; }, { readonly company: "Nexstar Media Group"; readonly baseUrls: readonly ["www.nexstar.tv"]; }, { readonly company: "PBS News"; readonly baseUrls: readonly ["www.pbs.org"]; }, { readonly company: "HuffPost"; readonly baseUrls: readonly ["www.huffpost.com"]; }, { readonly company: "The Boston Globe"; readonly baseUrls: readonly ["www.bostonglobe.com"]; }]; declare const UK_NEWS$2: readonly [{ readonly company: "BBC"; readonly baseUrls: readonly ["www.bbc.co.uk", "www.bbc.com"]; }, { readonly company: "The Guardian"; readonly baseUrls: readonly ["www.theguardian.com/uk"]; }, { readonly company: "The Daily Mail"; readonly baseUrls: readonly ["www.dailymail.co.uk"]; }, { readonly company: "The Sun"; readonly baseUrls: readonly ["www.thesun.co.uk"]; }, { readonly company: "The Times"; readonly baseUrls: readonly ["www.thetimes.co.uk"]; }, { readonly company: "Sky News"; readonly baseUrls: readonly ["news.sky.com"]; }, { readonly company: "The Telegraph"; readonly baseUrls: readonly ["www.telegraph.co.uk"]; }, { readonly company: "ITV News"; readonly baseUrls: readonly ["www.itv.com/news"]; }, { readonly company: "Financial Times"; readonly baseUrls: readonly ["www.ft.com"]; }, { readonly company: "Metro"; readonly baseUrls: readonly ["www.metro.co.uk"]; }, { readonly company: "The Independent"; readonly baseUrls: readonly ["www.independent.co.uk"]; }, { readonly company: "Evening Standard"; readonly baseUrls: readonly ["www.standard.co.uk"]; }, { readonly company: "Daily Mirror"; readonly baseUrls: readonly ["www.mirror.co.uk"]; }, { readonly company: "Channel 4 News"; readonly baseUrls: readonly ["www.channel4.com/news"]; }, { readonly company: "LBC"; readonly baseUrls: readonly ["www.lbc.co.uk"]; }, { readonly company: "Daily Express"; readonly baseUrls: readonly ["www.express.co.uk"]; }, { readonly company: "Birmingham Mail"; readonly baseUrls: readonly ["www.birminghammail.co.uk"]; }, { readonly company: "Manchester Evening News"; readonly baseUrls: readonly ["www.manchestereveningnews.co.uk"]; }, { readonly company: "The Scotsman"; readonly baseUrls: readonly ["www.scotsman.com"]; }, { readonly company: "Daily Record"; readonly baseUrls: readonly ["www.dailyrecord.co.uk"]; }]; declare const GERMAN_NEWS$2: readonly [{ readonly company: "BILD"; readonly baseUrls: readonly ["www.bild.de"]; }, { readonly company: "Die Zeit"; readonly baseUrls: readonly ["www.zeit.de"]; }, { readonly company: "Frankfurter Allgemeine Zeitung"; readonly baseUrls: readonly ["www.faz.net"]; }, { readonly company: "Süddeutsche Zeitung"; readonly baseUrls: readonly ["www.sueddeutsche.de"]; }, { readonly company: "Der Spiegel"; readonly baseUrls: readonly ["www.spiegel.de"]; }, { readonly company: "Die Welt"; readonly baseUrls: readonly ["www.welt.de"]; }, { readonly company: "Tagesschau"; readonly baseUrls: readonly ["www.tagesschau.de"]; }, { readonly company: "t-online"; readonly baseUrls: readonly ["www.t-online.de"]; }, { readonly company: "n-tv"; readonly baseUrls: readonly ["www.n-tv.de"]; }, { readonly company: "Handelsblatt"; readonly baseUrls: readonly ["www.handelsblatt.com"]; }, { readonly company: "Focus Online"; readonly baseUrls: readonly ["www.focus.de"]; }, { readonly company: "Frankfurter Rundschau"; readonly baseUrls: readonly ["www.fr.de", "www.fr-online.de"]; }, { readonly company: "taz - die tageszeitung"; readonly baseUrls: readonly ["www.taz.de"]; }, { readonly company: "Der Tagesspiegel"; readonly baseUrls: readonly ["www.tagesspiegel.de"]; }, { readonly company: "Rheinische Post"; readonly baseUrls: readonly ["www.rp-online.de"]; }, { readonly company: "Express"; readonly baseUrls: readonly ["www.express.de"]; }, { readonly company: "Münchner Merkur"; readonly baseUrls: readonly ["www.merkur.de"]; }, { readonly company: "Stuttgarter Zeitung"; readonly baseUrls: readonly ["www.stuttgarter-zeitung.de"]; }, { readonly company: "Hamburger Abendblatt"; readonly baseUrls: readonly ["www.abendblatt.de"]; }, { readonly company: "Deutsche Welle"; readonly baseUrls: readonly ["www.dw.com"]; }]; declare const FRENCH_NEWS$2: readonly [{ readonly company: "Le Figaro"; readonly baseUrls: readonly ["www.lefigaro.fr"]; }, { readonly company: "Le Monde"; readonly baseUrls: readonly ["www.lemonde.fr"]; }, { readonly company: "France 24"; readonly baseUrls: readonly ["www.france24.com"]; }, { readonly company: "Libération"; readonly baseUrls: readonly ["www.liberation.fr"]; }, { readonly company: "Les Echos"; readonly baseUrls: readonly ["www.lesechos.fr"]; }, { readonly company: "Ouest-France"; readonly baseUrls: readonly ["www.ouest-france.fr"]; }, { readonly company: "Le Parisien"; readonly baseUrls: readonly ["www.leparisien.fr"]; }, { readonly company: "Mediapart"; readonly baseUrls: readonly ["www.mediapart.fr"]; }, { readonly company: "L'Express"; readonly baseUrls: readonly ["www.lexpress.fr"]; }, { readonly company: "La Croix"; readonly baseUrls: readonly ["www.la-croix.com"]; }, { readonly company: "20 Minutes"; readonly baseUrls: readonly ["www.20minutes.fr"]; }, { readonly company: "Courrier International"; readonly baseUrls: readonly ["www.courrierinternational.com"]; }, { readonly company: "Le Point"; readonly baseUrls: readonly ["www.lepoint.fr"]; }, { readonly company: "Marianne"; readonly baseUrls: readonly ["www.marianne.net"]; }, { readonly company: "BFM TV"; readonly baseUrls: readonly ["www.bfmtv.com"]; }, { readonly company: "RTL France"; readonly baseUrls: readonly ["www.rtl.fr"]; }, { readonly company: "Charlie Hebdo"; readonly baseUrls: readonly ["www.charliehebdo.fr"]; }, { readonly company: "Challenges"; readonly baseUrls: readonly ["www.challenges.fr"]; }, { readonly company: "Télérama"; readonly baseUrls: readonly ["www.telerama.fr"]; }, { readonly company: "L'Obs"; readonly baseUrls: readonly ["www.nouvelobs.com"]; }]; declare const CANADIAN_NEWS$2: readonly [{ readonly company: "CBC News"; readonly baseUrls: readonly ["www.cbc.ca"]; }, { readonly company: "CTV News"; readonly baseUrls: readonly ["www.ctvnews.ca"]; }, { readonly company: "The Globe and Mail"; readonly baseUrls: readonly ["www.theglobeandmail.com"]; }, { readonly company: "Global News"; readonly baseUrls: readonly ["www.globalnews.ca"]; }, { readonly company: "Toronto Star"; readonly baseUrls: readonly ["www.thestar.com"]; }, { readonly company: "National Post"; readonly baseUrls: readonly ["www.nationalpost.com"]; }, { readonly company: "La Presse"; readonly baseUrls: readonly ["www.lapresse.ca"]; }, { readonly company: "Radio-Canada"; readonly baseUrls: readonly ["ici.radio-canada.ca"]; }, { readonly company: "The Canadian Press"; readonly baseUrls: readonly ["www.thecanadianpress.com"]; }, { readonly company: "Financial Post"; readonly baseUrls: readonly ["financialpost.com"]; }, { readonly company: "The Weather Network"; readonly baseUrls: readonly ["www.theweathernetwork.com"]; }, { readonly company: "Le Devoir"; readonly baseUrls: readonly ["www.ledevoir.com"]; }, { readonly company: "TVA Nouvelles"; readonly baseUrls: readonly ["www.tvanouvelles.ca"]; }, { readonly company: "Journal de Montréal"; readonly baseUrls: readonly ["www.journaldemontreal.com"]; }, { readonly company: "CityNews"; readonly baseUrls: readonly ["www.citynews.ca"]; }, { readonly company: "BNN Bloomberg"; readonly baseUrls: readonly ["www.bnnbloomberg.ca"]; }, { readonly company: "The Hamilton Spectator"; readonly baseUrls: readonly ["www.thespec.com"]; }, { readonly company: "Ottawa Citizen"; readonly baseUrls: readonly ["ottawacitizen.com"]; }, { readonly company: "Windsor Star"; readonly baseUrls: readonly ["windsorstar.com"]; }, { readonly company: "Edmonton Journal"; readonly baseUrls: readonly ["edmontonjournal.com"]; }]; declare const DUTCH_NEWS$2: readonly [{ readonly company: "Algemeen Dagblad (AD)"; readonly baseUrls: readonly ["www.ad.nl"]; }, { readonly company: "NOS"; readonly baseUrls: readonly ["www.nos.nl"]; }, { readonly company: "De Telegraaf"; readonly baseUrls: readonly ["www.telegraaf.nl"]; }, { readonly company: "NU.nl"; readonly baseUrls: readonly ["www.nu.nl"]; }, { readonly company: "Volkskrant"; readonly baseUrls: readonly ["www.volkskrant.nl"]; }, { readonly company: "NRC Handelsblad"; readonly baseUrls: readonly ["www.nrc.nl"]; }, { readonly company: "Trouw"; readonly baseUrls: readonly ["www.trouw.nl"]; }, { readonly company: "Het Parool"; readonly baseUrls: readonly ["www.parool.nl"]; }, { readonly company: "RTL Nieuws"; readonly baseUrls: readonly ["www.rtlnieuws.nl"]; }, { readonly company: "BNR Nieuwsradio"; readonly baseUrls: readonly ["www.bnr.nl"]; }, { readonly company: "Emerce"; readonly baseUrls: readonly ["www.emerce.nl"]; }, { readonly company: "VPRO"; readonly baseUrls: readonly ["www.vpro.nl"]; }, { readonly company: "De Gelderlander"; readonly baseUrls: readonly ["www.gelderlander.nl"]; }, { readonly company: "Friesch Dagblad"; readonly baseUrls: readonly ["www.frieschdagblad.nl"]; }, { readonly company: "De Stentor"; readonly baseUrls: readonly ["www.destentor.nl"]; }, { readonly company: "Metro Nieuws"; readonly baseUrls: readonly ["www.metronieuws.nl"]; }, { readonly company: "ANP"; readonly baseUrls: readonly ["www.anp.nl"]; }, { readonly company: "Dagblad van het Noorden"; readonly baseUrls: readonly ["www.dvhn.nl"]; }, { readonly company: "Reformatorisch Dagblad"; readonly baseUrls: readonly ["www.rd.nl"]; }, { readonly company: "Financieele Dagblad"; readonly baseUrls: readonly ["www.fd.nl"]; }]; declare const ITALIAN_NEWS$2: readonly [{ readonly company: "ANSA"; readonly baseUrls: readonly ["www.ansa.it", "www.ansamed.info"]; }, { readonly company: "Corriere della Sera"; readonly baseUrls: readonly ["www.corriere.it"]; }, { readonly company: "la Repubblica"; readonly baseUrls: readonly ["www.repubblica.it"]; }, { readonly company: "Il Sole 24 Ore"; readonly baseUrls: readonly ["www.ilsole24ore.com"]; }, { readonly company: "La Stampa"; readonly baseUrls: readonly ["www.lastampa.it"]; }, { readonly company: "Il Messaggero"; readonly baseUrls: readonly ["www.ilmessaggero.it"]; }, { readonly company: "Il Giornale"; readonly baseUrls: readonly ["www.ilgiornale.it"]; }, { readonly company: "Avvenire"; readonly baseUrls: readonly ["www.avvenire.it"]; }, { readonly company: "Il Fatto Quotidiano"; readonly baseUrls: readonly ["www.ilfattoquotidiano.it"]; }, { readonly company: "La Nazione"; readonly baseUrls: readonly ["www.lanazione.it"]; }, { readonly company: "TgCom24"; readonly baseUrls: readonly ["www.tgcom24.mediaset.it"]; }, { readonly company: "Sky TG24"; readonly baseUrls: readonly ["tg24.sky.it"]; }, { readonly company: "Rai News"; readonly baseUrls: readonly ["www.rainews.it"]; }, { readonly company: "Gazzetta dello Sport"; readonly baseUrls: readonly ["www.gazzetta.it"]; }, { readonly company: "Il Resto del Carlino"; readonly baseUrls: readonly ["www.ilrestodelcarlino.it"]; }, { readonly company: "Il Mattino"; readonly baseUrls: readonly ["www.ilmattino.it"]; }, { readonly company: "Il Secolo XIX"; readonly baseUrls: readonly ["www.ilsecoloxix.it"]; }, { readonly company: "Italia Oggi"; readonly baseUrls: readonly ["www.italiaoggi.it"]; }, { readonly company: "Libero"; readonly baseUrls: readonly ["www.liberoquotidiano.it"]; }, { readonly company: "Il Tirreno"; readonly baseUrls: readonly ["www.iltirreno.it"]; }]; declare const BELGIUM_NEWS$2: readonly [{ readonly company: "Het Laatste Nieuws (HLN)"; readonly baseUrls: readonly ["www.hln.be"]; }, { readonly company: "Nieuwsblad"; readonly baseUrls: readonly ["www.nieuwsblad.be"]; }, { readonly company: "RTBF"; readonly baseUrls: readonly ["www.rtbf.be"]; }, { readonly company: "Sudinfo"; readonly baseUrls: readonly ["www.sudinfo.be"]; }, { readonly company: "7sur7"; readonly baseUrls: readonly ["www.7sur7.be"]; }, { readonly company: "Le Soir"; readonly baseUrls: readonly ["www.lesoir.be"]; }, { readonly company: "De Standaard"; readonly baseUrls: readonly ["www.standaard.be"]; }, { readonly company: "VRT NWS"; readonly baseUrls: readonly ["www.vrt.be"]; }, { readonly company: "La Libre"; readonly baseUrls: readonly ["www.lalibre.be"]; }, { readonly company: "Gazet van Antwerpen"; readonly baseUrls: readonly ["www.gva.be"]; }, { readonly company: "Het Belang van Limburg"; readonly baseUrls: readonly ["www.hbvl.be"]; }, { readonly company: "De Morgen"; readonly baseUrls: readonly ["www.demorgen.be"]; }, { readonly company: "L'Avenir"; readonly baseUrls: readonly ["www.lavenir.net"]; }, { readonly company: "The Brussels Times"; readonly baseUrls: readonly ["www.brusselstimes.com"]; }, { readonly company: "Metro Belgique"; readonly baseUrls: readonly ["nl.metrotime.be"]; }, { readonly company: "Sudpresse"; readonly baseUrls: readonly ["www.sudpress.be"]; }, { readonly company: "Flamish Radio and TV Broadcasting Organization (VRT)"; readonly baseUrls: readonly ["www.vrt.be"]; }, { readonly company: "Knack"; readonly baseUrls: readonly ["www.knack.be"]; }, { readonly company: "De Tijd"; readonly baseUrls: readonly ["www.tijd.be"]; }, { readonly company: "BX1"; readonly baseUrls: readonly ["www.bx1.be"]; }]; declare const MEXICAN_NEWS$2: readonly [{ readonly company: "Televisa"; readonly baseUrls: readonly ["www.televisa.news"]; }, { readonly company: "El Universal"; readonly baseUrls: readonly ["www.eluniversal.com.mx"]; }, { readonly company: "Milenio"; readonly baseUrls: readonly ["www.milenio.com"]; }, { readonly company: "Excélsior"; readonly baseUrls: readonly ["www.excelsior.com.mx"]; }, { readonly company: "Reforma"; readonly baseUrls: readonly ["www.reforma.com"]; }, { readonly company: "La Jornada"; readonly baseUrls: readonly ["www.jornada.com.mx"]; }, { readonly company: "El Financiero"; readonly baseUrls: readonly ["www.elfinanciero.com.mx"]; }, { readonly company: "Proceso"; readonly baseUrls: readonly ["www.proceso.com.mx"]; }, { readonly company: "SDP Noticias"; readonly baseUrls: readonly ["www.sdpnoticias.com"]; }, { readonly company: "Diario de Yucatán"; readonly baseUrls: readonly ["www.yucatan.com.mx"]; }, { readonly company: "El Economista"; readonly baseUrls: readonly ["www.eleconomista.com.mx"]; }, { readonly company: "El Heraldo de México"; readonly baseUrls: readonly ["www.heraldodemexico.com.mx"]; }, { readonly company: "Noticieros Televisa"; readonly baseUrls: readonly ["noticieros.televisa.com"]; }, { readonly company: "Expansión"; readonly baseUrls: readonly ["expansion.mx"]; }, { readonly company: "La Razón"; readonly baseUrls: readonly ["www.razon.com.mx"]; }, { readonly company: "Noroeste"; readonly baseUrls: readonly ["www.noroeste.com.mx"]; }, { readonly company: "Uniradio Noticias"; readonly baseUrls: readonly ["www.uniradionoticias.com"]; }, { readonly company: "El Imparcial"; readonly baseUrls: readonly ["www.elimparcial.com"]; }, { readonly company: "Publimetro México"; readonly baseUrls: readonly ["www.publimetro.com.mx"]; }, { readonly company: "Notimex"; readonly baseUrls: readonly ["www.notimex.gob.mx"]; }]; declare const SPANISH_NEWS$2: readonly [{ readonly company: "El País"; readonly baseUrls: readonly ["www.elpais.com"]; }, { readonly company: "El Mundo"; readonly baseUrls: readonly ["www.elmundo.es"]; }, { readonly company: "ABC"; readonly baseUrls: readonly ["www.abc.es"]; }, { readonly company: "La Vanguardia"; readonly baseUrls: readonly ["www.lavanguardia.com"]; }, { readonly company: "El Confidencial"; readonly baseUrls: readonly ["www.elconfidencial.com"]; }, { readonly company: "La Razón"; readonly baseUrls: readonly ["www.larazon.es"]; }, { readonly company: "20 Minutos"; readonly baseUrls: readonly ["www.20minutos.es"]; }, { readonly company: "Agencia EFE"; readonly baseUrls: readonly ["www.efe.com"]; }, { readonly company: "Europa Press"; readonly baseUrls: readonly ["www.europapress.es"]; }, { readonly company: "Diario AS"; readonly baseUrls: readonly ["www.as.com"]; }, { readonly company: "Mundo Deportivo"; readonly baseUrls: readonly ["www.mundodeportivo.com"]; }, { readonly company: "El Periódico"; readonly baseUrls: readonly ["www.elperiodico.com"]; }, { readonly company: "Cinco Días"; readonly baseUrls: readonly ["www.cincodias.com"]; }, { readonly company: "Expansión"; readonly baseUrls: readonly ["www.expansion.com"]; }, { readonly company: "La Información"; readonly baseUrls: readonly ["www.lainformacion.com"]; }, { readonly company: "OK Diario"; readonly baseUrls: readonly ["www.okdiario.com"]; }, { readonly company: "Heraldo de Aragón"; readonly baseUrls: readonly ["www.heraldo.es"]; }, { readonly company: "Faro de Vigo"; readonly baseUrls: readonly ["www.farodevigo.es"]; }, { readonly company: "El Correo"; readonly baseUrls: readonly ["www.elcorreo.com"]; }, { readonly company: "Diario Sur"; readonly baseUrls: readonly ["www.diariosur.es"]; }]; declare const INDIAN_NEWS$2: readonly [{ readonly company: "The Times of India"; readonly baseUrls: readonly ["timesofindia.indiatimes.com"]; }, { readonly company: "The Hindu"; readonly baseUrls: readonly ["www.thehindu.com"]; }, { readonly company: "Hindustan Times"; readonly baseUrls: readonly ["www.hindustantimes.com"]; }, { readonly company: "NDTV"; readonly baseUrls: readonly ["www.ndtv.com"]; }, { readonly company: "India Today"; readonly baseUrls: readonly ["www.indiatoday.in"]; }, { readonly company: "Zee News"; readonly baseUrls: readonly ["zeenews.india.com"]; }, { readonly company: "Indian Express"; readonly baseUrls: readonly ["indianexpress.com"]; }, { readonly company: "The Economic Times"; readonly baseUrls: readonly ["economictimes.indiatimes.com"]; }, { readonly company: "Deccan Herald"; readonly baseUrls: readonly ["www.deccanherald.com"]; }, { readonly company: "DNA India"; readonly baseUrls: readonly ["www.dnaindia.com"]; }, { readonly company: "The Print"; readonly baseUrls: readonly ["theprint.in"]; }, { readonly company: "News18"; readonly baseUrls: readonly ["www.news18.com"]; }, { readonly company: "Scroll.in"; readonly baseUrls: readonly ["scroll.in"]; }, { readonly company: "Asian News International (ANI)"; readonly baseUrls: readonly ["www.aninews.in"]; }, { readonly company: "Outlook India"; readonly baseUrls: readonly ["www.outlookindia.com"]; }, { readonly company: "Business Standard"; readonly baseUrls: readonly ["www.business-standard.com"]; }, { readonly company: "Mint"; readonly baseUrls: readonly ["www.livemint.com"]; }, { readonly company: "OneIndia"; readonly baseUrls: readonly ["www.oneindia.com"]; }, { readonly company: "Quint"; readonly baseUrls: readonly ["www.thequint.com"]; }, { readonly company: "Free Press Journal"; readonly baseUrls: readonly ["www.freepressjournal.in"]; }]; declare const CHINESE_NEWS$2: readonly [{ readonly company: "Xinhua News Agency"; readonly baseUrls: readonly ["www.xinhuanet.com"]; }, { readonly company: "China Central Television (CCTV)"; readonly baseUrls: readonly ["www.cctv.com"]; }, { readonly company: "China Daily"; readonly baseUrls: readonly ["www.chinadaily.com.cn"]; }, { readonly company: "CGTN (China Global Television Network)"; readonly baseUrls: readonly ["www.cgtn.com"]; }, { readonly company: "People's Daily"; readonly baseUrls: readonly ["www.people.cn"]; }, { readonly company: "Global Times"; readonly baseUrls: readonly ["www.globaltimes.cn"]; }, { readonly company: "South China Morning Post"; readonly baseUrls: readonly ["www.scmp.com"]; }, { readonly company: "Shanghai Daily"; readonly baseUrls: readonly ["www.shanghaidaily.com"]; }, { readonly company: "China News Service"; readonly baseUrls: readonly ["www.ecns.cn"]; }, { readonly company: "Caixin"; readonly baseUrls: readonly ["www.caixinglobal.com"]; }, { readonly company: "The Paper"; readonly baseUrls: readonly ["www.thepaper.cn"]; }, { readonly company: "Yicai Global"; readonly baseUrls: readonly ["www.yicaiglobal.com"]; }, { readonly company: "Economic Daily"; readonly baseUrls: readonly ["www.ce.cn"]; }, { readonly company: "21st Century Business Herald"; readonly baseUrls: readonly ["www.21jingji.com"]; }, { readonly company: "Beijing Review"; readonly baseUrls: readonly ["www.bjreview.com"]; }, { readonly company: "China Economic Net"; readonly baseUrls: readonly ["www.ce.cn"]; }, { readonly company: "Tencent News"; readonly baseUrls: readonly ["news.qq.com"]; }, { readonly company: "Sina News"; readonly baseUrls: readonly ["news.sina.com.cn"]; }, { readonly company: "NetEase News"; readonly baseUrls: readonly ["news.163.com"]; }, { readonly company: "Phoenix TV"; readonly baseUrls: readonly ["www.ifeng.com"]; }]; /** news sites in Denmark */ declare const DANISH_NEWS$2: readonly [{ readonly company: "Politiken"; readonly baseUrls: readonly ["www.politiken.dk"]; }, { readonly company: "Berlingske"; readonly baseUrls: readonly ["www.berlingske.dk"]; }, { readonly company: "Jyllands-Posten"; readonly baseUrls: readonly ["jyllands-posten.dk"]; }, { readonly company: "Ekstra Bladet"; readonly baseUrls: readonly ["ekstrabladet.dk"]; }, { readonly company: "Information"; readonly baseUrls: readonly ["www.information.dk"]; }, { readonly company: "BT"; readonly baseUrls: readonly ["www.bt.dk"]; }, { readonly company: "Weekendavisen"; readonly baseUrls: readonly ["www.weekendavisen.dk"]; }, { readonly company: "Fyens Stiftstidende"; readonly baseUrls: readonly ["fyens.dk"]; }, { readonly company: "Kristeligt Dagblad"; readonly baseUrls: readonly ["www.kristeligt-dagblad.dk"]; }, { readonly company: "Copenhagen Post"; readonly baseUrls: readonly ["cphpost.dk"]; }, { readonly company: "Nordjyske Stiftstidende"; readonly baseUrls: readonly ["nordjyske.dk"]; }, { readonly company: "Århus Stiftstidende"; readonly baseUrls: readonly ["stiften.dk"]; }, { readonly company: "Dagbladet Børsen"; readonly baseUrls: readonly ["borsen.dk"]; }, { readonly company: "Lokalavisen"; readonly baseUrls: readonly ["lokalavisen.dk"]; }, { readonly company: "TV2 Nyheder"; readonly baseUrls: readonly ["tv2.dk"]; }, { readonly company: "DR Nyheder"; readonly baseUrls: readonly ["dr.dk"]; }, { readonly company: "Avisen Danmark"; readonly baseUrls: readonly ["avisen.dk"]; }, { readonly company: "Fagbladet 3F"; readonly baseUrls: readonly ["fagbladet3f.dk"]; }, { readonly company: "Herning Folkeblad"; readonly baseUrls: readonly ["herningfolkeblad.dk"]; }, { readonly company: "Midtjyllands Avis"; readonly baseUrls: readonly ["midtjyllandsavis.dk"]; }]; declare const SWISS_NEWS$2: readonly [{ readonly company: "Neue Zürcher Zeitung (NZZ)"; readonly baseUrls: readonly ["www.nzz.ch"]; readonly type: readonly ["newspaper", "digital"]; }, { readonly company: "Swissinfo"; readonly baseUrls: readonly ["www.swissinfo.ch"]; readonly type: readonly ["digital-first"]; }, { readonly company: "20 Minuten"; readonly baseUrls: readonly ["www.20min.ch"]; readonly type: readonly ["newspaper", "digital"]; }, { readonly company: "Blick"; readonly baseUrls: readonly ["www.blick.ch"]; readonly type: readonly ["newspaper", "digital"]; }, { readonly company: "Le Temps"; readonly baseUrls: readonly ["www.letemps.ch"]; readonly type: readonly ["newspaper", "digital"]; }, { readonly company: "Tages-Anzeiger"; readonly baseUrls: readonly ["www.tagesanzeiger.ch"]; readonly type: readonly ["newspaper", "digital"]; }, { readonly company: "SRF News"; readonly baseUrls: readonly ["www.srf.ch"]; readonly type: readonly ["television", "radio", "digital"]; }, { readonly company: "Luzerner Zeitung"; readonly baseUrls: readonly ["www.luzernerzeitung.ch"]; readonly type: readonly ["newspaper", "digital"]; }, { readonly company: "La Tribune de Genève"; readonly baseUrls: readonly ["www.tdg.ch"]; readonly type: readonly ["newspaper", "digital"]; }, { readonly company: "Aargauer Zeitung"; readonly baseUrls: readonly ["www.aargauerzeitung.ch"]; readonly type: readonly ["newspaper", "digital"]; }, { readonly company: "24 Heures"; readonly baseUrls: readonly ["www.24heures.ch"]; readonly type: readonly ["newspaper", "digital"]; }, { readonly company: "Radio Télévision Suisse (RTS)"; readonly baseUrls: readonly ["www.rts.ch"]; readonly type: readonly ["television", "radio", "digital"]; }, { readonly company: "Der Bund"; readonly baseUrls: readonly ["www.derbund.ch"]; readonly type: readonly ["newspaper", "digital"]; }, { readonly company: "Schweizer Radio und Fernsehen (SRF)"; readonly baseUrls: readonly ["www.srf.ch"]; readonly type: readonly ["television", "radio", "digital"]; }, { readonly company: "Basler Zeitung"; readonly baseUrls: readonly ["www.bazonline.ch"]; readonly type: readonly ["newspaper", "digital"]; }, { readonly company: "Handelszeitung"; readonly baseUrls: readonly ["www.handelszeitung.ch"]; readonly type: readonly ["newspaper", "digital"]; }, { readonly company: "Watson"; readonly baseUrls: readonly ["www.watson.ch"]; readonly type: readonly ["digital-first"]; }, { readonly company: "Le Matin"; readonly baseUrls: readonly ["www.lematin.ch"]; readonly type: readonly ["newspaper", "digital"]; }, { readonly company: "La Liberté"; readonly baseUrls: readonly ["www.laliberte.ch"]; readonly type: readonly ["newspaper", "digital"]; }, { readonly company: "The Swiss Times"; readonly baseUrls: readonly ["www.theswisstimes.ch"]; readonly type: readonly ["digital-first"]; }]; declare const AUSTRALIAN_NEWS$2: readonly [{ readonly company: "ABC News"; readonly baseUrls: readonly ["www.abc.net.au"]; readonly type: readonly ["television", "radio", "digital"]; }, { readonly company: "The Sydney Morning Herald"; readonly baseUrls: readonly ["www.smh.com.au"]; readonly type: readonly ["newspaper", "digital"]; }, { readonly company: "The Australian"; readonly baseUrls: readonly ["www.theaustralian.com.au"]; readonly type: readonly ["newspaper", "digital"]; }, { readonly company: "Herald Sun"; readonly baseUrls: readonly ["www.heraldsun.com.au"]; readonly type: readonly ["newspaper", "digital"]; }, { readonly company: "9News"; readonly baseUrls: readonly ["www.9news.com.au"]; readonly type: readonly ["television", "digital"]; }, { readonly company: "SBS News"; readonly baseUrls: readonly ["www.sbs.com.au"]; readonly type: readonly ["television", "digital", "multicultural"]; }, { readonly company: "The Age"; readonly baseUrls: readonly ["www.theage.com.au"]; readonly type: readonly ["newspaper", "digital"]; }, { readonly company: "Sky News Australia"; readonly baseUrls: readonly ["www.skynews.com.au"]; readonly type: readonly ["television", "digital"]; }, { readonly company: "Australian Financial Review"; readonly baseUrls: readonly ["www.afr.com"]; readonly type: readonly ["newspaper", "digital"]; }, { readonly company: "news.com.au"; readonly baseUrls: readonly ["www.news.com.au"]; readonly type: readonly ["digital-first"]; }, { readonly company: "The Courier-Mail"; readonly baseUrls: readonly ["www.couriermail.com.au"]; readonly type: readonly ["newspaper", "digital"]; }, { readonly company: "7NEWS"; readonly baseUrls: readonly ["7news.com.au"]; readonly type: readonly ["television", "digital"]; }, { readonly company: "The West Australian"; readonly baseUrls: readonly ["www.thewest.com.au"]; readonly type: readonly ["newspaper", "digital"]; }, { readonly company: "Daily Telegraph"; readonly baseUrls: readonly ["www.dailytelegraph.com.au"]; readonly type: readonly ["newspaper", "digital"]; }, { readonly company: "Guardian Australia"; readonly baseUrls: readonly ["www.theguardian.com/au"]; readonly type: readonly ["digital-first"]; }, { readonly company: "Crikey"; readonly baseUrls: readonly ["www.crikey.com.au"]; readonly type: readonly ["digital-first", "independent"]; }, { readonly company: "AAP (Australian Associated Press)"; readonly baseUrls: readonly ["www.aap.com.au"]; readonly type: readonly ["news agency", "digital"]; }, { readonly company: "NT News"; readonly baseUrls: readonly ["www.ntnews.com.au"]; readonly type: readonly ["newspaper", "digital"]; }, { readonly company: "The Canberra Times"; readonly baseUrls: readonly ["www.canberratimes.com.au"]; readonly type: readonly ["newspaper", "digital"]; }, { readonly company: "Brisbane Times"; readonly baseUrls: readonly ["www.brisbanetimes.com.au"]; readonly type: readonly ["digital-first"]; }]; declare const JAPANESE_NEWS$2: readonly [{ readonly company: "The Asahi Shimbun"; readonly baseUrls: readonly ["www.asahi.com"]; readonly type: readonly ["newspaper", "digital"]; }, { readonly company: "Yomiuri Shimbun"; readonly baseUrls: readonly ["www.yomiuri.co.jp"]; readonly type: readonly ["newspaper", "digital"]; }, { readonly company: "Nikkei"; readonly baseUrls: readonly ["www.nikkei.com"]; readonly type: readonly ["newspaper", "digital"]; }, { readonly company: "Mainichi Shimbun"; readonly baseUrls: readonly ["mainichi.jp"]; readonly type: readonly ["newspaper", "digital"]; }, { readonly company: "Kyodo News"; readonly baseUrls: readonly ["www.kyodonews.jp"]; readonly type: readonly ["news agency", "digital"]; }, { readonly company: "Japan Times"; readonly baseUrls: readonly ["www.japantimes.co.jp"]; readonly type: readonly ["newspaper", "digital"]; }, { readonly company: "NHK"; readonly baseUrls: readonly ["www.nhk.or.jp"]; readonly type: readonly ["television", "radio", "digital"]; }, { readonly company: "Fuji News Network (FNN)"; readonly baseUrls: readonly ["www.fnn.jp"]; readonly type: readonly ["television", "digital"]; }, { readonly company: "Sankei Shimbun"; readonly baseUrls: readonly ["www.sankei.com"]; readonly type: readonly ["newspaper", "digital"]; }, { readonly company: "Toyo Keizai"; readonly baseUrls: readonly ["www.toyokeizai.net"]; readonly type: readonly ["digital", "business magazine"]; }, { readonly company: "Hokkaido Shimbun"; readonly baseUrls: readonly ["www.hokkaido-np.co.jp"]; readonly type: readonly ["newspaper", "digital"]; }, { readonly company: "Shizuoka Shimbun"; readonly baseUrls: readonly ["www.at-s.com"]; readonly type: readonly ["newspaper", "digital"]; }, { readonly company: "Tokyo Shimbun"; readonly baseUrls: readonly ["www.tokyo-np.co.jp"]; readonly type: readonly ["newspaper", "digital"]; }, { readonly company: "Yahoo Japan News"; readonly baseUrls: readonly ["news.yahoo.co.jp"]; readonly type: readonly ["digital-first"]; }, { readonly company: "TBS News"; readonly baseUrls: readonly ["news.tbs.co.jp"]; readonly type: readonly ["television", "digital"]; }, { readonly company: "Nippon TV News 24 Japan"; readonly baseUrls: readonly ["www.news24.jp"]; readonly type: readonly ["television", "digital"]; }, { readonly company: "Jiji Press"; readonly baseUrls: readonly ["www.jiji.com"]; readonly type: readonly ["news agency", "digital"]; }, { readonly company: "TV Asahi News"; readonly baseUrls: readonly ["news.tv-asahi.co.jp"]; readonly type: readonly ["television", "digital"]; }, { readonly company: "WOWOW Prime News"; readonly baseUrls: readonly ["www.wowow.co.jp"]; readonly type: readonly ["television", "digital"]; }, { readonly company: "Kansai Telecasting Corporation (KTV)"; readonly baseUrls: readonly ["www.ktv.jp"]; readonly type: readonly ["television", "digital"]; }]; declare const SOUTH_KOREAN_NEWS$2: readonly [{ readonly company: "Yonhap News Agency"; readonly baseUrls: readonly ["www.yonhapnews.co.kr"]; readonly type: readonly ["news agency", "digital"]; }, { readonly company: "The Korea Herald"; readonly baseUrls: readonly ["www.koreaherald.com"]; readonly type: readonly ["newspaper", "digital"]; }, { readonly company: "The Korea Times"; readonly baseUrls: readonly ["www.koreatimes.co.kr"]; readonly type: readonly ["newspaper", "digital"]; }, { readonly company: "Chosun Ilbo"; readonly baseUrls: readonly ["www.chosun.com"]; readonly type: readonly ["newspaper", "digital"]; }, { readonly company: "JoongAng Ilbo"; readonly baseUrls: readonly ["www.joongang.co.kr"]; readonly type: readonly ["newspaper", "digital"]; }, { readonly company: "Dong-A Ilbo"; readonly baseUrls: readonly ["www.donga.com"]; readonly type: readonly ["newspaper", "digital"]; }, { readonly company: "MBC News"; readonly baseUrls: readonly ["www.imnews.imbc.com"]; readonly type: readonly ["television", "digital"]; }, { readonly company: "SBS News"; readonly baseUrls: readonly ["news.sbs.co.kr"]; readonly type: readonly ["television", "digital"]; }, { readonly company: "KBS News"; readonly baseUrls: readonly ["news.kbs.co.kr"]; readonly type: readonly ["television", "radio", "digital"]; }, { readonly company: "Hankyoreh"; readonly baseUrls: readonly ["english.hani.co.kr"]; readonly type: readonly ["newspaper", "digital"]; }, { readonly company: "Maeil Business Newspaper"; readonly baseUrls: readonly ["www.mk.co.kr"]; readonly type: readonly ["newspaper", "digital"]; }, { readonly company: "MoneyToday"; readonly baseUrls: readonly ["www.mt.co.kr"]; readonly type: readonly ["digital-first", "business"]; }, { readonly company: "Seoul Shinmun"; readonly baseUrls: readonly ["www.seoul.co.kr"]; readonly type: readonly ["newspaper", "digital"]; }, { readonly company: "OhmyNews"; readonly baseUrls: readonly ["www.ohmynews.com"]; readonly type: readonly ["digital-first"]; }, { readonly company: "News1 Korea"; readonly baseUrls: readonly ["www.news1.kr"]; readonly type: readonly ["news agency", "digital"]; }, { readonly company: "Asia Business Daily"; readonly baseUrls: readonly ["www.asiae.co.kr"]; readonly type: readonly ["newspaper", "digital"]; }, { readonly company: "Herald Business"; readonly baseUrls: readonly ["biz.heraldcorp.com"]; readonly type: readonly ["newspaper", "digital"]; }, { readonly company: "eDaily"; readonly baseUrls: readonly ["www.edaily.co.kr"]; readonly type: readonly ["digital-first", "business"]; }, { readonly company: "Seoul Economic Daily"; readonly baseUrls: readonly ["www.sedaily.com"]; readonly type: readonly ["newspaper", "digital"]; }, { readonly company: "JTBC News"; readonly baseUrls: readonly ["news.jtbc.co.kr"]; readonly type: readonly ["television", "digital"]; }]; declare const TURKISH_NEWS$2: readonly [{ readonly company: "Anadolu Agency (AA)"; readonly baseUrls: readonly ["www.aa.com.tr"]; readonly type: readonly ["news agency", "digital"]; }, { readonly company: "Hürriyet"; readonly baseUrls: readonly ["www.hurriyet.com.tr"]; readonly type: readonly ["newspaper", "digital"]; }, { readonly company: "Sabah"; readonly baseUrls: readonly ["www.sabah.com.tr"]; readonly type: readonly ["newspaper", "digital"]; }, { readonly company: "Milliyet"; readonly baseUrls: readonly ["www.milliyet.com.tr"]; readonly type: readonly ["newspaper", "digital"]; }, { readonly company: "TRT World"; readonly baseUrls: readonly ["www.trtworld.com"]; readonly type: readonly ["television", "digital"]; }, { readonly company: "CNN Türk"; readonly baseUrls: readonly ["www.cnnturk.com"]; readonly type: readonly ["television", "digital"]; }, { readonly company: "Sozcu"; readonly baseUrls: readonly ["www.sozcu.com.tr"]; readonly type: readonly ["newspaper", "digital"]; }, { readonly company: "Daily Sabah"; readonly baseUrls: readonly ["www.dailysabah.com"]; readonly type: readonly ["newspaper", "digital"]; }, { readonly company: "Yeni Şafak"; readonly baseUrls: readonly ["www.yenisafak.com"]; readonly type: readonly ["newspaper", "digital"]; }, { readonly company: "Habertürk"; readonly baseUrls: readonly ["www.haberturk.com"]; readonly type: readonly ["television", "digital"]; }, { readonly company: "BirGün"; readonly baseUrls: readonly ["www.birgun.net"]; readonly type: readonly ["newspaper", "digital"]; }, { readonly company: "Türkiye Gazetesi"; readonly baseUrls: readonly ["www.turkiyegazetesi.com.tr"]; readonly type: readonly ["newspaper", "digital"]; }, { readonly company: "Cumhuriyet"; readonly baseUrls: readonly ["www.cumhuriyet.com.tr"]; readonly type: readonly ["newspaper", "digital"]; }, { readonly company: "Diken"; readonly baseUrls: readonly ["www.diken.com.tr"]; readonly type: readonly ["digital-first"]; }, { readonly company: "NTV"; readonly baseUrls: readonly ["www.ntv.com.tr"]; readonly type: readonly ["television", "digital"]; }, { readonly company: "Ensonhaber"; readonly baseUrls: readonly ["www.ensonhaber.com"]; readonly type: readonly ["digital-first"]; }, { readonly company: "T24"; readonly baseUrls: readonly ["www.t24.com.tr"]; readonly type: readonly ["digital-first"]; }, { readonly company: "Karar"; readonly baseUrls: readonly ["www.karar.com"]; readonly type: readonly ["newspaper", "digital"]; }, { readonly company: "Gazete Duvar"; readonly baseUrls: readonly ["www.gazeteduvar.com.tr"]; readonly type: readonly ["digital-first"]; }, { readonly company: "Bloomberg HT"; readonly baseUrls: readonly ["www.bloomberght.com"]; readonly type: readonly ["television", "digital"]; }]; declare const NORWEGIAN_NEWS$2: readonly [{ readonly company: "Aftenposten"; readonly baseUrls: readonly ["www.aftenposten.no"]; readonly type: readonly ["newspaper", "digital"]; }, { readonly company: "Verdens Gang (VG)"; readonly baseUrls: readonly ["www.vg.no"]; readonly type: readonly ["newspaper", "digital"]; }, { readonly company: "Dagbladet"; readonly baseUrls: readonly ["www.dagbladet.no"]; readonly type: readonly ["newspaper", "digital"]; }, { readonly company: "NRK"; readonly baseUrls: readonly ["www.nrk.no"]; readonly type: readonly ["television", "radio", "digital"]; }, { readonly company: "Dagens Næringsliv"; readonly baseUrls: readonly ["www.dn.no"]; readonly type: readonly ["newspaper", "digital"]; }, { readonly company: "Nettavisen"; readonly baseUrls: readonly ["www.nettavisen.no"]; readonly type: readonly ["digital-first"]; }, { readonly company: "Klassekampen"; readonly baseUrls: readonly ["www.klassekampen.no"]; readonly type: readonly ["newspaper", "digital"]; }, { readonly company: "Morgenbladet"; readonly baseUrls: readonly ["www.morgenbladet.no"]; readonly type: readonly ["newspaper", "digital"]; }, { readonly company: "E24"; readonly baseUrls: readonly ["www.e24.no"]; readonly type: readonly ["digital-first", "business"]; }, { readonly company: "TV2"; readonly baseUrls: readonly ["www.tv2.no"]; readonly type: readonly ["television", "digital"]; }, { readonly company: "Bergens Tidende"; readonly baseUrls: readonly ["www.bt.no"]; readonly type: readonly ["newspaper", "digital"]; }, { readonly company: "Adresseavisen"; readonly baseUrls: readonly ["www.adressa.no"]; readonly type: readonly ["newspaper", "digital"]; }, { readonly company: "Stavanger Aftenblad"; readonly baseUrls: readonly ["www.aftenbladet.no"]; readonly type: readonly ["newspaper", "digital"]; }, { readonly company: "Fædrelandsvennen"; readonly baseUrls: readonly ["www.fvn.no"]; readonly type: readonly ["newspaper", "digital"]; }, { readonly company: "ABC Nyheter"; readonly baseUrls: readonly ["www.abcnyheter.no"]; readonly type: readonly ["digital-first"]; }, { readonly company: "Romerikes Blad"; readonly baseUrls: readonly ["www.rb.no"]; readonly type: readonly ["newspaper", "digital"]; }, { readonly company: "Sunnmørsposten"; readonly baseUrls: readonly ["www.smp.no"]; readonly type: readonly ["newspaper", "digital"]; }, { readonly company: "Finansavisen"; readonly baseUrls: readonly ["www.finansavisen.no"]; readonly type: readonly ["newspaper", "digital"]; }, { readonly company: "Nordlys"; readonly baseUrls: readonly ["www.nordlys.no"]; readonly type: readonly ["newspaper", "digital"]; }, { readonly company: "Hamar Arbeiderblad"; readonly baseUrls: readonly ["www.h-a.no"]; readonly type: readonly ["newspaper", "digital"]; }]; //#endregion //#region ../constants/src/NoDefaultValue.d.ts /** * A constant which indicates that a particular * type/property was not given a _default value_. */ declare const NO_DEFAULT_VALUE$2: Constant$2<"no-default-value", unknown>; /** * A unique symbol which indicates that a particular * type was not given a "default value". */ type NoDefaultValue$2 = typeof NO_DEFAULT_VALUE$2; //#endregion //#region ../constants/src/NotDefined.d.ts /** * **NOT_DEFINED** * * A runtime constant which indicates that some value has not been defined (yet). */ declare const NOT_DEFINED$1: Constant$2<"not-defined", unknown>; type NotDefined$1 = typeof NOT_DEFINED$1; //#endregion //#region ../constants/src/NumericChar.d.ts /** * **NUMERIC_CHAR** * * A tuple containing all numeric characters. * * **Related:** `NumericChar` */ declare const NUMERIC_CHAR$2: ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]; /** * **HEXADECIMAL_CHAR** * * All numeric and alpha (upper and lower) characters used to represent * a **hexadecimal** number. */ declare const HEXADECIMAL_CHAR$2: ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "A", "b", "B", "c", "C", "d", "D", "e", "E", "f", "F"]; //#endregion //#region ../constants/src/Phone.d.ts /** * **PHONE_COUNTRY_CODES** * * `[code, 3 letter country code, 2 letter country code]` */ declare const PHONE_COUNTRY_CODES$2: readonly [readonly ["886", "TWN", "TW"], readonly ["93", "AFG", "AF"], readonly ["355", "ALB", "AL"], readonly ["213", "DZA", "DZ"], readonly ["1-684", "ASM", "AS"], readonly ["376", "AND", "AD"], readonly ["244", "AGO", "AO"], readonly ["1-264", "AIA", "AI"], readonly ["672", "ATA", "AQ"], readonly ["1-268", "ATG", "AG"], readonly ["54", "ARG", "AR"], readonly ["374", "ARM", "AM"], readonly ["297", "ABW", "AW"], readonly ["61", "AUS", "AU"], readonly ["43", "AUT", "AT"], readonly ["994", "AZE", "AZ"], readonly ["1-242", "BHS", "BS"], readonly ["973", "BHR", "BH"], readonly ["880", "BGD", "BD"], readonly ["1-246", "BRB", "BB"], readonly ["375", "BLR", "BY"], readonly ["32", "BEL", "BE"], readonly ["501", "BLZ", "BZ"], readonly ["229", "BEN", "BJ"], readonly ["1-441", "BMU", "BM"], readonly ["975", "BTN", "BT"], readonly ["591", "BOL", "BO"], readonly ["599", "BES", "BQ"], readonly ["387", "BIH", "BA"], readonly ["267", "BWA", "BW"], readonly ["47", "BVT", "BV"], readonly ["55", "BRA", "BR"], readonly ["246", "IOT", "IO"], readonly ["1-284", "VGB", "VG"], readonly ["673", "BRN", "BN"], readonly ["359", "BGR", "BG"], readonly ["226", "BFA", "BF"], readonly ["257", "BDI", "BI"], readonly ["238", "CPV", "CV"], readonly ["855", "KHM", "KH"], readonly ["237", "CMR", "CM"], readonly ["1", "CAN", "CA"], readonly ["1-345", "CYM", "KY"], readonly ["236", "CAF", "CF"], readonly ["235", "TCD", "TD"], readonly ["56", "CHL", "CL"], readonly ["86", "CHN", "CN"], readonly ["852", "HKG", "HK"], readonly ["853", "MAC", "MO"], readonly ["61", "CXR", "CX"], readonly ["61", "CCK", "CC"], readonly ["57", "COL", "CO"], readonly ["269", "COM", "KM"], readonly ["242", "COG", "CG"], readonly ["682", "COK", "CK"], readonly ["506", "CRI", "CR"], readonly ["385", "HRV", "HR"], readonly ["53", "CUB", "CU"], readonly ["599", "CUW", "CW"], readonly ["357", "CYP", "CY"], readonly ["420", "CZE", "CZ"], readonly ["225", "CIV", "CI"], readonly ["850", "PRK", "KP"], readonly ["243", "COD", "CD"], readonly ["45", "DNK", "DK"], readonly ["253", "DJI", "DJ"], readonly ["1-767", "DMA", "DM"], readonly ["1-809", "DOM", "DO"], readonly ["1-829", "DOM", "DO"], readonly ["1-849", "DOM", "DO"], readonly ["593", "ECU", "EC"], readonly ["20", "EGY", "EG"], readonly ["503", "SLV", "SV"], readonly ["240", "GNQ", "GQ"], readonly ["291", "ERI", "ER"], readonly ["372", "EST", "EE"], readonly ["268", "SWZ", "SZ"], readonly ["251", "ETH", "ET"], readonly ["500", "FLK", "FK"], readonly ["298", "FRO", "FO"], readonly ["679", "FJI", "FJ"], readonly ["358", "FIN", "FI"], readonly ["33", "FRA", "FR"], readonly ["594", "GUF", "GF"], readonly ["689", "PYF", "PF"], readonly ["262", "ATF", "TF"], readonly ["241", "GAB", "GA"], readonly ["220", "GMB", "GM"], readonly ["995", "GEO", "GE"], readonly ["49", "DEU", "DE"], readonly ["233", "GHA", "GH"], readonly ["350", "GIB", "GI"], readonly ["30", "GRC", "GR"], readonly ["299", "GRL", "GL"], readonly ["1-473", "GRD", "GD"], readonly ["590", "GLP", "GP"], readonly ["1-671", "GUM", "GU"], readonly ["502", "GTM", "GT"], readonly ["44", "GGY", "GG"], readonly ["224", "GIN", "GN"], readonly ["245", "GNB", "GW"], readonly ["592", "GUY", "GY"], readonly ["509", "HTI", "HT"], readonly ["672", "HMD", "HM"], readonly ["39-06", "VAT", "VA"], readonly ["504", "HND", "HN"], readonly ["36", "HUN", "HU"], readonly ["354", "ISL", "IS"], readonly ["91", "IND", "IN"], readonly ["62", "IDN", "ID"], readonly ["98", "IRN", "IR"], readonly ["964", "IRQ", "IQ"], readonly ["353", "IRL", "IE"], readonly ["44", "IMN", "IM"], readonly ["972", "ISR", "IL"], readonly ["39", "ITA", "IT"], readonly ["1-876", "JAM", "JM"], readonly ["81", "JPN", "JP"], readonly ["44", "JEY", "JE"], readonly ["962", "JOR", "JO"], readonly ["7", "KAZ", "KZ"], readonly ["254", "KEN", "KE"], readonly ["686", "KIR", "KI"], readonly ["965", "KWT", "KW"], readonly ["996", "KGZ", "KG"], readonly ["856", "LAO", "LA"], readonly ["371", "LVA", "LV"], readonly ["961", "LBN", "LB"], readonly ["266", "LSO", "LS"], readonly ["231", "LBR", "LR"], readonly ["218", "LBY", "LY"], readonly ["423", "LIE", "LI"], readonly ["370", "LTU", "LT"], readonly ["352", "LUX", "LU"], readonly ["261", "MDG", "MG"], readonly ["265", "MWI", "MW"], readonly ["60", "MYS", "MY"], readonly ["960", "MDV", "MV"], readonly ["223", "MLI", "ML"], readonly ["356", "MLT", "MT"], readonly ["692", "MHL", "MH"], readonly ["596", "MTQ", "MQ"], readonly ["222", "MRT", "MR"], readonly ["230", "MUS", "MU"], readonly ["262", "MYT", "YT"], readonly ["52", "MEX", "MX"], readonly ["691", "FSM", "FM"], readonly ["377", "MCO", "MC"], readonly ["976", "MNG", "MN"], readonly ["382", "MNE", "ME"], readonly ["1-664", "MSR", "MS"], readonly ["212", "MAR", "MA"], readonly ["258", "MOZ", "MZ"], readonly ["95", "MMR", "MM"], readonly ["264", "NAM", "NA"], readonly ["674", "NRU", "NR"], readonly ["977", "NPL", "NP"], readonly ["31", "NLD", "NL"], readonly ["687", "NCL", "NC"], readonly ["64", "NZL", "NZ"], readonly ["505", "NIC", "NI"], readonly ["227", "NER", "NE"], readonly ["234", "NGA", "NG"], readonly ["683", "NIU", "NU"], readonly ["672", "NFK", "NF"], readonly ["1-670", "MNP", "MP"], readonly ["47", "NOR", "NO"], readonly ["968", "OMN", "OM"], readonly ["92", "PAK", "PK"], readonly ["680", "PLW", "PW"], readonly ["507", "PAN", "PA"], readonly ["675", "PNG", "PG"], readonly ["595", "PRY", "PY"], readonly ["51", "PER", "PE"], readonly ["63", "PHL", "PH"], readonly ["870", "PCN", "PN"], readonly ["48", "POL", "PL"], readonly ["351", "PRT", "PT"], readonly ["974", "QAT", "QA"], readonly ["82", "KOR", "KR"], readonly ["373", "MDA", "MD"], readonly ["40", "ROU", "RO"], readonly ["7", "RUS", "RU"], readonly ["250", "RWA", "RW"], readonly ["262", "REU", "RE"], readonly ["590", "BLM", "BL"], readonly ["290", "SHN", "SH"], readonly ["1-869", "KNA", "KN"], readonly ["1-758", "LCA", "LC"], readonly ["590", "MAF", "MF"], readonly ["508", "SPM", "PM"], readonly ["1-784", "VCT", "VC"], readonly ["685", "WSM", "WS"], readonly ["378", "SMR", "SM"], readonly ["239", "STP", "ST"], readonly ["966", "SAU", "SA"], readonly ["221", "SEN", "SN"], readonly ["381", "SRB", "RS"], readonly ["248", "SYC", "SC"], readonly ["232", "SLE", "SL"], readonly ["65", "SGP", "SG"], readonly ["1-721", "SXM", "SX"], readonly ["421", "SVK", "SK"], readonly ["386", "SVN", "SI"], readonly ["677", "SLB", "SB"], readonly ["252", "SOM", "SO"], readonly ["27", "ZAF", "ZA"], readonly ["500", "SGS", "GS"], readonly ["211", "SSD", "SS"], readonly ["34", "ESP", "ES"], readonly ["94", "LKA", "LK"], readonly ["970", "PSE", "PS"], readonly ["249", "SDN", "SD"], readonly ["597", "SUR", "SR"], readonly ["47", "SJM", "SJ"], readonly ["46", "SWE", "SE"], readonly ["41", "CHE", "CH"], readonly ["963", "SYR", "SY"], readonly ["992", "TJK", "TJ"], readonly ["66", "THA", "TH"], readonly ["389", "MKD", "MK"], readonly ["670", "TLS", "TL"], readonly ["228", "TGO", "TG"], readonly ["690", "TKL", "TK"], readonly ["676", "TON", "TO"], readonly ["1-868", "TTO", "TT"], readonly ["216", "TUN", "TN"], readonly ["90", "TUR", "TR"], readonly ["993", "TKM", "TM"], readonly ["1-649", "TCA", "TC"], readonly ["688", "TUV", "TV"], readonly ["256", "UGA", "UG"], readonly ["380", "UKR", "UA"], readonly ["971", "ARE", "AE"], readonly ["44", "GBR", "GB"], readonly ["255", "TZA", "TZ"], readonly ["1-340", "VIR", "VI"], readonly ["1", "USA", "US"], readonly ["598", "URY", "UY"], readonly ["998", "UZB", "UZ"], readonly ["678", "VUT", "VU"], readonly ["58", "VEN", "VE"], readonly ["84", "VNM", "VN"], readonly ["681", "WLF", "WF"], readonly ["212", "ESH", "EH"], readonly ["967", "YEM", "YE"], readonly ["260", "ZMB", "ZM"], readonly ["263", "ZWE", "ZW"], readonly ["358", "ALA", "AX"]]; //#endregion //#region ../constants/src/PluralExceptions.d.ts /** * **PLURAL_EXCEPTIONS** * * A lookup table that maps singular words to their _plural_ counterpart. */ declare const PLURAL_EXCEPTIONS$2: { readonly photo: "photos"; readonly piano: "pianos"; readonly halo: "halos"; readonly foot: "feet"; readonly man: "men"; readonly woman: "women"; readonly person: "people"; readonly mouse: "mice"; readonly series: "series"; readonly sheep: "sheep"; readonly money: "monies"; readonly deer: "deer"; readonly goose: "geese"; readonly child: "children"; readonly tooth: "teeth"; readonly ox: "oxen"; readonly basis: "bases"; readonly radius: "radii"; readonly syllabus: "syllabi"; readonly ice: "ice"; readonly fish: "fish"; readonly means: "means"; readonly phenomenon: "phenomena"; readonly criterion: "criteria"; readonly datum: "data"; readonly memorandum: "memoranda"; readonly bacterium: "bacteria"; readonly stratum: "strata"; readonly curriculum: "curricula"; readonly index: "indices"; readonly appendix: "appendices"; readonly vortex: "vortices"; readonly bison: "bison"; readonly axis: "axes"; readonly antenna: "antennas"; readonly cactus: "cacti"; readonly corpus: "corpora"; readonly beau: "beaux"; readonly die: "dice"; readonly ellipsis: "ellipses"; readonly erratum: "errata"; readonly focus: "foci"; readonly formula: "formulas"; readonly fungus: "fungi"; readonly genus: "genera"; readonly graffito: "graffiti"; readonly grouse: "grouses"; readonly half: "halves"; readonly hoof: "hooves"; readonly hypothesis: "hypothesis"; readonly larva: "larvae"; readonly libretto: "libretti"; readonly loaf: "loaves"; readonly locus: "loci"; readonly medium: "mediums"; readonly minutia: "minutiae"; readonly nucleus: "nuclei"; readonly oasis: "oases"; readonly opus: "opuses"; readonly ovum: "ova"; readonly parenthesis: "parentheses"; readonly phylum: "phyla"; readonly quiz: "quizzes"; readonly referendum: "referendums"; readonly self: "selves"; readonly species: "species"; readonly stimulus: "stimuli"; readonly swine: "swine"; readonly synopsis: "synopses"; readonly thesis: "theses"; readonly thief: "thieves"; readonly vertex: "vertexes"; readonly wife: "wives"; readonly wolf: "wolves"; }; //#endregion //#region ../constants/src/RepoConstants.d.ts /** * common sources for source code repositories */ declare const REPO_SOURCES$2: readonly ["github", "bitbucket", "gitlab", "codecommit", "local"]; declare const REPO_SOURCE_LOOKUP$2: { readonly github: readonly ["https://github.com", "https://github.io"]; readonly bitbucket: readonly ["https://bitbucket.org"]; readonly gitlab: readonly ["https://gitlab.com"]; readonly codecommit: readonly ["https://aws.amazon.com/codecommit/"]; readonly local: readonly []; }; //#endregion //#region ../constants/src/Retail.d.ts /** * Amazon's DNS entries (for retail business) */ declare const AMAZON_DNS$2: readonly ["www.amazon.com", "www.amazon.co.uk", "www.amazon.fr", "www.amazon.de", "www.amazon.it", "www.amazon.es"]; declare const WALMART_DNS$2: readonly ["www.walmart.com", "www.walmart.ca", "www.walmart.com.mx"]; declare const APPLE_DNS$2: readonly ["store.apple.com", "www.apple.com"]; declare const HOME_DEPOT_DNS$2: readonly ["www.homedepot.com", "www.homedepot.ca"]; declare const EBAY_DNS$2: readonly ["www.ebay.com", "www.ebay.co.uk", "www.ebay.fr", "www.ebay.de", "www.ebay.it"]; declare const TARGET_DNS$2: readonly ["www.target.com"]; declare const ETSY_DNS$2: readonly ["www.etsy.com"]; declare const COSTCO_DNS$2: readonly ["www.costco.com", "www.costco.co.uk", "www.costco.ca"]; declare const CHEWY_DNS$2: readonly ["www.chewy.com"]; declare const BEST_BUY_DNS$2: readonly ["www.bestbuy.com", "www.bestbuy.ca"]; declare const WAYFAIR_DNS$2: readonly ["www.wayfair.com", "www.wayfair.ca", "www.wayfair.co.uk"]; declare const NIKE_DNS$2: readonly ["www.nike.com"]; declare const MACYS_DNS$2: readonly ["www.macys.com"]; declare const LOWES_DNS$2: readonly ["www.lowes.com"]; declare const IKEA_DNS$2: readonly ["www.ikea.com"]; declare const DELL_DNS$2: readonly ["www.dell.com"]; /** DNS for H&M retailer */ declare const HM_DNS$2: readonly ["www2.hm.com"]; declare const ZARA_DNS$2: readonly ["www.zara.com"]; declare const KROGER_DNS$2: readonly ["www.kroger.com"]; declare const WALGREENS_DNS$2: readonly ["www.walgreens.com"]; declare const CVS_DNS$2: readonly ["www.cvs.com"]; declare const WHOLE_FOODS_DNS$2: readonly ["www.wholefoodsmarket.com", "www.wholefoodsmarket.co.uk"]; //#endregion //#region ../constants/src/SafeEncoding.d.ts declare const SAFE_ENCODING__QUOTES$2: { readonly "\"": "^"; readonly "'": "^"; readonly "`": "^"; }; declare const SAFE_ENCODING__WHITESPACE$2: { readonly " ": "^"; readonly "\t": "^"; readonly "\n": "^"; readonly "\r": "^"; }; declare const SAFE_ENCODING__BRACKETS$2: { readonly "[": "^"; readonly "]": "^"; readonly "(": "^"; readonly ")": "^"; readonly "{": "^"; readonly "}": "^"; }; //#endregion //#region ../constants/src/SimpleTokens.d.ts declare const SIMPLE_DICT_VALUES$2: readonly ["string", "number", "boolean", "unknown", "Opt", "Opt", "Opt", "Opt"]; declare const SIMPLE_SET_TYPES$2: readonly ["string", "number", "boolean", "unknown", "Opt", "Opt", "Opt", "Opt"]; declare const SIMPLE_SCALAR_TOKENS$2: readonly ["string", "number", `string(${string})`, `number(${number})` | `number(${number},${string})`, "boolean", "true", "false", "null", "undefined", "unknown", "any", "never"]; declare const SIMPLE_OPT_SCALAR_TOKENS$2: readonly ["Opt", "Opt", "Opt", "Opt", "Opt", "Opt", "Opt", "Opt", "Opt", `Opt` | `Opt`, `Opt"]; declare const SIMPLE_UNION_TOKENS$2: readonly [`union(${string})` | `union(${string},${string})`]; declare const SIMPLE_MAP_KEYS$2: readonly ["string", "number", "Dict", "Dict", "Dict", "Dict", "Dict", "Dict>", "Dict>", "Dict>"]; declare const SIMPLE_MAP_VALUES$2: readonly ["string", "number", "Dict", "Dict", "Dict", "Dict", "Dict", "Dict>", "Dict>", "Dict>", "boolean", "unknown", "undefined", "Dict", "Array", "Dict>", "Dict>", "Dict>", "Dict>"]; declare const SIMPLE_DICT_TOKENS$2: readonly ["Dict", "Dict", "Dict", "Dict", "Dict", "Dict>", "Dict>", "Dict>", "Dict>", `Dict<{${string}: string}>` | `Dict<{${string}: number}>` | `Dict<{${string}: boolean}>` | `Dict<{${string}: undefined}>` | `Dict<{${string}: null}>` | `Dict<{${string}: unknown}>` | `Dict<{${string}: true}>` | `Dict<{${string}: false}>` | `Dict<{${string}: string(${string})}>` | `Dict<{${string}: number(${number})}>` | `Dict<{${string}: number(${number},${string})}>` | `Dict<{${string}: any}>` | `Dict<{${string}: never}>` | `Dict<{${string}: Opt}>` | `Dict<{${string}: Opt}>` | `Dict<{${string}: Opt}>` | `Dict<{${string}: Opt}>` | `Dict<{${string}: Opt}>` | `Dict<{${string}: Opt}>` | `Dict<{${string}: Opt}>` | `Dict<{${string}: Opt}>` | `Dict<{${string}: Opt}>` | `Dict<{${string}: Opt}>` | `Dict<{${string}: Opt}>` | `Dict<{${string}: Opt` | `Dict<{${string}: Opt`, `Dict<{${string}: string, ${string}: ${string}}` | `Dict<{${string}: number, ${string}: ${string}}` | `Dict<{${string}: boolean, ${string}: ${string}}` | `Dict<{${string}: undefined, ${string}: ${string}}` | `Dict<{${string}: null, ${string}: ${string}}` | `Dict<{${string}: unknown, ${string}: ${string}}` | `Dict<{${string}: true, ${string}: ${string}}` | `Dict<{${string}: false, ${string}: ${string}}` | `Dict<{${string}: string(${string}), ${string}: ${string}}` | `Dict<{${string}: number(${number}), ${string}: ${string}}` | `Dict<{${string}: number(${number},${string}), ${string}: ${string}}` | `Dict<{${string}: any, ${string}: ${string}}` | `Dict<{${string}: never, ${string}: ${string}}` | `Dict<{${string}: Opt, ${string}: ${string}}` | `Dict<{${string}: Opt, ${string}: ${string}}` | `Dict<{${string}: Opt, ${string}: ${string}}` | `Dict<{${string}: Opt, ${string}: ${string}}` | `Dict<{${string}: Opt, ${string}: ${string}}` | `Dict<{${string}: Opt, ${string}: ${string}}` | `Dict<{${string}: Opt, ${string}: ${string}}` | `Dict<{${string}: Opt, ${string}: ${string}}` | `Dict<{${string}: Opt, ${string}: ${string}}` | `Dict<{${string}: Opt, ${string}: ${string}}` | `Dict<{${string}: Opt, ${string}: ${string}}` | `Dict<{${string}: Opt", `Array`, "Array", `Array` | `Array`, "Array", "Array", "Array", "Array", "Array"]; declare const SIMPLE_MAP_TOKENS$2: readonly ["Map", "Map" | "Map" | "Map" | "Map" | "Map" | "Map" | "Map" | "Map>" | "Map>" | "Map>" | "Map>" | "Map>>" | "Map>>" | "Map>>" | "Map>>" | "Map" | "Map" | "Map" | "Map" | "Map" | "Map" | "Map" | "Map>" | "Map>" | "Map>" | "Map>" | "Map>>" | "Map>>" | "Map>>" | "Map>>" | "Map" | "Map" | "Map" | "Map" | "Map" | "Map" | "Map" | "Map>" | "Map>" | "Map>" | "Map>" | "Map>>" | "Map>>" | "Map>>" | "Map>>" | "Map, string>" | "Map, number>" | "Map, boolean>" | "Map, undefined>" | "Map, unknown>" | "Map, Array>" | "Map, Dict>" | "Map, Dict>" | "Map, Dict>" | "Map, Dict>" | "Map, Dict>" | "Map, Dict>>" | "Map, Dict>>" | "Map, Dict>>" | "Map, Dict>>" | "Map, string>" | "Map, number>" | "Map, boolean>" | "Map, undefined>" | "Map, unknown>" | "Map, Array>" | "Map, Dict>" | "Map, Dict>" | "Map, Dict>" | "Map, Dict>" | "Map, Dict>" | "Map, Dict>>" | "Map, Dict>>" | "Map, Dict>>" | "Map, Dict>>" | "Map, string>" | "Map, number>" | "Map, boolean>" | "Map, undefined>" | "Map, unknown>" | "Map, Array>" | "Map, Dict>" | "Map, Dict>" | "Map, Dict>" | "Map, Dict>" | "Map, Dict>" | "Map, Dict>>" | "Map, Dict>>" | "Map, Dict>>" | "Map, Dict>>" | "Map, string>" | "Map, number>" | "Map, boolean>" | "Map, undefined>" | "Map, unknown>" | "Map, Array>" | "Map, Dict>" | "Map, Dict>" | "Map, Dict>" | "Map, Dict>" | "Map, Dict>" | "Map, Dict>>" | "Map, Dict>>" | "Map, Dict>>" | "Map, Dict>>" | "Map>, string>" | "Map>, number>" | "Map>, boolean>" | "Map>, undefined>" | "Map>, unknown>" | "Map>, Array>" | "Map>, Dict>" | "Map>, Dict>" | "Map>, Dict>" | "Map>, Dict>" | "Map>, Dict>" | "Map>, Dict>>" | "Map>, Dict>>" | "Map>, Dict>>" | "Map>, Dict>>" | "Map>, string>" | "Map>, number>" | "Map>, boolean>" | "Map>, undefined>" | "Map>, unknown>" | "Map>, Array>" | "Map>, Dict>" | "Map>, Dict>" | "Map>, Dict>" | "Map>, Dict>" | "Map>, Dict>" | "Map>, Dict>>" | "Map>, Dict>>" | "Map>, Dict>>" | "Map>, Dict>>" | "Map>, string>" | "Map>, number>" | "Map>, boolean>" | "Map>, undefined>" | "Map>, unknown>" | "Map>, Array>" | "Map>, Dict>" | "Map>, Dict>" | "Map>, Dict>" | "Map>, Dict>" | "Map>, Dict>" | "Map>, Dict>>" | "Map>, Dict>>" | "Map>, Dict>>" | "Map>, Dict>>", "WeakMap"]; declare const SIMPLE_SET_TOKENS$2: readonly ["Set", "Set" | "Set" | "Set" | "Set" | "Set>" | "Set>" | "Set>" | "Set>"]; //#endregion //#region ../constants/src/Social.d.ts declare const SOCIAL_MEDIA$2: [{ readonly name: "Facebook"; readonly description: "Connect with friends, family, and communities worldwide on one of the largest social networks."; readonly baseUrls: ["https://www.facebook.com"]; readonly profileUrl: "https://www.facebook.com/:user_id"; readonly approximateUserSize: 3000000000; readonly tickerSymbol: "META"; }, { readonly name: "YouTube"; readonly description: "A platform for sharing and watching videos, connecting creators with audiences globally."; readonly baseUrls: ["https://www.youtube.com"]; readonly profileUrl: "https://www.youtube.com/user/:user_id"; readonly approximateUserSize: 2500000000; readonly tickerSymbol: "GOOGL"; }, { readonly name: "WhatsApp"; readonly description: "A secure messaging app for personal and business communication."; readonly baseUrls: ["https://www.whatsapp.com", "https://wa.me"]; readonly profileUrl: "https://wa.me/:user_id"; readonly approximateUserSize: 2000000000; readonly tickerSymbol: "META"; }, { readonly name: "Instagram"; readonly description: "Share photos and videos with friends and followers through posts, stories, and reels."; readonly baseUrls: ["https://www.instagram.com"]; readonly profileUrl: "https://www.instagram.com/:user_id"; readonly approximateUserSize: 2000000000; readonly tickerSymbol: "META"; }, { readonly name: "TikTok"; readonly description: "A short-form video platform known for its highly engaging content and viral trends."; readonly baseUrls: ["https://www.tiktok.com"]; readonly profileUrl: "https://www.tiktok.com/@:user_id"; readonly approximateUserSize: 1600000000; }, { readonly name: "WeChat"; readonly description: "China's popular messaging and lifestyle app, integrating social media and mobile payments."; readonly baseUrls: ["https://www.wechat.com"]; readonly profileUrl: "https://www.wechat.com/:user_id"; readonly approximateUserSize: 1300000000; }, { readonly name: "Facebook Messenger"; readonly description: "A messaging app used for personal and business interactions, seamlessly integrated with Facebook."; readonly baseUrls: ["https://www.messenger.com"]; readonly profileUrl: "https://www.messenger.com/t/:user_id"; readonly approximateUserSize: 1000000000; readonly tickerSymbol: "META"; }, { readonly name: "Telegram"; readonly description: "A messaging platform focused on privacy, with channels and group capabilities."; readonly baseUrls: ["https://www.telegram.org", "https://t.me"]; readonly profileUrl: "https://t.me/:user_id"; readonly approximateUserSize: 900000000; }, { readonly name: "Snapchat"; readonly description: "A multimedia app popular for its disappearing messages and creative filters."; readonly baseUrls: ["https://www.snapchat.com"]; readonly profileUrl: "https://www.snapchat.com/add/:user_id"; readonly approximateUserSize: 800000000; readonly tickerSymbol: "SNAP"; }, { readonly name: "Douyin"; readonly description: "The Chinese version of TikTok, with similar short-form video content tailored for China."; readonly baseUrls: ["https://www.douyin.com"]; readonly profileUrl: "https://www.douyin.com/user/:user_id"; readonly approximateUserSize: 750000000; }, { readonly name: "LinkedIn"; readonly description: "The largest professional networking platform, where users connect for career opportunities, insights, and business networking."; readonly baseUrls: ["https://www.linkedin.com"]; readonly profileUrl: "https://www.linkedin.com/in/:user_id"; readonly approximateUserSize: 930000000; readonly tickerSymbol: "MSFT"; }, { readonly name: "X (formerly Twitter)"; readonly description: "A platform for real-time updates, news sharing, and public discourse with a focus on brief, impactful posts."; readonly baseUrls: ["https://www.twitter.com", "https://x.com"]; readonly profileUrl: "https://twitter.com/:user_id"; readonly approximateUserSize: 540000000; }, { readonly name: "Pinterest"; readonly description: "A visually-driven platform for sharing ideas, DIY projects, fashion, and more."; readonly baseUrls: ["https://www.pinterest.com"]; readonly profileUrl: "https://www.pinterest.com/:user_id"; readonly approximateUserSize: 460000000; readonly tickerSymbol: "PINS"; }, { readonly name: "Reddit"; readonly description: "A community-driven platform organized into niche forums or 'subreddits' focused on various topics."; readonly baseUrls: ["https://www.reddit.com"]; readonly profileUrl: "https://www.reddit.com/user/:user_id"; readonly approximateUserSize: 430000000; }, { readonly name: "Clubhouse"; readonly description: "A voice-based social network where users engage in live audio conversations on various topics."; readonly baseUrls: ["https://www.clubhouse.com"]; readonly profileUrl: "https://www.clubhouse.com/:user_id"; readonly approximateUserSize: 10000000; }, { readonly name: "Discord"; readonly description: "Originally aimed at gamers, Discord is now widely used by various communities for group chat, video, and voice calls."; readonly baseUrls: ["https://www.discord.com", "https://discord.com"]; readonly profileUrl: "https://discord.com/users/:user_id"; readonly approximateUserSize: 300000000; }]; //#endregion //#region ../constants/src/Tailwind.d.ts declare const TW_HUE_NEUTRAL$2: { readonly slate: 262; readonly gray: 270; readonly zinc: 269; readonly neutral: 270; readonly stone: 273; }; declare const TW_HUE_VIBRANT$2: { readonly red: 24; readonly orange: 44; readonly amber: 79; readonly yellow: 100; readonly lime: 132; readonly green: 144; readonly emerald: 159; readonly teal: 182; readonly cyan: 192; readonly sky: 219; readonly blue: 240; readonly indigo: 268; readonly violet: 283; readonly purple: 294; readonly fuchsia: 319; readonly pink: 334; readonly rose: 15; }; /** * **TW_COLOR_HUE** * * The _hue_ values for [TailwindCSS](https://tailwindcss.com/docs/customizing-colors) * when moved into the **oklch** color space. */ declare const TW_HUE$2: { readonly black: 0; readonly white: 106.37411429114086; readonly red: 24; readonly orange: 44; readonly amber: 79; readonly yellow: 100; readonly lime: 132; readonly green: 144; readonly emerald: 159; readonly teal: 182; readonly cyan: 192; readonly sky: 219; readonly blue: 240; readonly indigo: 268; readonly violet: 283; readonly purple: 294; readonly fuchsia: 319; readonly pink: 334; readonly rose: 15; readonly slate: 262; readonly gray: 270; readonly zinc: 269; readonly neutral: 270; readonly stone: 273; }; declare const TW_LUMINOSITY$2: { readonly 50: 97.78; readonly 100: 93.56; readonly 200: 88.11; readonly 300: 82.67; readonly 400: 74.22; readonly 500: 64.78; readonly 600: 57.33; readonly 700: 46.89; readonly 800: 39.44; readonly 900: 32; readonly 950: 23.78; }; /** * **TW_CHROMA** * * The possible chroma values from Tailwind CSS when using * the **okhsl** color model. * * **Related:** `TW_CHROMA_50`, `TW_CHROMA_100`, ... */ declare const TW_CHROMA$2: { readonly 50: 0.0108; readonly 100: 0.0321; readonly 200: 0.0609; readonly 300: 0.0908; readonly 400: 0.1398; readonly 500: 0.1472; readonly 600: 0.1299; readonly 700: 0.1067; readonly 800: 0.0898; readonly 900: 0.0726; readonly 950: 0.054; }; /** * The list of "targets" where Tailwind color string references * can be applied to. These domains are prefixes to the color string * when used (e.g., `bg-green-500`) */ declare const TW_COLOR_TARGETS$2: readonly ["bg", "text", "border", "ring", "shadow", "border"]; declare const TW_MODIFIERS_CORE$2: readonly ["dark", "focus", "hover", "active", "visited", "disabled"]; declare const TW_MODIFIERS_ORDER$2: readonly ["first", "last", "odd", "even"]; declare const TW_MODIFIERS_RELN$2: readonly ["focus-within", "focus-visible", "checked", "peer-invalid", "peer-checked/{{string}}"]; /** * The list of page size prefixes which Tailwind provides for adjusting to * device size. These are the defaults and can be customized. */ declare const TW_MODIFIERS_SIZING$2: readonly ["sm", "md", "lg", "xl", "2xl"]; //#endregion //#region ../constants/src/Timezones.d.ts declare const IANA_TIMEZONES$2: readonly ["Africa/Abidjan", "Africa/Accra", "Africa/Addis_Ababa", "Africa/Algiers", "Africa/Asmara", "Africa/Bamako", "Africa/Bangui", "Africa/Banjul", "Africa/Bissau", "Africa/Blantyre", "Africa/Brazzaville", "Africa/Bujumbura", "Africa/Cairo", "Africa/Casablanca", "Africa/Ceuta", "Africa/Conakry", "Africa/Dakar", "Africa/Dar_es_Salaam", "Africa/Djibouti", "Africa/Douala", "Africa/El_Aaiun", "Africa/Freetown", "Africa/Gaborone", "Africa/Harare", "Africa/Johannesburg", "Africa/Juba", "Africa/Kampala", "Africa/Khartoum", "Africa/Kigali", "Africa/Kinshasa", "Africa/Lagos", "Africa/Libreville", "Africa/Lome", "Africa/Luanda", "Africa/Lubumbashi", "Africa/Lusaka", "Africa/Malabo", "Africa/Maputo", "Africa/Maseru", "Africa/Mbabane", "Africa/Mogadishu", "Africa/Monrovia", "Africa/Nairobi", "Africa/Ndjamena", "Africa/Niamey", "Africa/Nouakchott", "Africa/Ouagadougou", "Africa/Porto-Novo", "Africa/Sao_Tome", "Africa/Tripoli", "Africa/Tunis", "Africa/Windhoek", "America/Adak", "America/Anchorage", "America/Anguilla", "America/Antigua", "America/Araguaina", "America/Argentina/Buenos_Aires", "America/Argentina/Catamarca", "America/Argentina/Cordoba", "America/Argentina/Jujuy", "America/Argentina/La_Rioja", "America/Argentina/Mendoza", "America/Argentina/Rio_Gallegos", "America/Argentina/Salta", "America/Argentina/San_Juan", "America/Argentina/San_Luis", "America/Argentina/Tucuman", "America/Argentina/Ushuaia", "America/Aruba", "America/Asuncion", "America/Atikokan", "America/Atka", "America/Bahia", "America/Bahia_Banderas", "America/Barbados", "America/Belem", "America/Belize", "America/Blanc-Sablon", "America/Boa_Vista", "America/Bogota", "America/Boise", "America/Cambridge_Bay", "America/Campo_Grande", "America/Cancun", "America/Caracas", "America/Cayenne", "America/Cayman", "America/Chicago", "America/Chihuahua", "America/Creston", "America/Cuiaba", "America/Curacao", "America/Danmarkshavn", "America/Dawson", "America/Dawson_Creek", "America/Denver", "America/Detroit", "America/Dominica", "America/Edmonton", "America/Eirunepe", "America/El_Salvador", "America/Fort_Nelson", "America/Fortaleza", "America/Glace_Bay", "America/Godthab", "America/Goose_Bay", "America/Grand_Turk", "America/Grenada", "America/Guadeloupe", "America/Guatemala", "America/Guayaquil", "America/Guyana", "America/Halifax", "America/Havana", "America/Hermosillo", "America/Indiana/Indianapolis", "America/Indiana/Knox", "America/Indiana/Marengo", "America/Indiana/Petersburg", "America/Indiana/Tell_City", "America/Indiana/Vevay", "America/Indiana/Vincennes", "America/Indiana/Winamac", "America/Inuvik", "America/Iqaluit", "America/Jamaica", "America/Juneau", "America/Kentucky/Louisville", "America/Kentucky/Monticello", "America/Kralendijk", "America/La_Paz", "America/Lima", "America/Los_Angeles", "America/Lower_Princes", "America/Maceio", "America/Managua", "America/Manaus", "America/Marigot", "America/Martinique", "America/Matamoros", "America/Mazatlan", "America/Menominee", "America/Merida", "America/Metlakatla", "America/Mexico_City", "America/Miquelon", "America/Moncton", "America/Monterrey", "America/Montevideo", "America/Montserrat", "America/Nassau", "America/New_York", "America/Nipigon", "America/Nome", "America/Noronha", "America/North_Dakota/Beulah", "America/North_Dakota/Center", "America/North_Dakota/New_Salem", "America/Ojinaga", "America/Panama", "America/Pangnirtung", "America/Paramaribo", "America/Phoenix", "America/Port-au-Prince", "America/Port_of_Spain", "America/Porto_Velho", "America/Puerto_Rico", "America/Punta_Arenas", "America/Rainy_River", "America/Rankin_Inlet", "America/Recife", "America/Regina", "America/Resolute", "America/Rio_Branco", "America/Santarem", "America/Santiago", "America/Santo_Domingo", "America/Sao_Paulo", "America/Scoresbysund", "America/Sitka", "America/St_Barthelemy", "America/St_Johns", "America/St_Kitts", "America/St_Lucia", "America/St_Thomas", "America/St_Vincent", "America/Swift_Current", "America/Tegucigalpa", "America/Thule", "America/Thunder_Bay", "America/Tijuana", "America/Toronto", "America/Tortola", "America/Vancouver", "America/Whitehorse", "America/Winnipeg", "America/Yakutat", "America/Yellowknife", "Antarctica/Casey", "Antarctica/Davis", "Antarctica/DumontDUrville", "Antarctica/Macquarie", "Antarctica/Mawson", "Antarctica/McMurdo", "Antarctica/Palmer", "Antarctica/Rothera", "Antarctica/South_Pole", "Antarctica/Syowa", "Antarctica/Troll", "Antarctica/Vostok", "Arctic/Longyearbyen", "Asia/Almaty", "Asia/Amman", "Asia/Anadyr", "Asia/Aqtau", "Asia/Aqtobe", "Asia/Ashgabat", "Asia/Atyrau", "Asia/Baghdad", "Asia/Baku", "Asia/Bangkok", "Asia/Barnaul", "Asia/Beirut", "Asia/Bishkek", "Asia/Brunei", "Asia/Chita", "Asia/Choibalsan", "Asia/Colombo", "Asia/Damascus", "Asia/Dhaka", "Asia/Dili", "Asia/Dubai", "Asia/Dushanbe", "Asia/Famagusta", "Asia/Gaza", "Asia/Hebron", "Asia/Ho_Chi_Minh", "Asia/Hong_Kong", "Asia/Hovd", "Asia/Irkutsk", "Asia/Jakarta", "Asia/Jayapura", "Asia/Jerusalem", "Asia/Kabul", "Asia/Kamchatka", "Asia/Karachi", "Asia/Kathmandu", "Asia/Khandyga", "Asia/Kolkata", "Asia/Krasnoyarsk", "Asia/Kuala_Lumpur", "Asia/Kuching", "Asia/Kuwait", "Asia/Macau", "Asia/Magadan", "Asia/Makassar", "Asia/Manila", "Asia/Muscat", "Asia/Nicosia", "Asia/Novokuznetsk", "Asia/Novosibirsk", "Asia/Omsk", "Asia/Oral", "Asia/Phnom_Penh", "Asia/Pontianak", "Asia/Pyongyang", "Asia/Qatar", "Asia/Qostanay", "Asia/Qyzylorda", "Asia/Riyadh", "Asia/Sakhalin", "Asia/Samarkand", "Asia/Seoul", "Asia/Shanghai", "Asia/Singapore", "Asia/Srednekolymsk", "Asia/Taipei", "Asia/Tashkent", "Asia/Tbilisi", "Asia/Tehran", "Asia/Thimphu", "Asia/Tokyo", "Asia/Tomsk", "Asia/Ulaanbaatar", "Asia/Urumqi", "Asia/Ust-Nera", "Asia/Vientiane", "Asia/Vladivostok", "Asia/Yakutsk", "Asia/Yangon", "Asia/Yekaterinburg", "Asia/Yerevan", "Atlantic/Azores", "Atlantic/Bermuda", "Atlantic/Canary", "Atlantic/Cape_Verde", "Atlantic/Faroe", "Atlantic/Madeira", "Atlantic/Reykjavik", "Atlantic/South_Georgia", "Atlantic/St_Helena", "Atlantic/Stanley", "Australia/Adelaide", "Australia/Brisbane", "Australia/Broken_Hill", "Australia/Currie", "Australia/Darwin", "Australia/Eucla", "Australia/Hobart", "Australia/Lindeman", "Australia/Lord_Howe", "Australia/Melbourne", "Australia/Perth", "Australia/Sydney", "Europe/Amsterdam", "Europe/Andorra", "Europe/Astrakhan", "Europe/Athens", "Europe/Belgrade", "Europe/Berlin", "Europe/Brussels", "Europe/Bucharest", "Europe/Budapest", "Europe/Chisinau", "Europe/Copenhagen", "Europe/Dublin", "Europe/Gibraltar", "Europe/Guernsey", "Europe/Helsinki", "Europe/Isle_of_Man", "Europe/Istanbul", "Europe/Jersey", "Europe/Kaliningrad", "Europe/Kiev", "Europe/Kirov", "Europe/Lisbon", "Europe/Ljubljana", "Europe/London", "Europe/Luxembourg", "Europe/Madrid", "Europe/Malta", "Europe/Mariehamn", "Europe/Minsk", "Europe/Monaco", "Europe/Moscow", "Europe/Oslo", "Europe/Paris", "Europe/Podgorica", "Europe/Prague", "Europe/Riga", "Europe/Rome", "Europe/Samara", "Europe/San_Marino", "Europe/Sarajevo", "Europe/Simferopol", "Europe/Skopje", "Europe/Sofia", "Europe/Stockholm", "Europe/Tallinn", "Europe/Tirane", "Europe/Ulyanovsk", "Europe/Uzhgorod", "Europe/Vaduz", "Europe/Vatican", "Europe/Vienna", "Europe/Vilnius", "Europe/Volgograd", "Europe/Warsaw", "Europe/Zagreb", "Europe/Zaporozhye", "Europe/Zurich", "Indian/Antananarivo", "Indian/Chagos", "Indian/Christmas", "Indian/Cocos", "Indian/Comoro", "Indian/Kerguelen", "Indian/Mahe", "Indian/Maldives", "Indian/Mauritius", "Indian/Mayotte", "Indian/Reunion", "UTC", "Zulu", "Pacific/Apia", "Pacific/Auckland", "Pacific/Bougainville", "Pacific/Chatham", "Pacific/Chuuk", "Pacific/Easter", "Pacific/Efate", "Pacific/Enderbury", "Pacific/Fakaofo", "Pacific/Fiji", "Pacific/Funafuti", "Pacific/Galapagos", "Pacific/Gambier", "Pacific/Guadalcanal", "Pacific/Guam", "Pacific/Honolulu", "Pacific/Kiritimati", "Pacific/Kosrae", "Pacific/Kwajalein", "Pacific/Majuro", "Pacific/Marquesas", "Pacific/Midway", "Pacific/Nauru", "Pacific/Niue", "Pacific/Norfolk", "Pacific/Noumea", "Pacific/Pago_Pago", "Pacific/Palau", "Pacific/Pitcairn", "Pacific/Pohnpei", "Pacific/Port_Moresby", "Pacific/Rarotonga", "Pacific/Saipan", "Pacific/Tahiti", "Pacific/Tarawa", "Pacific/Tongatapu", "Pacific/Wake", "Pacific/Wallis"]; //#endregion //#region ../constants/src/TypeOf.d.ts /** * **TYPE_OF** * * The set of values which are possible results of the `typeof` command in Javascript. */ declare const TYPE_OF$2: readonly ["string", "number", "boolean", "undefined", "symbol", "bigint", "function", "object"]; //#endregion //#region ../constants/src/TypeTokens.d.ts /** * **Type Tokens** which have zero configuration elements. */ declare const TT_ATOMICS$2: readonly ["undefined", "null", "boolean", "true", "false"]; /** * **Type Tokens** which have a literal variant which represents * the _single_ configuration of this type which is available. */ declare const TT_SINGLETONS$2: readonly ["string", "number"]; declare const TT_SETS$2: readonly ["string-set", "numeric-set", "fn-set", "union-set"]; /** * **Type Tokens** which represent _functions_ (either the typical * variety or Generator functions). */ declare const TT_FUNCTIONS$2: readonly ["fn", "gen"]; /** * **Type Tokens** which _contain_ other **Type Tokens** to make up their * identity. */ declare const TT_CONTAINERS$2: readonly ["rec", "arr", "set", "map", "union", "obj", "tuple"]; declare const TT_START$2: "<<"; declare const TT_STOP$2: ">>"; declare const TT_DELIMITER$2: "::"; //#endregion //#region ../constants/src/TypeTokenVariants.d.ts declare const TYPE_TOKEN_REC_VARIANTS$2: readonly ["object-key", "string-key"]; declare const TYPE_TOKEN_REC_KEY_VARIANTS$2: readonly ["unknown", "any", "string", "number", "boolean", "truthy", "numberlike", "scalar", "object", "string|undefined", "number|undefined", "boolean|undefined", "object|undefined", "unknown[]", "any[]", "string[]", "number[]", "boolean[]"]; declare const TYPE_TOKEN_STRING_SET_VARIANTS$2: readonly ["endsWith::${string}", "startsWith::${string}", "contains::${string}", "civilianTime", "militaryTime", "ipv4Address", "ipv4Address::tight", "ipv4Address::loose", "ipv6Address", "ipv6Address::${string}", "numericString", "zipCode5", "zipCode5+4", "countryCode2", "countryCode3", "countryName", "capitalized", "url", "url::${string}", "isoDate", "isoDateTime", "usStateAbbrev", "usCitySuggestions", "metricCategory", "metric", "metric::${Metric}"]; declare const TYPE_TOKEN_UNION_SET_VARIANTS$2: string[]; //#endregion //#region ../types/src/base-types/AnyMap.d.ts /** * represents _any_ `Map` type */ type AnyMap$1 = Map; //#endregion //#region ../types/src/base-types/AnyObject.d.ts /** * **AnyObject** * * Meant to represent any valid object type (both indexable and not). */ type AnyObject$1 = Dictionary$1 | EmptyObject$1 | ExplicitlyEmptyObject$1; //#endregion //#region ../types/src/base-types/AnySet.d.ts /** * represents _any_ `Set` type */ type AnySet$1 = Set; //#endregion //#region ../types/src/base-types/AnyWeakMap.d.ts /** * represents _any_ `WeakMap` type */ type AnyWeakMap$1 = WeakMap; //#endregion //#region ../types/src/base-types/Container.d.ts /** * **Container** * * A type which represents common container types including: * * - any object-based dictionary type (Record) * - any array or tuple * - any `Map`, `WeakMap`, or `Set` * * Note: functions are intentionally excluded to avoid excessive type * comparisons when treating functions as containers. */ type Container$1 = readonly unknown[] | Dictionary$1 | Map | WeakMap | Set; //#endregion //#region ../types/src/base-types/Defined.d.ts /** * **Defined** * * Represents **every** type except for the _undefined_ type. */ type Defined$1 = Something$1 | null; //#endregion //#region ../types/src/base-types/Dictionary.d.ts /** * **Dictionary**`<[K],[V]>` * * Represents a Key/Value dictionary type. * * **Note:** this is pretty much the same as the built-in * `Record` type of Typescript but */ type Dictionary$1 = Record; //#endregion //#region ../types/src/base-types/Empty.d.ts /** * **Empty** * * values/types considered to be "empty" */ type Empty$1 = undefined | null | ExplicitlyEmptyObject$1 | [] | ""; //#endregion //#region ../types/src/base-types/EmptyObject.d.ts /** * **EmptyObject** * * An object/dictionary with **no** defined properties. */ type EmptyObject$1 = NonNullable; /** * **ExplicitlyEmptyObject** * * An `EmptyObject` with it's index keys set to _never_ (which prohibits any * key from being added) */ type ExplicitlyEmptyObject$1 = NonNullable<{ [x: string]: never; [x: symbol]: never; }>; //#endregion //#region ../types/src/base-types/FalsyValue.d.ts /** * **FalsyValue** * * A union of all _falsy_ values. * * **Note:** * - any value which is _not_ falsy is "truthy" * - in addition to the types in this union type; `NaN` too is * considered _falsy_ but there is no type representation for this. */ type FalsyValue$1 = false | 0 | -0 | "" | "false" | null | undefined; //#endregion //#region ../types/src/base-types/fns/AnyFunction.d.ts /** * **AnyFunction** * * A type which is meant to match on _all_ types of functions which can exist. */ type AnyFunction$1 = CallableFunction; //#endregion //#region ../types/src/base-types/fns/OptionalParamFn.d.ts /** * **OptionalParamFn** * * A function which either has _no_ parameters or any parameters it * does have are _optional_ in a way that it is safe to call it without * any parameters. * * To make the runtime aware of this flexibility, a property `optionalParams` * must be set to **true**. To convert a regular function to be this kind of * function you can use the `AsOptionalParamFn` utility. */ type OptionalParamFn$1 = ((() => any) | ((p1?: any, p2?: any, p3?: any, p4?: any) => any)) & { optionalParams: true; }; //#endregion //#region ../types/src/base-types/fns/ParameterlessFn.d.ts /** * **ParameterlessFn** * * A function which returns takes no parameters. */ type ParameterlessFn$1 = () => R; //#endregion //#region ../types/src/base-types/fns/TakeFunction.d.ts /** * **TakeWrapper** * * A builder/wrapper function around the core take callback. */ type TakeWrapper$1 = , TParseString extends string, TLexerTokens extends readonly TToken[]>(state: TState) => StartsWith$2 extends true ? LexerState$1, [...TLexerTokens, TToken]> | Error : NoMatch$1; //#endregion //#region ../types/src/literals/BooleanLike.d.ts /** * **BooleanLike** * * A union of all boolean types plus the string literal representations of these * literals. */ type BooleanLike$1 = boolean | "true" | "false" | "boolean"; //#endregion //#region ../types/src/literals/branding/BrandSymbol.d.ts declare const BrandSymbol$1: unique symbol; //#endregion //#region ../types/src/literals/branding/Brand.d.ts /** * **Brand** * * Brands a scalar `Base` type with `{ [BrandSymbol]: Kind }`. * * - you may optionally choose to add other key/value pairs * to the metadata. */ type Brand$1 | undefined = undefined> = [Kv] extends [undefined] ? Base & { [BrandSymbol$1]: Kind; } : Base & { [BrandSymbol$1]: Kind; } & Kv; //#endregion //#region ../types/src/literals/branding/IsBranded.d.ts /** * **IsBranded**`` * * Boolean operator which tests whether `T` has been _branded_ with the * `Brand` utility. */ type IsBranded$1 = typeof BrandSymbol$1 extends keyof T ? true : false; //#endregion //#region ../types/src/literals/branding/Unbrand.d.ts type Digit$6$1 = "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9"; type ValidTwoDigitMonth$1$1 = `0${Exclude}` | `1${"0" | "1" | "2"}`; type ValidTwoDigitDate$1$1 = `0${Exclude}` | `1${Digit$6$1}` | `2${Digit$6$1}` | `3${"0" | "1"}`; type UnbrandTwoDigitMonth$1 = { [M in ValidTwoDigitMonth$1$1]: T extends Brand$1 ? M : never }[ValidTwoDigitMonth$1$1]; type UnbrandTwoDigitDate$1 = { [D in ValidTwoDigitDate$1$1]: T extends Brand$1 ? D : never }[ValidTwoDigitDate$1$1]; /** * **Unbrand**`` * * Removes branding from a branded type, returning the original base type. * * Note: This utility has a known limitation with intersection types. * When a branded type is intersected with a literal (e.g., `Brand & "literal"`), * TypeScript creates a composite type that cannot be decomposed to extract just the literal. * This is a fundamental TypeScript limitation. * * @example * * ```ts * // string & { [Brand Symbol]: "UserId" } * type Branded = Brand; * type Unbranded = Unbrand; // string * ``` */ type Unbrand$1 = T extends `${infer A extends Digit$6$1}${infer B extends Digit$6$1}${infer C extends Digit$6$1}${infer D extends Digit$6$1}` & { [BrandSymbol$1]: "FourDigitYear"; } ? `${A}${B}${C}${D}` : T extends { [BrandSymbol$1]: "TwoDigitMonth"; } ? UnbrandTwoDigitMonth$1 : T extends { [BrandSymbol$1]: "TwoDigitDate"; } ? UnbrandTwoDigitDate$1 : T extends Brand$1 ? B : T; //#endregion //#region ../types/src/literals/Color.d.ts /** * **HexColor** * * A color value based in hexadecimal format */ type HexColor$1 = `#${HexadecimalChar$1}${HexadecimalChar$1}${string}`; /** * **RgbColor** * * Type to enforce an `rgb()` color definition */ type RgbColor$1 = CssRgb$1; //#endregion //#region ../types/src/literals/ExpandRecursively.d.ts type ExpandParameters$1 = [] extends TParams ? IsNarrowingFn$1 extends true ? AsNarrowingFn$1, ExpandDictionary$1>> : AsStaticFn$1, ExpandDictionary$1>> : ExpandParameters$1, [...TResults, First$1$1 extends Dictionary$1 ? ExpandDictionary$1> : First$1$1]>; /** * Recursively goes over an object based structure and tries to reduce * it down to just a simple key/value type. */ type ExpandRecursively$1 = T extends Dictionary$1 ? { [K in keyof T]: T[K] extends AnyFunction$1 ? T[K] extends TypedFunction$1 ? ExpandParameters$1> : T[K] : ExpandRecursively$1 } : T; /** * Recursively goes over an object based structure and tries to reduce * it down to just a simple key/value type. */ type ExpandDictionary$1 = T extends Dictionary$1 ? { [K in keyof T]: T[K] extends AnyFunction$1 ? T[K] : ExpandRecursively$1 } : T; type Expand$1 = T extends infer O ? { [K in keyof O]: O[K] } : never; //#endregion //#region ../types/src/literals/FromTokenNames.d.ts type WideTokenNames$1 = "string" | "number" | "boolean" | "null" | "undefined" | "never" | "unknown" | "string[]" | "number[]" | "boolean[]" | "unknown[]"; type ConvertWideTokenNames$1 = T extends "string" ? string : T extends "number" ? number : T extends "boolean" ? boolean : T extends "null" ? null : T extends "undefined" ? undefined : T extends "never" ? never : T extends "unknown" ? unknown : T extends "string[]" ? string[] : T extends "number[]" ? number[] : T extends "boolean[]" ? boolean[] : T extends "unknown[]" ? unknown[] : never; type WideContainerNames$1 = "object" | "Dictionary" | "Map" | "Set" | "WeakMap"; type ConvertWideContainerNames$1 = T extends "object" ? object : T extends "Dictionary" ? Record : T extends "Map" ? Map : T extends "Set" ? Set : T extends "WeakMap" ? WeakMap : never; /** * **FromWideTokens**`` * * Looks for `WideContainerNames` or `WideTokenNames` and converts them to * the type they describe. If it is `T` is not any of these tokens it is * simply proxied through. * * If you'd prefer to setup a different type for when no token is matched * you can add it under `TElse`. */ type FromWideTokens$1 = T extends WideTokenNames$1 | WideContainerNames$1 ? T extends WideTokenNames$1 ? ConvertWideTokenNames$1 : T extends WideContainerNames$1 ? ConvertWideContainerNames$1 : never : IsNever$1 extends true ? T : TElse; //#endregion //#region ../types/src/literals/Narrowable.d.ts /** * **Narrowable** * * A union of types which when used as a generic's base value helps to extract * the most narrow definition available. * * **Related:** `NarrowableDefined`, `NarrowableScalar` */ type Narrowable$1 = string | number | boolean | symbol | object | undefined | void | null; //#endregion //#region ../types/src/literals/RuntimeUnion.d.ts /** * **RuntimeUnion**`` * * Represents a _union type_ at runtime where the `ReturnType` is the * union type of the member in the `members` array. */ interface RuntimeUnion$1 { kind: "Union"; members: T; type: TupleToUnion$1; includes: (v: unknown) => boolean; } //#endregion //#region ../types/src/literals/Unset.d.ts /** * **Unset** * * The **Unset** type allows you to specify a _parameter_ which * has **not** been set yet but then allows a user to choose any * value they like. * * **Related:** `unset()` */ interface Unset$1 { kind: "Unset"; } //#endregion //#region ../types/src/literals/VueRef.d.ts declare const Ref$1: unique symbol; /** * **VueRef**`` * * Intended to be the same type as VueJS's `Ref` but without the need * to include any of the VueJS framework in deps. * * **Notes:** * * - a real `Ref` has both the `value` property and a _private_ symbol * exposed to the runtime as a type (but the type is intentionally not exported). * - whenever using this type, please use it with `IsRef()`,`isRef()` utils * * **Related:** * * - `IsRef`, `isRef()`, `VueComputedRef` */ interface VueRef$1 { [Ref$1]: "VueRef"; value: T; } //#endregion //#region ../types/src/base-types/fns/TypedFunction.d.ts /** * **TypedFunction**`<[P],[R]>` * * A function which has basic typing information. * * **Related:** `TypedFunctionWithDictionary>` */ type TypedFunction$1

= ((...args: P) => R); //#endregion //#region ../types/src/base-types/functional/LeftRight.d.ts /** * **LeftRight**`` * * A tuple which has two possible states represented as `L` * and `R`. * * **Related:** `AsLeft`, `AsRight`, `WhereLeft`, `HandleRight`, `LeftExtends`, ... */ type LeftRight$1 = [kind: "LeftRight", left: L, right: R]; //#endregion //#region ../types/src/base-types/Indexable.d.ts /** * **Indexable** * * A type which can be _indexed_. This means either an array of * some sort, an indexable object, a `Map`, or a `WeakMap`. */ type Indexable$1 = IndexableObject$1 | unknown[] | readonly unknown[] | WeakMap | Map; //#endregion //#region ../types/src/base-types/IndexableObject.d.ts type Len$1$1 = UnionToTuple$2>["length"]; /** * **IndexableObject**`<[TObj], [TIndex]>` * * Type utility which receives a `KV` object and and adds an _index signature_ * so that other properties may be added in the runtime. * * - by default the index signature is `{ [key: string]: unknown; [key: symbol]: unknown }` * but this can be changed by changing `TIndex` * * ```ts * // { [x: string]: unknown; foo: 1; bar: 2 } * type FooBarIdx = IndexableObject<{foo: 1; bar: 2}, KV>; * ``` * * **Related:** `EmptyObject`, `IndexedObject` */ type IndexableObject$1 = If$1, never, IsEqual$1 extends true ? Dictionary$1 : IsNever$1> extends true ? Dictionary$1 : ExpandRecursively$1>>; //#endregion //#region ../types/src/base-types/LikeRegExp.d.ts /** * **LikeRegExp** * * Is either a real Regular Expression or a string * that has been has been validated it _can_ be a * regular expression with utilities like `isLikeRegExp()` */ type LikeRegExp$1 = RegExp | string; //#endregion //#region ../types/src/base-types/NarrowObject.d.ts /** * **NarrowObject**`` * * Defines a `Record` type who's values extends `Narrowable`. This type is most * commonly used in runtime settings where a function wants to _extend_ this * type to ensure that the received values are as narrow as could be available * from the input source. */ type NarrowObject$1 = Record; //#endregion //#region ../types/src/base-types/Nothing.d.ts /** * **Nothing** * * This type represents a type which holds no real value; this * is a union between `null` and `undefined`. */ type Nothing$1 = null | undefined; //#endregion //#region ../types/src/base-types/ObjectKey.d.ts /** * **ObjectKey** * * The union of `string` and `symbol` represents the valid key types for a * object/dictionary type. */ type ObjectKey$1 = string | symbol; //#endregion //#region ../types/src/base-types/objects/FromTo.d.ts /** * An object type which semantically is meant to express the * movement from one type to another. * * - it can be used to express any type movement but the most * common scenario is to move from one string literal to another * so both TFrom and TTo _default_ to `string`. */ interface FromTo$1 { from: TFrom; to: TTo; } //#endregion //#region ../types/src/base-types/Scalar.d.ts /** * **Scalar** * * Defines the types which makeup a "scalar" type. */ type Scalar$1 = string | number | bigint | boolean | null | symbol | undefined | void; //#endregion //#region ../types/src/base-types/Something.d.ts /** * **Something** * * This type represents **any** type _other than_ `null` or `undefined` (aka, the `Nothing` types). * * **Note:** _this is equivalent to the `{}` type (which is often a surprise to many)_ */ interface Something$1 {} //#endregion //#region ../types/src/base-types/Thenable.d.ts /** * **Thenable**`` * * An object which resembles a promise and is guarenteed to provide a `.then` and `.catch` * callback hook. */ interface Thenable$1 extends PromiseLike { then: (...args: any[]) => any; } //#endregion //#region ../types/src/base-types/Tuple.d.ts type TupleRange$1 = [required: number, optional: number]; type _Tuple$1 = 0 extends TLength ? TType extends unknown[] ? Readonly : readonly TType[] : TLength extends number ? Readonly> : TLength extends TupleRange$1 ? Readonly<[...FixedLengthArray$1, ...FixedLengthArray$1]> : TLength extends `${infer Num extends number}+` ? Num extends number ? Readonly<[...FixedLengthArray$1, ...TType[]]> : never : never; /** * **Tuple**`` * * As a default, a **Tuple** is represented as a readonly array of _unknown_ properties. * * - by expressing `TType` you can state either a constant type _or_ a list of types * - by expressing `TLength` it will make the tuple a fixed length (assuming that `TType` * is set to a constant value rather than as a list) * ```ts * // readonly unknown[] * type T1 = Tuple; * // readonly [string, string, string, string] * type T2 = Tuple; * ``` */ type Tuple$1$1 = _Tuple$1 extends readonly unknown[] ? _Tuple$1 : never; //#endregion //#region ../types/src/base-types/Variable.d.ts /** * **Variable** * * the **Variable** type reinforces that a variable: * * - start with an alpha character (upper or lower) * - end with an alphanumeric character * * Further type safety would become too expensive. */ type Variable$1 = `${AlphaChar$1}${string}${AlphanumericChar$1}`; //#endregion //#region ../types/src/boolean-logic/branching/Fallback.d.ts /** * **Fallback**`` * * Branching operator which allows giving a value `TVal` a _default value_ when * it's value is either `null`, `undefined`, or `never`. */ type Fallback$1 = [IsUnion$1] extends [true] ? [UnionMemberExtends$1] extends [true] ? UnionFilter$1 | TFallback : TVal : IsNull$1 extends true ? TFallback : IsUndefined$1 extends true ? TFallback : TVal; //#endregion //#region ../types/src/boolean-logic/branching/If.d.ts /** * **If**`` * * Branching utility which tests `TTest` for a boolean value. */ type If$1 = [IsNever$1] extends [true] ? TNever : [TTest] extends [Error] ? TError : [TTest] extends [boolean] ? [IsTrue$1] extends [true] ? TIf : [IsBooleanLiteral$1] extends [true] ? TElse : TMaybe : [TTest] extends [LogicFunction$1] ? [IsTrue$1>] extends [true] ? TIf : [IsFalse$1>] extends [true] ? TElse : [IsBoolean$1>] extends [true] ? TMaybe : never : never; //#endregion //#region ../types/src/boolean-logic/branching/IfAllLiteral.d.ts /** * **IfAllLiteral**`` * * Branching utility which branches on whether the tuple passed in * has _literal_ values for every member. */ type IfAllLiteral$1 = AllLiteral$1 extends true ? IF : ELSE; //#endregion //#region ../types/src/boolean-logic/branching/IfEqual.d.ts /** * **IfEqual**`` * * Type utility which returns type `IF` _if_ `X` is equal to `Y`; otherwise returns * type `ELSE`. */ type IfEqual$1> = IsEqual$1 extends true ? IF : ELSE; //#endregion //#region ../types/src/boolean-logic/branching/IfLength.d.ts /** * **IfLength**`` * * Type utility which returns type `IF` when `TEvaluate` evaluates to being * a length of `TLength`. It returns type `ELSE` if it can determine the length * at design time and otherwise returns `MAYBE`. * * - the `ELSE` type will default to `TEvaluate` by default * - the `MAYBE` type will default to `IF | ELSE` by default * - If a _non-array_ type is passed into `TEvaluate` then utility will result `ELSE` * type. */ type IfLength$1 = TEvaluate extends readonly unknown[] ? IsNumericLiteral$1 extends true ? IfEqual$1, TLength, IF, ELSE> : MAYBE : TEvaluate extends unknown[] ? MAYBE : TEvaluate extends string ? If$1, IfEqual$1, TLength, IF, ELSE>, MAYBE> : MAYBE; //#endregion //#region ../types/src/boolean-logic/branching/IfNever.d.ts /** * **IfNever**`` * * Type utility which transforms type `T` based on whether it extends the _never_ * type. */ type IfNever$1 = [IsNever$1] extends [true] ? IF : ELSE; //#endregion //#region ../types/src/boolean-logic/branching/IfUnset.d.ts /** * **IfUnset**`` * * Branching utility which will proxy _any_ type through except * for those set with `Unset<[T]>`. * * When `Unset` is found then it will be replaced with `TElse`. */ type IfUnset$1 = TTest extends Unset$1 ? TElse : Exclude; //#endregion //#region ../types/src/boolean-logic/combinators/And.d.ts interface LogicOptions$1$1 { empty?: boolean | unknown; err?: "false" | "error" | unknown; } type Reduce$2$1 = { [K in keyof T]: T[K] extends TypedFunction$1 ? ReturnType : T[K] }; /** * **And**`` * * Performs logical AND operation on an array of boolean values or functions returning boolean. * * - Returns `false` if any element is `false` * - Returns `boolean` if any element is wide `boolean` type * - Returns `true` if all elements are `true` * - Returns `false` for empty arrays (or value from options.empty) * - Returns `boolean` for wide arrays (length not known at compile time) * - Supports functions that return boolean values * - Configurable error handling via options parameter * * **Related:** `Or`, `Not` */ type And$1 = IsAny$1 extends true ? TOpt extends { err: "error"; } ? Err$1<"invalid/and", "The And logical combinator has a 'any' type! And is expecting a tuple of boolean values (or functions which return boolean).", { library: "inferred-types"; }> : false : IsNever$1 extends true ? TOpt extends { err: "error"; } ? Err$1<"invalid/and", "The And logical combinator has a 'never' type! And is expecting a tuple of boolean values (or functions which return boolean).", { library: "inferred-types"; }> : false : HasAny$1<[...T]> extends true ? TOpt extends { err: "error"; } ? Err$1<"invalid/and", "The And found elements in T which were the 'any' type! And expects all elements to be a boolean value or a function which returns a boolean value.", { value: T; library: "inferred-types"; }> : false : HasNever$1<[...T]> extends true ? TOpt extends { err: "error"; } ? Err$1<"invalid/and", "The And found elements in T which were the 'never' type! And expects all elements to be a boolean value or a function which returns a boolean value.", { value: T; library: "inferred-types"; }> : false : [[...T]] extends [readonly (boolean | TypedFunction$1)[]] ? number extends T["length"] ? boolean : [[]] extends [[...T]] ? TOpt extends { empty: infer E; } ? E : false : [[...T]] extends [readonly boolean[]] ? HasFalse$1 extends true ? false : HasWideBoolean$1 extends true ? boolean : true : Reduce$2$1<[...T]> extends readonly boolean[] ? HasFalse$1> extends true ? false : HasWideBoolean$1> extends true ? boolean : true : TOpt extends { err: "error"; } ? Err$1<"invalid/and", "The conditions passed into And could not be reduced down to just a boolean array.", { library: "inferred-types"; value: T; }> : false : TOpt extends { err: "error"; } ? Err$1<"invalid/and", "The And type utility requires that all elements passed to it are either a boolean value directly or a LogicFunction which returns a boolean value"> : false; //#endregion //#region ../types/src/boolean-logic/combinators/comparison/Compare.d.ts type ContainsAllParams$1 = number extends TParams["length"] ? boolean : TParams extends readonly [infer Head, ...infer Rest] ? Contains$1 extends true ? ContainsAllParams$1 : false : true; /** * **Comparator** * * A _comparator_ is a runtime function which is created when calling * the `compare(op, params) utility. * * - a _comparator_ also has `op`, and `params` properties */ type Comparator$1 = [IsNever$1] extends [true] ? Err$1<`invalid-operation`, `An invalid operation was presented as a Comparator!`> : { kind: "comparator"; op: TOp; params: TParams; } & (>(val: TVal) => Compare$1); type Process__DateTime$1 = TOp extends "after" ? TVal extends DateLike$1 ? First$1$1 extends DateLike$1 ? IsAfter$1> : false : Err$1<`invalid-value/not-date-like`> : TOp extends "before" ? TVal extends DateLike$1 ? First$1$1 extends DateLike$1 ? IsBefore$1> : Err$1<`invalid-params/not-date-like`, `The '${TOp}' operation expects the parameter used for comparator to be a valid representation of a date but it was not!`, { param: TVal; val: TVal; }> : Err$1<`invalid-value/not-date-like`, `The '${TOp}' operation expects the value passed in to be a valid representation of a date but it was not!`, { val: TVal; }> : TOp extends "sameDay" ? TVal extends DateLike$1 ? First$1$1 extends DateLike$1 ? IsSameDay$1> : Err$1<`invalid-params/not-date-like`> : Err$1<`invalid-value/not-date-like`> : TOp extends "sameMonthYear" ? TVal extends DateLike$1 ? First$1$1 extends DateLike$1 ? IsSameMonthYear$1> : Err$1<`invalid-params/not-date-like`, `The '${TOp}' operation expects the parameter used for comparator to be a valid representation of a date but it was not!`, { param: TVal; val: TVal; }> : Err$1<`invalid-value/not-date-like`, `The '${TOp}' operation expects the value passed in to be a valid representation of a date but it was not!`, { val: TVal; }> : TOp extends "sameMonth" ? TVal extends DateLike$1 ? First$1$1 extends DateLike$1 ? IsSameMonth$1> : Err$1<`invalid-params/not-date-like`, `The '${TOp}' operation expects the parameter used for comparator to be a valid representation of a date but it was not!`, { param: TVal; val: TVal; }> : Err$1<`invalid-value/not-date-like`, `The '${TOp}' operation expects the value passed in to be a valid representation of a date but it was not!`, { val: TVal; }> : TOp extends "sameYear" ? TVal extends DateLike$1 ? First$1$1 extends DateLike$1 ? IsSameYear$1> : Err$1<`invalid-params/not-date-like`, `The '${TOp}' operation expects the parameter used for comparator to be a valid representation of a date but it was not!`, { param: TVal; val: TVal; }> : Err$1<`invalid-value/not-date-like`, `The '${TOp}' operation expects the value passed in to be a valid representation of a date but it was not!`, { val: TVal; }> : Unset$1; type Process__General$1 = TOp extends "extends" ? DoesExtend$1> : TOp extends "equals" ? IsEqual$1 : TOp extends "false" ? [TVal] extends [boolean] ? [boolean] extends [TVal] ? boolean : IsFalse$1 : [TVal] extends [null] ? false : [TVal] extends [undefined] ? false : [TVal] extends [0] ? false : [TVal] extends [""] ? false : [TVal] extends [true] ? false : [TVal] extends [false] ? true : IsFalse$1 : TOp extends "falsy" ? IsFalsy$1 : TOp extends "true" ? AreIncompatible$1 extends true ? false : IsTrue$1 : TOp extends "truthy" ? IsTruthy$1 : TOp extends "equalsSome" ? TParams extends readonly [...infer L] ? number extends As$1$1["length"] ? boolean : SomeEqual$1, TVal> : boolean : TOp extends "contains" ? TVal extends string | number | readonly unknown[] ? Contains$1> : false : TOp extends "containsSome" ? TVal extends string | number | readonly unknown[] ? Contains$1>, TParams> : false : TOp extends "containsAll" ? TVal extends string | number | readonly unknown[] ? ContainsAllParams$1>, TParams> : false : Unset$1; type Process__String$1 = TOp extends "startsWith" ? TVal extends ComparisonAccept$1<"startsWith"> ? TParams extends readonly (string | number)[] ? number extends TParams["length"] ? boolean : StartsWith$2, TParams[number]> : Err$1<`invalid-type/parameters`> : Err$1<`invalid-value/wrong-type`, `The '${TOp}' operation expects the value passed in to be a valid representation of a date but it was not!`, { val: TVal; }> : TOp extends "endsWith" ? TVal extends ComparisonAccept$1<"endsWith"> ? TParams extends readonly (string | number)[] ? number extends TParams["length"] ? boolean : EndsWith$1, TParams[number]> : Err$1<`invalid-type/parameters`> : Err$1<`invalid-value/wrong-type`, `The '${TOp}' operation expects the value passed in to be a valid representation of a date but it was not!`, { val: TVal; }> : TOp extends "endsWithNumber" ? EndsWithNumber$1 : TOp extends "startsWithNumber" ? IsStringLiteral$1$1 extends true ? FirstChar$1> extends NumericChar$1 ? true : false : IsString$1 extends true ? boolean : false : TOp extends "onlyNumbers" ? IsStringLiteral$1$1 extends true ? TVal extends "" ? false : IsEqual$1, NumericChar$1>, TVal> : IsString$1 extends true ? boolean : false : TOp extends "onlyLetters" ? IsStringLiteral$1$1 extends true ? TVal extends "" ? false : IsEqual$1, AlphaChar$1>, TVal> : IsString$1 extends true ? boolean : false : TOp extends "alphaNumeric" ? IsStringLiteral$1$1 extends true ? TVal extends "" ? false : IsEqual$1, AlphanumericChar$1>, TVal> : IsString$1 extends true ? boolean : false : TOp extends "isTemplateLiteral" ? IsStringLiteral$1$1 extends true ? IsTemplateLiteral$1 : false : Unset$1; type Process__Object$1 = TOp extends "objectKeyGreaterThan" ? IsDictionary$1 extends false ? Err$1<`invalid-value/wrong-type`, `The '${TOp}' operation expects the value passed in to be a dictionary object but it wasn't!`> : [Extends$1, NumberLike$1>] extends [true] ? [First$1$1] extends [keyof TVal] ? Extends$1], NumberLike$1> extends true ? IsGreaterThan$1], NumberLike$1>, As$1$1, NumberLike$1>> : Err$1<`invalid-value/non-numeric`, `The '${TOp}' operation expects the key '${AsString$1>}' in the value passed in to be a numeric value but it wasn't!`, { val: TVal; }> : false : Err$1<`invalid-params/${TOp}`, `The '${TOp}' operation expects the second param to be NumberLike but it wasn't!`, { val: TVal; params: TParams; invalid: TParams[1]; }> : TOp extends "objectKeyGreaterThanOrEqual" ? IsDictionary$1 extends false ? Err$1<`invalid-value/wrong-type`, `The '${TOp}' operation expects the value passed in to be a dictionary object but it wasn't!`> : [Extends$1, NumberLike$1>] extends [true] ? [First$1$1] extends [keyof TVal] ? Extends$1], NumberLike$1> extends true ? IsGreaterThanOrEqual$1], NumberLike$1>, As$1$1, NumberLike$1>> : Err$1<`invalid-value/non-numeric`, `The '${TOp}' operation expects the key '${AsString$1>}' in the value passed in to be a numeric value but it wasn't!`, { val: TVal; }> : false : Err$1<`invalid-params/${TOp}`, `The '${TOp}' operation expects the second param to be NumberLike but it wasn't!`, { val: TVal; params: TParams; invalid: TParams[1]; }> : TOp extends "objectKeyLessThan" ? IsDictionary$1 extends false ? Err$1<`invalid-value/wrong-type`, `The '${TOp}' operation expects the value passed in to be a dictionary object but it wasn't!`> : [Extends$1, NumberLike$1>] extends [true] ? [First$1$1] extends [keyof TVal] ? Extends$1], NumberLike$1> extends true ? IsLessThan$1], NumberLike$1>, As$1$1, NumberLike$1>> : Err$1<`invalid-value/non-numeric`, `The '${TOp}' operation expects the key '${AsString$1>}' in the value passed in to be a numeric value but it wasn't!`, { val: TVal; }> : false : Err$1<`invalid-params/${TOp}`, `The '${TOp}' operation expects the second param to be NumberLike but it wasn't!`, { val: TVal; params: TParams; invalid: TParams[1]; }> : TOp extends "objectKeyLessThanOrEqual" ? IsDictionary$1 extends false ? Err$1<`invalid-value/wrong-type`, `The '${TOp}' operation expects the value passed in to be a dictionary object but it wasn't!`> : [Extends$1, NumberLike$1>] extends [true] ? [First$1$1] extends [keyof TVal] ? Extends$1], NumberLike$1> extends true ? IsLessThanOrEqual$1], NumberLike$1>, As$1$1, NumberLike$1>> : Err$1<`invalid-value/non-numeric`, `The '${TOp}' operation expects the key '${AsString$1>}' in the value passed in to be a numeric value but it wasn't!`, { val: TVal; }> : false : Err$1<`invalid-params/${TOp}`, `The '${TOp}' operation expects the second param to be NumberLike but it wasn't!`, { val: TVal; params: TParams; invalid: TParams[1]; }> : TOp extends "objectKeyEquals" ? IsDictionary$1 extends false ? Err$1<`invalid-value/wrong-type`, `The '${TOp}' operation expects the value passed in to be a dictionary object but it wasn't!`> : [First$1$1] extends [keyof TVal] ? IsEqual$1], Second$2$1> : false : TOp extends "objectKeyExtends" ? TVal extends Dictionary$1 ? First$1$1 extends keyof TVal ? TVal[First$1$1] extends Second$2$1 ? true : false : false : Err$1<`invalid-value`, `The operation '' expects values to be a valid container!`, { val: TVal; params: TParams; }> : TOp extends "objectKeyStartsWith" ? TVal extends Dictionary$1 ? First$1$1 extends infer Key extends keyof TVal ? TVal[Key] extends string | number ? StartsWith$2, string | number>> : false : Err$1<`invalid-value/wrong-type`, `The '${TOp}' operation expects the value passed in to be a dictionary object but it wasn't!`> : false : Unset$1; type Process__Numeric$1 = TOp extends "greaterThan" ? TVal extends NumberLike$1 ? First$1$1 extends NumberLike$1 ? IsGreaterThan$1> : Err$1<`invalid-param/not-number-like`, `The operation '${TOp}' expects the first parameter to be NumberLike!`, { val: TVal; params: TParams; }> : Err$1<`invalid-value/not-number-like`, `The operation '${TOp}' expects the value to be compared with the comparator to be NumberLike!`, { val: TVal; params: TParams; }> : TOp extends "greaterThanOrEqual" ? TVal extends NumberLike$1 ? First$1$1 extends NumberLike$1 ? IsGreaterThanOrEqual$1> : Err$1<`invalid-param/not-number-like`, `The operation '${TOp}' expects the first parameter to be NumberLike!`, { val: TVal; params: TParams; }> : Err$1<`invalid-value/not-number-like`, `The operation '${TOp}' expects the value to be compared with the comparator to be NumberLike!`, { val: TVal; params: TParams; }> : TOp extends "lessThan" ? TVal extends NumberLike$1 ? First$1$1 extends NumberLike$1 ? IsLessThan$1> : Err$1<`invalid-param/not-number-like`, `The operation '${TOp}' expects the first parameter to be NumberLike!`, { val: TVal; params: TParams; }> : Err$1<`invalid-value/not-number-like`, `The operation '${TOp}' expects the value to be compared with the comparator to be NumberLike!`, { val: TVal; params: TParams; }> : TOp extends "lessThanOrEqual" ? TVal extends NumberLike$1 ? First$1$1 extends NumberLike$1 ? IsLessThanOrEqual$1> : Err$1<`invalid-param/not-number-like`, `The operation '${TOp}' expects the first parameter to be NumberLike!`, { val: TVal; params: TParams; }> : Err$1<`invalid-value/not-number-like`, `The operation '${TOp}' expects the value to be compared with the comparator to be NumberLike!`, { val: TVal; params: TParams; }> : TOp extends "betweenExclusively" ? TVal extends NumberLike$1 ? TParams extends readonly [infer Min extends NumberLike$1, infer Max extends NumberLike$1] ? IsBetweenExclusively$1 : false : false : TOp extends "betweenInclusively" ? TVal extends NumberLike$1 ? TParams extends readonly [infer Min extends NumberLike$1, infer Max extends NumberLike$1] ? IsBetweenInclusively$1 : false : false : Unset$1; type Process__Other$1 = TOp extends "errors" ? IsError$1 : TOp extends "hasLength" ? TVal extends string ? Contains$1["length"]> : TVal extends readonly unknown[] ? Contains$1 : TVal extends number ? Contains$1["length"]> : false : TOp extends "errorsOfType" ? TVal extends Error ? "type" extends keyof TVal ? First$1$1 extends TVal["type"] ? true : false : false : false : TOp extends "returnEquals" ? TVal extends TypedFunction$1 ? IsEqual$1, TParams[0]> : TVal extends AnyFunction$1 ? boolean : false : TOp extends "returnExtends" ? TVal extends ((...args: any[]) => any) ? Extends$1, TParams[0]> : false : Unset$1; /** * process the type for the comparison */ type Comparison$1 = Process__DateTime$1 extends Unset$1 ? Process__General$1 extends Unset$1 ? Process__String$1 extends Unset$1 ? Process__Object$1 extends Unset$1 ? Process__Numeric$1 extends Unset$1 ? Process__Other$1 extends Unset$1 ? Err$1<`invalid-operation/compare`, `The operation '${TOp}' is not a recognized operation in the Compare<...> type utility!`> : Process__Other$1 : Process__Numeric$1 : Process__Object$1 : Process__String$1 : Process__General$1 : Process__DateTime$1; /** * **Compare**`` * * Compares the value `TVal` with `TComparator` using * the `TOp` _operator_. * * When either TVal or any parameter is a wide type (like `string`, `number`), * returns `boolean` instead of a definitive `true`/`false`. */ type ValidateParams$1 = TOp extends "equals" ? TParams extends readonly [unknown] ? true : Err$1<"invalid-parameters", "equals operation requires exactly 1 parameter"> : TOp extends "equalsSome" ? TParams extends readonly [unknown, unknown, ...unknown[]] ? true : Err$1<"invalid-parameters", "equalsSome operation requires at least 2 parameters"> : TOp extends "extends" ? TParams extends readonly [unknown, ...unknown[]] ? true : Err$1<"invalid-parameters", "extends operation requires exactly 1 parameter"> : true; type Compare$1, TOp extends Suggest$1, TParams extends readonly unknown[]> = TOp extends ComparisonOperation$1 ? ValidateParams$1 extends Error ? ValidateParams$1 : Comparison$1 : Err$1<`invalid-operation/${TOp}`, `The operation '${TOp}' is not a valid operation for the Compare utility!`, { op: TOp; params: TParams; }>; //#endregion //#region ../types/src/boolean-logic/combinators/comparison/ComparisonAccept.d.ts /** * **ComparisonAccept**`` * * Provides the _base type_ which a comparison function will accept. * * - those operations which don't state an explicit `accept` property * in their definitions will be assigned the type `unknown`. */ type ComparisonAccept$1 = TOp extends keyof ComparisonLookup$1 ? "accept" extends keyof ComparisonLookup$1[TOp] ? ComparisonLookup$1[TOp]["accept"] : Narrowable$1 : TOp extends ComparisonOperation$1 ? Narrowable$1 : Narrowable$1; //#endregion //#region ../types/src/boolean-logic/combinators/comparison/ComparisonLookup.d.ts /** * **ComparisonOperation**`` * * Operations known by the `Compare` and `compare()` utilities * and leveraged by utilities like `Filter`/`filter()`, etc. * * - the generic `T` is used to switch between `run-time` and `design-time` * modes */ type ComparisonOperation$1 = typeof COMPARISON_OPERATIONS$2[number]; /** * A type which provides a lookup table for standard conversion types. */ interface ComparisonLookup$1 { isTemplateLiteral: { params: readonly []; accept: unknown; take: 1; }; extends: { params: readonly [types: unknown, ...unknown[]]; accept: unknown; }; startsWith: { params: readonly [startsWith: string | number, ...variants: (string | number)[]]; accept: string | number; }; endsWith: { params: readonly (string | number)[]; convert: "stringUnion"; accept: string | number; take: 1; }; endsWithNumber: { params: []; desc: "tests whether a string literal ends with a numeric value"; accept: string; take: 0; }; startsWithNumber: { params: []; desc: "tests whether a string literal starts with a numeric value"; accept: string; take: 0; }; onlyNumbers: { params: []; desc: "tests whether a string literal contains only numeric characters"; accept: string; take: 0; }; alphaNumeric: { params: []; desc: "tests whether a string literal contains only alphabetic and numeric characters"; accept: string; take: 0; }; onlyLetters: { params: readonly []; desc: "tests whether a string literal contains only letter characters"; accept: string; take: 0; }; contains: { params: readonly [substring: string | number]; convert: ["stringLiteral"]; accept: string | number | readonly (string | number)[]; take: 1; }; containsAll: { params: readonly [substrings: string | number, ...readonly (string | number)[]]; accept: string | number | readonly (string | number)[]; convert: "stringArray"; take: "*"; }; containsSome: { params: readonly [val1: string | number, val2: string | number, ...(string | number)[]]; accept: string | number | readonly (string | number)[]; convert: "stringUnion"; take: "1"; }; greaterThan: { params: readonly [value: NumberLike$1]; accept: NumberLike$1; take: 1; }; greaterThanOrEqual: { params: readonly [value: NumberLike$1]; accept: NumberLike$1; take: 1; }; lessThan: { params: readonly [value: NumberLike$1]; accept: NumberLike$1; take: 1; }; lessThanOrEqual: { params: readonly [value: NumberLike$1]; accept: NumberLike$1; take: 1; }; objectKeyGreaterThan: { params: readonly [key: string, type: NumberLike$1]; take: 2; }; objectKeyGreaterThanOrEqual: { params: readonly [key: string, type: NumberLike$1]; take: 2; }; objectKeyLessThan: { params: readonly [key: string, type: NumberLike$1]; take: 2; }; objectKeyLessThanOrEqual: { params: readonly [key: string, type: NumberLike$1]; take: 2; }; betweenInclusively: { params: readonly [greaterThan: NumberLike$1, lessThan: NumberLike$1]; accept: NumberLike$1; take: 2; }; betweenExclusively: { params: readonly [greaterThan: NumberLike$1, lessThan: NumberLike$1]; accept: NumberLike$1; take: 2; }; equals: { params: readonly [value: unknown]; take: 1; accept: unknown; }; equalsSome: { params: readonly [potentialValues: unknown, unknown, ...unknown[]]; take: "*"; }; errors: { params: readonly []; take: 0; }; errorsOfType: { params: readonly [type: string | Error]; take: 1; }; before: { params: readonly [date: DateLike$1]; accept: DateLike$1; take: 1; }; after: { params: readonly [date: DateLike$1]; accept: DateLike$1; take: 1; }; sameDay: { params: readonly [date: DateLike$1]; accept: DateLike$1; take: 1; }; sameMonth: { params: readonly [date: DateLike$1]; accept: DateLike$1; take: 1; }; sameMonthYear: { params: readonly [date: DateLike$1]; accept: DateLike$1; take: 1; }; sameYear: { params: readonly [date: DateLike$1]; accept: DateLike$1; take: 1; }; truthy: { params: readonly []; take: 0; accept: Narrowable$1; }; falsy: { params: readonly []; accept: Narrowable$1; take: 0; }; true: { params: readonly []; take: 0; }; false: { params: readonly []; take: 0; }; objectKeyEquals: { params: readonly [key: string, value: unknown]; take: 2; }; objectKeyExtends: { params: readonly [key: string, type: unknown]; accept: Dictionary$1; take: 2; }; objectExtends: { params: readonly [type: unknown]; take: 1; accept: Dictionary$1; }; objectKeyStartsWith: { params: readonly [prop: ObjectKey$1, comparator: string | number]; take: 2; accept: Dictionary$1; }; returnEquals: { params: readonly [validReturnTypes: unknown, ...unknown[]]; take: "*"; accept: (...args: any[]) => any; }; returnExtends: { params: readonly [validReturnTypes: unknown, ...unknown[]]; take: "1"; convert: "union"; accept: (...args: any[]) => any; }; } //#endregion //#region ../types/src/boolean-logic/combinators/comparison/GetComparisonParams.d.ts /** * Presents the type options for entering a comparison's * parameters. This is meant as a convenience function * and allows you to not be forced to enter parameter * that aren't required. */ type GetComparisonParams$1 = As$1$1<[IsUnion$1] extends [true] ? readonly unknown[] : TOp extends keyof ComparisonLookup$1 ? ["params"] extends [keyof ComparisonLookup$1[TOp]] ? ComparisonLookup$1[TOp]["params"] extends readonly unknown[] ? ComparisonLookup$1[TOp]["params"] : never : readonly unknown[] : readonly unknown[], readonly unknown[]>; //#endregion //#region ../types/src/boolean-logic/combinators/Every.d.ts type Process$50$1> = TElements extends [infer Head, ...infer Rest] ? TElements extends readonly unknown[] ? Head extends ComparisonAccept$1 ? [Compare$1] extends [true] ? Process$50$1 : false : Process$50$1 : false : true; /** * **Every**`` * * Evaluates a container (_a tuple or kv object_) to see if **every** one of * the _values_ it contains match the comparison provided by the `TOp` and * `TComparator`. * * ```ts * // true * type T = Every<["foo","bar","baz"], "extends", [string]>; * // false * type F = Every<["foo","bar","baz", 42], "extends", [string]>; * ``` */ type Every$1 | First$1$1>> = IsWideContainer$1 extends true ? boolean : Process$50$1, TOp, TComparator extends GetComparisonParams$1 ? TComparator : TComparator extends First$1$1> ? [TComparator] extends GetComparisonParams$1 ? [TComparator] : never : never>; //#endregion //#region ../types/src/boolean-logic/combinators/Logic.d.ts type LogicHandler$1 = "truthy" | "false" | "never"; type Handle$3 = THandler extends "truthy" ? IsTruthy$1 : THandler extends "false" ? false : THandler extends "never" ? never : never; /** * Converts any type `T` into a `true`, `false` or `boolean`. * * - if `never` is passed in it will always be proxied through * - if a value is neither: * - `true`, `false`, or `boolean` * - nor _returns_ `true`, `false`, or `boolean` * - the generic `U` will come into effect * - by default it is set to `truthy` */ type Logic$1 = [IsTrue$1] extends [true] ? true : [IsFalse$1] extends [true] ? false : [IsBoolean$1] extends [true] ? boolean : [IsNever$1] extends [true] ? never : [T] extends [LogicFunction$1] ? [IsTrue$1>] extends [true] ? true : [IsFalse$1>] extends [true] ? false : [IsBoolean$1>] extends [true] ? boolean : [IsNever$1>] extends [true] ? never : Handle$3 : Handle$3; //#endregion //#region ../types/src/boolean-logic/combinators/Not.d.ts /** * **Not**`` * * A boolean negation that can work on both a single value or an * tuple of values. * * ```ts * // false * type Single = Not; * // [ false, true, boolean ] * type Multi = Not<[true,false,boolean]>; * ``` * * **Related:** `Inverse` */ type Not$1 = [IsAny$1] extends [true] ? Logic$1 : [IsNever$1] extends [true] ? Logic$1 : [IsUnknown$1] extends [true] ? Logic$1 : [TVal] extends [readonly unknown[]] ? { [K in keyof TVal]: Logic$1 } : [IsTrue$1>] extends [true] ? false : [IsFalse$1>] extends [true] ? true : [IsBoolean$1>] extends [true] ? boolean : never; //#endregion //#region ../types/src/boolean-logic/combinators/Or.d.ts interface LogicOptions$3 { empty?: boolean | unknown; err?: "false" | "error" | unknown; } type Reduce$1$1 = { [K in keyof T]: T[K] extends TypedFunction$1 ? ReturnType : T[K] }; /** * **Or**`` * * Performs logical OR operation on an array of boolean values or functions returning boolean. * * - Returns `true` if any element is `true` * - Returns `boolean` if any element is wide `boolean` type * - Returns `false` if all elements are `false` * - Returns `false` for empty arrays (or value from options.empty) * - Returns `boolean` for wide arrays (length not known at compile time) * - Supports functions that return boolean values * - Configurable error handling via options parameter * * **Related:** `And`, `Not` */ type Or$1 = IsAny$1 extends true ? TOpt extends { err: "error"; } ? Err$1<"invalid/or", "The Or<...> logical combinator has a 'any' type! Or is expecting a tuple of boolean values (or functions which return boolean).", { library: "inferred-types"; }> : false : IsNever$1 extends true ? TOpt extends { err: "error"; } ? Err$1<"invalid/or", "The Or<...> logical combinator has a 'never' type! Or is expecting a tuple of boolean values (or functions which return boolean).", { library: "inferred-types"; }> : false : HasAny$1 extends true ? TOpt extends { err: "error"; } ? Err$1<"invalid/or", "The Or found elements in T which were the 'any' type! Or expects all elements to be a boolean value or a function which returns a boolean value.", { value: T; }> : false : HasNever$1 extends true ? TOpt extends { err: "error"; } ? Err$1<"invalid/or", "The Or found elements in T which were the 'never' type! Or expects all elements to be a boolean value or a function which returns a boolean value.", { value: T; }> : false : T extends readonly (boolean | TypedFunction$1)[] ? number extends T["length"] ? boolean : [] extends T ? TOpt extends { empty: infer E; } ? E : false : T extends readonly boolean[] ? HasTrue$1 extends true ? true : HasWideBoolean$1 extends true ? boolean : false : Reduce$1$1 extends readonly boolean[] ? HasTrue$1> extends true ? true : HasWideBoolean$1> extends true ? boolean : false : TOpt extends { err: "error"; } ? Err$1<"invalid/or", "The conditions passed into Or could not be reduced down to just a boolean array.", { library: "inferred-types"; value: T; }> : false : TOpt extends { err: "error"; } ? Err$1<"invalid/or", "The Or type utility requires that all elements passed to it are either a boolean value directly or a LogicFunction which returns a boolean value", { value: T; }> : false; //#endregion //#region ../types/src/boolean-logic/combinators/Some.d.ts type Process$49$1, THasBool extends boolean = false> = [] extends TComparator ? IsTrue$1 extends true ? boolean : false : T extends readonly unknown[] ? T extends readonly [infer First, ...infer Rest] ? First extends ComparisonAccept$1 ? [Compare$1] extends [false] ? Process$49$1 : [Compare$1] extends [true] ? true : [Compare$1] extends [boolean] ? Process$49$1 : Process$49$1, TOp, TComparator, THasBool> : false : false : false; /** * **Some**`` * * Evaluates a container (_a tuple or kv object_) to see if **some** of the _values_ it contains * match the comparison provided by the `TOp` and `TComparator`. * * ```ts * // true * type Test = Some<["foo","bar","baz"], "equals", ["foo"]>; * ``` */ type Some$1 | GetComparisonParams$1[0]> = IsWideContainer$1 extends true ? boolean : Process$49$1, TOp, TComparator extends GetComparisonParams$1 ? TComparator : TComparator extends GetComparisonParams$1[0] ? [TComparator] extends GetComparisonParams$1 ? [TComparator] : never : never>; //#endregion //#region ../types/src/boolean-logic/narrowing/As.d.ts /** * **As**`` * * Ensures that `TContent` _extends_ `TType` or turns type to `never`. */ type As$1$1 = [TContent] extends [TType] ? TContent : never; //#endregion //#region ../types/src/boolean-logic/narrowing/AsDoneFn.d.ts /** * **AsDoneFn**`` * * Narrows */ type AsDoneFn$1 = T extends { done: FnWithDescription$1; } ? T & { done: () => unknown; } : never; //#endregion //#region ../types/src/boolean-logic/operators/compare/AllLiteral.d.ts /** * **AllLiteral**`` * * A boolean operator which tests whether all properties in * the tuple `TTuple` are _literal_ types. */ type AllLiteral$1 = And$1<{ [K in keyof T]: IsLiteralLike$1 extends true ? true : false }>; //#endregion //#region ../types/src/boolean-logic/operators/compare/AreIncompatible.d.ts /** * **AreIncompatible**`` * * Checks if two types are fundamentally incompatible and can never be equal. * For example, string and number are incompatible, but string and string | number * are not incompatible because they could overlap. */ type AreIncompatible$1 = Or$1<[IsNever$1, IsNever$1]> extends true ? false : [T] extends [U] ? false : [U] extends [T] ? false : [T, U] extends [string, number] ? true : [T, U] extends [number, string] ? true : [T, U] extends [string, boolean] ? true : [T, U] extends [boolean, string] ? true : [T, U] extends [number, boolean] ? true : [T, U] extends [boolean, number] ? true : [T, U] extends [string, null] ? true : [T, U] extends [null, string] ? true : [T, U] extends [number, null] ? true : [T, U] extends [null, number] ? true : [T, U] extends [boolean, null] ? true : [T, U] extends [null, boolean] ? true : [T, U] extends [string, undefined] ? true : [T, U] extends [undefined, string] ? true : [T, U] extends [number, undefined] ? true : [T, U] extends [undefined, number] ? true : [T, U] extends [boolean, undefined] ? true : [T, U] extends [undefined, boolean] ? true : false; //#endregion //#region ../types/src/boolean-logic/operators/compare/DoesExtend.d.ts /** * **DoesExtend**`` * * Boolean type utility which returns `true` if `TValue` _extends_ `TExtends`. */ type DoesExtend$1 = IsNever$1 extends true ? false : [TValue] extends [TExtends] ? true : false; //#endregion //#region ../types/src/boolean-logic/operators/compare/Extends.d.ts /** * **Extends**`` * * A boolean operator which checks whether `T` extends `U` and returns * **true** or **false**. This is an _alias_ for `DoesExtend`. */ type Extends$1 = IsNever$1 extends true ? IsNever$1 extends true ? true : false : DoesExtend$1; //#endregion //#region ../types/src/boolean-logic/operators/compare/HasOtherCharacters.d.ts type Process$48$1 = ReplaceAll$1 extends "" ? false : true; /** * **HasOtherCharacters**`` * * Boolean type utility which tests whether `TStr` has any * characters _other_ than those in `TChars`. * * - union types are fine for `TChars` * - a tuple for `TChars` behaves the same as union type * * **Related:** `HasCharacters` */ type HasOtherCharacters$1 = [IsWideType$1] extends [true] ? boolean : [TChars] extends [string] ? IsWideType$1 extends true ? boolean : Process$48$1 : TChars extends readonly string[] ? Process$48$1> : never; //#endregion //#region ../types/src/boolean-logic/operators/compare/IsEmpty.d.ts /** * Boolean operator which returns `true` when `T` is: * * - `null` or `undefined` * - and empty array * - an empty object * - an empty string (aka, `""`) * * If `T` is a _wide_ type this will always return `boolean` */ type IsEmpty$2 = T extends undefined ? true : T extends null ? true : IsWideType$1 extends true ? boolean : IsEmptyObject$1 extends true ? true : IsEmptyArray$1 extends true ? true : IsEmptyString$1 extends true ? true : false; //#endregion //#region ../types/src/boolean-logic/operators/compare/IsEqual.d.ts /** * **IsEqual**`` * * Type utility which tests whether two types -- `X` and `Y` -- are * exactly the same type. * * - if either `X` or `Y` are **any** then this test resolves to **false** * * **Alias:** `Equals` */ type IsEqual$1 = Equals$1; /** * **Equals**`` * * Type utility which tests whether two types -- `X` and `Y` -- are * exactly the same type. * * - if either `X` or `Y` are **any** then this test resolves to **false** * * **Alias:** `IsEqual` */ type Equals$1 = As$1$1<[IsAny$1] extends [true] ? false : [IsAny$1] extends [true] ? false : [X] extends [Y] ? [Y] extends [X] ? [X] extends [Container$1] ? [Keys$1$1] extends [Keys$1$1>] ? [Keys$1$1>] extends [Keys$1$1] ? TTrue : TFalse : TFalse : TTrue : TFalse : TFalse, TTrue | TFalse>; //#endregion //#region ../types/src/boolean-logic/operators/compare/IsUnknown.d.ts /** * **IsUnknown**`` * * Tests whether a given `T` is of the **unknown** type. */ type IsUnknown$1 = [IsNever$1] extends [true] ? false : [IsAny$1] extends [true] ? false : IsEqual$1 extends true ? true : false; //#endregion //#region ../types/src/boolean-logic/operators/compare/IsUnset.d.ts /** * **IsUnset**`` * * Boolean operator which reports true/false on whether * `T` is the value `Unset`. */ type IsUnset$1 = IsEqual$1; //#endregion //#region ../types/src/boolean-logic/operators/compare/IsVueRef.d.ts /** * **IsVueRef**`` * * Boolean type utility that detects whether the type passed in * is a VueJS `Ref<...>` type or this library's `VueRef<...>` * (which serves as a lightweight proxy type for Vue's `Ref`). */ type IsVueRef$1 = T extends object ? And$1<[Keys$1$1["length"] extends 2 ? true : false, "value" extends keyof T ? true : false]> extends true ? true : false : false; //#endregion //#region ../types/src/boolean-logic/operators/compare/NarrowlyContains.d.ts /** * **NarrowlyContains**`` * * Type utility which checks whether all elements in a tuple `TList` * **equal** the type contained in `TContains`.s * * @deprecated use `Contains` with "equals" operator for this * functionality. * * **Related:** `Contains`, `ContainsAll`, `ContainsSome` */ type NarrowlyContains$1 = IsEqual$1, TContains> extends true ? true : [] extends AfterFirst$1 ? false : NarrowlyContains$1, TContains>; //#endregion //#region ../types/src/boolean-logic/operators/compare/NotEqual.d.ts /** * **NotEqual**`` * * Boolean utility to determine whether two values are **not** equal. */ type NotEqual$1 = IsEqual$1 extends true ? false : true; //#endregion //#region ../types/src/boolean-logic/operators/compare/SomeEqual.d.ts /** * **SomeEqual**`` * * A type utility which tests whether `TVal` is exactly equal to an array of values * stored in `TList`. Possible results are `true`, `false`. A wide `boolean` type * is not possible as equality operator can always be evaluated at design time. * * **See Also:** `SomeExtend` and `IfSomeEqual` */ type SomeEqual$1 = Or$1<{ [K in keyof TList]: IsEqual$1 }>; //#endregion //#region ../types/src/boolean-logic/operators/containers/AllStringLiterals.d.ts /** * **AllStringLiterals**`` * * Boolean operator which checks whether **all** of the * passed in elements are _string literals_. */ type AllStringLiterals$1 = And$1<{ [K in keyof T]: IsStringLiteral$1$1 }>; //#endregion //#region ../types/src/boolean-logic/operators/containers/HasArray.d.ts type _HasArray$1 = [] extends TList ? false : IsArray$1> extends true ? true : _HasArray$1>; /** * **HasArray**`` * * Checks whether a list of items includes an _array_ (tuple or wide array type) within it. */ type HasArray$1 = _HasArray$1; //#endregion //#region ../types/src/boolean-logic/operators/containers/HasSameKeys.d.ts /** * **AsTuple**`` * * Type utility which ensures that `T` is tuple value * encapsulating it as a single item array if it is a * non-array type. * * **Related:** `AsArray` */ type AsTuple$2 = T extends Tuple$1$1 ? T : T extends unknown[] ? readonly [...T] : If$1, readonly [], readonly [T]>; type Process$47$1 = And$1<{ [K in keyof A]: K extends keyof B ? true : false }>; type _Keys$1$1 = UnionToTuple$2> extends readonly ObjectKey$1[] ? UnionToTuple$2> : never; /** * **HasSameKeys**`` * * Boolean operator which compares two lists to see if they have the same keys. */ type HasSameKeys$1 = IsTuple$1 extends true ? IsTuple$1 extends true ? AsTuple$2["length"] extends AsTuple$2["length"] ? Process$47$1, AsTuple$2> : false : false : DoesExtend$1 extends true ? DoesExtend$1 extends true ? _Keys$1$1["length"] extends _Keys$1$1["length"] ? HasSameValues$1<_Keys$1$1, _Keys$1$1> : false : false : false; //#endregion //#region ../types/src/boolean-logic/operators/containers/HasSameValues.d.ts type CheckAllExist$1 = [] extends A ? true : And$1<{ [K in keyof A]: NarrowlyContains$1 }>; type Test$6$1 = A extends readonly unknown[] ? B extends readonly unknown[] ? [] extends A ? [] extends B ? true : false : [] extends B ? false : A["length"] extends B["length"] ? CheckAllExist$1 extends true ? CheckAllExist$1 extends true ? true : false : false : false : false : false; /** * **HasSameValues**`` * * Boolean type utility which determines if the values in * `TContainer` and `TComparator` are the same (even if the order * is different). * * #### Wide Types * * - if _either_ `TContainer` or `TComparator` are wide types then * this utility will evaluate to `boolean` rather than the typical `true` * or `false` literals * * #### `any` and `never` * * - if _either_ `TContainer` or `TComparator` or _both_ are equal to * `never` or `any` then this utility will resolve to `TException` (which * defaults to being `false`)! */ type HasSameValues$1 = [IsAny$1] extends [true] ? TException : [IsNever$1] extends [true] ? TException : [IsAny$1] extends [true] ? TException : [IsNever$1] extends [true] ? TException : Test$6$1>, Values$1>> extends true ? TContainer extends readonly unknown[] ? TComparator extends readonly unknown[] ? IsEqual$1, GetOptionalElementCount$1> : false : TContainer extends Dictionary$1 ? TComparator extends Dictionary$1 ? IsEqual$1>, GetOptionalElementCount$1>> : false : never : TException; //#endregion //#region ../types/src/boolean-logic/operators/containers/IsArray.d.ts /** * **IsArray** * * Boolean utility which tests for whether `T` is an array ( * both a mutable array or a readonly array) */ type IsArray$1 = [T] extends [any[]] ? true : [T] extends [readonly any[]] ? true : false; //#endregion //#region ../types/src/boolean-logic/operators/containers/IsContainer.d.ts /** * **IsContainer**`` * * Boolean operator which detects whether `T` is a "container" where a * container is any object or array. */ type IsContainer$1 = [IsNever$1] extends [true] ? false : [T] extends [null | undefined] ? false : [T] extends [AnyFunction$1] ? false : [T] extends [readonly any[]] ? true : [T] extends [object] ? true : false; //#endregion //#region ../types/src/boolean-logic/operators/containers/IsDictionary.d.ts type IsDictionary$1 = T extends Dictionary$1 ? Not$1> : false; //#endregion //#region ../types/src/lists/AfterFirst.d.ts /** * **AfterFirst**`` * * returns the elements in an array _after_ the first element */ type AfterFirst$1 = T extends readonly [unknown, ...unknown[]] ? T extends readonly [unknown, ...infer Rest] ? readonly [...Rest] : never : T extends unknown[] ? [] : T extends [unknown, ...infer Rest] ? Rest : []; //#endregion //#region ../types/src/lists/AppendToLast.d.ts /** * **AppendToLast**`` * * Appends some text `TAppend` to the last element of `TList`. */ type AppendToLast$1 = TList extends readonly [...infer LeadIn extends readonly string[], infer Last extends string] ? [...LeadIn, `${Last}${TAppend}`] : [TAppend]; //#endregion //#region ../types/src/lists/AsArray.d.ts type NonArrayMembers$1 = NotFilter$1 extends infer Members extends readonly unknown[] ? Members[number] : never; type ArrayMembers$1 = { [K in keyof T]: T[K] extends readonly (infer Kind)[] ? As$1$1[]> : never }[number]; /** * **AsArray**`` * * Type utility which ensures that `T` is an array by: * * - encapsulating it as a single item array if it is a * non-array type (but not _undefined_). * - converting a union type into a tuple (unless it contains undefined) * - if `T` is undefined then it is converted to an empty array `[]` * - if `T` was already an array then it is just proxied through * - if `T` is a union then non array elements are converted to array types */ type AsArray$1 = [IsAny$1] extends [true] ? unknown[] : [IsNever$1] extends [true] ? [] : [IsUnknown$1] extends [true] ? unknown[] : [T] extends [readonly (infer Kind)[]] ? As$1$1[]> : [IsUndefined$1] extends [true] ? [] : [IsUnion$1] extends [true] ? [UnionToTuple$2] extends [infer Tuple extends readonly unknown[]] ? Expand$1> | ArrayMembers$1> : never : IsUndefined$1 extends true ? [] : [T]; //#endregion //#region ../types/src/lists/BeforeLast.d.ts /** * **BeforeLast**`` * * Returns: * * - the _elements_ in an **array**; _excluding_ the last element * - the _characters_ in a **string** excluding the last character * * This behavior is _very_ much like `Pop` but where `Pop` will * return _never_ when an empty input is passed in, this utility returns * the "empty" state: * * - a _tuple_ will return `[]` * - a _string_ will return "" * * **Related:** `Pop`, `Last`, `AfterFirst`, `First` */ type BeforeLast$1 = [T] extends [string] ? string extends T ? string : IsEqual$1 extends true ? "" : Pop$1> extends infer Leading extends readonly string[] ? Concat$1 : never : [T] extends [readonly unknown[]] ? T extends readonly [...infer Leading, unknown] ? Leading : [] : never; //#endregion //#region ../types/src/lists/ConvertAndMap.d.ts /** * **ConverterDefn**`` * * A conversion definition which has wide types for keys and * callback functions to call when a particular type is provided * as input. */ interface ConverterDefn$1 { string: (v: T) => TStr; number: (v: T) => TNum; boolean: (v: T) => TBool; object: (v: T) => TObj; tuple: (v: T) => TTuple; nothing: (v: T) => TNothing; } //#endregion //#region ../types/src/lists/EachAsString.d.ts type EachAsString$1 = { [K in keyof T]: T[K] extends string ? T[K] : T[K] extends number ? `${T[K]}` : T[K] extends boolean ? `${T[K]}` : T[K] extends AnyObject$1 ? ObjectToString$1 : T[K] extends readonly any[] ? ToJsonArray$1 : T[K] extends Map ? `Map<${AsString$1},${AsString$1}>` : "" }; //#endregion //#region ../types/src/lists/ElementOf.d.ts /** * **ElementOf**`` * * Pulls the type of an array's element out of the array type itself. */ type ElementOf$1 = T extends (infer U)[] ? U : never; //#endregion //#region ../types/src/lists/Filter.d.ts type Process$46$1[], TOp extends ComparisonOperation$1, TParams extends readonly unknown[]> = RemoveMarked$1<{ [K in keyof TList]: Compare$1 extends true ? TList[K] : Marked$2$2 }>; /** * **Filter**`` * * Allows a known tuple `TList` to be reduced to just those elements which * _extend_ type `TFilter`. * * - `TFilter` can be single value, an array of values, or even no values at all * - the number of parameters is dictated by the operation * - if _either_ zero or one parameters are required you may also just * express the first parameter outside of array syntax. * * **Related:** `NotFilter` * * ```ts * // [1,2,3] * type Num = Filter<[1,2,3,"foo","bar"], "extends", number>; * ``` */ type Filter$1[], TOp extends ComparisonOperation$1, TParams extends readonly unknown[]> = Process$46$1; //#endregion //#region ../types/src/lists/Find.d.ts type FindAcc$1)[], TOp extends ComparisonOperation$1, TParams extends GetComparisonParams$1> = [] extends TList ? undefined : First$1$1 extends ComparisonAccept$1 ? [Compare$1, TOp, TParams>] extends [true] ? First$1$1 : FindAcc$1, TOp, TParams> : never; /** * **Find**`` * * Type utility used to find the first value in `TList` which _equals_ `TValue`. * Will return _undefined_ if no matches found. * * - use **FindExtends** if you want a more permissive match * - by default, values in `TList` will be compared directly but you can _dereference_ * array and object properties with `TIndex` if you want to compare on a child property * * ```ts * type List = [ { id: 1, value: "hi" }, { id: 2, value: "bye" } ] * // { id: 1; value: "hi" } * type T = Find * ``` */ type Find$2> = TList extends readonly ComparisonAccept$1[] ? FindAcc$1 : undefined; //#endregion //#region ../types/src/lists/FindMaxLength.d.ts type Reduce$3 = [] extends T ? TVal : Reduce$3, First$1$1 extends [string, infer Len extends number] ? If$1, Len, TMax> : TMax, First$1$1 extends [infer Val extends string, infer Len extends number] ? If$1, Val, TVal> : TVal>; /** * **FindMaxLength**`` * * Utility which reduces a tuple of strings to only the * string which is longest. */ type FindMaxLength$1 = T extends readonly string[] ? Reduce$3<{ [K in keyof T]: T[K] extends string ? [T[K], StrLen$1] : never }> : never; //#endregion //#region ../types/src/lists/First.d.ts /** * **First**`` * * Returns the _first_ type in a list. If `TElse` is provided it will set * the type to `TElse` when: * - `T` is a Tuple type * - `T[1]` is not a valid index of `T` * - by default `TElse` is set to _never_ * * **Related:** `Second`, `Last` */ type First$1$1 = T extends readonly unknown[] ? T[0] extends T[number] ? T[0] : ELSE : never; //#endregion //#region ../types/src/lists/Flatten.d.ts type ToFlat$1 = IsArray$1 extends true ? As$1$1 : IsUnion$1 extends true ? UnionHasArray$1 extends true ? [FlattenUnion$1] : [T] : [T]; type FlatPass$1 = [] extends TList ? TResult : FlatPass$1, [...TResult, ...ToFlat$1>]>; /** * Processes Tuple structures. * * - Each pass will start by validating that `TList` still has * either Tuples within it or values which are Tuples * - Assuming it does */ type FlattenTuple$1 = TLevel extends 0 ? TList : Or$1<[HasUnionType$1, HasArray$1]> extends true ? FlattenTuple$1, Decrement$1> : TList; type Iterate$6$1 = TupleToUnion$1<{ [K in keyof T]: T[K] extends readonly unknown[] ? Flatten$1 : T[K] }>; type FlattenUnion$1 = IsUnion$1 extends true ? Iterate$6$1, 1> : TValue; type WideFlatten$1 = T extends (infer Type)[] ? Type extends unknown[] ? Type : T : never; /** * Responsible for branching the flattening operation * to either `_Flat`, `WideFlatten` for Tuples or Arrays * and `FlattenUnion` for a union type. * * Just returns `TList` "as is" if it's not a a Tuple or * Union type. */ type Process$45$1 = TList extends readonly unknown[] ? IsTuple$1 extends true ? FlattenTuple$1 : WideFlatten$1 : IsUnion$1 extends true ? FlattenUnion$1 : TList; /** * converts a wide array to a scalar and tuple * to a union type */ type ToScalar$1 = [IsTuple$1>] extends [true] ? TupleToUnion$1> : Process$45$1 extends (infer Type)[] ? Type : never; type IterateScalar$1 = TupleToUnion$1<{ [K in keyof T]: T[K] extends unknown[] ? ToScalar$1 : T[K] }>; /** * **Flatten**`` * * - where `TList` is an array, this utility will flatten the array to a depth of * `TLevel` (by default one level). * - where `TList` is a _union type_ it will flatten any of it's elements * - where `TList is neither an array nor has a union type which is, this utility * simply proxies the value `TList` through * - in most cases you would not _flatten_ below a single dimensional array but * if you set `ToScalar` to `true` then it will flatten right out of being an array * into a union type */ type Flatten$1 = [ToScalar] extends [false] ? Process$45$1 : [IsUnion$1>] extends [true] ? IterateScalar$1>, TLevel> : [IsTuple$1>] extends [true] ? TupleToUnion$1> : Process$45$1 extends (infer Type)[] ? Type : never; //#endregion //#region ../types/src/lists/GetEach.d.ts type Process$44$1 = RemoveNever$1<{ [K in keyof TList]: TList[K] extends Container$1 | TypedFunction$1 | Error ? Get$2$1 : TList[K] extends TypedFunction$1 ? Get$2$1, TKey, TDefault> : TKey extends "." ? TList[K] : never }>; /** * **GetEach**`` * * Type utility which receives a list of types -- `TList` -- and then _gets_ a * key `TKey` (using dot syntax) from each element in the array. * * - if a given element is not an object then it is excluded from the result set * - values which evaluate to _undefined_ are also removed from the result set * - if either `null` or "" are used for `TKey` then this simply proxies `TList` * through * * ```ts * // ["Bob", "Wendy"] * type T = GetEach<[ * { name: "Bob", age: 12 }, * { name: "Wendy", age: 24 } * ], "name"> * ``` */ type GetEach$1 = TKey extends null ? TList : TKey extends "" ? TList : Process$44$1<[...TList], Exclude, TDefault> extends readonly unknown[] ? Process$44$1<[...TList], Exclude, TDefault> : never; //#endregion //#region ../types/src/lists/IndexOf.d.ts type Override$1$1 = TOverride extends Constant$2<"no-override"> ? TValue : TValue extends Error ? TOverride : TValue; type NegativeIndex$1 = TDepth["length"] extends TPositive ? TValue extends readonly [infer Head, ...readonly unknown[]] ? Head : Err$1<"invalid-index", `Use of a negative index [${AsString$1}] was unsuccessful in matching a valid index`, { container: TValue; key: TIdx; revIndex: TPositive; revContainer: Reverse$1; }> : TValue extends readonly [unknown, ...infer Rest] ? NegativeIndex$1 : If$1, TValue[TPositive], Err$1<"invalid-index", `Use of a negative index [${AsString$1}] was unsuccessful in matching a valid index`, { container: TValue; key: TIdx; revIndex: TPositive; revContainer: Reverse$1; }>>; type HandleArr$1 = TIdx extends number ? IsNegativeNumber$1 extends true ? NegativeIndex$1, TIdx> : If$1, TValue[TIdx], Err$1<"invalid-index", Concat$1<["Attempt to index [", ToString$1, "] into a non-container type!"]>, { container: TValue; key: TIdx; library: "inferred-types/constants"; }>> : Err$1<"invalid-index", `IndexOf}> failed because a tuple container must use numeric indexes!`, { container: TValue; key: TIdx; library: "inferred-types/constants"; }>; type HandleObj$1 = TIdx extends keyof TValue ? TValue[TIdx] : Err$1<"invalid-index", Concat$1<["Attempt to index [", ToString$1, "] into a non-container type!"]>, { container: TValue; key: TIdx; library: "inferred-types/constants"; }>; type Process$43$1 = If$1, TValue, TValue extends readonly unknown[] ? If$1>, HandleArr$1>, Err$1<"invalid-index", `Call to IndexOf,${AsString$1}> is not allowed as an tuple based container must receive either null or numeric index value.`, { library: "inferred-types/constants"; container: TValue; key: TIdx; }>> : TValue extends Dictionary$1 ? TIdx extends ObjectKey$1 ? HandleObj$1 : Err$1<"invalid-index", `Call to IndexOf,${AsString$1}> is not allowed as an object based container must receive either null, a string, or a symbol index value.`, { library: "inferred-types/constants"; container: TValue; key: TIdx; }> : Err$1<"invalid-index", `IndexOf,${AsString$1}> was called but a non-null value was used to index a non-container which will never work!`, { library: "inferred-types/constants"; container: TValue; key: TIdx; }>>; /** * **IndexOf** * * A type utility which _dereferences_ a property/index item on an array * or object. * * - if `TIdx` is passed in as `null` then this will act as an identity * function and return `TValue`. * - if `TIdx` is a negative number it will index in reverse for tuple based * containers * * **Related:** `Get`, `IsValidIndex` * * **Errors:** produces an Error when an a bad index value * is passed in for the given container */ type IndexOf$1> = TIdx extends null ? TValue : Override$1$1>, TOverride>; //#endregion //#region ../types/src/lists/Last.d.ts /** * **Last**`` * * Returns the _last_ element in a list of elements. * * - by default `TEmpty` is _never_ but this can be changed. */ type Last$1$1 = IfLength$1 extends readonly unknown[] ? TContent[AfterFirst$1["length"]] extends TContent[number] ? TContent[AfterFirst$1["length"]] : TEmpty : TEmpty>>; //#endregion //#region ../types/src/lists/LogicalReturns.d.ts type Process$42$1 = { [K in keyof TValues]: TValues[K] extends ((...args: any[]) => boolean) ? ReturnType : TValues[K] }; /** * **LogicalReturns**`` * * Given a known tuple of values, this utility will reduce it to * another tuple of items which are either a _boolean type_ or a function * with a boolean return. In the latter case the function's return value * will be represented in the Tuple. * * **Related**: `ReturnTypes` and `TruthyReturns` */ type LogicalReturns$1 = Process$42$1 extends readonly boolean[] ? Process$42$1 : never; //#endregion //#region ../types/src/lists/MakeOptional.d.ts type Process$41$1 = TInput extends readonly [infer Head extends unknown, ...infer Rest extends readonly unknown[]] ? Depth["length"] extends 128 ? readonly unknown[] : IsGreaterThan$1 extends true ? Process$41$1, { required: TOutput["required"]; optional: [...TOutput["optional"], Head]; }, [unknown, ...Depth]> : Process$41$1, { required: [...TOutput["required"], Head]; optional: TOutput["optional"]; }, [unknown, ...Depth]> : [...TOutput["required"], ...Partial]; /** * **MakeOptional**`` * * Take a tuple `T` and makes the last `U` elements _optional_ with the * `?` optional modifier. * * ```ts * // [ string, number, string? ] * type Test = MakeOptional<[string, number, string], 1>; * ``` * * **Note:** * - the mix of optional vs. required elements in `T` has no bearing on * the outcome. * * **Related:** `MakeKeysOptional` */ type MakeOptional$1 = Subtract$1["length"], U> extends infer Req extends number ? number extends Req ? never : Process$41$1, Req> : never; //#endregion //#region ../types/src/lists/NotFilter.d.ts type Process$40$1[], TOp extends ComparisonOperation$1, TParams extends readonly unknown[]> = RemoveMarked$1<{ [K in keyof TList]: [Compare$1] extends [false] ? TList[K] : Marked$2$2 }>; /** * **NotFilter**`` * * Performs the same task as `Filter` but with the opposite results. * * - when elements are evaluated to `true` on their comparison operation * they are _removed_ * * **Related:** `Filter` * * ```ts * // ["foo","bar"] * type NotNum = NotFilter<[1,2,3,"foo","bar"], "extends", number>; * ``` */ type NotFilter$1[], TOp extends ComparisonOperation$1, TParams extends readonly unknown[]> = Process$40$1; //#endregion //#region ../types/src/lists/NumericKeys.d.ts type IndicesTuple$1 = number extends T["length"] ? number[] : T extends readonly [any, ...infer R] ? IndicesTuple$1 : Acc; /** * **NumericKeys**<`TList`> * * Will provide a tuple of numeric keys for * a literal array and `number[]` for a wide array. * * ```ts * type Arr = ["foo", "bar", "baz"]; * // readonly [0, 1, 2] * type T = NumericKeys; * ``` * * **Related:** `NumericKeys__Union`, `Keys`, `ObjectKeys` */ type NumericKeys$1 = HasVariadicTail$1 extends true ? DropVariadicTail$1 extends infer NonVariadic extends readonly unknown[] ? IndicesTuple$1 extends infer NonVariadic extends readonly unknown[] ? [...NonVariadic, ...number[]] : never : never : IndicesTuple$1; //#endregion //#region ../types/src/lists/Pop.d.ts type _Pop$1 = TVal extends [...(infer Rest), unknown] ? Rest : []; type AdjustVariadic$1< /** the list of elements with any variadic elements removed */TList extends readonly unknown[], /** the original array which we'll use to detect variadic properties */TOrigin extends readonly unknown[], /** the element which was just removed */TRemoved, TType = (VariadicType$1 extends (infer Base)[] ? Base : never)> = IsVariadicArray$1 extends true ? TRemoved extends TType ? [...TList, ...TType[]] : [...TList, ...TType[]] | [...TList, TRemoved, ...TType[]] : TList; /** * **Pop**`` * * Removes the last element of a list. * ```ts * // [1,2] * type T = Pop<[1,2,3]>; * ``` * * - to provide additional utility, you can also pass * in a string literal and get back the literal with the last * character removed. * - when popping an empty tuple/array, the type remains `[]` */ type Pop$1 = TList extends readonly unknown[] ? IsWideArray$1 extends true ? TList : DropVariadic$1> extends [...infer NewList extends readonly [unknown, ...unknown[]], infer Removed] ? HasOptionalElements$1 extends true ? TupleMeta$1["optionalElementCount"] extends infer Optional extends number ? IsGreaterThan$1, 0> extends true ? MakeOptional$1> extends infer Next extends readonly unknown[] ? AdjustVariadic$1), TList, Removed> : never : NewList | Pop$1 : NewList | Pop$1 : AdjustVariadic$1 : [] : TList extends string ? IsWideType$1 extends true ? string : IsStringLiteral$1$1 extends true ? TList extends string ? TList extends "" ? "" : Chars$2 extends readonly string[] ? Concat$1<_Pop$1>> : never : never : string : _Pop$1>; //#endregion //#region ../types/src/lists/Push.d.ts type Process$39$1 = [...TList, TValue]; /** * **Push**`` * * Pushes a value `TVal` onto an existing list `TList`. * * - If you want to make the push conditional you can add `TCondition` */ type Push$1 = [TCondition] extends [true] ? As$1$1, readonly unknown[]> : TList; //#endregion //#region ../types/src/lists/Reverse.d.ts type RevAcc$1 = TInput extends [infer Head, ...infer Rest] ? RevAcc$1 : TResults; /** * **Reverse**`` * * Reverses the order of a `Tuple` or a `string`. * * **Note:** * - to ensure all elements are retained while **not** breaking the rules * regarding _optional_ elements not being allowed to precede _required_ ones * we convert all elements to **required** rather than risk losing elements. */ type Reverse$1 = T extends readonly unknown[] ? RevAcc$1> : T extends string ? Join$1>> : never; //#endregion //#region ../types/src/lists/Second.d.ts /** * **Second**`` * * Returns the _second_ type in a list. If `TElse` is provided it will set * the type to `TElse` when: * - `T` is a Tuple type * - `T[1]` is not a valid index of `T` * - by default `TElse` is set to _never_ * * **Related:** `First`, `Last` */ type Second$2$1 = T extends readonly unknown[] ? T[1] extends T[number] ? T[1] : ELSE : never; //#endregion //#region ../types/src/lists/Shift.d.ts type _Shift$1 = TList extends [unknown, ...(infer Tail)] ? Tail : undefined; /** * **Shift**`` * * Removes the first element of a list, returning the rest. * ```ts * // [2,3] * type T = Shift<[1,2,3]>; * ``` * * - to provide additional utility, you can also pass * in a string literal and get back the literal with the first * character removed. * - if there is nothing left in Tuple or an empty string is passed in as input * then the output will _undefined_. */ type Shift$1$1 = IsUndefined$1 extends true ? undefined : [] extends T ? undefined : T extends readonly unknown[] ? _Shift$1> : string extends T ? string : T extends string ? T extends "" ? undefined : _Shift$1>>> extends readonly string[] ? Concat$1<_Shift$1>>>> : undefined : never; //#endregion //#region ../types/src/lists/Shortest.d.ts type Process$38$1 = T extends [infer Head extends string, ...infer Rest extends readonly string[]] ? Depth["length"] extends 128 ? TResult extends Unset$1 ? string : TResult : Process$38$1 extends true ? Min$1$1<[TShortest, Length$1]> : TShortest, IsStringLiteral$1$1 extends true ? IsLessThan$1, TShortest> extends true ? Head : TResult : TResult, [unknown, ...Depth]> : TResult extends Unset$1 ? string : TResult; /** * **Shortest**`` * * Takes a tuple of strings and returns the shortest one in the tuple. * * - if more than one string is _tied_ for being shortest then * the **first** one found will be returned. * - if _all_ elements passed in were wide then the result will be `string` * - if _some_ of the elements passed in were wide then they will be * ignored and only the literal strings will be compared */ type Shortest$1 = Process$38$1; //#endregion //#region ../types/src/lists/Slice.d.ts type PositiveOfNegative$1 = `${T}` extends `-${infer N extends number}` ? N : never; type DropLeading$1 = TDepth["length"] extends TStart ? TList : number extends TStart ? TList : TDepth["length"] extends 64 ? TList : TList extends readonly [unknown, ...infer Rest] ? DropLeading$1 : never; type DropTrailing$1 = Subtract$1 extends infer Keep extends number ? number extends TStart ? TList : TakeFirst$1 : []; type TruncateAtLen$1 = TLen extends number ? number extends TLen ? TList : `${TLen}` extends `-${string}` ? DropTrailing$1> : TakeFirst$1 : TList; type ProcessList$1 = TList extends readonly unknown[] ? number extends TStart ? TruncateAtLen$1 : `${TStart}` extends `-${string}` ? TakeLast$1> : IsGreaterThan$1 extends true ? TLen extends number ? [] : never : TruncateAtLen$1, TLen> : never; type ProcessChars$1 = ProcessList$1 extends readonly string[] ? ProcessList$1 extends infer Result extends readonly string[] ? Concat$1 : never : never; /** * **Slice**`` * * Provides a slice of a tuple or a string. * * - negative indexes for `TEnd` can be used * - `TStart` defaults to 0 * - `TLen` defaults to the all the remaining elements * but can be any amount; if you use negative values this * will drop that many values off the end of the tuple * * **Related:** `SliceArray`, `SliceString` */ type Slice$1 = [TList] extends [string] ? SliceString$1 : [TList] extends [readonly unknown[]] ? SliceArray$1 : never; /** * **SliceArray** * * Slices an array. * * - negative indexes for `TEnd` can be used * - `TStart` defaults to 0 * - `TLen` defaults to the all the remaining elements * but can be any amount; if you use negative values this * will drop that many values off the end of the tuple * * **Related:** `Slice`, `SliceArray` */ type SliceString$1 = Chars$2 extends infer Characters extends readonly string[] ? IsGreaterThan$1 extends true ? "" : ProcessChars$1 : never; /** * **SliceArray** * * Slices an array. * * - negative indexes for `TEnd` can be used * - `TStart` defaults to 0 * - `TLen` defaults to the all the remaining elements * but can be any amount; if you use negative values this * will drop that many values off the end of the tuple * * **Related:** `Slice`, `SliceString` */ type SliceArray$1 = ProcessList$1<[...TList], TStart, TLen> extends infer Result extends readonly unknown[] ? Result extends readonly (TList[number])[] ? Result : never : never; //#endregion //#region ../types/src/lists/sort/Sort.d.ts type SortOrder$1$1 = "ASC" | "DESC" | "Natural"; type Dotpath$1 = string; /** * **SortOptions**`<[TOrder],[TOffset],[TStart],[TEnd]>` * * Specifies how you'd like a list sorted. */ interface SortOptions$1 { /** * the sorting strategy for the list * * @default "ASC" */ order?: SortOrder$1$1; /** * by adding a `DotPath` to the offset you are expressing that * the items in your list are some sort of a container and you'd * like the sorting comparison to be done on the offset/index specified. * * @default undefined */ offset?: Dotpath$1 | undefined; /** * allows pinning items to the _start_ of the list * Can be a single value or array of values * * @default undefined */ start?: unknown; /** * allows pinning items to the _end_ of the list * Can be a single value or array of values * * @default undefined */ end?: unknown; } //#endregion //#region ../types/src/lists/sort/SortByLength.d.ts /** * Returns true if A is longer than B. * We compare by stripping one char at a time. */ type IsLonger$2 = A extends `${string}${infer ARest}` ? B extends `${string}${infer BRest}` ? IsLonger$2 : true : false; /** Find the longest string in a readonly tuple */ type Longest$2 = T extends readonly [infer H extends string, ...infer R extends readonly string[]] ? Longest$2 extends true ? H : Curr> : Curr; /** * Remove the first occurrence of V from a readonly tuple */ type RemoveFirst$2 = T extends readonly [infer H, ...infer R] ? H extends V ? [...Acc, ...R] : RemoveFirst$2 : Acc; type Sort$2 = T["length"] extends 0 ? Acc : Longest$2 extends infer L extends string ? Sort$2, [...Acc, L]> : never; /** * **SortByLength**`` * * Sorts the elements from longest to shortest. * * - use `Reverse` utility if you want the opposite. */ type SortByLength$1 = Sort$2; //#endregion //#region ../types/src/lists/SortByKey.d.ts /** * default options for sorting */ interface SortByKeyOptions$1 { /** Object Key's that should be pinned to the start of the array */ start?: T | readonly T[]; /** Object keys's that should be pinned to the end of the array */ end?: T | readonly T[]; order?: SortOrder$2; } type ToArray$1 = T extends readonly unknown[] ? T : readonly [T]; type SortByKey$1 = TList extends readonly any[] ? Mutable$1<_SortByKey$1> : TList; type _SortByKey$1 = _Reorder$1 : readonly [], TConfig["end"] extends any ? ToArray$1 : readonly []>; type _Reorder$1 = readonly [..._GetStartElements$1, ..._GetMiddleElements$1, ..._GetEndElements$1]; type _GetStartElements$1 = TStart extends readonly [infer First, ...infer Rest] ? [..._FilterByValue$1, ..._GetStartElements$1] : []; type _GetEndElements$1 = TEnd extends readonly [infer First, ...infer Rest] ? [..._FilterByValue$1, ..._GetEndElements$1] : []; type _GetMiddleElements$1 = _FilterByValues$1; type _FilterByValue$1 = TList extends readonly [infer First, ...infer Rest extends object[]] ? First extends object ? TKey extends keyof First ? First[TKey] extends TValue ? readonly [First, ..._FilterByValue$1] : _FilterByValue$1 : _FilterByValue$1 : _FilterByValue$1 : []; type _FilterByValues$1 = TList extends readonly [infer First, ...infer Rest extends object[]] ? First extends object ? TKey extends keyof First ? First[TKey] extends TValues[number] ? _FilterByValues$1 : [First, ..._FilterByValues$1] : [First, ..._FilterByValues$1] : [First, ..._FilterByValues$1] : []; //#endregion //#region ../types/src/lists/TakeFirst.d.ts type Take$8$1 = TDepth["length"] extends TLen ? TResult : number extends TLen ? TContent : TDepth["length"] extends 64 ? TResult : [] extends TContent ? TResult : TContent extends readonly [infer Head, ...infer Tail] ? Take$8$1 : TResult; type CountOptionalInFirstN$1 = number extends N ? number : GetRequiredElementCount$1 extends infer Req extends number ? GetOptionalElementCount$1 extends infer Opt extends number ? Subtract$1 extends infer Delta extends number ? IsLessThan$1 extends true ? 0 : Min$1$1<[Opt, Delta]> : 0 : 0 : 0; /** * **TakeFirst**`` * * Takes the first `TLen` items from `TContent` and discards the rest. * * **Note:** * - if `TLen` is larger then the number of elements left in * `TContent` then only the remaining elements will be returned. */ type TakeFirst$1> = HasOptionalElements$1 extends true ? AllOptionalElements$1 extends true ? Partial> : number extends TLen ? TContent : Take$8$1 extends infer FirstN extends readonly unknown[] ? CountOptionalInFirstN$1 extends infer Optional extends number ? MakeOptional$1 : never : never : Take$8$1; //#endregion //#region ../types/src/lists/TakeLast.d.ts /** * **TakeLast**`` * * Takes the last `TLen` items from `TContent` and discards the rest. * * Note: * - by default if `TLen` is larger than the size of `TContent` this * is fine and instead of getting precisely `TLen` elements you'll get */ type TakeLast$1> = HasOptionalElements$1 extends true ? MakeOptional$1, TLen>> extends readonly unknown[] ? Reverse$1, TLen>> : [], As$1$1, TLen]>, number>> : Reverse$1, TLen>>; //#endregion //#region ../types/src/lists/Variadic.d.ts /** Does T have at least one fixed (non-variadic) element? */ type HasFixedHead$1 = Exclude extends never ? false : true; /** * **SplitAtVariadic**`` * * Split T into: * - Prefix: whatever remains after removing the maximal fixed suffix * - Suffix: the maximal fixed suffix (elements guaranteed to be present at the end) * * For example: * - SplitAtVariadic<[...string[], 1, 2]> -> [[...string[]], [1, 2]] * - SplitAtVariadic<[1, ...string[], 2]> -> [[1, ...string[]], [2]] * - SplitAtVariadic<[1, 2]> -> [[], [1, 2]] * - SplitAtVariadic -> [string[], []] */ type SplitAtVariadic$1 = Depth["length"] extends 30 ? [T, Acc] : T extends readonly [...infer P, infer L] ? SplitAtVariadic$1 : [T, Acc]; /** * **HasVariadicTail**`` * * Boolean operator which tests whether the tuple `T` concludes with * a _variadic_ type. * * - **Note**: while all wide type arrays like `number[]` or even `[...number[]]` ( * which coincidentally are the same type) are by nature _variadic_. This utility, * however, will return `false` for wide types so we can isolate only literal types * that have variadic tails. * * **Related:** * - `HasVariadicHead`, `HasVariadicInterior`, `IsVariadicArray` * - `VariadicType`, `GetNonVariadicLength` */ type HasVariadicTail$1 = [IsAny$1] extends [true] ? false : [IsNever$1] extends [true] ? false : IsVariadicArray$1 extends true ? HasFixedHead$1 extends true ? SplitAtVariadic$1 extends [...any[], []] ? true : false : false : false; /** * **HasVariadicHead**`` * * Tests whether if `T` starts with a variadic type with a fixed * type at the end. * * - **Note**: while all wide type arrays like `number[]` or even `[...number[]]` ( * which coincidentally are the same type) are by nature _variadic_. This utility, * however, will return `false` for wide types so we can isolate only literal types * that have variadic tails. * * **Related:** * - `HasVariadicTail`, `HasVariadicInterior`, `IsVariadicArray` * - `VariadicType`, `GetNonVariadicLength` */ type HasVariadicHead$1 = [IsAny$1] extends [true] ? false : [IsNever$1] extends [true] ? false : IsVariadicArray$1 extends true ? HasFixedHead$1 extends true ? false : SplitAtVariadic$1 extends [...unknown[], []] ? false : true : false; /** * **HasVariadicInterior**`` * * tests whether `T` has a _variadic_ element in the _interior_ of * the array. * * **Related:** `HasVariadicHead`, `HasVariadicTail`, `IsVariadicArray` */ type HasVariadicInterior$1 = [IsAny$1] extends [true] ? false : [IsNever$1] extends [true] ? false : IsVariadicArray$1 extends true ? Not$1, HasVariadicTail$1]>> extends true ? SplitAtVariadic$1 extends [...unknown[], []] ? false : true : false : false; /** * **AllOptionalElements** * * Boolean operator which detects whether `T`'s elements are ALL designed as optional (e.g., marked with the * `?` modifier). * * **Related:** `HasOptionalElements` */ type AllOptionalElements$1 = IsEqual$1, T>; /** * **GetNonVariadicLength**`` * * Determines the length of the tuple when the variadic tail has been stripped off. * * - if `T` is not variadic then this will simply report the length of the tuple` * - _optional_ elements (e.g., marked with the `?` modifier) are always included in the length */ type GetNonVariadicLength$1 = Depth["length"] extends 25 ? F["length"] : [] extends Required ? F["length"] : Required> extends [infer Explicit, ...infer REST] ? GetNonVariadicLength$1 : F["length"]; /** * **NonVariadicRequired**`` * * Get's the elements which have a fixed value (aka, are not * _variadic_) as well as are "required" (aka, no `?` modifier used) */ type NonVariadicRequired$1 = Depth["length"] extends 25 ? F["length"] : [] extends T ? F["length"] : Mutable$1 extends [infer Explicit, ...infer REST] ? NonVariadicRequired$1 : F["length"]; /** * **GetRequiredElementCount**`` * * counts only the **required** elements of `T` * * **Related:** `GetOptionalElementCount`, `TupleMeta` */ type GetRequiredElementCount$1 = NonVariadicRequired$1; /** * **GetOptionalElementCount**`` * * counts only the **optional** elements of `T` (e.g., those with the `?` modifier). * * **Related:** `GetRequiredElementCount`, `TupleMeta`, `MakeOptional` */ type GetOptionalElementCount$1 = T extends readonly unknown[] ? T["length"] extends number ? GetNonVariadicLength$1 extends infer NonVarLen extends number ? GetRequiredElementCount$1 extends infer ReqLen extends number ? Subtract$1 : 0 : 0 : 0 : never; /** * **DropVariadicTail**`` * * Removes the variadic tail found on the tuple `T`. * * - if no variadic tuple is found on `T` then it is just passed through * as is * * ```ts * // [ string, number? ] * type Test = ExcludeVariadicTail<[string, number?, ...string[]]>; * ``` */ type DropVariadicTail$1 = HasVariadicTail$1 extends true ? GetNonVariadicLength$1 extends infer Len extends number ? SliceArray$1 : T : T; /** * **IsVariadicArray**`` * * Boolean operator which determines if this tuple/array is variadic. * * - unlike some other utilities, this does not distinguish between * variadic arrays with fixed type elements versus **wide** array types; * both will return `true` */ type IsVariadicArray$1 = number extends T["length"] ? true : false; /** * **DropVariadicHead**`` * * Removes the variadic head found on the tuple `T`. * * - if no variadic head is found on `T` then it is just passed through * * ```ts * // [ string, number? ] * type Test = ExcludeVariadicHead<[...string[], string, number?]>; * ``` */ type DropVariadicHead$1 = SplitAtVariadic$1 extends [infer Prefix extends readonly unknown[], infer Suffix extends readonly unknown[]] ? IsVariadicArray$1 extends true ? HasFixedHead$1 extends false ? Suffix : T : T : never; /** * **DropVariadic**`` * * Drops any variadic element found in `T` while retaining all the fixed length * elements. * * - if `T` has no variadic elements then it will be returned "as is" * * ```ts * // [1,2,3] * type Test = DropVariadic<[1,2,3, ...string[]]>; * ``` * * **Related:** `DropVariadicHead`, `DropVariadicTail`, `IsVariadicArray` */ type DropVariadic$1 = IsVariadicArray$1 extends false ? T : HasVariadicHead$1 extends true ? DropVariadicHead$1 : HasVariadicTail$1 extends true ? DropVariadicTail$1 : HasVariadicInterior$1 extends true ? SplitAtVariadic$1 extends [...infer Head, ...infer Tail] ? IsVariadicArray$1 extends true ? Tail extends readonly unknown[] ? Tail : never : IsVariadicArray$1 extends true ? Head extends readonly unknown[] ? Head : never : T : T : T; /** * **VariadicType**`` * * Returns the element type of a tuple's variadic tail. * * - Returns `never` if the tuple has no variadic tail * - For tuples with variadic tails like `[1, 2, ...number[]]`, returns the element type (`number`) * - Empty tuples and tuples with only optional elements return `never` * - Wide array types like `string[]`, or `number[]` -- _which are innately variadic types_ -- will correctly * report their variadic type as `string`, `number`, etc. * * **Related:** `GetNonVariadicLength`, `NonVariadic`, `VariadicType` */ type VariadicType$1 = IsVariadicArray$1 extends true ? HasVariadicHead$1 extends true ? DropVariadicHead$1 extends infer DroppedHead extends readonly unknown[] ? R extends readonly [...infer Head, ...DroppedHead] ? Head : never : never : HasVariadicTail$1 extends true ? DropVariadicTail$1 extends infer DroppedTail extends readonly unknown[] ? R extends readonly [...DroppedTail, ...infer Tail] ? Tail : never : never : never : never; //#endregion //#region ../types/src/boolean-logic/operators/containers/IsEmptyArray.d.ts /** * Boolean operator which tests `T` for whether it is an array * with zero elements. * * - if `T` is a wide array it will return `boolean` */ type IsEmptyArray$1 = T extends any[] ? number extends T["length"] ? GetNonVariadicLength$1 extends 0 ? boolean : false : T["length"] extends 0 ? true : false : false; //#endregion //#region ../types/src/boolean-logic/operators/containers/IsEmptyObject.d.ts /** * **IsEmptyObject**`` * * - T must be an object (but not a function and not an array/tuple) * - T must expose **no known keys** (`keyof T` is `never`) * - `any`, `unknown`, and `never` are rejected */ type IsEmptyObject$1 = IsAny$1 extends true ? false : IsNever$1 extends true ? false : IsNull$1 extends true ? false : IsUndefined$1 extends true ? false : T extends AnyFunction$1 ? false : IsObject$1 extends true ? ObjectKeys$1 extends readonly PropertyKey[] ? TupleMeta$1>["isEmpty"] : false : false; //#endregion //#region ../types/src/boolean-logic/operators/containers/IsNonEmptyObject.d.ts /** * **IsNonEmptyObject**`` * * Boolean type util which detects whether `T` _is_ an object * and _has at least one property_. * * **Note:** this will report **false** for`ExplicitlyEmptyObject` but * not `EmptyObject` * * **Related:** `IsEmptyObject` */ type IsNonEmptyObject$1 = T extends AnyObject$1 ? IsEqual$1 extends true ? false : Keys$1$1>["length"] extends 0 ? false : IsNumericLiteral$1>["length"]> extends true ? true : false : false; //#endregion //#region ../types/src/boolean-logic/operators/containers/IsObject.d.ts /** * **IsObject**`` * * Boolean operator which tests whether `T` extends `object` in a non-nullable fashion. */ type IsObject$1 = [IsAny$1] extends [true] ? false : [IsNever$1] extends [true] ? false : [IsNull$1] extends [true] ? false : [IsUndefined$1] extends [true] ? false : T extends object ? true : false; //#endregion //#region ../types/src/boolean-logic/operators/containers/IsReadonlyArray.d.ts /** * **IsReadonlyArray**`` * * Boolean type utility which detects whether `T` is a readonly array. */ type IsReadonlyArray$1 = T extends unknown[] ? false : T extends readonly unknown[] ? true : false; //#endregion //#region ../types/src/boolean-logic/operators/containers/IsSameContainerType.d.ts /** * test that `A` and `B` are both a Dictionary object or both are an array */ type IsSameContainerType$1 = Or$1<[And$1<[IsDictionary$1, IsDictionary$1]>, And$1<[IsArray$1, IsArray$1]>]>; //#endregion //#region ../types/src/boolean-logic/operators/containers/IsValidIndex.d.ts type HasPositiveIndex$1 = TDepth["length"] extends TKey ? TContainer extends readonly [unknown, ...readonly unknown[]] ? true : false : TContainer extends readonly [unknown, ...infer Rest] ? HasPositiveIndex$1 : false; type HasNegativeIndex$1 = TDepth["length"] extends TKey ? TContainer extends readonly [unknown, ...readonly unknown[]] ? true : false : TContainer extends readonly [unknown, ...infer Rest] ? HasNegativeIndex$1 : false; type PositiveIndexOf$1 = `${T}` extends `-${infer N extends number}` ? N : never; /** * **IsValidIndex**`` * * Provides a boolean check on whether `TKey` is a valid key for `TContainer`. * * - valid responses are `true` or `false` if literal types found; otherwise `boolean` * - negative indexes are allowed when `TContainer` is a tuple */ type IsValidIndex$1 = TContainer extends Tuple$1$1 ? IsTuple$1 extends true ? TKey extends number ? number extends TKey ? boolean : `${TKey}` extends `-${string}` ? PositiveIndexOf$1 extends infer Positive extends number ? Positive extends 0 ? false : HasNegativeIndex$1 : false : HasPositiveIndex$1 : false : boolean : TContainer extends Dictionary$1 ? IsEqual$1 extends true ? false : [IsLiteralLikeObject$1] extends [true] ? [IsStringLiteral$1$1] extends [true] ? [TKey] extends [keyof TContainer] ? true : false : [TKey] extends [symbol] ? [TKey] extends [keyof TContainer] ? true : false : false : boolean : false; //#endregion //#region ../types/src/boolean-logic/operators/datetime/IsAfter.d.ts type IsSameDateDifferentPrecision$1$1 = A extends `${infer DatePart}T00:00:00Z` ? B extends DatePart ? true : false : B extends `${infer DatePart}T00:00:00Z` ? A extends DatePart ? true : false : false; type IsCharGreater$1$1 = A extends "0" ? false : A extends "1" ? B extends "0" ? true : false : A extends "2" ? B extends "0" | "1" ? true : false : A extends "3" ? B extends "0" | "1" | "2" ? true : false : A extends "4" ? B extends "0" | "1" | "2" | "3" ? true : false : A extends "5" ? B extends "0" | "1" | "2" | "3" | "4" ? true : false : A extends "6" ? B extends "0" | "1" | "2" | "3" | "4" | "5" ? true : false : A extends "7" ? B extends "0" | "1" | "2" | "3" | "4" | "5" | "6" ? true : false : A extends "8" ? B extends "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" ? true : false : A extends "9" ? B extends "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" ? true : false : A extends ":" ? B extends "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" ? true : false : A extends "T" ? B extends "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" | "-" | ":" ? true : false : A extends "Z" ? B extends "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" | "-" | ":" | "T" ? true : false : A extends "-" ? B extends "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" ? true : false : false; type LexicographicCompare$1$1 = A extends B ? false : IsSameDateDifferentPrecision$1$1 extends true ? false : [A] extends [never] ? false : [B] extends [never] ? false : [A, B] extends [string, string] ? A extends `${infer AFirst}${infer ARest}` ? B extends `${infer BFirst}${infer BRest}` ? AFirst extends BFirst ? LexicographicCompare$1$1 : IsCharGreater$1$1 : true : false : false; /** * **IsAfter**`` * * Tests whether `A` is _after_ (in time) `B`. * * Preserves literal types by using string comparison for ISO date strings. * For wide types or complex dates, it returns boolean. */ type IsAfter$1 = A extends object ? boolean : B extends object ? boolean : string extends A ? boolean : string extends B ? boolean : number extends A ? boolean : number extends B ? boolean : A extends number ? B extends number ? IsGreaterThan$1 : boolean : A extends string ? B extends string ? LexicographicCompare$1$1 : boolean : boolean; //#endregion //#region ../types/src/interpolation/ApplyTemplate.d.ts type ToBaseType$2 = { [K in keyof T]: T[K] extends NumberLike$1 ? AsNumber$1 : T[K] extends BooleanLike$1 ? AsBoolean$1 : T[K] }; type Finalize$2 = TOnlyStringLit extends true ? [TContent, ...TApplied] : [TContent, ...ToBaseType$2]; type Apply$1$1 = [] extends TStatic ? TResults : TStatic extends readonly [infer Head extends string, infer Next extends string, ...infer Rest extends string[]] ? Apply$1$1, Next>]> : TStatic extends readonly [infer Head extends string] ? [...TResults, RetainAfter$1] : TResults; /** * **ApplyTemplate**`` * * If the content found in `TContent` is a match for `TTemplate`, then * the type returned will be the dynamic segments defined in the template. * * Alternatively, if `TContent` _does not_ match the dynamic segments * defined in `TTemplate` then a **invalid-content** error will be returned. * * Returns a tuple of the format: * * - [ full, p1, p2, p3, ... ] */ type ApplyTemplate$1 = IsStringLiteral$1$1 extends true ? FromLiteralTemplate$1 extends infer Template extends string ? Finalize$2>, TOnlyStringLit> : never : string; //#endregion //#region ../types/src/interpolation/AsLiteralTemplate.d.ts type Convert$8$1> = TKeys extends [infer Head extends string & keyof TSegments, ...infer Rest extends readonly string[]] ? [FromInputToken__String$1>] extends [string | number | boolean] ? Convert$8$1>}`>, TSegments, Rest> : TContent extends `{{${Head}}}` ? FromInputToken__String$1> : Err$1<`invalid-type/template`, `The segment '{{${Head}}}' was configured as a type which can not be embedded inside of a string literal!`, { segment: Head; invalidType: FromInputToken__String$1>; content: TContent; }> : TContent; /** * **AsLiteralTemplate**`` * * Converts Static Template sections to a Literal Template */ type AsLiteralTemplate$1 = TContent extends number ? `${TContent}` : TContent extends string ? TContent extends `{{${infer Inner extends string}}}` ? Inner extends keyof TSegments ? FromInputToken__String$1> : Convert$8$1 : Convert$8$1 : never; //#endregion //#region ../types/src/interpolation/AsStaticTemplate.d.ts type NoBooleanConversion$1 = Err$1<`invalid-string/boolean-literal`, `An attempt was made to convert a string from a "literal template" to a "static template" but the use of ${boolean} converts to a union type and quickly becomes unmanageable. Use the static {{boolean}} form instead.`, { template: T; }>; type RestoreVocabularyPlaceholders$1 = TContent extends `${infer Before}${"$"}{${infer Name}}${infer After}` ? Name extends Extract ? RestoreVocabularyPlaceholders$1<`${Before}{{${Name}}}${After}`, TSegments> : `${Before}${"$"}{${Name}}${RestoreVocabularyPlaceholders$1}` : TContent; type HasVocabularyPlaceholder$1 = TContent extends `${string}${"$"}{${string}}${string}` ? true : false; /** * **FromLiteralTemplate**`` * * Converts a string literal type into a Static Template where: * * - `${string}` is `{{string}}` * - `${number}` is `{{number}}` * - the `${boolean}` literal will produce a union and is too expensive to try and * capture so instead we'll return an error. * * This type utility is the _inverse_ of `StringLiteralTemplate`. */ type FromLiteralTemplate$1 = string extends T ? string | Error : IsUnion$1 extends true ? NoBooleanConversion$1 : ReplaceStringInterpolation$1, "{{string}}">; type Convert$7$1> extends readonly string[] ? UnionToTuple$2> : [])> = TKeys extends [infer Head extends string, ...infer Rest extends readonly string[]] ? Convert$7$1, TSegments, Rest> : TContent; /** * **AsStaticTemplate**`` * * Converts a string literal type into a Static Template where: * * - `${string}` is `{{string}}` * - `${number}` is `{{number}}` * - the `${boolean}` literal will produce a union and is too expensive to try and * capture so instead we'll throw an error. * * In addition you can optionally add a **template map** which will allow for additional * vocabulary to be used. There are a few pre-configured maps: * * - `TemplateMap__Basics` - this is the default of strings, numbers, and booleans * - `TemplateMap__Generics` - an easy way to allow for generic params to included */ type AsStaticTemplate$1 = As$1$1 extends true ? HasVocabularyPlaceholder$1 extends true ? RestoreVocabularyPlaceholders$1 : Convert$7$1, string>, TSegments> : Convert$7$1, string>, TSegments>, string>; //#endregion //#region ../types/src/dictionary/Get.d.ts type _Get$1 = K extends `${infer A}.${infer B}` ? A extends keyof T ? _Get$1> : Acc : K extends keyof T ? _Get$1 : Acc; /** * **Get**`` * * Provides a type utility which allows reaching into * a container using a _dot path_ to get the type * somewhere inside the parent structure. */ type Get$2$1 = IsNever$1<_Get$1> extends true ? TDefVal : _Get$1 extends undefined ? TDefVal : _Get$1; //#endregion //#region ../types/src/dictionary/GetFixedKeys.d.ts /** * **GetFixedKeys**`` * * Returns a union type for all _fixed_ keys found in `T` (aka, not indexed keys). * * **Related:** `GetIndexKeys`, `OnlyFixedKeys`, `RemoveIndexKeys` */ type GetFixedKeys$1 = IsEqual$1 extends true ? ObjectKey$1[] : T extends Dictionary$1 ? keyof RemoveIndexKeys$1 : never; //#endregion //#region ../types/src/dictionary/GetIndexKeys.d.ts /** * **GetIndexKeys`` * * Returns a union type of all the _index_ types found in `T`. * * - an index can be wide-type indexes such as `{ [x: string]: string }` * _or_ `{ [x: symbol]: number }` * - but they can also be _template literal_ indexes like `{ [x: `_${string}`]: string }` * * **Related:** `OnlyIndexKeys` */ type GetIndexKeys$1 = keyof OnlyIndexKeys$1 & (string | symbol); //#endregion //#region ../types/src/dictionary/KeysWithError.d.ts type Process$37$1, readonly ObjectKey$1[]>, R extends readonly ObjectKey$1[] = []> = [] extends K ? R : First$1$1 extends keyof T ? T[First$1$1] extends Error ? Process$37$1, [...R, First$1$1]> : Process$37$1, R> : never; /** * **KeysWithError**`` * * Returns all of the keys in a dictionary `T` which _extend_ `Error`. */ type KeysWithError$1 = Process$37$1; //#endregion //#region ../types/src/dictionary/KeysWithoutValue.d.ts /** * **KeysWithoutValue**`` * * The _keys_ on a given object `T` which _do not_ extend the type value of `W`. * * ```ts * // "foo" * type T = KeysWithoutValue<{ foo: "hi"; bar: 5; baz: number }, number>; * ``` */ type KeysWithoutValue$1 = { [K in keyof TObj]: TObj[K] extends TValue ? never : Readonly }[keyof TObj]; //#endregion //#region ../types/src/dictionary/MakeKeysOptional.d.ts type Iterate$5$1 = ExpandRecursively$1 & { [K in keyof WithKeys$1]?: K extends keyof TObj ? TObj[K] : never }>; type ConvertArray$1 = IsGreaterThanOrEqual$1 extends true ? Partial : Subtract$1 extends infer ReqNum extends number ? Negative$1 extends infer OptNum extends number ? [Slice$1, Slice$1] extends [infer ReqElements extends readonly unknown[], infer OptElements extends readonly unknown[]] ? [...ReqElements, ...Partial] : never : never : never; /** * **MakeKeysOptional**`` * * Makes a set of keys on a known container `T`: * * - if `T` is a **dictionary** object then `U` should: * - be a tuple of keys which you want to force * to _optional_. * - all other keys will be kept "as is" * - if `T` is an **array** then `U` should be: * - in a tuple, only the _last_ items are allowed to be optional * - therefore `U` is a number indicating _how many_ values should be optional * * **Related:** `MakeKeysRequired` */ type MakeKeysOptional$1 = T extends Dictionary$1 ? Iterate$5$1> : T extends readonly unknown[] ? ConvertArray$1, As$1$1> : never; //#endregion //#region ../types/src/dictionary/MixObjects.d.ts type Mix$1, readonly (PropertyKey & keyof B)[]>> = K extends [infer Head extends keyof B & PropertyKey, ...infer Rest extends readonly (keyof B & PropertyKey)[]] ? Head extends keyof A ? Mix$1 & Record, B, Rest> : Mix$1, B, Rest> : ExpandDictionary$1; /** * **MixObjects**`` * * Combines two objects by unionizing the values of shared keys * and adding keys in `B` to `A` which didn't exist. */ type MixObjects$1 = Mix$1; //#endregion //#region ../types/src/dictionary/ObjectKeys.d.ts type Shaped$1 = [] extends TKeys ? [...L, ...Partial, ...Partial] : IsTemplateLiteral$1> extends true ? First$1$1 & string extends infer Pattern extends string ? Shaped$1, TOpt, L, O, [...V, ...Pattern[]]> : never : Contains$1> extends true ? Shaped$1, TOpt, L, [...O, First$1$1], V> : Shaped$1, TOpt, [...L, First$1$1], O, V>; type HandleDict$1 = Required extends Record ? IsNever$1 extends true ? TObj extends Dictionary$1 ? [] : PropertyKey[] : IsEqual$1 extends true ? ObjectKey$1[] : IsEqual$1 extends true ? string[] : IsEqual$1 extends true ? symbol[] : IsEqual$1 extends true ? number[] : IsNever$1 extends true ? PropertyKey[] : IsNever$1> extends true ? IsLiteralString$1 extends true ? Shaped$1, readonly PropertyKey[]>, OptionalKeysTuple$1> : IsUnion$1 extends true ? Shaped$1, readonly PropertyKey[]>, OptionalKeysTuple$1> : K[] : [...UnionToTuple$2>, ...(GetIndexKeys$1)[]] : never; /** * **ObjectKeys**`` * * Provides the keys of a given object in a tuple form. * * **Related:** `Keys`, `OptionalKeys`, `RequiredKeys`, `NumericKeys` */ type ObjectKeys$1 = [IsAny$1] extends [true] ? Err$1<`invalid-type/object-keys`, `Call to ObjectKeys where T was 'any'!`> : IsNever$1 extends true ? Err$1<`invalid-type/object-keys`, `Call to ObjectKeys where T was 'never'!`> : TObj extends object ? TObj extends Map ? IsUnion$1 extends true ? IsLiteralUnion$1 extends true ? Required, readonly PropertyKey[]>, OptionalKeysTuple$1>> : IsWideUnion$1 extends true ? UnionToTuple$2[] : "mixed" : K[] : TObj extends Set ? Err$1<`invalid-type/object-keys`, `The type passed into ObjectKeys was a Set. Set's do not have keys`> : TObj extends WeakMap ? IsUnion$1 extends true ? K : K extends Scalar$1 | object | readonly unknown[] ? K[] : unknown : Required extends Record ? IsNever$1 extends true ? TObj extends Dictionary$1 ? [] : PropertyKey[] : IsEqual$1 extends true ? ObjectKey$1[] : IsEqual$1 extends true ? RemoveIndexKeys$1> extends Record ? [...(As$1$1>>, readonly PropertyKey[]>), ...string[]] : PropertyKey[] : IsNever$1 extends true ? PropertyKey[] : TObj extends Dictionary$1 ? HandleDict$1 : K[] : ObjectKey$1[] : Err$1<`invalid-type/object-keys`, `The type passed into ObjectKeys was not an object!`, { value: TObj; }>; //#endregion //#region ../types/src/dictionary/OnlyIndexKeys.d.ts type ExtractIndexKeysFromObj$1 = { [K in keyof T as string extends K ? K : number extends K ? K : symbol extends K ? K : never]: T[K] }; type GetTemplateLiteralIndexes$1 = TKeys extends [infer Head extends ObjectKey$1, ...infer Rest extends readonly ObjectKey$1[]] ? IsTemplateLiteral$1 extends true ? GetTemplateLiteralIndexes$1> : GetTemplateLiteralIndexes$1 : ExpandDictionary$1; /** * **OnlyIndexKeys**<`T`> * * Returns a dictionary with all fixed keys removed and only _index_ * signatures remaining. * * - index can be wide-type indexes such as `{ [x: string]: string }` * - but they can also be _template literal_ indexes like `{ [x: `_${string}`]: string }` * * **Related: `GetIndexKeys` */ type OnlyIndexKeys$1 = ExpandDictionary$1 & GetTemplateLiteralIndexes$1>>; //#endregion //#region ../types/src/dictionary/OptionalKeys.d.ts /** * **OptionalKeys**`` * * Provides a union type of the _keys_ in `T` which are * **optional** properties. * * **Note:** you also may optionally filter further by specifying a value * by the _value_ of the key and then only keys which are required AND * who extend `V` will be included in the union. * * **Related:** `OptionalKeys`, `RequiredProps` * Provides a union type of the _keys_ in `T` which are * **required** properties. * * **Note:** you also may optionally filter further by specifying a value * by the _value_ of the key and then only keys which are required AND * who extend `V` will be included in the union. * * **Related:** `RequiredKeys`, `RequiredProps` */ type OptionalKeys$1 = T extends Dictionary$1 ? { [K in keyof T]-?: EmptyObject$1 extends { [P in K]: T[K] } ? If$1, K, K extends V ? K : never> : never }[keyof T] : never; /** * **OptionalKeysTuple**`` * * Provides a tuple of the _keys_ in `T` which are * **optional** properties. * * **Related:** `RequiredKeys`, `OptionalProps` */ type OptionalKeysTuple$1 = T extends Dictionary$1 ? As$1$1>, "equals", [boolean]>, readonly ObjectKey$1[]> : never; //#endregion //#region ../types/src/dictionary/OptRecord.d.ts /** * **OptRecord**`` * * Create a Record with the optional property set. */ type OptRecord$1 = MakeKeysOptional$1, [T]>; //#endregion //#region ../types/src/dictionary/RemoveIndexKeys.d.ts type Arr$1$1 = { [K in keyof T as number extends K ? never : string extends K ? never : symbol extends K ? never : K]: T[K] }; type FilterDictKeys$1 = { [K in keyof T as string extends K ? never : number extends K ? never : symbol extends K ? never : IsTemplateLiteral$1 extends true ? never : K]: T[K] }; /** * **RemoveIndexKeys**`` * * Removes _index_ keys which permit key/values to be added to an object while * retaining all explicit key/values defined on an object. * * - this includes both _wide_ indexes like `string` but also literal template * indexes like `_${string}` * * ```ts * type Obj = { [key: string]: unknown; foo: 42 }; * // { foo: 42 } * type Obj2 = RemoveIndexKeys; * ``` */ type RemoveIndexKeys$1 = T extends Dictionary$1 ? HasIndexKeys$1 extends true ? Required>> extends infer Keys extends readonly PropertyKey[] ? WithKeys$1 : never : T : T extends readonly any[] ? Arr$1$1 : never; //#endregion //#region ../types/src/dictionary/RequiredKeys.d.ts /** * **RequiredKeys**`` * * Provides a union type of the _keys_ in `T` which are * **required** properties. * * **Note:** you also may optionally filter further by specifying a value * by the _value_ of the key and then only keys which are required AND * who extend `V` will be included in the union. * * **Related:** `OptionalKeys`, `RequiredProps`, `RequiredKeysTuple` */ type RequiredKeys$1 = As$1$1<{ [K in keyof T]-?: EmptyObject$1 extends { [P in K]: T[K] } ? never : IfUnset$1 }[keyof T], ObjectKey$1>; //#endregion //#region ../types/src/dictionary/ReverseLookup.d.ts /** * **ReverseLookup**`` * * Inverts a table of string to string lookups so that the values * can now lookup the keys. * * Uses mapped types for O(1) complexity instead of recursive processing, * significantly improving performance for large mappings while preserving * narrow literal types. */ type ReverseLookup$1> = { [K in keyof T as T[K]]: K }; //#endregion //#region ../types/src/dictionary/SharedKeys.d.ts /** * **SharedKeys**`` * * Given two objects `A` and `B`, this type utility will provide the * _keys_ which both objects contain. * ```ts * type O1 = { foo: 1; bar: 2; baz: 88 }; * type O2 = { bar: 5; baz: 3; nada: true }; * // ["bar", "baz"] * type X = SharedKeys; * ``` * * **Note:** this is now just an alias to `IntersectingKeys` */ type SharedKeys$1 | object, B extends Record | object> = IntersectingKeys$1, As$1$1>; //#endregion //#region ../types/src/dictionary/StringKeys.d.ts type _StringKeys$1 = UnionToTuple$2<{ [K in keyof T]: K extends string ? Readonly : never }[keyof T]>; /** * **SKeys**`` * * Creates a tuple of all _string_ keys of `T`. * * **Related:** `Keys`, `StringKeys` * @deprecated prefer use of `StringKeys` */ /** * **StringKeys**`` * * Creates a tuple of all _string_ keys of `T`. * * **Related:** `Keys` */ type StringKeys$1 = IsVueRef$1 extends true ? ["value"] : _StringKeys$1 extends readonly string[] ? _StringKeys$1 : never; //#endregion //#region ../types/src/dictionary/Values.d.ts type Validate$7$1 = [IsAny$1] extends [true] ? Err$1<`invalid-type/values`, `Values was called where T was the 'any' type`> : [IsNever$1] extends [true] ? Err$1<`invalid-type/values`, `Values was called where T was the 'never' type`> : T; type GetValues$1 = [] extends TKeys ? TAcc : Required extends readonly [infer First, ...infer Rest] ? First extends keyof TObj ? Rest extends readonly PropertyKey[] ? IsTuple$1 extends true ? UnionMemberEquals$1 extends true ? GetValues$1 : GetValues$1 : GetValues$1 : never : never : TAcc; /** * **Values**`` * * Produces a tuple of all the _values_ in an object. * * - you _can_ run it on a tuple too but this is in effect an identity * function and will just return the tuple's values/types "as is" * - passing in `any` or `never` to this utility will result in an Error */ type Values$1 = As$1$1 extends Error ? Validate$7$1 : T extends readonly unknown[] ? T : Keys$1$1 extends readonly unknown[] ? number extends Keys$1$1["length"] ? T extends Record ? V[] : T extends readonly (infer V)[] ? V[] : unknown[] : GetValues$1> extends infer V extends readonly unknown[] ? OptionalKeysTuple$1["length"] extends infer OptNum extends number ? OptNum extends 0 ? GetValues$1> : MakeKeysOptional$1 : GetValues$1> : never : never, readonly unknown[]>; //#endregion //#region ../types/src/dictionary/WithKeys.d.ts type MakeIntoUnion$1 = K extends readonly PropertyKey[] ? TupleToUnion$1 : K; type MakeNumericIndex$1 = T; /** * **WithKeys**`` * * This type utility will ensure that the type `T` will _retain_ the key/value * pairs which extend `K`. * * It is very similar to **Pick** but rather `K` being restricted to * being a string union, wth **WithKeys** you can use the union type * or a readonly array of strings. * * ```ts * type Test = { foo: 1, bar: number, baz: string }; * // { foo: 1, bar: number } * type T1 = WithKeys; // Pick syntax * type T2 = WithKeys; * ``` */ type WithKeys$1 = ExpandRecursively$1 extends keyof T ? T extends Tuple$1$1 ? MakeNumericIndex$1>> : Pick> : never>>; //#endregion //#region ../types/src/dictionary/WithoutKeys.d.ts /** * **WithoutKeys**`` * * Removes the keys in `TKeys` from an object `TObj`. * * **Note:** This is functionally equivalent to the `Omit` built-in but: * * - allows passing in a union type (like Omit) * - or a tuple of ObjectKey's (distinct from Omit). */ type WithoutKeys$1 = TKeys extends readonly ObjectKey$1[] ? Omit : TKeys extends ObjectKey$1 ? ExpandDictionary$1> : never; //#endregion //#region ../types/src/dictionary/WithoutValue.d.ts /** * **WithoutValue** * * Reduces an object's type down to only those key/value pairs where the * value is **NOT** of type `W`. * * ```ts * const foo = { a: 1, b: "hi", c: () => "hello" } * // { a: 1, b: "hi" } * type W = WithValue * ``` * * You manually exclude keys as well by setting the optional `E` generic. */ type WithoutValue$1 = Mutable$1>>>; //#endregion //#region ../types/src/dictionary/WithValue.d.ts type Marked$1$4 = typeof MARKED$2; type Process$36$1 = RemoveMarked$1<{ [K in keyof TObj]: If$1 : Extends$1, TObj[K], Marked$1$4> }>; /** * **WithValue**`` * * Reduces an object's type down to only those key/value pairs where the * value is of type `W`. * ```ts * const foo = { a: 1, b: "hi", c: () => "hello" } * // { c: () => "hello" } * type W = WithValue * ``` * * **Related:** `WithoutValue`, `WithKeys`, `WithoutKeys` */ type WithValue$1 = ExpandRecursively$1>; //#endregion //#region ../types/src/interpolation/IsStaticTemplate.d.ts type Curly$1, O extends string = never> = K extends [infer Head extends string, ...infer Rest extends readonly string[]] ? Curly$1 : O; /** * **IsStaticTemplate**`` * * A boolean operator which indicates whether any of the dynamic segments * defined in `TSegments` was found in `TContent`. */ type IsStaticTemplate$1 = Contains$1>; //#endregion //#region ../types/src/type-conversion/AsBoolean.d.ts /** * **AsBoolean**`` * * Converts any `BooleanLike` value to a boolean value * and return `never` otherwise. */ type AsBoolean$1 = T extends boolean ? T : T extends "true" ? true : T extends "false" ? false : T extends "boolean" ? boolean : never; //#endregion //#region ../types/src/type-conversion/AsFromTo.d.ts /** converts an object's key values into FromTo tuple */ type ConvertFromTo$1 = Values$1<{ [K in keyof TObj]: { from: K; to: TObj[K]; } }>; /** * **AsFromTo**`` * * Converts: * - an object KV is converted into a `FromTo[]` tuple * * **Notes:** * - any value which is already a FromTo will be kept as is * - any value which is _not_ a number will be converted to a `NumberLike` string and added * - any value which is neither a string or any of the above will be discarded */ type AsFromTo$1> = IsLiteralLikeObject$1 extends true ? ConvertFromTo$1 extends readonly FromTo$1[] ? ConvertFromTo$1 : never : FromTo$1[]; //#endregion //#region ../types/src/type-conversion/AsNumber.d.ts /** * **ParseInt**`` * * Converts a known string literal representation of a number * to an actual number. */ type ParseInt$1 = T extends `${infer Int}.${infer Dec}` ? StripChars$1 extends "" ? Int extends `${infer N extends number}` ? N : never : `${Int}.${TrimCharEnd$1}` extends `${infer N extends number}` ? N : never : T extends `${infer N extends number}` ? N : never; type JustZeros$1 = T extends `${infer HEAD extends string}${infer REST extends string}` ? HEAD extends "0" ? JustZeros$1 : false : true; /** * Addresses the possibility of leading zeros for both integer values * and decimal values, positive and negative values */ type Handler$1 = StartsWith$2 extends true ? Contains$1 extends true ? JustZeros$1> extends true ? As$1$1<`0.${RetainAfter$1}`, `${number}`> : As$1$1, `${number}`> : JustZeros$1 extends true ? "0" : StripWhile$1 : StartsWith$2 extends true ? As$1$1<`0${T}`, `${number}`> : T; /** * **AsNumber**`` * * Returns a _number_ for `T` where `T` extends a _number_ or * `${number}` type; otherwise return _never_. Literal types are * preserved. * * ```ts * // 4 * type Num = AsNumber<"4">; * ``` * **Related:** `ToNumber` */ type AsNumber$1 = IsBranded$1 extends true ? AsNumber$1> : T extends number ? T : T extends `${number}` ? StartsWith$2 extends true ? ParseInt$1<`-${Handler$1, `${number}`>>}`> : ParseInt$1> : never; //#endregion //#region ../types/src/type-conversion/AsPropertyKey.d.ts /** * **AsPropertyKey**`` * * Ensures that `T` is a property key or, if a tuple is passed in, that * all values extend `PropertyKey` */ type AsPropertyKey$1 = T extends PropertyKey ? T : never; //#endregion //#region ../types/src/type-conversion/AsRecord.d.ts /** * **AsRecord**`` * * Receives a `Record`, `object`, or `Tuple` and ensures the type * is a `Record` type for all object-like types and just passes * Tuples through "as is". */ type AsRecord$1 = T extends Tuple$1$1 ? T : T extends Dictionary$1 ? T : T extends object ? T extends any[] ? never : NonNullable : never; //#endregion //#region ../types/src/type-conversion/AsString.d.ts type OnlyString$1 = As$1$1, readonly string[]>; /** * **AsString** * * Attempts to convert `T` to a string type where possible. * * - will convert any string, boolean, or numeric value * to a string value * - `42` -> `"42"` * - number -> `${number}` * - true -> `"true"` * - union types who's elements include at least one element of * `string` | `number | `boolean` will be converted to an appropriate * string literal: * - `"foo" | 42 | true` will be converted to `"foo" | "42" | "true"` * - wide `string[]` arrays will be converted to `string` * - a tuple of values will be made into a JS string representing that type: * - `[string, number, "foo"]` -> `"[ string, number 'foo' ]""` * * **Related:** `ToString` */ type AsString$1 = [string] extends [T] ? string : [T] extends [string] ? T : [IsUnion$1] extends [true] ? OnlyString$1>[number] : [T] extends [number] ? `${T}` : [T] extends [boolean] ? `${T}` : [T] extends [readonly (unknown)[]] ? IsWideArray$1 extends true ? T extends (infer Type extends string | number | boolean)[] ? `${Type}` : never : ToJsonArray$1 : [T] extends [object] ? [T] extends [Dictionary$1] ? ToJsonObject$1 : never : never; //#endregion //#region ../types/src/type-conversion/AsStringUnion.d.ts type ConvertUnion$1$1 = TupleToUnion$1<{ [K in keyof T]: [T[K]] extends [string] ? T[K] : [T[K]] extends [number] ? `${T[K]}` : [T[K]] extends [boolean] ? `${T[K]}` : [THandle] extends ["drop"] ? never : T[K] }>; /** * **AsStringUnion**`` * * A type conversion utility which ensures unions (and a few literals) are * converted to string literal variants: * * - if `T` is a union type, all _numeric_ or _boolean_ elements in the union * will be converted to a string literal equivalent and others will be dropped * - if you would prefer non-convertible types are left as part of the union * you can set the `THandle` to "proxy" (instead of the default "drop") * * For non-union types, the goal is to address a similar outcome which is: * * - if `T` is of type `number` or `boolean` then this is converted to a * string literal equivalent * - all other types result in `never` or are just proxied through if * `THandle` is set to "proxy" */ type AsStringUnion$1 = [IsUnion$1] extends [true] ? ConvertUnion$1$1, THandle> : [T] extends [string] ? T : [T] extends [number] ? `${T}` : [T] extends [boolean] ? `${T}` : [THandle] extends ["drop"] ? never : T; //#endregion //#region ../types/src/type-conversion/AsUnion.d.ts /** * **AsUnion**`` * * Converts any tuple into a union based on the tuples elements. Otherwise, * simply passes `T` through unchanged. */ type AsUnion$2 = T extends readonly any[] ? T[number] : T; //#endregion //#region ../types/src/type-conversion/encoding/EncodingLookups.d.ts type SafeEncoding__Quotes$1 = Mutable$1; type SafeEncoding__Whitespace$1 = Mutable$1; type SafeEncoding__Brackets$1 = Mutable$1; type SafeEncodingConversion$1 = [] extends T ? R : SafeEncodingConversion$1, [...R, ...(First$1$1 extends "quotes" ? AsFromTo$1 : First$1$1 extends "brackets" ? AsFromTo$1 : First$1$1 extends "whitespace" ? AsFromTo$1 : [])]>; type SafeDecodingConversion$1 = [] extends T ? R : SafeDecodingConversion$1, [...R, ...(First$1$1 extends "quotes" ? AsFromTo$1> : First$1$1 extends "brackets" ? AsFromTo$1> : First$1$1 extends "whitespace" ? AsFromTo$1> : [])]>; //#endregion //#region ../types/src/type-conversion/encoding/SafeDecode.d.ts /** * **SafeDecode**`` * * Decodes an encoded `SafeString` back to a normal string. * Groups are: * * - "whitespace" * - "quotes" * - and "brackets" * * By default ALL are used. */ type SafeDecode$1 = IsStringLiteral$1$1 extends true ? ReplaceAllFromTo$1> : string; //#endregion //#region ../types/src/type-conversion/encoding/SafeEncode.d.ts /** * **SafeEncode**`` * * Encodes string into a `SafeString` using some or all of the * "safe key" groups. Groups are: * * - "whitespace" * - "quotes" * - and "brackets" * * By default ALL are used. * * **Related:** `SafeEncodeEscaped` */ type SafeEncode$1 = IsStringLiteral$1$1 extends true ? ReplaceAllFromTo$1> : SafeString$1; //#endregion //#region ../types/src/type-conversion/encoding/SafeEncodingGroup.d.ts type SafeEncodingGroup$1 = "whitespace" | "brackets" | "quotes"; //#endregion //#region ../types/src/type-conversion/encoding/SafeString.d.ts /** * **SafeString** * * A string which was encoded using `safeEncode()` runtime utility or `SafeEncode` type * utility. It is a string which has had one of several "groups" of characters replaced * (aka., encoded) into a safe token value. * * - use `safeDecode()` or `SafeDecode` utilities to move back to the original string value. */ type SafeString$1 = Brand$1; encoded: T; }>; //#endregion //#region ../types/src/type-conversion/encoding/StringEncoder.d.ts /** * **StringEncoder** * * A base type for _string encoders_ which take a string and convert * to anther type of string. */ type StringEncoder$1 = (input: T) => R; //#endregion //#region ../types/src/type-conversion/form-fields.d.ts /** * **Email** * * A simple email address representation * * **Related:** `IsEmail`, `isEmail()` */ type Email$1 = `${string}@${string}.${T}`; //#endregion //#region ../types/src/type-conversion/Immutable.d.ts type NeverOnSet$1 = T extends `set${infer Name}` ? Name extends Capitalize ? never : T : T; /** * **Immutable**`` * * An alternative to `Readonly` but adds: * * - removes the types of all _setter_ methods in the values of `T` * - deeply sets container properties as read-only (rather than just top level properties) * * **Related:** `immutable()`, `freeze()`, `var Object.freeze()` */ type Immutable$1 = Expand$1<{ readonly [K in keyof T as T[K] extends AnyFunction$1 ? NeverOnSet$1 : K]: T[K] extends object ? TDeep extends false ? T[K] : Immutable$1 : T[K] }>; //#endregion //#region ../types/src/type-conversion/LeftWhitespace.d.ts /** * Provides the _left_ whitespace of a string * ```ts * // "\n\t " * type T = LeftWhitespace<"\n\t foobar">; * ``` */ type LeftWhitespace$1 = string extends S ? string : Replace$1 extends string ? TrimLeft$1 : never, "">; //#endregion //#region ../types/src/type-conversion/Merge.d.ts /** * **MergeScalars**`` * * Provides a `Scalar` value by evaluating whether `TDefault` * and `TOverride` extends `TEmpty` (which is `null` | `undefined` * by default). * * Note: if both `TDefault` and `TOverride` are _undefined_ then the * exiting type will be _undefined_ (which isn't strictly a `Scalar` * value). */ type MergeScalars$1 = TDefault extends TEmpty ? TOverride : TOverride extends TEmpty ? TDefault : TOverride; type MergeTuplesAcc$1 = TOverride extends [infer Override, ...infer Rest extends unknown[]] ? If$1, MergeTuplesAcc$1, Rest, TKey, [...TResults, First$1$1]>, MergeTuplesAcc$1, Rest, TKey, [...TResults, Override]>> : readonly [...TResults, ...TDefault]; /** * **MergeTuples** * * Merges two tuple arrays by position in the tuple: * * - if `TOverride` is longer than `TDefault` then no defaults will be provided * - if `TDefault` is longer than `TOverride` then `TDefault` will be extended */ type MergeTuples$1 = MergeTuplesAcc$1<[...TDefault], [...TOverride], TKey>; //#endregion //#region ../types/src/type-conversion/MergeObjects.d.ts /** * **MergeObjects**`` * * A type utility that _shallowly merges_ two object types. * * Properties in TOverride will override properties in TDef. * This implementation avoids excessive recursion when dealing with optional properties. */ type MergeObjects$1 = ExpandDictionary$1 & TOverride>; //#endregion //#region ../types/src/type-conversion/Mutable.d.ts type MutableObject$1 = [T] extends [boolean] ? T : { -readonly [K in keyof T]: T[K] extends Dictionary$1 ? Mutable$1> : IsTuple$1 extends true ? Mutable$1 : T[K] extends readonly (infer R)[] ? [...R[]] : Mutable$1 }; type MutableArray$1 = [...{ [K in keyof T]: Mutable$1 }]; /** * **Mutable**`` * * Makes a readonly type -- either a dictionary or an array -- into a mutable value without * widening the type. */ type Mutable$1 = [IsUnion$1] extends [true] ? T : [T] extends [infer Arr extends readonly unknown[]] ? MutableArray$1 : [T] extends [infer Dict extends Dictionary$1] ? MutableObject$1 : T; //#endregion //#region ../types/src/type-conversion/numeric/HexToDecimal.d.ts type H2D$1 = Lowercase extends "f" ? 15 : Lowercase extends "e" ? 14 : Lowercase extends "d" ? 13 : Lowercase extends "c" ? 12 : Lowercase extends "b" ? 11 : Lowercase extends "a" ? 10 : Lowercase extends "9" ? 9 : Lowercase extends "8" ? 8 : Lowercase extends "7" ? 7 : Lowercase extends "6" ? 6 : Lowercase extends "5" ? 5 : Lowercase extends "4" ? 4 : Lowercase extends "3" ? 3 : Lowercase extends "2" ? 2 : Lowercase extends "1" ? 1 : 0; type HexByte$1 = Lowercase extends "0" ? H2D$1 : Lowercase extends "1" ? [16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31][H2D$1] : Lowercase extends "2" ? [32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47][H2D$1] : Lowercase extends "3" ? [48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63][H2D$1] : Lowercase extends "4" ? [64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79][H2D$1] : Lowercase extends "5" ? [80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95][H2D$1] : Lowercase extends "6" ? [96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111][H2D$1] : Lowercase extends "7" ? [112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127][H2D$1] : Lowercase extends "8" ? [128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143][H2D$1] : Lowercase extends "9" ? [144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159][H2D$1] : Lowercase extends "a" ? [160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175][H2D$1] : Lowercase extends "b" ? [176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191][H2D$1] : Lowercase extends "c" ? [192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207][H2D$1] : Lowercase extends "d" ? [208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223][H2D$1] : Lowercase extends "e" ? [224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239][H2D$1] : [240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255][H2D$1]; type HexCharsToDecimal$1 = T extends readonly [infer A extends HexadecimalChar$1, infer B extends HexadecimalChar$1, ...infer Rest extends readonly HexadecimalChar$1[]] ? TDepth["length"] extends 64 ? number[] : HexCharsToDecimal$1], [...TDepth, unknown]> : T extends readonly [infer A extends HexadecimalChar$1] ? [...V, H2D$1] : V; /** * **HexToDecimal**`` * * Iterates left-to-right, peeling off two hexadecimal digits at a time * until there are only 0 or 1 digits left (adds final digit if 1 is left). * What is left is an array of decimal numbers ranging from 0-255. * * ```ts * // [15] * type T1 = HexToDecimal<"f">; * // [255] * type T2 = HexToDecimal<"ff"> * // [255] * type T3 = HexToDecimal<"0xFF"> * // [255, 238, 9] * type T4 = HexToDecimal<"ffee09"> * ``` */ type HexToDecimal$1 = T extends number ? number extends T ? number[] : [T] : T extends `0x${infer Rest}` ? HexToDecimal$1 : T extends "" ? [0] : string extends T ? number[] | Err$1<"invalid-type/hexadecimal"> : IsHexadecimal$1 extends true ? string extends T ? number | Error : Chars$2> extends readonly HexadecimalChar$1[] ? HexCharsToDecimal$1>> : never : Err$1<"invalid-type/hexadecimal">; //#endregion //#region ../types/src/type-conversion/RemoveIndex.d.ts /** * **RemoveIndex**`` * * Removes an index like below while retaining other key/value pairs. * ```ts * interface Foo { * foo: string; * [key: string]: any; * } * // { foo: string } * type T = RemoveIndex; * ``` * * @deprecated use `RemoveIndexKeys` instead * */ type RemoveIndex$1> = { [P in keyof T as string extends P ? never : number extends P ? never : symbol extends P ? never : P]: T[P] }; //#endregion //#region ../types/src/type-conversion/Replace.d.ts type Process$35$1 = TText extends "" ? If$1, TReplace, ""> : TFind extends "" ? TText : TText extends `${infer F}${TFind}${infer E}` ? `${F}${TReplace}${E}` : TText; /** * **Replace**`` * * Type utility which takes a string `TText` and finds the _first instance_ of * `TFind` and replaces it with `TReplace`. * * ```ts * type Fooy = "fooy"; * // "Foo" * type Foo = Replace; * ``` * * Alternatively you can pass in `TFind` as an array of `FromTo` objects to describe * multiple transformations at once. * * ```ts * type Fooy = "fooy"; * // "Pooey" * type Pooey = Replace; * ``` * * **Related:** `ReplaceAll`, `ReplaceToFrom`, `ReplaceAllToFrom` */ type Replace$1 = IsStringLiteral$1$1 extends true ? As$1$1, string> : string; //#endregion //#region ../types/src/type-conversion/ReplaceAll.d.ts type ReplaceAllLiterals$1$1 = TText extends `${infer Head}${TFind}${infer Tail}` ? `${Head}${TReplace}${ReplaceAllLiterals$1$1}` : TText; type Iterate$4$1 = [] extends TFind ? TText : Iterate$4$1, TReplace>, AfterFirst$1, TReplace>; type Singular$1 = IsStringLiteral$1$1 extends true ? IsStringLiteral$1$1 extends true ? IsUnion$1 extends true ? UnionToTuple$2 extends readonly string[] ? Iterate$4$1, TReplace> : never : ReplaceAllLiterals$1$1 : string : string; type EachTupleElement$1 = { [K in keyof TText]: ReplaceAll$1 }; /** * **ReplaceAll**`` * * Type utility which takes a string `TText` and finds _all_ instances of * `TFind` and replaces it with `TReplace`. * * ```ts * const fooy = "fooy, Joey"; * // "foo, Joe" * type Foo = ReplaceAll; * ``` * * **Related:** `Replace` * * - **Note:** this utility has been upgraded to take either a _string_ or a * _tuple_ of strings for `TText`. */ type ReplaceAll$1 = TText extends readonly string[] ? IsLiteralLike$1 extends true ? EachTupleElement$1 : string[] : TText extends string ? Singular$1 : never; //#endregion //#region ../types/src/type-conversion/ReplaceAllFromTo.d.ts type ReplaceAllFromToLiteral$2 = Mappings extends readonly [infer First extends { from: string; to: string; }, ...infer Rest extends { from: string; to: string; }[]] ? ReplaceAllFromToLiteral$2, Rest> : S; type ReplaceAllLiterals$3 = TText extends `${infer Head}${TFind}${infer Tail}` ? `${Head}${TReplace}${ReplaceAllLiterals$3}` : TText; type ApplyMapping$2 = ReplaceAllLiterals$3; /** * **ReplaceAllFromTo**`` * * Replaces the _all instances_ of the `from` element of `TFromTo` found in * `TText` with the corresponding `to` value in `TFromTo`. * * ```ts * // "Foo-bar-baz" * type Dashing = Replace<"Foo Bar Baz", [ * { from: " "; to: "-" }, * { from: "B"; to: "b" } * ]>; * ``` * **Related:** `Replace`, `ReplaceAll` * * **Notes:** * - does allow TText to be passed in as a _symbol_ but when it is * it is ignored and passed through * - it also allows numeric values to be passed through and in those cases * the numbers are converted to a `NumberLike` type */ type ReplaceAllFromTo$1 = TText extends string ? ReplaceAllFromToLiteral$2 : TText extends number ? ReplaceAllFromTo$1<`${TText}`, TMappings> : TText; //#endregion //#region ../types/src/type-conversion/RetainChars.d.ts type Retention$1 = TChar extends `${infer Head}${infer Rest}` ? Head extends TRemove ? Retention$1 : Retention$1 : TRetain; /** * **RetainChars**`` * * Converts a string `TContent` into a string with all * of the characters in `TRetain` _retained_ while all * other characters are removed. */ type RetainChars$1 = string extends TContent ? string : string extends TRetain ? string : Retention$1; //#endregion //#region ../types/src/type-conversion/RightWhitespace.d.ts /** * Provides the _left_ whitespace of a string * ```ts * // "\n\t " * type T = LeftWhitespace<"\n\t foobar">; * ``` */ type RightWhitespace$1 = string extends S ? string : Replace$1, "">; //#endregion //#region ../types/src/type-conversion/StringLength.d.ts /** * Type utility that provides the _length_ of a given string type in a way which * is _not_ limited to TS's recursive string length of roughly 48. * * ```ts * // 3 * type Three = StringLength<"foo">; * ``` */ type StringLength$1 = S extends `${infer _First}${infer _Second}${infer _Third}${infer _Fourth}${infer _Fifth}${infer _Sixth}${infer _Seventh}${infer _Eighth}${infer _Ninth}${infer _Tenth}${infer Rest}` ? StringLength$1 : S extends `${infer _First}${infer _Second}${infer _Third}${infer _Fourth}${infer _Fifth}${infer _Sixth}${infer _Seventh}${infer _Eighth}${infer _Ninth}${infer Rest}` ? StringLength$1 : S extends `${infer _First}${infer _Second}${infer _Third}${infer _Fourth}${infer _Fifth}${infer _Sixth}${infer _Seventh}${infer _Eighth}${infer Rest}` ? StringLength$1 : S extends `${infer _First}${infer _Second}${infer _Third}${infer _Fourth}${infer _Fifth}${infer _Sixth}${infer _Seventh}${infer Rest}` ? StringLength$1 : S extends `${infer _First}${infer _Second}${infer _Third}${infer _Fourth}${infer _Fifth}${infer _Sixth}${infer Rest}` ? StringLength$1 : S extends `${infer _First}${infer _Second}${infer _Third}${infer _Fourth}${infer _Fifth}}${infer Rest}` ? StringLength$1 : S extends `${infer _First}${infer _Second}${infer _Third}${infer _Fourth}${infer Rest}` ? StringLength$1 : S extends `${infer _First}${infer _Second}${infer _Third}${infer Rest}` ? StringLength$1 : S extends `${infer _First}${infer _Second}${infer Rest}` ? StringLength$1 : S extends `${infer _First}${infer Rest}` ? StringLength$1 : [...R]["length"]; //#endregion //#region ../types/src/type-conversion/StripChars.d.ts type Removal$1 = TContent extends `${infer Head}${infer Remaining}` ? Removal$1 : TCollect; /** * **StripChars**`` * * Converts a string `TContent` into a string with all * of the characters in `TStrip` removed. * * - `TStrip` must be a single character or a union * of single characters */ type StripChars$1 = string extends TContent ? string : string extends TStrip ? string : Removal$1; //#endregion //#region ../types/src/type-conversion/ToJson.d.ts type Enc$1$1> = TOpt["encode"] extends true ? SafeEncode$1 : T; type InnerArray$1$1> = As$1$1<{ [K in keyof T]: T[K] extends string ? `${O["quote"]}${T[K]}${O["quote"]}` : Or$1<[Extends$1, Extends$1, Extends$1, Extends$1]> extends true ? `${As$1$1}` : T[K] extends readonly any[] ? ToJsonArray$1 : T[K] extends Dictionary$1 ? `{ ${InnerObject$2$1, O>} }` : never }, readonly string[]>; /** * **ToJsonArray**`` * * Converts an array to a JSON string of the same type. * * **Related:** `ToJson`, `ToJsonObject`, `ToJsonScalar` */ type ToJsonArray$1 = InnerArray$1$1> extends readonly string[] ? Join$1>, ", "> extends infer Inner extends string ? `[ ${Inner} ]` : never : never; type InnerObject$2$1 = { quote: "\""; encode: false; }, R extends readonly string[] = []> = [] extends K ? Join$1 : InnerObject$2$1, O, [...R, Or$1<[Extends$1], number>, Extends$1], boolean>, Equals$1], null>, Equals$1], undefined>]> extends true ? `${O["quote"]}${First$1$1}${O["quote"]}: ${As$1$1], boolean | number | null | undefined>}` : T[First$1$1] extends string ? `${O["quote"]}${First$1$1}${O["quote"]}: ${O["quote"]}${T[First$1$1]}${O["quote"]}` : T[First$1$1] extends readonly unknown[] ? `${O["quote"]}${First$1$1}${O["quote"]}: ${ToJsonArray$1], O>}` : T[First$1$1] extends Dictionary$1 ? `${O["quote"]}${First$1$1}${O["quote"]}: ${ToJsonObject$1]>}` : never]>; /** * **ToJsonObject**`` * * Converts an object type `T` to a JSON string of the same type. * * **Related:** `ToJson`, `ToJsonArray`, `ToJsonScalar` */ type ToJsonObject$1 = { quote: "\""; encode: false; }> = `{ ${InnerObject$2$1, O>} }`; /** * **ToJsonScalar**`` * * Converts a scalar value to the JSON string representation. * * **Related:** `ToJson`, `ToJsonArray`, `ToJsonObject` */ type ToJsonScalar$1, O extends Required = { quote: "\""; encode: false; }> = T extends string ? `${O["quote"]}${Enc$1$1}${O["quote"]}` : `${As$1$1}`; interface ToJsonOptions$1 { quote?: QuoteCharacter$1; encode?: boolean; } /** * Merges user options with defaults to create `Required` */ type O$2$1 = As$1$1>, Required>; /** * Converts an object, array or scalar value to a * strongly typed JSON string. * * **Related:** * - `ToJsonObject`, `ToJsonArray`, `ToJsonScalar` * - `ToStringLiteral` */ type ToJson$1 | Dictionary$1 | Tuple$1$1, Opt extends ToJsonOptions$1 = { quote: "\""; encode: false; }> = T extends Exclude ? ToJsonScalar$1, Required>> : T extends Dictionary$1 ? ToJsonObject$1, Required>> : T extends Tuple$1$1 ? ToJsonArray$1, Required>> : never; //#endregion //#region ../types/src/type-conversion/ToNumber.d.ts /** * **ToNumber**`` * * - Converts `T` into a numeric type: * - if `T` is a Scalar/Object it's converted to a number where possible * - if `T` is an array then each element will be converted to a number where possible * - any non-numeric content which can not be converted to a number will be convert to `never` * - a number or a numeric array will be proxied through "as is" */ type ToNumber$1 = IsTuple$1 extends true ? TValue extends readonly unknown[] ? ToNumericArray$1 extends readonly (number | never)[] ? ToNumericArray$1 : Err$1<"can-not-convert", `Attempt to convert a tuple into a numeric tuple failed!`, { library: "inferred-types/constants"; value: TValue; }> : never : TValue extends number ? TValue : TValue extends `${infer Num extends number}` ? Num : If$1, IsEqual$1]>, 1, If$1, IsEqual$1]>, 0, If$1, readonly (number | never)[], never>>>; //#endregion //#region ../types/src/type-conversion/ToString.d.ts type _ArrayToString$1 = { quote: "'"; encode: false; }, TOut extends string = "[ "> = [] extends T ? `${TOut} ]` : _ArrayToString$1, O, ToString$1> extends string ? TOut extends "[ " ? `[ ${ToString$1>}` : `${TOut}, ${ToString$1>}` : never>; type ArrayToString$1 = { quote: "'"; encode: false; }> = IsWideContainer$1 extends true ? T extends (infer Kind)[] ? `${ToString$1}[]` : `unknown[]` : _ArrayToString$1; type InnerObject$1$1 = { quote: "'"; encode: false; }, R extends readonly string[] = []> = [] extends K ? Join$1 : InnerObject$1$1, O, [...R, Or$1<[Extends$1], number>, Extends$1], boolean>, Equals$1], null>, Equals$1], undefined>]> extends true ? `${First$1$1}: ${As$1$1], boolean | number | null | undefined>}` : T[First$1$1] extends string ? `${First$1$1}: ${O["quote"]}${T[First$1$1]}${O["quote"]}` : T[First$1$1] extends readonly unknown[] ? `${First$1$1}: ${ArrayToString$1], O>}` : T[First$1$1] extends Dictionary$1 ? `${First$1$1}: ${ObjectToString$1]>}` : never]>; type ObjectToString$1 = { quote: "'"; encode: false; }> = IsLiteralLikeObject$1 extends true ? `{ ${InnerObject$1$1, O>} }` : T extends Record ? `Record}>` : "object"; type MapToString$1> = T extends Map ? `Map<${ToString$1}, ${ToString$1}>` : `Map`; type SetToString$1> = T extends Set ? `Set<${ToString$1}>` : `Set`; type WeakMapToString$1> = T extends WeakMap ? `WeakMap<${ToString$1}, ${ToString$1}}` : `WeakMap`; /** * **ToString** * * Converts _any_ type into a string representation of that type. * * **Related:** `AsString`, `ToJson` */ type ToString$1 = { quote: "'"; encode: false; }> = [T] extends [readonly unknown[]] ? ArrayToString$1 : [T] extends [string] ? [IsStringLiteral$1$1] extends [true] ? `${O["quote"]}${T}${O["quote"]}` : "string" : [T] extends [number] ? [IsNumericLiteral$1] extends [true] ? `${T}` : "number" : [T] extends [boolean] ? [IsBooleanLiteral$1] extends [true] ? `${T}` : "boolean" : [T] extends [null] ? `null` : [T] extends [undefined] ? `undefined` : [T] extends [Set] ? SetToString$1 : [T] extends [Map] ? MapToString$1 : [T] extends [WeakMap] ? WeakMapToString$1 : [T] extends [Dictionary$1] ? ObjectToString$1 : [IsUnion$1] extends [true] ? "Union<...>" : "unknown"; //#endregion //#region ../types/src/type-conversion/ToStringArray.d.ts /** * **ToStringArray**`` * * Receives a tuple of values and converts each item * into a _string_ value using the `ToString` utility. */ type ToStringArray$1 = As$1$1<{ [K in keyof T]: AsString$1 }, readonly string[]>; //#endregion //#region ../types/src/type-conversion/ToStringLiteral.d.ts interface ToLiteralOptions$1 { quote?: QuoteCharacter$1; encode?: boolean; /** * by default all scalar values are taken to be _what they are_ * but if this flag is set to `true` then string literals will * be evaluated as being an `InputToken`. */ tokensAllowed?: boolean; /** * for containers which support the concept of "optional" keys */ isOptional?: boolean; } type Enc$2 = TOpt["encode"] extends true ? SafeEncode$1 : T; /** * Converts the elements in an array to tokens. */ type InnerArray$2 = As$1$1<{ [K in keyof T]: T[K] extends string ? `${O["quote"]}${T[K]}${O["quote"]}` : Or$1<[Extends$1, Extends$1, Extends$1, Extends$1]> extends true ? `${As$1$1}` : T[K] extends readonly any[] ? ToStringLiteral__Array$1 : T[K] extends Dictionary$1 ? ToStringLiteral__Object$1 : never }, readonly string[]>; type Wrap$1 = `(${T})[]`; type AsUnionArrayString$1 = [] extends T ? Wrap$1, string>> : AsUnionArrayString$1, ToStringLiteral$1> extends infer Type extends string ? [...O, Type] : O>; type Splitter$2 = T extends [infer Head, ...infer Rest extends readonly unknown[]] ? IsGreaterThan$1 extends true ? Splitter$2, [...R, Head], O> : Splitter$2, R, [...O, Head]> : [R, T extends [infer Last] ? [...O, Last] : O]; type ArrayWithOptionalElements$1> = Required extends infer Tuple extends readonly unknown[] ? Splitter$2 extends [infer Req extends readonly unknown[], infer Opt extends readonly unknown[]] ? InnerArray$2 extends infer Req extends readonly string[] ? InnerArray$2 extends infer Opt extends readonly string[] ? Join$1<[...Req, ...Each$1], ", "> extends infer Inner extends string ? `[ ${Inner} ]` : never : never : never : never : never; /** * **ToStringLiteral__Array**`` * * Converts an array to a string literal representing that array. * * ```ts * // "[ 1, 2, 3 ]"" * type Test = ToStringLiteral__Array<[1,2,3]>; * ``` * * **Related:** * - `ToStringLiteral`, `ToStringLiteral__Object` * - `ToJson`, `ToJsonObject`, `ToJsonScalar` */ type ToStringLiteral__Array$1 = [TupleMeta$1["hasOptionalElements"]] extends [true] ? ArrayWithOptionalElements$1 : [TupleMeta$1["isWide"]] extends [true] ? [T] extends [readonly (infer Type)[]] ? [IsUnion$1] extends [true] ? [UnionToTuple$2] extends [readonly unknown[]] ? AsUnionArrayString$1> : never : [Type] extends [Scalar$1] ? `${ToStringLiteral__Scalar$1}[]` : [Type] extends [Dictionary$1] ? ToStringLiteral__Object$1 extends infer Obj extends string ? `${Obj}[]` : never : never : never : [T["length"]] extends [0] ? `[]` : InnerArray$2 extends (infer Arr extends readonly string[]) ? Join$1 extends infer Inner extends string ? `[ ${Inner} ]` : never : never; /** * Object keys typically do not need be surrounded by quotations * marks at least if they are of the `PascalCase` or `camelCase` * variety but if they contain spaces, dashes, or really any character * other than alphanumeric characters then they must be quoted. */ type IsObjectKeyRequiringQuotes$1> = [] extends TChars ? false : First$1$1 extends AlphanumericChar$1 ? IsObjectKeyRequiringQuotes$1> : true; type KeyName$1 = As$1$1; type Quote$1$1 = As$1$1}${O["quote"]}` : `"${Enc$2}"`, string>; /** * Builds out the key/value pairs in the an object */ type InnerObject$3 & ObjectKey$1)[] = As$1$1>, readonly (keyof Required & ObjectKey$1)[]>, TOptKeys extends string | symbol = OptionalKeys$1, TReq extends Dictionary$1 = Required, TResult extends readonly string[] = []> = TKeys extends [infer K extends ObjectKey$1 & keyof TDict, ...infer Rest extends readonly ObjectKey$1[]] ? TReq[K] extends infer Value ? Value extends Error ? Value : [IsUnion$1] extends [true] ? InnerObject$3, TOpt> extends infer Union extends string ? [...TResult, `${KeyName$1}: ${Union}`] : never> : Value extends Scalar$1 ? InnerObject$3}: ${ToStringLiteral__Scalar$1}`]> : Value extends readonly unknown[] ? InnerObject$3}: ${ToStringLiteral__Array$1}`]> : Value extends Dictionary$1 ? ToStringLiteral__Object$1 extends infer ObjResult ? ObjResult extends Error ? ObjResult : ObjResult extends string ? InnerObject$3}: ${ObjResult}`]> : never : never : never : never : TKeys extends [infer Last extends keyof Required & ObjectKey$1] ? [...TResult, ToStringLiteral$1] : TResult; /** * **ToStringLiteral__Object**`` * * Converts an object type `T` to a JSON string of the same type. * * **Related:** `ToJson`, `ToJsonArray`, `ToJsonScalar` */ type ToStringLiteral__Object$1 = InnerObject$3 extends infer Inner ? Inner extends Error ? Inner : Inner extends readonly string[] ? `{ ${Join$1} }` : never : never; /** * **ToJsonScalar**`` * * Converts a scalar value to the JSON string representation. * * **Related:** `ToJson`, `ToJsonArray`, `ToJsonObject` */ type ToStringLiteral__Scalar$1 = [IsAny$1] extends [true] ? `any` : [IsNever$1] extends [true] ? `never` : [T] extends [string] ? [string] extends [T] ? `string` : `${Quote$1$1}` : [T] extends [number] ? [number] extends [T] ? `number` : `${T}` : [T] extends [bigint] ? [bigint] extends [T] ? `bigint` : `${T}` : [IsNull$1] extends [true] ? `null` : [IsUndefined$1] extends [true] ? `undefined` : [IsUnknown$1] extends [true] ? `unknown` : [IsTrue$1] extends [true] ? `true` : [IsFalse$1] extends [true] ? `false` : [IsBoolean$1] extends [true] ? `boolean` : [T] extends [void] ? `void` : [T] extends [symbol] ? `symbol` : never; type ToStringLiteral__Union$1 = Join$1<{ [K in keyof T]: ToStringLiteral$1 }, " | ">; interface O$1$1 { quote: T["quote"] extends QuoteCharacter$1 ? T["quote"] : "\""; encode: T["encode"] extends boolean ? T["encode"] : false; } /** * Converts any Typescript type into a string literal * _representation_ of that type. * * **Related:** * - `ToStringLiteral__Scalar`, `ToStringLiteral__Object` * - `ToJsonObject`, `ToJsonArray`, `ToJsonScalar` */ type ToStringLiteral$1 = [IsAny$1] extends [true] ? "any" : [IsNever$1] extends [true] ? "never" : [T] extends [Error] ? T : [IsUnion$1] extends [true] ? ToStringLiteral__Union$1, Opt> : [T] extends [Scalar$1] ? ToStringLiteral__Scalar$1 : [T] extends [readonly unknown[]] ? ToStringLiteral__Array$1> : [T] extends [Dictionary$1] ? ToStringLiteral__Object$1> : never; //#endregion //#region ../types/src/type-conversion/TrimEach.d.ts /** * **TrimEach**`` * * Trims each element of a Tuple/Array which extends _string_. * * - Non-string values are left as-is * * **Related:** `TrimDictionary` */ type TrimEach$1 = { [K in keyof T]: T[K] extends string ? Trim$1 : T[K] }; //#endregion //#region ../types/src/type-conversion/TupleToIntersection.d.ts type Break$2$1 = E extends "error" ? Err$1<"invalid-intersection", TMsg, TCtx> : never; type Set$1$1 = IsUnset$1 extends true ? W : V & W; type Intersect$1$1 = T extends [infer Head, ...infer Rest] ? Head extends TypedFunction$1 ? IsNever$1>> extends true ? Break$2$1<`A function with a key-value dictionary caused the intersection type to become 'never'`, { intersection: V; conflict: Head; }, E> : Intersect$1$1>> : IsNever$1> extends true ? Break$2$1<`TupleToIntersection hit an element which caused the intersection type to become 'never'`, { intersection: V; conflict: Head; }, E> : Intersect$1$1> : F extends undefined ? ExpandRecursively$1 : F extends TypedFunction$1 ? F & ExpandRecursively$1 : never; /** * **TupleToIntersection**`` * * Recursively intersects all the elements of a tuple. * * - Empty tuples will return `unknown` as type * - if you want an Error instead of the `never` type you can set `E` to * "error" and the conflicting element which _caused_ the intersection to * become `never` will be highlighted. */ type TupleToIntersection$1 = [] extends T ? unknown : Intersect$1$1; //#endregion //#region ../types/src/type-conversion/TupleToUnion.d.ts /** * Converts a Tuple type into a _union_ of the tuple elements * * ```ts * const arr = [1, 3, 5] as const; * // 1 | 3 | 5 * type U = TupleToUnion; * ``` * * **Note:** an empty array will be converted to a `string` type. */ type TupleToUnion$1 = [T] extends [readonly unknown[]] ? [Keys$1$1["length"]] extends [0] ? never : T[number] : never; //#endregion //#region ../types/src/type-conversion/UnionArrayToTuple.d.ts type UnionToIntersection$2$1 = (U extends unknown ? (arg: U) => 0 : never) extends ((arg: infer I) => 0) ? I : never; type LastInUnion$1$1 = UnionToIntersection$2$1 0 : never> extends ((x: infer L) => 0) ? L : never; type UnionToTuple$1$1> = [U] extends [never] ? [] : [...UnionToTuple$1$1>, Last]; /** * **UnionArrayToTuple**`` * * If you have a type which is an _array_ of a Union type but you want to * represent this as a Tuple, this utility will make this conversion for you. * * **Related:** `UnionToTuple` */ type UnionArrayToTuple$1 = T extends any[] ? UnionToTuple$1$1> : never; //#endregion //#region ../types/src/type-conversion/UnionToIntersection.d.ts /** * **UnionToIntersection**`` * * Type utility which converts a union type to an intersection */ type UnionToIntersection$1$1 = (U extends U ? (x: U) => unknown : never) extends ((x: infer R) => unknown) ? R : never; //#endregion //#region ../types/src/type-conversion/UnionToTuple.d.ts /** * UnionToIntersection<{ foo: string } | { bar: string }> = * { foo: string } & { bar: string }. */ type UnionToIntersection$3 = (U extends unknown ? (arg: U) => 0 : never) extends ((arg: infer I) => 0) ? I : never; /** * LastInUnion<1 | 2> = 2. */ type LastInUnion$2 = UnionToIntersection$3 0 : never> extends ((x: infer L) => 0) ? L : never; /** * ExcludeExact - Excludes from T only members that are EXACTLY equal to U * (not just extending U). This prevents tuples like [1,2,3] from being excluded * when excluding number[], since [1,2,3] extends number[] but is not equal to it. */ type ExcludeExact$1 = T extends U ? U extends T ? never : T : T; /** * **UnionToTuple**`<1 | 2> => [1, 2]` * * Converts union members into a tuple. * * **Related**: `UnionArrayToTuple`, `UnionToTuple__PreserveBoolean` */ type UnionToTuple$2> = [U] extends [never] ? [] : [...UnionToTuple$2>, Last]; //#endregion //#region ../types/src/type-conversion/Widen.d.ts /** * **WidenScalar**`` * * Widens any _scalar_ type `T`. */ type WidenScalar$1 = T extends string ? string : T extends number ? number : T extends boolean ? boolean : T extends bigint ? bigint : T extends symbol ? symbol : T extends null ? null : T extends undefined ? undefined : never; type Process$34$1 = T extends Scalar$1 ? WidenScalar$1 : T extends AnyFunction$1 ? T extends TypedFunction$1 ? WidenFunc$1 : AnyFunction$1 : T extends readonly unknown[] ? WidenTuple$1 : T extends Dictionary$1 ? WidenDictionary$1> : T; type WidenDictionary$1, readonly ObjectKey$1[]>, TResults extends Dictionary$1 = EmptyObject$1> = K extends [infer Head extends ObjectKey$1, ...infer Rest extends ObjectKey$1[]] ? WidenDictionary$1>> : ExpandRecursively$1; type WidenTuple$1 = { [K in keyof T]: IsLiteralLike$1 extends true ? WidenLiteral$1 : Process$34$1 }; /** * **WidenUnion** * * Widens all the elements in the union type. */ type WidenUnion$1 = WidenTuple$1>[number]; type WidenLiteral$1 = T extends Scalar$1 ? WidenScalar$1 : IsUnion$1 extends true ? WidenUnion$1 : T extends readonly unknown[] ? WidenTuple$1 : T extends Dictionary$1 ? WidenDictionary$1> : never; /** * Widens each element of a _fixed-length_ tuple, accumulating into `R`. * * The recursion peels elements with a **readonly** head/rest pattern so it * matches both mutable and `readonly` tuples (a mutable-only pattern would * fail to match a `readonly` tuple and collapse the result to `[]`). */ type WidenArrayInner$1 = T extends readonly [infer Head, ...infer Rest] ? WidenArrayInner$1]> : R; /** * Widens the elements of an array/tuple `T` by one level while preserving its * structure. _Wide_ (variadic-length) arrays pass through untouched; a * fixed-length tuple has each element widened and its `readonly` modifier * re-applied so that, e.g., `readonly [string, 1 | 2 | 3]` widens to * `readonly [string, number]` (not the narrower mutable form). */ type WidenArray$1 = number extends T["length"] ? T : [IsReadonlyArray$1] extends [true] ? readonly [...WidenArrayInner$1] : WidenArrayInner$1; /** * Recovers a function's return type **without** the `any`-collapse that the * built-in `ReturnType` suffers for a _union_-constrained generic whose type * parameter is woven into a template literal (e.g. * `` (name: T) => `hi ${T}` ``). Re-inferring `R` * through a fresh call signature keeps the concrete (often _union_) return. */ type RecoverFnReturn$1 = T extends { (...args: infer _A): infer R; } ? R : never; /** * Widens a _recovered_ function return value. * * For string (or string-union) returns we collapse to the widest template * literal that still preserves the shared prefix — e.g. * `"hi Bob" | "hi Nancy"` becomes `` `hi ${string}` ``. Non-string returns * defer to the ordinary `Widen`. */ type WidenFnReturnValue$1 = [R] extends [string] ? LongestCommonPrefix$1> extends infer TPrefix extends string ? [TPrefix] extends [""] ? string : `${TPrefix}${string}` : string : Widen$1; /** * **WidenFunc**`` * * Widens a function `T` while preserving its _narrowing_ vs _static_ character: * * - a **narrowing** function keeps its generic input constraint and widens * only its return value; a single-parameter narrowing function is rebuilt * in the ergonomic `` (x: X) => R `` form. * - a **static** function widens through `FnFrom`. * * Unlike the (now deprecated) `WidenFunction`, `WidenFunc` receives the whole * function and can therefore _recover_ template-literal returns that * `ReturnType` would otherwise collapse to `any`. * * The widened pieces are computed **once** in the `_Params`/`_Return`/`_Props` * helper parameters; hoisting `FnMeta["params"]` into an eager type * parameter is also what keeps the rebuilt parameter tuple at the correct * _arity_ (passing it lazily lets TypeScript collapse `[P]` to `P[]`). */ type WidenFunc$1["params"] : []), _Return = (T extends TypedFunction$1 ? WidenFnReturnValue$1> : never), _Props extends Dictionary$1 = (T extends TypedFunction$1 ? ExpandDictionary$1> : EmptyObject$1)> = Function extends T ? Function : T extends TypedFunction$1 ? [IsNarrowingFn$1] extends [true] ? _Params extends readonly [infer P0] ? [IsNonEmptyContainer$1<_Props>] extends [true] ? ((x: X) => _Return) & _Props : (x: X) => _Return : FnFrom$1<_Params, _Return, _Props> : FnFrom$1<_Params, _Return, _Props> : never; type WidenContainer$1 = [T] extends [readonly unknown[]] ? TForce extends true ? readonly unknown[] : WidenArray$1 : [T] extends [Dictionary$1] ? TForce extends true ? Dictionary$1 : WidenDictionary$1 : [T] extends [Map] ? TForce extends true ? AnyMap$1 : Map> : [T] extends [WeakMap] ? TForce extends true ? AnyWeakMap$1 : WeakMap> : [T] extends [Set] ? TForce extends true ? AnySet$1 : Set> : T; /** * **Widen**`` * * Converts a literal type to a _wider_ type. * * - for _scalar values_ `T` will just become wide variant (e.g., `5` → `number`) * - for _union types_ all elements of the union will be made wide * - for _container values_ it will widen the items inside the container * * **Note:** should you want the container values to be fully widened you * can set `TForce` to true. */ type Widen$1 = [IsUnion$1] extends [true] ? WidenUnion$1 : [T] extends [TypedFunction$1] ? FnFrom$1> extends true ? Parameters : WidenArray$1>, Widen$1>, WidenDictionary$1>> : [T] extends [Scalar$1] ? WidenScalar$1 : [T] extends [Container$1] ? WidenContainer$1 : T extends Scalar$1 ? WidenScalar$1 : Process$34$1; //#endregion //#region ../types/src/interpolation/IsTemplateLiteral.d.ts type CountTemplates$1 = string extends T ? 1 : T extends `${infer First}${infer Rest}` ? Or$1<[string extends First ? true : false, `${number}` extends First ? true : false]> extends true ? CountTemplates$1 : CountTemplates$1 : C["length"]; /** * **isTemplateLiteral**`` * * A boolean operator which evaluates if `T` has dynamic types * like `${string}`, `${number}`, or `${boolean}` included in * it. * * - Note a wide `string` and a `${string}` type will result in `false` as they * are both equivalent to a wide string in the type system. */ type IsTemplateLiteral$1 = IsUnion$1 extends true ? Every$1, "containsSome", ["true", "false"]> : T extends string ? string extends T ? false : T extends "" ? false : [CountTemplates$1<`|${T}|`>] extends [0] ? false : true : false; //#endregion //#region ../types/src/interpolation/ReplaceInterpolation.d.ts /** * determine replacement type */ type R$1$1 = T extends string ? T : T extends readonly (string | number | boolean)[] ? T["length"] extends 0 ? D : First$1$1 : never; type Next$1$1 = T extends string ? T : T extends readonly (string | number | boolean)[] ? AfterFirst$1 : never; /** * **ReplaceStringInterpolation**`` * * Replaces all instances of `${string}` in `TContent` with `TReplace` */ type ReplaceStringInterpolation$1 = TContent extends `${infer First}${infer Rest}` ? [IsEqual$1] extends [true] ? ReplaceStringInterpolation$1, `${TResult}${R$1$1}`> : ReplaceStringInterpolation$1 : [TContent] extends [""] ? TResult : [IsEqual$1] extends [true] ? `${TResult}${R$1$1}` : `${TResult}${TContent}`; /** * **ReplaceNumericInterpolation**`` * * Replaces all instances of `${number}` in `TContent` with `TReplace` * * - when `TReplace` is single string then all instances are replaced with * this value * - when `TReplace` is an array of strings then strings are pulled off in a FIFO * manner to replace * * **Related:** `ReplaceStringInterpolation` */ type ReplaceNumericInterpolation$1 = TContent extends `${infer First}${infer Rest}` ? [IsEqual$1] extends [true] ? ReplaceNumericInterpolation$1, `${TResult}${R$1$1}`> : ReplaceNumericInterpolation$1 : [TContent] extends [""] ? TResult : [IsEqual$1] extends [true] ? `${TResult}${R$1$1}` : `${TResult}${TContent}`; //#endregion //#region ../types/src/interpolation/StartsWithTemplateLiteral.d.ts type UnionStartsBoolean$1 = And$1<{ [K in keyof T]: T[K] extends string ? StartsWith$2 : never }>; /** * **HasLeadingTemplateLiteral**`` * * tests whether `T` _starts with_ a leading template literal * such as `${string}`, `${number}`, or `${boolean}` */ type StartsWithTemplateLiteral$1 = T extends string ? [IsUnion$1] extends [true] ? [UnionToTuple$2] extends [readonly string[]] ? UnionStartsBoolean$1> : never : T extends `${infer First}${infer _Rest}` ? IsEqual$1<`${string}`, First> extends true ? true : IsEqual$1<`${number}`, First> extends true ? true : false : false : false; //#endregion //#region ../types/src/interpolation/StaticTemplateSections.d.ts type Finalize$1$1 = TWithType extends true ? { [K in keyof TResults]: StringLiteralTemplate$1 } : TResults; type Section$1$1 = TWithType extends null ? THead : `${THead}${TBlock}`; type Scan$1 = TTemplate extends `{{string}}${infer Rest}` ? Scan$1]> : TTemplate extends `{{number}}${infer Rest}` ? Scan$1]> : TTemplate extends `{{boolean}}${infer Rest}` ? Scan$1]> : TTemplate extends `{{true}}${infer Rest}` ? Scan$1]> : TTemplate extends `{{false}}${infer Rest}` ? Scan$1]> : TTemplate extends `${infer Head}${infer Rest}` ? Scan$1 : TResults; /** * **StaticTemplateSections**`` * * Segments the various static sections defined in the `TTemplate`. * * - if you optionally set the `TWithType` generic to `true` then the * string literal templates will be added * - if you set `TWithType` generic to `false` then the template blocks * like `{{string}}`, etc. will be added. */ type StaticTemplateSections$1 = Finalize$1$1 extends infer Template extends string ? As$1$1, readonly string[]> : [], TWithType>; //#endregion //#region ../types/src/interpolation/StringLiteralTemplate.d.ts type _StringLiteralTemplate$1 = T extends number ? `${number}` : T extends boolean ? `${boolean}` : T extends `${infer Before}{{string}}${infer After}` ? StringLiteralTemplate$1<`${Before}${string}${After}`> : T extends `${infer Before}{{number}}${infer After}` ? StringLiteralTemplate$1<`${Before}${number}${After}`> : T extends `${infer Before}{{boolean}}${infer After}` ? StringLiteralTemplate$1<`${Before}${boolean}${After}`> : T extends `${infer Before}{{true}}${infer After}` ? StringLiteralTemplate$1<`${Before}${true}${After}`> : T extends `${infer Before}{{false}}${infer After}` ? StringLiteralTemplate$1<`${Before}${false}${After}`> : T; /** * **StringLiteralTemplate**`` * * Converts a string literal into a "template" by replacing tokens * like `{{string}}`, `{{number}}`, or `{{boolean}}` with the * corresponding string literal equivalent. * * **Related:** `EachAsStringLiteralTemplate`, `ObjectValuesAsStringLiteralTemplate` */ type StringLiteralTemplate$1 = IsStringLiteral$1$1 extends true ? _StringLiteralTemplate$1 : never; //#endregion //#region ../types/src/interpolation/StripSurroundingStringTemplate.d.ts /** * **StripLeadingStringTemplate**`` * * Strips any existing `${string}` type when it starts the type T. * * ```ts * // `FooBar${string}` * type Foobar = StripLeadingStringTemplate<`${string}Foobar${string}`> * ``` */ type StripLeadingStringTemplate$1 = T extends `${infer First}${infer Rest}` ? IsEqual$1 extends true ? StripLeadingStringTemplate$1 : T : never; /** * **StripTrailingStringTemplate**`` * * Strips any existing `${string}` type when ity terminates the type T. * * ```ts * // `${string}FooBar` * type Foobar = StripTailingStringTemplate<`${string}Foobar${string}`> * ``` */ type StripTrailingStringTemplate$1 = IsStringLiteral$1$1 extends true ? Join$1> : never; /** * **StripSurroundingStringTemplate**`` * * Strips any existing `${string}` type when it _leads_ or _terminates_ the type T. * * ```ts * // `FooBar` * type Foobar = StripTailingStringTemplate<`${string}Foobar${string}`> * ``` */ type StripSurroundingStringTemplate$1 = IsStringLiteral$1$1 extends true ? StripTrailingStringTemplate$1> : never; //#endregion //#region ../types/src/interpolation/template-maps.d.ts interface TemplateMap__Basic$1 { string: "string"; number: "number"; boolean: "boolean"; } type AddGeneric$1 = { [K in keyof G | T["name"]]: K extends T["name"] ? T["token"] : K extends keyof G ? G[K] : never }; /** * **TemplateMap__Generics**`` * * Provides a static template based on the generic types provided. It also * always includes the basics for `string`, `number`, and `boolean`. */ type TemplateMap__Generics$1 = T extends [infer Head extends GenericParam$1, ...infer Rest extends readonly GenericParam$1[]] ? TemplateMap__Generics$1> : G; //#endregion //#region ../types/src/boolean-logic/operators/datetime/IsBefore.d.ts type IsSameDateDifferentPrecision$2 = A extends `${infer DatePart}T00:00:00Z` ? B extends DatePart ? true : false : B extends `${infer DatePart}T00:00:00Z` ? A extends DatePart ? true : false : false; type IsCharGreater$2 = A extends "0" ? false : A extends "1" ? B extends "0" ? true : false : A extends "2" ? B extends "0" | "1" ? true : false : A extends "3" ? B extends "0" | "1" | "2" ? true : false : A extends "4" ? B extends "0" | "1" | "2" | "3" ? true : false : A extends "5" ? B extends "0" | "1" | "2" | "3" | "4" ? true : false : A extends "6" ? B extends "0" | "1" | "2" | "3" | "4" | "5" ? true : false : A extends "7" ? B extends "0" | "1" | "2" | "3" | "4" | "5" | "6" ? true : false : A extends "8" ? B extends "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" ? true : false : A extends "9" ? B extends "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" ? true : false : A extends ":" ? B extends "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" ? true : false : A extends "T" ? B extends "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" | "-" | ":" ? true : false : A extends "Z" ? B extends "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" | "-" | ":" | "T" ? true : false : A extends "-" ? B extends "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" ? true : false : false; type LexicographicCompare$2 = A extends B ? false : IsSameDateDifferentPrecision$2 extends true ? false : [A] extends [never] ? false : [B] extends [never] ? false : [A, B] extends [string, string] ? A extends `${infer AFirst}${infer ARest}` ? B extends `${infer BFirst}${infer BRest}` ? AFirst extends BFirst ? LexicographicCompare$2 : IsCharGreater$2 : true : false : false; /** * **IsBefore**`` * * Tests whether `A` is _before_ (in time) `B`. */ type IsBefore$1 = A extends object ? boolean : B extends object ? boolean : string extends A ? boolean : string extends B ? boolean : IsTemplateLiteral$1 extends true ? boolean : IsTemplateLiteral$1 extends true ? boolean : number extends A ? boolean : number extends B ? boolean : A extends number ? B extends number ? IsLessThan$1 : boolean : A extends string ? B extends string ? LexicographicCompare$2 : boolean : boolean; //#endregion //#region ../types/src/boolean-logic/operators/datetime/IsDayJs.d.ts interface Shape$5 { add: AnyFunction$1; clone: AnyFunction$1; date: AnyFunction$1; endOf: AnyFunction$1; isAfter: AnyFunction$1; isBefore: AnyFunction$1; daysInMonth: AnyFunction$1; millisecond: AnyFunction$1; calendar: unknown; } /** * **IsDayJs**`` * * Boolean utility to test whether `T` is DayJS date object. */ type IsDayJs$1 = [IsAny$1] extends [true] ? false : [IsNever$1] extends [true] ? false : [IsUnknown$1] extends [true] ? boolean : [IsUnion$1] extends [true] ? true extends (T extends Shape$5 ? true : false) ? T extends Shape$5 ? true : boolean : false : IsDictionary$1 extends true ? T extends Shape$5 ? true : false : false; //#endregion //#region ../types/src/datetime/AsDateMeta.d.ts type ParsedDateType$1 = T extends [infer Year, infer Month, infer Date, infer Time] ? Date extends null ? Month extends null ? "year" : "year-month" : Year extends null ? "year-independent" : Time extends null ? "date" : "datetime" : never; type HasTime$1 = ParsedDateType$1 extends "datetime" ? T[3] extends [infer Hour, infer Minute, infer Second, infer MS, infer TZ] ? Hour extends "00" ? Minute extends "00" ? Or$1<[Extends$1, IsNull$1]> extends true ? Or$1<[Extends$1, IsNull$1]> extends true ? Or$1<[Extends$1, IsNull$1]> extends true ? false : true : true : true : true : true : never : false; type Hour$1$1 = T extends null ? null : T extends ParsedTime$1 ? T[0] : never; type Minute$1$1 = T extends null ? null : T extends ParsedTime$1 ? T[1] : never; type Second$1$1 = T extends null ? null : T extends ParsedTime$1 ? T[2] : never; type Millisecond$1 = T extends null | undefined ? null : T extends ParsedTime$1 ? T[3] : never; type Offset$1 = T extends null ? null : T extends ParsedTime$1 ? T[4] : never; type SetParsed$1 = { dateType: ParsedDateType$1; hasTime: HasTime$1; year: T[0]; month: T[1]; date: T[2]; hour: Hour$1$1; minute: Minute$1$1; second: Second$1$1; ms: Millisecond$1; timezone: Offset$1; }; /** * **AsDateMeta**`` * * Tests to see if `T` can be parsed into a `DateMeta` type. * * - a valid ISO string _or_ a `ParsedData` array should be * able to be parsed. * - if it can then `DateMeta` is returned * - if not then an `Error` will be returned * * Note: if the value passed in as `T` is a `ParsedDate` type * then this utility will never return an error as the validation * has already been done. */ type AsDateMeta$1 = T extends ParsedDate$1 ? SetParsed$1 : ParseDate$1 extends infer P ? P extends Error ? P : P extends ParsedDate$1 ? SetParsed$1

: never : never; //#endregion //#region ../types/src/datetime/AsFourDigitYear.d.ts type Digit$5$1 = "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9"; type IsDigits$1 = T extends "" ? false : T extends `${Digit$5$1}${infer Rest}` ? Rest extends "" ? true : IsDigits$1 : false; type IsFourDigits$1 = T extends `${Digit$5$1}${Digit$5$1}${Digit$5$1}${Digit$5$1}` ? true : false; type BrandYear$1 = IsTrue$1 extends true ? FourDigitYear$1> : T; type ConvertNumericString$1 = T extends `-${string}` ? Err$1<`year-invalid/negative`, `The generic passed into AsFourDigitYear was a NEGATIVE number. This is not allowed!`, { T: T; }> : T extends `${string}.${string}` ? TNumberInput extends true ? Err$1<`year-invalid/float`, `The generic passed into AsFourDigitYear was a number but not an integer!`, { T: T; }> : Err$1<"year-invalid/type"> : IsDigits$1 extends true ? PadStart$1 extends infer Padded extends string ? IsFourDigits$1 extends true ? BrandYear$1 : TNumberInput extends true ? Err$1<`year-invalid/too-large`, `The generic passed into AsFourDigitYear was an integer number but it was larger than 9999 so it will not fit into the ISO FourDigitYear format!`, { T: T; }> : Err$1<"year-invalid/type"> : Err$1<"year-invalid/type"> : Err$1<"year-invalid/type">; type Convert$6$1 = T extends string ? IsBranded$1 extends true ? Convert$6$1, B> : ConvertNumericString$1 : T extends number ? number extends T ? IsTrue$1 extends true ? FourDigitYear$1<"branded"> | Error : FourDigitYear$1 | Error : ConvertNumericString$1<`${T}`, B, true> : Err$1<`year-invalid/wrong-type`, `The type passed in as T to AsFourDigitYear was an invalid type! T must be a number or a string literal that can be converted into a number`, { T: T; }>; /** * **AsFourDigitYear**`` * * A type conversion utility which tries to convert `T` into a valid `FourDigitYear` type. * * - by default the conversion is done but the type returned is _not_ a branded type * - to switch this behavior then pass in `true` to the generic `B` * * If there is no way to convert `T` to a `FourDigitYear` then an Error will be returned. */ type AsFourDigitYear$1 = [IsAny$1] extends [true] ? IsTrue$1 extends true ? FourDigitYear$1<"branded"> | Error : FourDigitYear$1 | Error : As$1$1, IsTrue$1 extends true ? FourDigitYear$1<"branded"> | Error : FourDigitYear$1 | Error>; //#endregion //#region ../types/src/errors/Err.d.ts /** * **TypedError** * * An `Error` which is guaranteed to have a `type` property * and may optionally have a `subType` property. */ type TypedError$1 = Expand$1; type _Err$1$1 = EmptyObject$1> = TType extends `${infer Type}/${infer Subtype}` ? Expand$1<{ name: PascalCase$1 extends string ? RetainUntil$1 : never>; type: KebabCase$1; subType: Subtype extends string ? KebabCase$1 : undefined; message: TMsg extends "" ? string : TMsg; cause?: unknown; stack?: string; } & TCtx> & Error : Expand$1<{ name: PascalCase$1>; message: TMsg extends "" ? string : TMsg; type: TType; cause?: unknown; stack?: string; } & TCtx> & Error; /** * handles when the "type" is a wide string */ type WideErrType$1$1 = EmptyObject$1> = string extends TMsg ? IsEqual$1 extends true ? Error : _Err$1$1 : _Err$1$1; /** * **Err**`` * * Create a strongly typed error with type and subType information. * * - TType assigns the type to the errors `type` property until a `/` character is found * - the `subType` property is the string literal portion of `TType` after the `/` character * - any key/value pairs on `TCtx` will be available on the error too * * **Related:** * - `err(type, msg, ctx)` mirrors same functionality for runtime * - `ErrContext` allows _adding_ context to an existing Error * - `WhenErr` allows conditionally adding context to an Error * when/if `T` extends Error. Otherwise proxies `T` through "as is" */ type Err$1 = EmptyObject$1> = string extends TType ? WideErrType$1$1 : _Err$1$1; /** * Adds "context" to an existing `Error`. */ type ErrContext$1 = Expand$1 & C> extends Error ? Expand$1 & C> & Error : never; //#endregion //#region ../types/src/errors/ErrMsg.d.ts type ErrMsg$1 = TContext extends string ? TType & { desc: TContext; kind: "ErrMsg"; } : TType & ExpandDictionary$1; //#endregion //#region ../types/src/errors/ErrType.d.ts /** * **ErrType**`` * * Return the `type` property of `T` if: * * - T is an Error * - T has the property `type` * * **Related:** `Err`, `ErrSubType` */ type ErrType$1 = T extends Error ? "type" extends keyof T ? T["type"] extends infer Type ? Type : undefined : undefined : undefined; //#endregion //#region ../types/src/errors/HasErrors.d.ts type CheckArray$1$1 = T extends [infer Head, ...infer Rest] ? U extends string ? Head extends Err$1 ? true : CheckArray$1$1 : Head extends Error ? true : CheckArray$1$1 : false; type CheckDictionary$1$1 = CheckArray$1$1, U>; /** * **HasErrors**`` * * Checks whether a container `T` has _values_ which extend Error. */ type HasErrors$1 = T extends readonly unknown[] ? CheckArray$1$1 : T extends Dictionary$1 ? CheckDictionary$1$1 : never; //#endregion //#region ../types/src/errors/IsolateErrors.d.ts /** * The results produced by the `IsolateErrors` utility */ interface IsolatedResults$1 { successes: readonly unknown[]; errors: readonly Error[]; otherErrors: readonly Error[]; } type CheckArray$2 = T extends readonly [infer Head, ...infer Rest] ? Head extends Error ? U extends string ? CheckArray$2 ? { successes: R["successes"]; errors: [...R["errors"], Head]; otherErrors: R["otherErrors"]; } : { successes: R["successes"]; errors: R["errors"]; otherErrors: [...R["otherErrors"], Head]; }, IsolatedResults$1>> : CheckArray$2> : CheckArray$2> : R; type CheckDictionary$2 = CheckArray$2, U>; /** * **IsolateErrors**`` * * Isolates error's from successful outcomes in the _values_ of `T`. * * - When `U` is unset then you will be returned a dictionary with `successes` and `errors` properties. * - When `U` **is** set then it represents a type/subtype of the error. The result this utility * returns is `successes`, `errors`, and `otherErrors` (for errors which were found but not errors * of the specified type) */ type IsolateErrors$1 = T extends readonly unknown[] ? CheckArray$2 : T extends Dictionary$1 ? CheckDictionary$2 : never; //#endregion //#region ../types/src/string-literals/AsTypeSubtype.d.ts type AsTypeSubtype$1 = IsWideString$1 extends true ? [string, string | undefined] : T extends `${infer Type}/${infer Subtype}` ? [Type, Subtype] : [T, undefined]; //#endregion //#region ../types/src/string-literals/casing/CamelCase.d.ts /** * Direct camelCase conversion that leverages optimized PascalCase */ type CamelCaseSimple$1 = IsAllCaps$1 extends true ? Uncapitalize>>> : Uncapitalize>>; /** * **CamelCase**`` * * Converts a string to `CamelCase` format. */ type CamelCase$1 = string extends T ? string : T extends string ? CamelCaseSimple$1 : T extends readonly unknown[] ? { [K in keyof T]: T[K] extends string ? CamelCase$1 : T[K] } : never; //#endregion //#region ../types/src/string-literals/casing/DashUppercase.d.ts type _DU$1 = T extends Lowercase ? T : `-${Lowercase}`; /** * Converts uppercase characters to a dash and then the lowercase equivalent * * ```ts * // "one-two-three" * type T = DashUppercase<"oneTwoThree">; * ``` * * _Intended to be used as a lower level utility; prefer `Dasherize` for more full-fledged * dash solution_. */ type DashUppercase$1 = HasUppercase$1 extends false ? T : T extends `${infer C0}${infer C1}${infer R}` ? `${_DU$1}${_DU$1}${DashUppercase$1}` : T extends `${infer C0}${infer R}` ? `${_DU$1}${DashUppercase$1}` : ""; //#endregion //#region ../types/src/string-literals/casing/KebabCase.d.ts type Process$33$1 = TPreserve extends true ? Concat$1<[LeftWhitespace$1, KebabCase$1, RightWhitespace$1]> : string extends TString ? string : DashUppercase$1>> extends `${infer Begin}${"_" | " "}${infer Rest}` ? KebabCase$1<`${Lowercase}-${Rest}`> : Replace$1>>>>, "--", "-">; /** * **KebabCase**`` * * Converts a string literal into a `kebab-case` format while optionally * allowing surrounding whitespace. * * ```ts * // "foo-bar" * type Dash = Dasherize<"foo_bar">; * type Dash = Dasherize<"fooBar">; * type Dash = Dasherize<"FooBar">; * // "\n foo-bar \t" * type Dash = Dasherize<"\n foo bar \t">; * ``` */ type KebabCase$1 = TInput extends string ? Process$33$1 extends string ? Process$33$1 : never : TInput extends readonly unknown[] ? As$1$1<{ [K in keyof TInput]: TInput[K] extends string ? KebabCase$1 : TInput[K] }, readonly unknown[]> : never; //#endregion //#region ../types/src/string-literals/casing/LowerAllCaps.d.ts /** * **LowerAllCaps**` * * Type utility which will convert an "all caps" string to a string where all characters are lowercase; in * all other cases it will do nothing and simply return `T` as `T`. * * **Related:** `RaiseAllLowercase` */ type LowerAllCaps$1 = IsAllCaps$1 extends true ? Lowercase : T; //#endregion //#region ../types/src/string-literals/casing/PascalCase.d.ts /** * Limited depth PascalCase - processes up to 20 segments to avoid deep recursion */ type LimitedPascalCase$1 = Depth["length"] extends 20 ? T : T extends `${infer Before}-${infer After}` ? `${Capitalize}${LimitedPascalCase$1}` : T extends `${infer Before}_${infer After}` ? `${Capitalize}${LimitedPascalCase$1}` : T extends `${infer Before} ${infer After}` ? `${Capitalize}${LimitedPascalCase$1}` : Capitalize; /** * Recursive PascalCase for strings with delimiters * Processes one character at a time to handle mixed delimiters correctly */ type RecursivePascalCase$1 = T extends `${string}${"-" | "_" | " "}${string}` ? LimitedPascalCase$1 : T extends `${infer First}${infer Rest}` ? First extends "-" | "_" | " " ? RecursivePascalCase$1 : CapNext extends true ? `${Uppercase}${RecursivePascalCase$1}` : `${Lowercase}${RecursivePascalCase$1}` : ""; /** * Handles camelCase strings by detecting uppercase letters as word boundaries */ type HandleCamelCase$1 = T extends `${infer First}${infer Rest}` ? Uppercase extends First ? Lowercase extends First ? HandleCamelCase$1 : Result extends "" ? HandleCamelCase$1 : HandleCamelCase$1 : Rest extends `${infer Next}${string}` ? Uppercase extends Next ? Lowercase extends Next ? HandleCamelCase$1}`> : HandleCamelCase$1}-`> : HandleCamelCase$1}`> : `${Result}${Lowercase}` : Result; /** * Simplified PascalCase conversion that uses recursive approach for delimited strings */ type PascalCaseSimple$1 = T extends `${string}-${string}` | `${string}_${string}` | `${string} ${string}` ? RecursivePascalCase$1 : T extends `${infer _First}${infer Rest}` ? Rest extends `${string}${Uppercase}${string}` ? RecursivePascalCase$1> : Capitalize : Capitalize; /** * Converts a string literal type to a **PascalCase** representation. * ```ts * // "FooBar" * type T = PascalCase<"fooBar">; * type T = PascalCase<"foo-bar">; * type T = PascalCase<"foo_bar">; * type T = PascalCase<"\n foo_bar \t">; * ``` */ type PascalCase$1 = string extends T ? string : T extends string ? IsAllCaps$1 extends true ? PascalCaseSimple$1>> : PascalCaseSimple$1> : T extends readonly unknown[] ? { [K in keyof T]: T[K] extends string ? PascalCase$1 : T[K] } : never; //#endregion //#region ../types/src/string-literals/casing/SnakeCase.d.ts /** * Direct snake_case conversion in a single pass * Handles camelCase, PascalCase, kebab-case, spaces, and existing snake_case */ type SnakeCaseCore$1 = T extends `${infer First}${infer Rest}` ? First extends "-" | " " ? SnakeCaseCore$1 : First extends "_" ? SnakeCaseCore$1 : Uppercase extends First ? Lowercase extends First ? SnakeCaseCore$1 : PrevWasLower extends true ? SnakeCaseCore$1}`, false> : SnakeCaseCore$1}`, false> : SnakeCaseCore$1}`, true> : Result; /** * Limited depth snake_case to avoid deep recursion on very long strings */ type LimitedSnakeCase$1 = Depth["length"] extends 25 ? T : T extends `${infer Before}-${infer After}` ? `${Lowercase}_${LimitedSnakeCase$1}` : T extends `${infer Before} ${infer After}` ? `${Lowercase}_${LimitedSnakeCase$1}` : Lowercase; /** * Optimized SnakeCase that tries fast paths first */ type SnakeCaseSimple$1 = T extends `${string}${"-" | " "}${string}` ? LimitedSnakeCase$1 : IsAllCaps$1 extends true ? Lowercase : SnakeCaseCore$1; /** * **SnakeCase**`` * * Converts a string literal type to _snake_case_. * ```ts * // "foo_bar" * type T = SnakeCase<"fooBar">; * type T = SnakeCase<"foo bar">; * type T = SnakeCase<"foo-bar">; * ``` */ type SnakeCase$1 = string extends T ? string : T extends string ? SnakeCaseSimple$1> : T extends readonly unknown[] ? { [K in keyof T]: T[K] extends string ? SnakeCase$1 : T[K] } : never; //#endregion //#region ../types/src/string-literals/character-sets/AlphaChar.d.ts /** * **AlphaChar** * * Alphabetical character (both upper and lowercase). * * **Related:** `UpperAlphaChar`, `LowerAlphaChar`, `Alpha` */ type AlphaChar$1 = UpperAlphaChar$1 | LowerAlphaChar$1; //#endregion //#region ../types/src/string-literals/character-sets/AlphanumericChar.d.ts /** * **AlphanumericChar** * * A character which is either a letter (upper or lower) or a number. */ type AlphanumericChar$1 = AlphaChar$1 | NumericChar$1; //#endregion //#region ../types/src/string-literals/character-sets/brackets/Brackets.d.ts /** * Opening and closing brackets. Where brackets are parenthesis, square brackets, and curly brackets. * * **Related:** `OpeningBracket`, `ClosingBracket` */ type Bracket$1 = "(" | "[" | "{" | "<" | ")" | "]" | "}" | ">"; //#endregion //#region ../types/src/string-literals/character-sets/Char.d.ts /** * **Char** * * Meant to represent a single character. Includes: * * - Alphanumeric characters * - Punctuation ( . , ; ! ? ) * - Whitespace ( " " "\t" "\n" "\b" ) * - Bracket characters ( { [ ( ) ] } ) * - Quote characters ( " ' ` ) * - Currency characters ( $ ¢ £ € ฿ ¥ ₹ ₽ ) * - Math characters ( + - * / ^ ✕ ÷ = ≄ > < ) * - Special Chars ( @ ~ # & | \ # ) */ type Char$1$1 = AlphanumericChar$1 | Punctuation$2 | Whitespace$1 | Bracket$1 | SpecialChar$1 | QuoteCharacter$1 | PlusMinus$1 | NBSP$1 | CurrencyChar$1 | MatchChar$1 | EscapeCodeChars$1; //#endregion //#region ../types/src/string-literals/character-sets/Country.d.ts type Iso3166_1_Lookup$1 = typeof ISO3166_1$2; type Props$1 = "alpha2" | "alpha3" | "countryCode" | "name"; /** * **Iso3166_1_Alpha2** * * A union of all 2 character country codes defined by the ISO3166-1 * standard. */ type Iso3166_1_Alpha2$1 = { [K in keyof Iso3166_1_Lookup$1]: "alpha2" extends keyof Iso3166_1_Lookup$1[K] ? Iso3166_1_Lookup$1[K]["alpha2"] : never }[number]; /** * **Iso3166_1_Alpha3** * * A union of all 2 character country codes defined by the ISO3166-1 * standard. */ type Iso3166_1_Alpha3$1 = { [K in keyof Iso3166_1_Lookup$1]: "alpha3" extends keyof Iso3166_1_Lookup$1[K] ? Iso3166_1_Lookup$1[K]["alpha3"] : never }[number]; /** * **Iso3166_1_Alpha3** * * A union of all 2 character country codes defined by the ISO3166-1 * standard. */ type Iso3166_1_CountryCode$1 = { [K in keyof Iso3166_1_Lookup$1]: "countryCode" extends keyof Iso3166_1_Lookup$1[K] ? Iso3166_1_Lookup$1[K]["countryCode"] : never }[number]; /** * **Iso3166_1_Alpha3** * * A union of all 2 character country codes defined by the ISO3166-1 * standard. */ type Iso3166_1_CountryName$1 = { [K in keyof Iso3166_1_Lookup$1]: "name" extends keyof Iso3166_1_Lookup$1[K] ? Iso3166_1_Lookup$1[K]["name"] : never }[number]; type LookupAlpha2$1 = [] extends Lookup ? undefined : T extends First$1$1["alpha2"] ? First$1$1[`${Prop}`] : LookupAlpha2$1, Prop>; type LookupAlpha3$1 = [] extends Lookup ? undefined : T extends First$1$1["alpha3"] ? First$1$1[`${Prop}`] : LookupAlpha3$1, Prop>; type LookupCountryCode$1 = [] extends Lookup ? undefined : T extends First$1$1["countryCode"] ? First$1$1[`${Prop}`] : LookupCountryCode$1, Prop>; type LookupCountryName$1 = [] extends Lookup ? undefined : T extends First$1$1["name"] ? First$1$1[`${Prop}`] : LookupCountryName$1, Prop>; /** * **Iso3166Country**`` * * Provides the ISO3166-1 **country name** if provided a valid lookup value ( * aka, a alpha-2, alpha-3, or country code). If not valid returns _undefined_. */ type Iso3166CountryLookup$1 = T extends number ? Iso3166CountryLookup$1<`${T}`> : T extends string ? IsStringLiteral$1$1 extends true ? T extends Iso3166_1_Alpha2$1 ? LookupAlpha2$1 : T extends Iso3166_1_Alpha3$1 ? LookupAlpha3$1 : T extends Iso3166_1_CountryCode$1 ? LookupCountryCode$1 : T extends Iso3166_1_CountryName$1 ? LookupCountryName$1 : IsStringLiteral$1$1 extends true ? undefined : If$1, Iso3166_1_CountryCode$1 | undefined, undefined> : undefined : undefined; /** * **Iso3166Alpha2Lookup**`` * * Provides the ISO3166-1 **Alpha 2** code if provided a valid lookup value ( * aka, a alpha-3, country code, or country name). If not valid returns _undefined_. */ type Iso3166Alpha2Lookup$1 = T extends number ? Iso3166CountryLookup$1<`${T}`> : T extends string ? IsStringLiteral$1$1 extends true ? T extends Iso3166_1_Alpha2$1 ? LookupAlpha2$1 : T extends Iso3166_1_Alpha3$1 ? LookupAlpha3$1 : T extends Iso3166_1_CountryCode$1 ? LookupCountryCode$1 : T extends Iso3166_1_CountryName$1 ? LookupCountryName$1 : IsStringLiteral$1$1 extends true ? undefined : If$1, Iso3166_1_Alpha2$1 | undefined, undefined> : undefined : undefined; /** * **Iso3166Alpha33Lookup**`` * * Provides the ISO3166-1 **Alpha 3** code if provided a valid lookup value ( * aka, a alpha-3, country code, or country name). If not valid returns _undefined_. */ type Iso3166Alpha3Lookup$1 = T extends number ? Iso3166CountryLookup$1<`${T}`> : T extends string ? IsStringLiteral$1$1 extends true ? T extends Iso3166_1_Alpha2$1 ? LookupAlpha2$1 : T extends Iso3166_1_Alpha3$1 ? LookupAlpha3$1 : T extends Iso3166_1_CountryCode$1 ? LookupCountryCode$1 : T extends Iso3166_1_CountryName$1 ? LookupCountryName$1 : IsStringLiteral$1$1 extends true ? undefined : If$1, Iso3166_1_Alpha3$1 | undefined, undefined> : undefined : undefined; /** * **Iso3166Alpha33Lookup**`` * * Provides the ISO3166-1 **Alpha 3** code if provided a valid lookup value ( * aka, a alpha-3, country code, or country name). If not valid returns _undefined_. */ type Iso3166CodeLookup$1 = T extends number ? Iso3166CountryLookup$1<`${T}`> : T extends string ? IsStringLiteral$1$1 extends true ? T extends Iso3166_1_Alpha2$1 ? LookupAlpha2$1 : T extends Iso3166_1_Alpha3$1 ? LookupAlpha3$1 : T extends Iso3166_1_CountryCode$1 ? LookupCountryCode$1 : T extends Iso3166_1_CountryName$1 ? LookupCountryName$1 : IsStringLiteral$1$1 extends true ? undefined : If$1, Iso3166_1_CountryCode$1 | undefined, undefined> : undefined : undefined; //#endregion //#region ../types/src/string-literals/character-sets/css/absolute.d.ts interface CssAbsolutionPositioningProperties$1 { /** [Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/top) */ "top"?: CssSizing$1; /** [Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/bottom) */ "bottom"?: CssSizing$1; /** [Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/left) */ "left"?: CssSizing$1; /** [Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/right) */ "right"?: CssSizing$1; /** * The inset CSS property is a shorthand that corresponds to the top, right, bottom, * and/or left properties. It has the same multi-value syntax of the margin shorthand. * * This inset properties, including inset, have no effect on non-positioned elements. * * - [Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/inset) */ "inset"?: CssSizing$1 | `${CssSizing$1} ${string}`; /** * The `inset-block` CSS property defines the logical block start and end offsets of an * element, which maps to physical offsets depending on the element's writing mode, * directionality, and text orientation. It corresponds to the top and bottom, or * right and left properties depending on the values defined for writing-mode, direction, * and text-orientation. * * This inset property has no effect on non-positioned elements. * * - [Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/inset-block) */ "inset-block"?: CssSizing$1 | `${CssSizing$1} ${string}`; /** [Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/inset-block-end) */ "inset-block-end"?: CssSizing$1; /** [Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/inset-block-start) */ "inset-block-start"?: CssSizing$1; /** * The `inset-inline` CSS property defines the logical start and end offsets of an element * in the inline direction, which maps to physical offsets depending on the element's * * writing mode, directionality, and text orientation. It corresponds to the top and * bottom, or right and left properties depending on the values defined for writing-mode, * direction, and text-orientation. * * This inset property has no effect on non-positioned elements. * * - [Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/inset-inline) */ "inset-inline"?: CssSizing$1 | `${CssSizing$1} ${string}`; /** [Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/inset-inline-end) */ "inset-inline-end"?: CssSizing$1; /** [Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/inset-inline-start) */ "inset-inline-start"?: CssSizing$1; } //#endregion //#region ../types/src/string-literals/character-sets/css/align.d.ts type Positions$1$1 = "normal" | "start" | "center" | "end" | "flex-start" | "flex-end" | "baseline" | "first baseline" | "space-between" | "space-around" | "space-evenly" | "stretch" | "safe center" | "unsafe center" | CssGlobal$1; type CssAlignContent$1 = Positions$1$1; type CssAlignItems$1 = Positions$1$1 | "anchor-center"; type CssAlignSelf$1 = Positions$1$1 | "anchor-center"; interface CssAlignProperties$1 { /** [Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/align-content) */ "align-content"?: CssAlignContent$1; /** [Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/align-items) */ "align-items"?: CssAlignItems$1; /** [Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/align-self) */ "align-self"?: CssAlignSelf$1; /** [Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/vertical-align) */ "vertical-align"?: "baseline" | "top" | "middle" | "bottom" | "sub" | "text-top"; } //#endregion //#region ../types/src/string-literals/character-sets/css/animation.d.ts type CssAnimationDelay$1 = CssTiming$1; type Direction$1$1 = "normal" | "reverse" | "alternate" | "alternate-reverse"; type CssAnimationDirection$1 = Direction$1$1 | `${Direction$1$1}${Opt$1$1<`, ${Direction$1$1}`>}` | `${Direction$1$1}${Opt$1$1<`, ${Direction$1$1}`>}${Opt$1$1<`, ${Direction$1$1}`>}${string}`; type FillMode$1 = "none" | "forwards" | "backwards" | "both"; type CssAnimationFillMode$1 = FillMode$1 | `${FillMode$1}${Opt$1$1<`, ${FillMode$1}`>}` | `${FillMode$1}${Opt$1$1<`, ${FillMode$1}`>}${Opt$1$1<`, ${FillMode$1}`>}${string}`; type Composition$1 = "replace" | "add" | "accumulate"; type CssAnimationComposition$1 = Composition$1 | `${Composition$1}${Opt$1$1<`, ${Composition$1}`>}` | `${Composition$1}${Opt$1$1<`, ${Composition$1}`>}${Opt$1$1<`, ${Composition$1}`>}${string}`; type TimingFunction$1 = "ease" | "ease-in" | "ease-out" | "ease-in-out" | "linear" | "step-start" | "step-end" | `cubic-bezier(${string})` | `linear(${string})` | `steps(${string})`; type CssAnimationTimingFunction$1 = TimingFunction$1 | `${TimingFunction$1}${Opt$1$1<`, ${TimingFunction$1}`>}${string}`; type PlayState$1 = "paused" | "running"; type CssAnimationPlayState$1 = PlayState$1 | `${PlayState$1}${Opt$1$1<`, ${PlayState$1}`>}` | `${PlayState$1}${Opt$1$1<`, ${PlayState$1}`>}${Opt$1$1<`, ${PlayState$1}`>}${string}`; interface CssAnimationProperties$1 { /** [Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/animation) */ "animation"?: string; /** [Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/animation-composition) */ "animation-composition"?: CssAnimationComposition$1 | CssGlobal$1; /** [Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/animation-delay) */ "animation-delay"?: CssAnimationDelay$1 | CssGlobal$1; /** [Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/animation-direction) */ "animation-direction"?: CssAnimationDirection$1 | CssGlobal$1; /** [Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/animation-fill-mode) */ "animation-fill-mode"?: CssAnimationFillMode$1 | CssGlobal$1; /** [Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/animation-name) */ "animation-name"?: string; /** [Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/animation-play-state) */ "animation-play-state"?: CssAnimationPlayState$1 | CssGlobal$1; /** [Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/animation-range) */ "animation-range"?: string; /** [Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/animation-range-end) */ "animation-range-end"?: string; /** [Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/animation-range-start) */ "animation-range-start"?: string; /** [Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/animation-timeline) */ "animation-timeline"?: string; /** [Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/animation-timing-function) */ "animation-timing-function"?: CssAnimationTimingFunction$1 | CssGlobal$1; } //#endregion //#region ../types/src/string-literals/character-sets/css/background.d.ts interface CssBackgroundProperties$1 { "background"?: string; "background-attachment"?: string; "background-blend-mode"?: string; "background-clip"?: string; "background-color"?: Suggest$1; "background-image"?: string; "background-origin"?: string; "background-position"?: string; "background-position-x"?: string; "background-position-y"?: string; "background-repeat"?: string; "background-size"?: CssSizing$1; } //#endregion //#region ../types/src/string-literals/character-sets/css/border.d.ts /** * CSS Border Styles * ([reference](https://developer.mozilla.org/en-US/docs/Web/CSS/border-style)) */ type CssBorderStyle$1 = "none" | "hidden" | "dotted" | "dashed" | "solid" | "double" | "groove" | "ridge" | "inset" | "outset"; /** * CSS Border Width * ([reference](https://developer.mozilla.org/en-US/docs/Web/CSS/border-width)) */ type CssBorderWidth$1 = "thin" | "medium" | "thick" | CssSizing$1; type CssBorderImageSource$1 = `url(${string})` | `url(${string}) ${number}` | `url(${string}) ${number} space` | `linear-gradient(${string},${string}) ${number} / ${CssSizing$1}` | `url(${string}) ${number} ${number} / ${CssSizing$1} ${string} / ${string}` | CssGlobal$1; /** * **CssBorderCollapse** * * The border-collapse CSS property sets whether cells inside a have shared * or separate borders. * * - [reference](https://developer.mozilla.org/en-US/docs/Web/CSS/border-collapse) */ type CssBorderCollapse$1 = "collapse" | "separate" | CssGlobal$1; /** * The border-image-repeat CSS property defines how the edge regions and * middle region of a source image are adjusted to fit the dimensions of * an element's border image. The middle region can be displayed by using * the keyword "fill" in the border-image-slice property. */ type CssBorderImageRepeat$1 = "stretch" | "repeat" | "round" | "space"; type CssBorderInlineSizing$1 = CssBorderStyle$1 | CssSizing$1 | `${CssSizing$1} ${CssBorderStyle$1}` | `${CssSizing$1} ${CssBorderStyle$1} ${string}`; type CssBorderProperties$1 = { "border"?: string; /** * The border-spacing CSS property sets the distance between the borders of * adjacent cells in a
. * This property applies only when border-collapse is separate. */ "border-spacing"?: CssSizing$1 | `${CssSizing$1} ${string}`; "border-radius"?: CssSizing$1 | `${CssSizing$1} ${string}`; "border-collapse"?: CssBorderCollapse$1; /** * Formats: * - single * - two: `[top & bottom, left & right]` * - three: `[top, left & right, bottom]` * - four: `[top, left, right, bottom]` */ "border-style"?: CssBorderStyle$1 | `${CssBorderStyle$1} ${CssBorderStyle$1}` | `${CssBorderStyle$1} ${CssBorderStyle$1} ${string}`; /** * Formats: * - single * - two: `[top & bottom, left & right]` * - three: `[top, left & right, bottom]` * - four: `[top, left, right, bottom]` */ "border-width"?: CssBorderWidth$1 | `${CssBorderWidth$1} ${string}`; "border-image"?: CssBorderImageSource$1; /** * The `border-image-outset` CSS property sets the distance by which an * element's border image is set out from its border box. * * The parts of the border image that are rendered outside the element's * border box with `border-image-outset` do not trigger overflow scrollbars * and don't capture mouse events. */ "border-image-outset"?: CssSizing$1; /** * The border-image-repeat CSS property defines how the edge regions and * middle region of a source image are adjusted to fit the dimensions of * an element's border image. The middle region can be displayed by using * the keyword "fill" in the border-image-slice property. * * Format: * - use once for all edges * - use two -- `CssBorderImageRepeat` x 2 - for: `[ top & bottom, left & right ]` */ "border-image-repeat"?: CssBorderImageRepeat$1 | `${CssBorderImageRepeat$1} ${CssBorderImageRepeat$1}`; /** * The `border-image-slice` CSS property divides the image specified by * `border-image-source` into regions. These regions form the components * of an element's border image. * * - [Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/border-image-slice) */ "border-image-slice"?: `${number}` | `${number} fill`; "border-image-source"?: CssBorderImageSource$1 | "none"; /** * The `border-end-end-radius` CSS property defines a logical border * radius on an element, which maps to a physical border radius * that depends on the element's writing-mode, direction, and * text-orientation. This is useful when building styles to work * regardless of the text orientation and writing mode. */ "border-end-end-radius"?: CssSizing$1; /** * The `border-end-start-radius` CSS property defines a logical border * radius on an element, which maps to a physical border radius depending * on the element's writing-mode, direction, and text-orientation. This is * useful when building styles to work regardless of the text orientation * and writing mode. */ "border-end-start-radius"?: CssSizing$1; /** * Formats: * - single * - two: `[top & bottom, left & right]` * - three: `[top, left & right, bottom]` * - four: `[top, left, right, bottom]` */ "border-color"?: CssColor$1 | `${CssColor$1} ${string}`; /** * The border-block-color CSS property defines the color of the logical * block borders of an element, which maps to a physical border color * depending on the element's writing mode, directionality, and text * orientation */ "border-block-color"?: CssColor$1; /** * The border-block-end-color CSS property defines the color of the logical * block-end border of an element, which maps to a physical border color * depending on the element's writing mode, directionality, and text orientation. */ "border-block-end-color"?: CssColor$1; /** * The border-block-end-color CSS property defines the color of the logical * block-end border of an element, which maps to a physical border color * depending on the element's writing mode, directionality, and text * orientation. */ "border-block-start-color"?: CssColor$1; /** * The border-inline CSS property is a shorthand property for setting * the individual logical inline border property values in a single place * in the style sheet. * * - [Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/border-inline) */ "border-inline"?: `${CssBorderWidth$1} ${string}` | `${CssColor$1} ${string}` | `${CssBorderStyle$1} ${string}`; "border-inline-style"?: CssBorderStyle$1; /** * The `border-inline-width` CSS property defines the width of the logical inline * borders of an element, which maps to a physical border width depending on the * element's writing mode, directionality, and text orientation. It corresponds to the * border-top-width and border-bottom-width, or border-left-width, and border-right-width * property depending on the values defined for writing-mode, direction, and text-orientation. * * - [Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/border-inline-width) */ "border-inline-width"?: CssBorderWidth$1 | `${CssBorderWidth$1} ${string}`; "border-inline-color"?: CssColor$1; "border-inline-start-style"?: CssBorderStyle$1; "border-inline-start-color"?: CssColor$1; "border-inline-start-width"?: CssBorderWidth$1; "border-inline-end-style"?: CssBorderStyle$1; "border-inline-end-color"?: CssColor$1; "border-inline-end-width"?: CssBorderWidth$1; "border-left"?: `${CssColor$1} ${string}` | `${CssBorderStyle$1} ${string}` | `${CssBorderWidth$1} ${string}`; "border-left-style"?: CssBorderStyle$1; "border-left-color"?: CssColor$1; "border-left-width"?: CssBorderWidth$1; "border-left-top-radius"?: CssSizing$1; "border-left-bottom-radius"?: CssSizing$1; "border-right"?: `${CssColor$1} ${string}` | `${CssBorderStyle$1} ${string}` | `${CssBorderWidth$1} ${string}`; "border-right-style"?: CssBorderStyle$1; "border-right-color"?: CssColor$1; "border-right-width"?: CssBorderWidth$1; "border-right-top-radius"?: CssSizing$1; "border-right-bottom-radius"?: CssSizing$1; "border-bottom"?: `${CssColor$1} ${string}` | `${CssBorderStyle$1} ${string}` | `${CssBorderWidth$1} ${string}`; "border-bottom-style"?: CssBorderStyle$1; "border-bottom-color"?: CssColor$1; "border-bottom-width"?: CssBorderWidth$1; "border-bottom-left-radius"?: CssSizing$1; "border-bottom-right-radius"?: CssSizing$1; "border-top"?: `${CssColor$1} ${string}` | `${CssBorderStyle$1} ${string}` | `${CssBorderWidth$1} ${string}`; "border-top-style"?: CssBorderStyle$1; "border-top-color"?: CssColor$1; "border-top-width"?: CssBorderWidth$1; "border-top-left-radius"?: CssSizing$1; "border-top-right-radius"?: CssSizing$1; /** * The `border-inline-end` CSS property is a shorthand property for setting the * individual logical inline-end border property values in a single place in * the style sheet. * * - [Refererence](https://developer.mozilla.org/en-US/docs/Web/CSS/border-inline-end) */ "border-inline-end"?: CssBorderInlineSizing$1; /** * The `border-inline-start` CSS property is a shorthand property for setting the * individual logical inline-start border property values in a single place in * the style sheet. * * - [Refererence](https://developer.mozilla.org/en-US/docs/Web/CSS/border-inline-start) */ "border-inline-start"?: CssBorderInlineSizing$1; } | { [key: `border-${string}`]: string; }; //#endregion //#region ../types/src/string-literals/character-sets/css/box.d.ts /** * [Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/box-decoration-break) */ type CssBoxDecorationBreak$1 = "slice" | "clone" | CssGlobal$1; /** [Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/box-shadow) */ type CssBoxShadow$1 = "none" | `inset ${string}${CssColorLight$1}` | `${CssSizingLight$1}${string}${CssColorLight$1}` | `${CssSizingLight$1}${string},${string}` | CssGlobal$1; /** [Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/box-sizing) */ type CssBoxSizing$1 = "border-box" | "content-box" | CssGlobal$1; interface CssBoxProperties$1 { "box-decoration-break"?: CssBoxDecorationBreak$1; "box-shadow"?: CssBoxShadow$1; "box-sizing"?: CssBoxSizing$1; } //#endregion //#region ../types/src/string-literals/character-sets/css/break.d.ts type CssBreak$1 = "auto" | "avoid" | "always" | "all" | "avoid-page" | "page" | "left" | "right" | "recto" | "verso" | "avoid-column" | "region" | CssGlobal$1; type CssBreakInside$1 = "auto" | "avoid" | "avoid-page" | "avoid-column" | "avoid-region" | CssGlobal$1; interface CssBreakProperties$1 { /** [Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/break-after) */ "break-after"?: CssBreak$1; /** [Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/break-before) */ "break-before"?: CssBreak$1; /** [Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/break-inside) */ "break-inside"?: CssBreakInside$1; } //#endregion //#region ../types/src/string-literals/character-sets/css/color.d.ts type CssNamedColor$1 = typeof CSS_NAMED_COLORS$2[number]; /** * Type lookup table with _keys_ of CSS Named Colors and _values_ * being the string `RgbColor` definition. */ type CssNamedColorLookup$1 = typeof CSS_COLOR_LOOKUP$2; type CssColorSpace$1 = "srgb" | "srgb-linear" | "display-p3" | "rec2020" | "a98-rgb" | "prophoto-rgb" | "xyz" | "xyz-d50" | "xyz-d65" | "hsl" | "hwb" | "lch" | "oklch"; /** * **CssRgb** * * CSS RGB colors (e.g., `rgb(123,86,255)`) */ type CssRgb$1 = `rgb(${OptionalSpace$1}${number} ${number} ${number}${OptionalSpace$1})` | `rgb(${OptionalSpace$1}${number},${OptionalSpace$1}${number},${OptionalSpace$1}${number}${OptionalSpace$1})`; type CssRgba$1 = `rgba(${number} ${number} ${number} ${number})` | `rgba(${number},${OptionalSpace$1}${number},${OptionalSpace$1}${number},${OptionalSpace$1}${number})`; /** * Hue, Saturation, and Lightness level (**HSL** color model) */ type CssHsl$1 = `hsl(${number} ${number} ${number})` | `hsl(${number},${OptionalSpace$1}${number},${OptionalSpace$1}${number})`; /** * Hue, Saturation, and Brightness (**HSB** color model) */ type CssHsb$1 = `hsb(${number} ${number} ${number})` | `hsb(${number},${OptionalSpace$1}${number},${OptionalSpace$1}${number})`; type OptionalPercent$1 = "%" | ""; /** * [**CssOkLch**](https://oklch.com/)`(lightness, chroma, hue)` * * - Lightness is critical to **contrast** between _background_ and _foreground_ elements * - Saturation levels are seen in _chroma_ values. * - Hue distinguishes the actual color you're viewing */ type CssOkLch$1 = `oklch(${number}${OptionalPercent$1} ${number}${OptionalPercent$1} ${number})`; /** * a hexadecimal color representation for CSS */ type CssHexColor$1 = `#${HexadecimalChar$1}${HexadecimalChar$1}${string}`; type ColorFnValue$1 = `${number}` | `${number}%` | "none"; type ColorFnOptOpacity$1 = "" | ` / ${number}`; /** * **CssColor** * * Intended to represent _any_ CSS color value. */ type CssColor$1 = CssNamedColor$1 | CssHexColor$1 | CssRgb$1 | CssRgba$1 | CssOkLch$1 | CssHsb$1 | CssHsl$1 | "currentcolor" | `color(${string})`; type CssColorLight$1 = CssNamedColor$1 | `#${number}` | "currentcolor" | `${"rgb" | "rgba" | "hsb" | "hsl"}(${string})` | `color(${string})`; /** * The new CSS 4 `color(colorspace v1 v2 v3 [/ alpha])` function. * * **Related:** `CssColorSpace`, `ColorFnValue`, `ColorFnOptOpacity` */ type CssColorFn$1 = `color(${TColorSpace} ${TV1} ${TV2} ${TV3})${TOp}` | `color(${CssColor$1} from ${TColorSpace} ${TV1} ${TV2} ${TV3})${TOp}`; //#endregion //#region ../types/src/string-literals/character-sets/css/definition.d.ts /** * **CssDefinition** * * Provides a means to define a CSS selector in a type strong manner. * * - each _key_ is a possible CSS property with a type definition provided to constrain it * - it is also indexed so that any property without a strong type definition can still be * added as a string value. */ type CssDefinition$1 = { /** [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/appearance) */"appearance"?: Suggest$1; /** [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/backdrop-filter) */ "backdrop-filter"?: Suggest$1; /** * The valid values for the * [**display**](https://developer.mozilla.org/en-US/docs/Web/CSS/display) * property in CSS. */ "display"?: Suggest$1; /** [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/position) */ "position"?: Suggest$1; /** [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/aspect-ratio) */ "aspect-ratio"?: Suggest$1; /** [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/opacity) */ "opacity"?: Suggest$1; /** [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/gap) */ "gap"?: Suggest$1; /** [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/flex) */ "flex"?: Suggest$1; /** [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/flex-grow) */ "flex-grow"?: Suggest$1; /** [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/flex-shrink) */ "flex-shrink"?: CssFlexShrink$1; /** [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/flex-direction) */ "flex-direction"?: Suggest$1; /** [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/flex-flow) */ "flex-flow"?: Suggest$1; /** [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/flex-basis) */ "flex-basis"?: Suggest$1; /** [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/float) */ "float"?: Suggest$1; /** * a union of valid values for the **CSS** [`list-style`](https://developer.mozilla.org/en-US/docs/Web/CSS/list-style) property. * * The list-style CSS shorthand property allows you to set all the list style properties * at once. */ "list-style"?: Suggest$1; /** * The block-size CSS property defines the horizontal or vertical size of an element's block, * depending on its writing mode. It corresponds to either the width or the height property, * depending on the value of writing-mode. * * If the writing mode is vertically oriented, the value of block-size relates to the width of * the element; otherwise, it relates to the height of the element. A related property is * inline-size, which defines the other dimension of the element. * /** [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/block-size) */ "block-size"?: Suggest$1; /** [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/border-size) */ "border-size"?: Suggest$1; /** [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/content) */ "content"?: Suggest$1; /** [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/color) */ "color"?: Suggest$1; /** [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/cursor) */ "cursor"?: Suggest$1; /** [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/height) */ "height"?: Suggest$1; /** [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/width) */ "width"?: Suggest$1; /** [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/perspective) */ "perspective"?: Suggest$1; "perspective-origin"?: Suggest$1; /** [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/mix-blend-mode) */ "mix-blend-mode"?: Suggest$1; /** [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/letter-spacing) */ "letter-spacing"?: Suggest$1; /** * The lighting-color CSS property defines the color of the light source for the * and SVG lighting filter primitives within an * SVG . If present, it overrides the element's lighting-color attribute. * * - [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/lighting-color) */ "lighting-color"?: Suggest$1; /** [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/object-fit) */ "object-fit"?: Suggest$1; /** [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/object-position) */ "object-position"?: Suggest$1; "order"?: Suggest$1<`${number}` | CssGlobal$1>; /** [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/image-orientation) */ "image-orientation"?: Suggest$1; /** [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/image-rendering) */ "image-rendering"?: Suggest$1; /** [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/image-resolution) */ "image-resolution"?: Suggest$1; /** [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/hanging-punction) */ "hanging-punctuation"?: Suggest$1; /** [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/min-height) */ "min-height"?: Suggest$1; /** [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/min-width) */ "min-width"?: Suggest$1; /** [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/min-block-size) */ "min-block-size"?: Suggest$1; /** [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/min-inline-size) */ "min-inline-size"?: Suggest$1; /** [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/stop-color) */ "stop-color"?: Suggest$1; /** [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/stop-opacity) */ "stop-opacity"?: Suggest$1<`${number}` | `${number}%` | CssGlobal$1>; /** [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/tab-size) */ "tab-size"?: Suggest$1<`${number}` | CssSizingLight$1 | CssGlobal$1>; /** [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/table-layout) */ "table-layout"?: Suggest$1<"auto" | "fixed" | CssGlobal$1>; /** [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/translate) */ "translate"?: Suggest$1; /** [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/quotes) */ "quotes"?: Suggest$1; /** [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/r) */ "r"?: Suggest$1; /** [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/pointer-events) */ "pointer-events"?: string; /** [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/resize) */ "resize"?: Suggest$1<"both" | "horizontal" | "vertical" | "none" | CssGlobal$1>; /** [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/rotate) */ "rotate"?: Suggest$1; "row-gap"?: Suggest$1; /** [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/rx) */ "rx"?: Suggest$1; /** [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/ry) */ "ry"?: Suggest$1; /** [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/x) */ "x"?: Suggest$1; /** [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/y) */ "y"?: Suggest$1; /** [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/white-space) */ "white-space"?: Suggest$1; /** [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/white-space-collapse) */ "white-space-collapse"?: Suggest$1; /** [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/widows) */ "widows"?: Suggest$1; /** [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/will-change) */ "will-change"?: Suggest$1; /** [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/word-break) */ "word-break"?: Suggest$1; /** [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/word-spacing) */ "word-spacing"?: Suggest$1<"normal" | CssSizing$1>; /** [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/writing-mode) */ "writing-mode"?: Suggest$1; /** [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/z-index) */ "z-index"?: Suggest$1<`${number}` | "auto" | CssGlobal$1>; /** [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/zoom) */ "zoom"?: Suggest$1<`${number}` | `${number}%` | "normal" | "reset" | CssGlobal$1>; } & CssBorderProperties$1 & CssBackgroundProperties$1 & CssAbsolutionPositioningProperties$1 & CssOffsetProperties$1 & CssBreakProperties$1 & CssBoxProperties$1 & CssTextProperties$1 & CssStrokeProperties$1 & CssJustifyProperties$1 & CssAlignProperties$1 & CssPlaceProperties$1 & CssAnimationProperties$1 & CssMarginProperties$1 & CssPaddingProperties$1 & CssOutlineProperties$1 & CssOverflowProperties$1 & CssOffsetProperties$1 & CssTransformProperties$1 & CssFontProperties$1 & { [key: string]: string; }; //#endregion //#region ../types/src/string-literals/character-sets/css/display-position.d.ts type Ratio$1 = `${number}${OptionalSpace$1}/${OptionalSpace$1}${number}`; type One$1 = `1`; type Special$1 = "inherit" | "initial" | "revert" | "revert-layer" | "unset"; type Auto$1 = "auto" | `auto ${Ratio$1}` | `${Ratio$1} auto`; /** * **CssAspectRatio** * * Allowed values for CSS's `aspect-ratio` property. */ type CssAspectRatio$1 = Ratio$1 | One$1 | Special$1 | Auto$1; /** * **CssPosition** * * The valid values for the `position` property in CSS. */ type CssPosition$1 = "static" | "relative" | "absolute" | "fixed" | "sticky" | "inherit" | "initial" | "revert" | "revert-layer" | "unset"; /** * **CssDisplay** * * The valid values for the [**display**](https://developer.mozilla.org/en-US/docs/Web/CSS/display) * property in CSS. */ type CssDisplay$1 = "block" | "flex" | "inline" | "inline-block" | "inline-flex" | "inline-grid" | "grid" | "flow-root" | "none" | "contents" | "block flex" | "block flow" | "block flow-root" | "block grid" | "inline flex" | "inline flow" | "inline flow-root" | "inline-grid" | "table" | "table-row" | "list-item" | CssGlobal$1; //#endregion //#region ../types/src/string-literals/character-sets/css/font.d.ts type CssFontFamily$1 = `"${string}"` | "serif" | "san-serif" | "monospace" | "cursive" | "fantasy" | "system-ui" | "ui-serif" | "ui-sans-serif" | "ui-monospace" | "ui-rounded" | "emoji" | "math" | "fansong"; type CssFontFeatureSetting$1 = "normal" | "liga" | "tnum" | "smcp"; type CssFontKerning$1 = "auto" | "normal" | "none" | CssGlobal$1; type CssFontPalette$1 = "normal" | "light" | "dark" | `--${string}` | `palette-mix(in ${ColorGamut},${string})`; type CssFontWidth$1 = "normal" | "ultra-condensed" | "extra-condensed" | "condensed" | "semi-condensed" | "expanded" | "extra-expanded" | "ultra-expanded" | `${number}%` | CssGlobal$1; type CssFontStyle$1 = "normal" | "italic" | "oblique" | `oblique ${CssRotation$1}` | CssGlobal$1; type CssFontSynthesis$1 = "none" | "weight" | "style" | "position" | "small-caps"; type CssFontWeight$1 = "normal" | "bold" | "100" | "200" | "300" | "400" | "500" | "600" | "700" | "800" | "900" | "lighter" | "bolder" | CssGlobal$1; /** * The font-language-override CSS property controls the use of language-specific glyphs in a typeface. * * By default, HTML's lang attribute tells browsers to display glyphs designed specifically * for that language. For example, a lot of fonts have a special character for the digraph * fi that merge the dot on the "i" with the "f." However, if the language is set to Turkish * the typeface will likely know not to use the merged glyph; Turkish has two versions of * the "i," one with a dot (i) and one without (ı), and using the ligature would incorrectly * transform a dotted "i" into a dotless "i." * * The font-language-override property lets you override the typeface behavior for a specific * language. This is useful, for example, when the typeface you're using lacks proper support * for the language. For instance, if a typeface doesn't have proper rules for the Azeri * language, you can force the font to use Turkish glyphs, which follow similar rules. */ type CssFontLanguageOverride$1 = string; interface CssFontProperties$1 { "font-family"?: CssFontFamily$1 | `${CssFontFamily$1}, ${CssFontFamily$1}${string}` | CssGlobal$1; "font-feature-settings"?: CssFontFeatureSetting$1 | `${CssFontFeatureSetting$1} ${number | "on" | "off"}` | `${CssFontFeatureSetting$1} ${number | "on" | "off"},${string}`; "font-kerning"?: CssFontKerning$1; "font-language-override"?: CssFontLanguageOverride$1; "font-size"?: CssSizing$1 | "xx-small" | "x-small" | "small" | "medium" | "large" | "x-large" | "xx-large" | "xxx-large"; /** * The font-size-adjust CSS property provides a way to modify the size of lowercase * letters relative to the size of uppercase letters, which defines the overall * font-size. This property is useful for situations where font fallback can * occur. * * - [Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/font-size-adjust) */ "font-size-adjust"?: CssSizingLight$1 | "none" | `${number}` | `from-font${Opt$1$1<` ${CssSizingLight$1}`>}` | `cap-height${Opt$1$1<` ${CssSizingLight$1}`>}` | `ex-height${Opt$1$1<` ${CssSizingLight$1}`>}` | `ch-width${Opt$1$1<` ${CssSizingLight$1}`>}` | `ic-width${Opt$1$1<` ${CssSizingLight$1}`>}` | `ic-height${Opt$1$1<` ${CssSizingLight$1}`>}`; /** * The font-palette CSS property allows specifying one of the many palettes contained in a * color font that a user agent may use for the font. Users can also override the values in * a palette or create a new palette by using the @font-palette-values at-rule. * * - [Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/font-palette) */ "font-palette"?: CssFontPalette$1; /** * An alias for `font-width` */ "font-stretch"?: CssFontWidth$1; /** * The font-stretch CSS property selects a normal, condensed, or expanded face from a font. * * - [Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/font-width) */ "font-width"?: CssFontWidth$1; /** [Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/font-style) */ "font-style"?: CssFontStyle$1; /** * The `font-synthesis` shorthand CSS property lets you specify whether or not the browser * may synthesize the bold, italic, small-caps, and/or subscript and superscript typefaces * when they are missing in the specified font-family. * * - [Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/font-synthesis) */ "font-synthesis"?: CssFontSynthesis$1 | `${CssFontSynthesis$1} ${CssFontSynthesis$1}` | `${CssFontSynthesis$1} ${CssFontSynthesis$1} ${CssFontSynthesis$1}${string}` | CssGlobal$1; /** [Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/font-weight) */ "font-weight"?: CssFontWeight$1; } //#endregion //#region ../types/src/string-literals/character-sets/css/global.d.ts type CssGlobal$1 = "inherit" | "initial" | "revert" | "unset" | "revert-layer"; //#endregion //#region ../types/src/string-literals/character-sets/css/html-element.d.ts type HtmlTableElement$1 = "col" | "colgroup" | "hgroup" | "table" | "tbody" | "td" | "tfoot" | "th" | "thead" | "time" | "tr"; type HtmlSymantecElement$1 = "abbr" | "acronym" | "address" | "area" | "article" | "aside" | "blockquote" | "caption" | "cite" | "details" | "dfn" | "dialog" | "fieldset" | "figure" | "figcaption" | "header" | "footer" | "legend" | "nav" | "menu" | "search" | "summary" | "section"; type HtmlInputElement$1 = "button" | "form" | "label" | "optgroup" | "option" | "select" | "input" | "textarea"; type HtmlFunctionalElement$1 = "a" | "br" | "canvas" | "code" | "data" | "embed" | "em" | "font" | "hr" | "i" | "iframe" | "img" | "mark" | "strike" | "progress" | "p" | "picture" | "plaintext" | "pre"; type HtmlMediaElement$1 = "audio" | "video"; type HtmlFrameworkElement$1 = "template" | "slot"; type HtmlStructuralElement$1 = "div" | `h${"1" | "2" | "3" | "4" | "5" | "6"}` | "frame" | "frameset" | "html" | "head" | "span"; type HtmlListElement$1 = "li" | "ol" | "ul"; type HtmlBodyElement$1 = "body" | "main" | HtmlListElement$1 | HtmlStructuralElement$1 | HtmlSymantecElement$1 | HtmlMediaElement$1 | HtmlInputElement$1 | HtmlFunctionalElement$1 | HtmlFrameworkElement$1 | HtmlTableElement$1; //#endregion //#region ../types/src/string-literals/character-sets/css/justify.d.ts type CssJustifyContent$1 = "center" | "start" | "end" | "flex-start" | "flex-end" | "left" | "right" | "normal" | "space-between" | "space-around" | "space-evenly" | "stretch" | "safe center" | "unsafe center" | CssGlobal$1; type Positions$2 = "stretch" | "center" | "start" | "end" | "flex-start" | "flex-end" | "self-start" | "self-end" | "left" | "right" | "anchor-center" | "baseline" | "first baseline" | "last baseline" | "safe center" | "unsafe center" | "legacy left" | "legacy right" | "legacy center" | CssGlobal$1; type CssJustifyItems$1 = Positions$2; type CssJustifySelf$1 = Positions$2; interface CssJustifyProperties$1 { /** [Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/justify-content) */ "justify-content"?: CssJustifyContent$1; /** [Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/justify-items) */ "justify-items"?: CssJustifyItems$1; /** [Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/justify-self) */ "justify-self"?: CssJustifySelf$1; } //#endregion //#region ../types/src/string-literals/character-sets/css/keyframe.d.ts /** * The _timestamp_ of a [CSS keyframe animation](https://developer.mozilla.org/en-US/docs/Web/CSS/@keyframes) * (e.g., "from", "to", "50%") */ type CssKeyframeTimestamp$1 = "from" | "to" | `${number}%` | `${number}%${string},${number}%`; //#endregion //#region ../types/src/string-literals/character-sets/css/margin.d.ts type CssMargin$1 = CssSizingLight$1 | `${CssSizingLight$1}, ${CssSizingLight$1}${Opt$1$1<`, ${CssSizingLight$1}`>}${string}`; type CssMarginBlock$1 = `${CssSizingLight$1}${Opt$1$1<`, ${CssSizingLight$1}`>}${string}`; type CssMarginBlockEnd$1 = CssSizingLight$1; type CssMarginBlockStart$1 = CssSizingLight$1; type CssMarginInline$1 = `${CssSizingLight$1}${Opt$1$1<`, ${CssSizingLight$1}`>}${string}`; type CssMarginInlineEnd$1 = CssSizingLight$1; type CssMarginInlineStart$1 = CssSizingLight$1; type CssMarginLeft$1 = CssSizingLight$1; type CssMarginRight$1 = CssSizingLight$1; type CssMarginTop$1 = CssSizingLight$1; type CssMarginBottom$1 = CssSizingLight$1; interface CssMarginProperties$1 { "margin"?: CssMargin$1; "margin-block"?: CssMarginBlock$1; "margin-block-end"?: CssMarginBlockEnd$1; "margin-block-start"?: CssMarginBlockStart$1; "margin-inline"?: CssMarginInline$1; "margin-inline-end"?: CssMarginInlineEnd$1; "margin-inline-start"?: CssMarginInlineStart$1; "margin-left"?: CssMarginLeft$1; "margin-right"?: CssMarginRight$1; "margin-top"?: CssMarginTop$1; "margin-bottom"?: CssMarginBottom$1; "margin-trim"?: string; } //#endregion //#region ../types/src/string-literals/character-sets/css/object.d.ts /** * **CssObjectFit** * * The [object-fit](https://developer.mozilla.org/en-US/docs/Web/CSS/object-fit) CSS property sets how the * content of a replaced element, such as an or >, TResult extends Record[] = []> = TRows extends readonly [infer Row extends string, ...infer Rest extends readonly string[]] ? TrimEach> extends infer ColData extends readonly string[] ? ColData extends readonly [""] ? Kv : Kv]> : never : TResult; /** * **FromCsv**`` * * Takes a string containing CSV data and converts it into * either: * * 1. a multidimensional array of data in rows by columns format * 2. an array of key/value dictionaries where the _keys_ are the * column names for a given row * * The second output type will only work if the first row of data * has column names in it. * * - the optional `TResolve` parameter can be set to `true` (the * default is `false`) and when it is then `NumberLike` values * will be converted to numbers and `BooleanLike` values will * be converted to their boolean counterparts. */ type FromCsv = string extends TCsv ? TFormat extends "[][]" ? string[][] : Record[] : TFormat extends "[][]" ? As$1, string[][]> : TFormat extends "KV[]" ? Split extends infer Rows extends readonly string[] ? Kv, AfterFirst> : never : never; //#endregion //#region src/lists/GetEach.d.ts type Process$74 = RemoveNever<{ [K in keyof TList]: TList[K] extends Container | TypedFunction | Error ? Get : TList[K] extends TypedFunction ? Get, TKey, TDefault> : TKey extends "." ? TList[K] : never }>; /** * **GetEach**`` * * Type utility which receives a list of types -- `TList` -- and then _gets_ a * key `TKey` (using dot syntax) from each element in the array. * * - if a given element is not an object then it is excluded from the result set * - values which evaluate to _undefined_ are also removed from the result set * - if either `null` or "" are used for `TKey` then this simply proxies `TList` * through * * ```ts * // ["Bob", "Wendy"] * type T = GetEach<[ * { name: "Bob", age: 12 }, * { name: "Wendy", age: 24 } * ], "name"> * ``` */ type GetEach = TKey extends null ? TList : TKey extends "" ? TList : Process$74<[...TList], Exclude, TDefault> extends readonly unknown[] ? Process$74<[...TList], Exclude, TDefault> : never; //#endregion //#region src/lists/IndexOf.d.ts type Override$1 = TOverride extends Constant$1<"no-override"> ? TValue : TValue extends Error ? TOverride : TValue; type NegativeIndex = TDepth["length"] extends TPositive ? TValue extends readonly [infer Head, ...readonly unknown[]] ? Head : Err<"invalid-index", `Use of a negative index [${AsString}] was unsuccessful in matching a valid index`, { container: TValue; key: TIdx; revIndex: TPositive; revContainer: Reverse; }> : TValue extends readonly [unknown, ...infer Rest] ? NegativeIndex : If, TValue[TPositive], Err<"invalid-index", `Use of a negative index [${AsString}] was unsuccessful in matching a valid index`, { container: TValue; key: TIdx; revIndex: TPositive; revContainer: Reverse; }>>; type HandleArr = TIdx extends number ? IsNegativeNumber extends true ? NegativeIndex, TIdx> : If, TValue[TIdx], Err<"invalid-index", Concat<["Attempt to index [", ToString, "] into a non-container type!"]>, { container: TValue; key: TIdx; library: "inferred-types/constants"; }>> : Err<"invalid-index", `IndexOf}> failed because a tuple container must use numeric indexes!`, { container: TValue; key: TIdx; library: "inferred-types/constants"; }>; type HandleObj = TIdx extends keyof TValue ? TValue[TIdx] : Err<"invalid-index", Concat<["Attempt to index [", ToString, "] into a non-container type!"]>, { container: TValue; key: TIdx; library: "inferred-types/constants"; }>; type Process$73 = If, TValue, TValue extends readonly unknown[] ? If>, HandleArr>, Err<"invalid-index", `Call to IndexOf,${AsString}> is not allowed as an tuple based container must receive either null or numeric index value.`, { library: "inferred-types/constants"; container: TValue; key: TIdx; }>> : TValue extends Dictionary ? TIdx extends ObjectKey ? HandleObj : Err<"invalid-index", `Call to IndexOf,${AsString}> is not allowed as an object based container must receive either null, a string, or a symbol index value.`, { library: "inferred-types/constants"; container: TValue; key: TIdx; }> : Err<"invalid-index", `IndexOf,${AsString}> was called but a non-null value was used to index a non-container which will never work!`, { library: "inferred-types/constants"; container: TValue; key: TIdx; }>>; /** * **IndexOf** * * A type utility which _dereferences_ a property/index item on an array * or object. * * - if `TIdx` is passed in as `null` then this will act as an identity * function and return `TValue`. * - if `TIdx` is a negative number it will index in reverse for tuple based * containers * * **Related:** `Get`, `IsValidIndex` * * **Errors:** produces an Error when an a bad index value * is passed in for the given container */ type IndexOf> = TIdx extends null ? TValue : Override$1>, TOverride>; //#endregion //#region src/lists/Last.d.ts /** * **Last**`` * * Returns the _last_ element in a list of elements. * * - by default `TEmpty` is _never_ but this can be changed. */ type Last$1 = IfLength extends readonly unknown[] ? TContent[AfterFirst["length"]] extends TContent[number] ? TContent[AfterFirst["length"]] : TEmpty : TEmpty>>; //#endregion //#region src/lists/LogicalReturns.d.ts type Process$72 = { [K in keyof TValues]: TValues[K] extends ((...args: any[]) => boolean) ? ReturnType : TValues[K] }; /** * **LogicalReturns**`` * * Given a known tuple of values, this utility will reduce it to * another tuple of items which are either a _boolean type_ or a function * with a boolean return. In the latter case the function's return value * will be represented in the Tuple. * * **Related**: `ReturnTypes` and `TruthyReturns` */ type LogicalReturns = Process$72 extends readonly boolean[] ? Process$72 : never; //#endregion //#region src/lists/Longest.d.ts type StringToTuple = T extends `${string}${infer Rest}` ? StringToTuple : TResult; type IsLonger$1 = StringToTuple extends infer ATuple extends readonly string[] ? StringToTuple extends infer BTuple extends readonly string[] ? ATuple extends readonly [...BTuple, unknown, ...readonly unknown[]] ? true : false : false : false; type Process$71 = T extends [infer Head extends string, ...infer Rest extends readonly string[]] ? Process$71 extends true ? TResult extends string ? IsLonger$1 extends true ? Head : TResult : Head : TResult> : TResult extends Unset ? string : TResult; /** * **Longest**`` * * Takes a tuple of strings and returns the longest one in the tuple. * * - if more than one string is _tied_ for being longest then * the **first** one found will be returned. * - if _all_ elements passed in were wide then the result will be `string` * - if _some_ of the elements passed in were wide then they will be * ignored and only the literal strings will be compared */ type Longest = Process$71; //#endregion //#region src/lists/MakeOptional.d.ts type Process$70 = TInput extends readonly [infer Head extends unknown, ...infer Rest extends readonly unknown[]] ? Depth["length"] extends 128 ? readonly unknown[] : IsGreaterThan extends true ? Process$70, { required: TOutput["required"]; optional: [...TOutput["optional"], Head]; }, [unknown, ...Depth]> : Process$70, { required: [...TOutput["required"], Head]; optional: TOutput["optional"]; }, [unknown, ...Depth]> : [...TOutput["required"], ...Partial]; /** * **MakeOptional**`` * * Take a tuple `T` and makes the last `U` elements _optional_ with the * `?` optional modifier. * * ```ts * // [ string, number, string? ] * type Test = MakeOptional<[string, number, string], 1>; * ``` * * **Note:** * - the mix of optional vs. required elements in `T` has no bearing on * the outcome. * * **Related:** `MakeKeysOptional` */ type MakeOptional = Subtract["length"], U> extends infer Req extends number ? number extends Req ? never : Process$70, Req> : never; type MakeRequired = Process$70, U>; //#endregion //#region src/lists/MapTo.d.ts type ElseOps = "never" | "proxy" | "false" | "true" | "boolean" | "unknown"; type Convert$12> = { [K in keyof TList]: TList[K] extends TTriggers ? Find$1 extends [any, infer Type] ? Type : never : TElse extends "proxy" ? TList[K] : TElse extends "false" ? false : TElse extends "true" ? true : TElse extends "boolean" ? boolean : TElse extends "unknown" ? unknown : TElse extends "never" ? never : never }; /** * **ArrayTo**`` * * Converts elements of TList which match the _first element_ of `TMap` to the type in the _second element_ * of `TMap`. * * - by default items not expressly remapped in `TMap` will by proxied through "as is" * - you can optionally, set `TElse` to: `never`, `false`, `true`, `boolean`, or `unknown` */ type ArrayTo = Convert$12; //#endregion //#region src/lists/NotFilter.d.ts type Process$69[], TOp extends ComparisonOperation, TParams extends readonly unknown[]> = RemoveMarked<{ [K in keyof TList]: [Compare] extends [false] ? TList[K] : Marked$2 }>; /** * **NotFilter**`` * * Performs the same task as `Filter` but with the opposite results. * * - when elements are evaluated to `true` on their comparison operation * they are _removed_ * * **Related:** `Filter` * * ```ts * // ["foo","bar"] * type NotNum = NotFilter<[1,2,3,"foo","bar"], "extends", number>; * ``` */ type NotFilter[], TOp extends ComparisonOperation, TParams extends readonly unknown[]> = Process$69; //#endregion //#region src/lists/NumericKeys.d.ts type IndicesTuple = number extends T["length"] ? number[] : T extends readonly [any, ...infer R] ? IndicesTuple : Acc; /** * **NumericKeys**<`TList`> * * Will provide a tuple of numeric keys for * a literal array and `number[]` for a wide array. * * ```ts * type Arr = ["foo", "bar", "baz"]; * // readonly [0, 1, 2] * type T = NumericKeys; * ``` * * **Related:** `NumericKeys__Union`, `Keys`, `ObjectKeys` */ type NumericKeys = HasVariadicTail extends true ? DropVariadicTail extends infer NonVariadic extends readonly unknown[] ? IndicesTuple extends infer NonVariadic extends readonly unknown[] ? [...NonVariadic, ...number[]] : never : never : IndicesTuple; //#endregion //#region src/lists/optional/TakeOptionalElements.d.ts /** * **TakeOptionalElements**`` * * Returns only the **optional** elements in `T`. * * **Related:** `TakeOptionalElements` */ type TakeOptionalElements = HasOptionalElements extends true ? SliceArray> extends infer Offset extends number ? Offset : never> : T; //#endregion //#region src/lists/optional/TakeRequiredElements.d.ts /** * **TakeRequiredElements**`` * * Returns only the **required** elements in `T`. * * **Related:** `TakeOptionalElements` */ type TakeRequiredElements = HasOptionalElements extends true ? SliceArray> : T; //#endregion //#region src/lists/Pop.d.ts type _Pop = TVal extends [...(infer Rest), unknown] ? Rest : []; type AdjustVariadic< /** the list of elements with any variadic elements removed */TList extends readonly unknown[], /** the original array which we'll use to detect variadic properties */TOrigin extends readonly unknown[], /** the element which was just removed */TRemoved, TType = (VariadicType extends (infer Base)[] ? Base : never)> = IsVariadicArray extends true ? TRemoved extends TType ? [...TList, ...TType[]] : [...TList, ...TType[]] | [...TList, TRemoved, ...TType[]] : TList; /** * **Pop**`` * * Removes the last element of a list. * ```ts * // [1,2] * type T = Pop<[1,2,3]>; * ``` * * - to provide additional utility, you can also pass * in a string literal and get back the literal with the last * character removed. * - when popping an empty tuple/array, the type remains `[]` */ type Pop = TList extends readonly unknown[] ? IsWideArray extends true ? TList : DropVariadic> extends [...infer NewList extends readonly [unknown, ...unknown[]], infer Removed] ? HasOptionalElements extends true ? TupleMeta["optionalElementCount"] extends infer Optional extends number ? IsGreaterThan, 0> extends true ? MakeOptional> extends infer Next extends readonly unknown[] ? AdjustVariadic), TList, Removed> : never : NewList | Pop : NewList | Pop : AdjustVariadic : [] : TList extends string ? IsWideType extends true ? string : IsStringLiteral$1 extends true ? TList extends string ? TList extends "" ? "" : Chars extends readonly string[] ? Concat<_Pop>> : never : never : string : _Pop>; //#endregion //#region src/lists/Push.d.ts type Process$68 = [...TList, TValue]; /** * **Push**`` * * Pushes a value `TVal` onto an existing list `TList`. * * - If you want to make the push conditional you can add `TCondition` */ type Push = [TCondition] extends [true] ? As$1, readonly unknown[]> : TList; //#endregion //#region src/lists/ReplaceLast.d.ts /** * **ReplaceLast**`` * * Replaces the _last_ element of `TList` with the value of `TVal`. * * **Related:** `AppendToLast` */ type ReplaceLast = Pop extends readonly unknown[] ? [...Pop, TVal] : never; //#endregion //#region src/lists/RetainLiterals.d.ts type Process$67 = RemoveMarked<{ [K in keyof T]: If, T[K], Constant$1<"Marked">> }>; /** * **RetainLiterals**`` * * Receives a tuple of items and keeps only the literal types * (e.g., object, number, string, Record, boolean, etc.). * * All literal types and elements such as _undefined_ and `null` are removed. * * **Related:** `Retain`, `FilterLiterals`, `RetainWideTypes` */ type RetainLiterals = Process$67 extends readonly unknown[] ? Process$67 : never; //#endregion //#region src/lists/RetainWideTypes.d.ts type Process$66 = RemoveMarked<{ [K in keyof T]: If, T[K], Constant$1<"Marked">> }>; /** * **RetainWideTypes**`` * * Receives a tuple of items and keeps only the "wide types" * (e.g., object literals, tuple literals, string literals, * numeric literals, and boolean literals). * * All wide types and elements such as _undefined_ and `null` are removed. * * **Related:** `Retain`, `RetainLiterals`, `FilterWideTypes` */ type RetainWideTypes = Process$66 extends readonly unknown[] ? Process$66 : never; //#endregion //#region src/lists/ReturnTypes.d.ts /** * **ReturnTypes**`` * * Given any Tuple, this utility will return a _union_ type * that represents all the possible _return types_ from functions found * in the array. Non-function types will be ignored as will functions * which don't return a boolean value. * * **See Also**: `LogicalReturns`, `TruthyReturns` */ type ReturnTypes = { [K in keyof T]: T[K] extends TypedFunction ? ReturnType extends boolean ? ReturnType : never : never }; //#endregion //#region src/lists/Reverse.d.ts type RevAcc = TInput extends [infer Head, ...infer Rest] ? RevAcc : TResults; /** * **Reverse**`` * * Reverses the order of a `Tuple` or a `string`. * * **Note:** * - to ensure all elements are retained while **not** breaking the rules * regarding _optional_ elements not being allowed to precede _required_ ones * we convert all elements to **required** rather than risk losing elements. */ type Reverse = T extends readonly unknown[] ? RevAcc> : T extends string ? Join>> : never; //#endregion //#region src/lists/Second.d.ts /** * **Second**`` * * Returns the _second_ type in a list. If `TElse` is provided it will set * the type to `TElse` when: * - `T` is a Tuple type * - `T[1]` is not a valid index of `T` * - by default `TElse` is set to _never_ * * **Related:** `First`, `Last` */ type Second$1 = T extends readonly unknown[] ? T[1] extends T[number] ? T[1] : ELSE : never; //#endregion //#region src/lists/Shift.d.ts type _Shift = TList extends [unknown, ...(infer Tail)] ? Tail : undefined; /** * **Shift**`` * * Removes the first element of a list, returning the rest. * ```ts * // [2,3] * type T = Shift<[1,2,3]>; * ``` * * - to provide additional utility, you can also pass * in a string literal and get back the literal with the first * character removed. * - if there is nothing left in Tuple or an empty string is passed in as input * then the output will _undefined_. */ type Shift = IsUndefined extends true ? undefined : [] extends T ? undefined : T extends readonly unknown[] ? _Shift> : string extends T ? string : T extends string ? T extends "" ? undefined : _Shift>>> extends readonly string[] ? Concat<_Shift>>>> : undefined : never; //#endregion //#region src/lists/Shortest.d.ts type Process$65 = T extends [infer Head extends string, ...infer Rest extends readonly string[]] ? Depth["length"] extends 128 ? TResult extends Unset ? string : TResult : Process$65 extends true ? Min$1<[TShortest, Length]> : TShortest, IsStringLiteral$1 extends true ? IsLessThan, TShortest> extends true ? Head : TResult : TResult, [unknown, ...Depth]> : TResult extends Unset ? string : TResult; /** * **Shortest**`` * * Takes a tuple of strings and returns the shortest one in the tuple. * * - if more than one string is _tied_ for being shortest then * the **first** one found will be returned. * - if _all_ elements passed in were wide then the result will be `string` * - if _some_ of the elements passed in were wide then they will be * ignored and only the literal strings will be compared */ type Shortest = Process$65; //#endregion //#region src/lists/Slice.d.ts type PositiveOfNegative = `${T}` extends `-${infer N extends number}` ? N : never; type DropLeading = TDepth["length"] extends TStart ? TList : number extends TStart ? TList : TDepth["length"] extends 64 ? TList : TList extends readonly [unknown, ...infer Rest] ? DropLeading : never; type DropTrailing = Subtract extends infer Keep extends number ? number extends TStart ? TList : TakeFirst : []; type TruncateAtLen = TLen extends number ? number extends TLen ? TList : `${TLen}` extends `-${string}` ? DropTrailing> : TakeFirst : TList; type ProcessList = TList extends readonly unknown[] ? number extends TStart ? TruncateAtLen : `${TStart}` extends `-${string}` ? TakeLast> : IsGreaterThan extends true ? TLen extends number ? [] : never : TruncateAtLen, TLen> : never; type ProcessChars = ProcessList extends readonly string[] ? ProcessList extends infer Result extends readonly string[] ? Concat : never : never; /** * **Slice**`` * * Provides a slice of a tuple or a string. * * - negative indexes for `TEnd` can be used * - `TStart` defaults to 0 * - `TLen` defaults to the all the remaining elements * but can be any amount; if you use negative values this * will drop that many values off the end of the tuple * * **Related:** `SliceArray`, `SliceString` */ type Slice = [TList] extends [string] ? SliceString : [TList] extends [readonly unknown[]] ? SliceArray : never; /** * **SliceArray** * * Slices an array. * * - negative indexes for `TEnd` can be used * - `TStart` defaults to 0 * - `TLen` defaults to the all the remaining elements * but can be any amount; if you use negative values this * will drop that many values off the end of the tuple * * **Related:** `Slice`, `SliceArray` */ type SliceString = Chars extends infer Characters extends readonly string[] ? IsGreaterThan extends true ? "" : ProcessChars : never; /** * **SliceArray** * * Slices an array. * * - negative indexes for `TEnd` can be used * - `TStart` defaults to 0 * - `TLen` defaults to the all the remaining elements * but can be any amount; if you use negative values this * will drop that many values off the end of the tuple * * **Related:** `Slice`, `SliceString` */ type SliceArray = ProcessList<[...TList], TStart, TLen> extends infer Result extends readonly unknown[] ? Result extends readonly (TList[number])[] ? Result : never : never; //#endregion //#region src/lists/sort/BooleanSort.d.ts /** * Detect if a type is the wide boolean type rather than a boolean literal */ type IsWideBool = boolean extends T ? true extends T ? false extends T ? true : false : false : false; /** * Boolean comparison for ASC order - returns true if A should come before B * ASC order: true comes before false */ type BoolLessThan = A extends true ? B extends false ? true : false : A extends false ? B extends true ? false : false : false; type BoolGreaterThan = BoolLessThan extends true ? false : A extends B ? false : true; /** * Filter booleans that are less than or equal to the pivot */ type FilterBoolLessThanOrEqual = TValues extends readonly [infer Head extends boolean, ...infer Tail extends readonly boolean[]] ? BoolLessThan extends true ? FilterBoolLessThanOrEqual : Head extends TPivot ? FilterBoolLessThanOrEqual : FilterBoolLessThanOrEqual : TOut; /** * Filter booleans that are greater than the pivot */ type FilterBoolGreaterThan = TValues extends readonly [infer Head extends boolean, ...infer Tail extends readonly boolean[]] ? BoolGreaterThan extends true ? FilterBoolGreaterThan : FilterBoolGreaterThan : TOut; /** * Quicksort implementation for booleans */ type _SortBooleans = TValues extends readonly [infer Head extends boolean, ...infer Tail extends readonly boolean[]] ? TReverse extends true ? [..._SortBooleans, TReverse>, Head, ..._SortBooleans, TReverse>] : [..._SortBooleans, TReverse>, Head, ..._SortBooleans, TReverse>] : []; /** * Helper to filter containers by boolean offset value comparison */ type FilterContainersBoolLessThanOrEqual = TContainers extends readonly [infer Head extends Container, ...infer Tail extends readonly Container[]] ? BoolLessThan, boolean>, As$1, boolean>> extends true ? FilterContainersBoolLessThanOrEqual : As$1, boolean> extends As$1, boolean> ? FilterContainersBoolLessThanOrEqual : FilterContainersBoolLessThanOrEqual : TOut; type FilterContainersBoolGreaterThan = TContainers extends readonly [infer Head extends Container, ...infer Tail extends readonly Container[]] ? BoolGreaterThan, boolean>, As$1, boolean>> extends true ? FilterContainersBoolGreaterThan : FilterContainersBoolGreaterThan : TOut; /** * Sort containers by boolean offset */ type _SortBooleanOffset = TContainers extends readonly [infer Head extends Container, ...infer Rest extends readonly Container[]] ? TReverse extends true ? [..._SortBooleanOffset, TOffset, TReverse>, Head, ..._SortBooleanOffset, TOffset, TReverse>] : [..._SortBooleanOffset, TOffset, TReverse>, Head, ..._SortBooleanOffset, TOffset, TReverse>] : []; /** * Filter narrow boolean types (true | false literals) */ type FilterNarrowBooleans = T extends readonly [infer Head extends boolean, ...infer Tail extends readonly boolean[]] ? IsWideBool extends true ? FilterNarrowBooleans : FilterNarrowBooleans : Result; /** * Filter wide boolean types (boolean type) */ type FilterWideBooleans = T extends readonly [infer Head extends boolean, ...infer Tail extends readonly boolean[]] ? IsWideBool extends true ? FilterWideBooleans : FilterWideBooleans : Result; /** * Separate wide and narrow boolean types */ interface SeparateWideBooleans { narrow: FilterNarrowBooleans; wide: FilterWideBooleans; } interface BooleanSortOptions { /** * by default this is set to sort by _ascending_ order but this can be * reversed by changing order to `DESC`. * reversed by changing order to `DESC` or kept in original order with `Natural`. * * ASC: true, false, boolean * DESC: false, true, boolean */ order?: TOrder; /** * by default, the sorting will expect the boolean value to exist * as the base type of the array's elements, however, if you are * list contains "container" types as objects then it may be more * useful to have the comparison be made to a property/offset of * these containers. */ offset?: TOffset; /** * Pin specific boolean values to the beginning of the sorted array. * If an array is provided, values are pinned in order. */ start?: unknown; /** * Pin specific boolean values to the end of the sorted array. * If an array is provided, values are pinned in order. */ end?: unknown; } /** * Main sorting logic without first elements */ type _BooleanSortMain, TNarrow extends readonly boolean[] = (TSeparated extends { narrow: infer N; } ? N extends readonly boolean[] ? N : [] : []), TWide extends readonly boolean[] = (TSeparated extends { wide: infer W; } ? W extends readonly boolean[] ? W : [] : []), TSorted extends readonly boolean[] = ([IsEqual] extends [true] ? TNarrow : _SortBooleans] extends [true] ? true : false>)> = [...TSorted, ...TWide]; /** * Extract first elements from boolean array */ type ExtractFirstBool = TFirst extends readonly unknown[] ? T extends readonly [infer Head extends boolean, ...infer Tail extends readonly boolean[]] ? Head extends TFirst[number] ? ExtractFirstBool : ExtractFirstBool : TOut : T extends readonly [infer Head extends boolean, ...infer Tail extends readonly boolean[]] ? Head extends TFirst ? ExtractFirstBool : ExtractFirstBool : TOut; /** * Remove first elements from boolean array */ type RemoveFirstBool = TFirst extends readonly unknown[] ? T extends readonly [infer Head extends boolean, ...infer Tail extends readonly boolean[]] ? Head extends TFirst[number] ? RemoveFirstBool : RemoveFirstBool : TOut : T extends readonly [infer Head extends boolean, ...infer Tail extends readonly boolean[]] ? Head extends TFirst ? RemoveFirstBool : RemoveFirstBool : TOut; /** * Sorting logic with start elements */ type _BooleanSortWithStart, TNarrow extends readonly boolean[] = (TSeparated extends { narrow: infer N; } ? N extends readonly boolean[] ? N : [] : []), TWide extends readonly boolean[] = (TSeparated extends { wide: infer W; } ? W extends readonly boolean[] ? W : [] : []), TStart = (O["start"] extends readonly any[] ? O["start"] : [O["start"]] extends readonly [infer S] ? S : O["start"]), TStartElements extends readonly boolean[] = ExtractFirstBool, TRemainingElements extends readonly boolean[] = RemoveFirstBool, TSorted extends readonly boolean[] = ([IsEqual] extends [true] ? TRemainingElements : _SortBooleans] extends [true] ? true : false>)> = [...TStartElements, ...TSorted, ...TWide]; /** * Sorting logic with end elements */ type _BooleanSortWithEnd, TNarrow extends readonly boolean[] = (TSeparated extends { narrow: infer N; } ? N extends readonly boolean[] ? N : [] : []), TWide extends readonly boolean[] = (TSeparated extends { wide: infer W; } ? W extends readonly boolean[] ? W : [] : []), TEnd = (O["end"] extends readonly any[] ? O["end"] : [O["end"]] extends readonly [infer E] ? E : O["end"]), TEndElements extends readonly boolean[] = ExtractFirstBool, TRemainingElements extends readonly boolean[] = RemoveFirstBool, TSorted extends readonly boolean[] = ([IsEqual] extends [true] ? TRemainingElements : _SortBooleans] extends [true] ? true : false>)> = [...TSorted, ...TEndElements, ...TWide]; /** * Sorting logic with both start and end elements */ type _BooleanSortWithStartAndEnd, TNarrow extends readonly boolean[] = (TSeparated extends { narrow: infer N; } ? N extends readonly boolean[] ? N : [] : []), TWide extends readonly boolean[] = (TSeparated extends { wide: infer W; } ? W extends readonly boolean[] ? W : [] : []), TStart = (O["start"] extends readonly any[] ? O["start"] : [O["start"]] extends readonly [infer S] ? S : O["start"]), TEnd = (O["end"] extends readonly any[] ? O["end"] : [O["end"]] extends readonly [infer E] ? E : O["end"]), TStartElements extends readonly boolean[] = ExtractFirstBool, TEndElements extends readonly boolean[] = ExtractFirstBool, TEnd>, TRemainingElements extends readonly boolean[] = RemoveFirstBool, TEnd>, TSorted extends readonly boolean[] = ([IsEqual] extends [true] ? TRemainingElements : _SortBooleans] extends [true] ? true : false>)> = [...TStartElements, ...TSorted, ...TEndElements, ...TWide]; /** * **BooleanSort**`` * * Sorts a boolean based tuple `T` or containers with boolean properties. * * - by default it sorts in _ascending_ order: true, false, boolean * - DESC order: false, true, boolean (wide boolean type always last) * - any _wide_ boolean encountered will always be pushed to the * end of the sort order * - supports pinning elements to the beginning with the `first` option * - supports container/offset sorting */ type BooleanSort = IsStringLiteral$1 extends true ? T extends readonly Container[] ? [IsEqual] extends [true] ? T : [IsEqual] extends [true] ? Reverse<_SortBooleanOffset, false>> : _SortBooleanOffset, false> : never : T extends readonly boolean[] ? Length extends 0 ? T : Length extends 1 ? T : O extends { start: any; } ? O extends { end: any; } ? _BooleanSortWithStartAndEnd : _BooleanSortWithStart : O extends { end: any; } ? _BooleanSortWithEnd : _BooleanSortMain : never; //#endregion //#region src/lists/sort/NumericSort.d.ts /** * Optimized comparison using string representation to avoid Iterator recursion * This is more efficient than creating tuple arrays for comparison */ type NumLessThanOrEqual = `${A}` extends `-${string}` ? `${B}` extends `-${string}` ? StringNumCompare<`${A}`, `${B}`> extends true | "equal" ? true : false : true : `${B}` extends `-${string}` ? false : StringNumCompare<`${A}`, `${B}`> extends true | "equal" ? true : false; type NumGreaterThan = NumLessThanOrEqual extends true ? false : true; /** * String-based numeric comparison that's more efficient than Iterator approach */ type StringNumCompare = A extends B ? "equal" : A extends `-${infer ANeg}` ? B extends `-${infer BNeg}` ? StringNumCompare : true : B extends `-${string}` ? false : ComparePositive$1; type ComparePositive$1 = A extends `${infer _A1}${infer _A2}${infer _A3}${infer _A4}${infer ARest}` ? B extends `${infer _B1}${infer _B2}${infer _B3}${infer _B4}${infer BRest}` ? ComparePositive$1 : false : B extends `${infer _B1}${infer _B2}${infer _B3}${infer _B4}${infer _BRest}` ? true : A extends `${infer A1}${infer A2}${infer A3}` ? B extends `${infer B1}${infer B2}${infer B3}` ? CompareByDigits<`${A1}${A2}${A3}`, `${B1}${B2}${B3}`> : false : B extends `${infer _B1}${infer _B2}${infer _B3}` ? true : A extends `${infer A1}${infer A2}` ? B extends `${infer B1}${infer B2}` ? CompareByDigits<`${A1}${A2}`, `${B1}${B2}`> : false : B extends `${infer _B1}${infer _B2}` ? true : CompareByDigits; type CompareByDigits = A extends B ? "equal" : A extends `${infer AH}${infer AT}` ? B extends `${infer BH}${infer BT}` ? AH extends BH ? CompareByDigits : CompareDigit$2 : false : true; type CompareDigit$2 = A extends "0" ? true : A extends "1" ? B extends "0" ? false : true : A extends "2" ? B extends "0" | "1" ? false : true : A extends "3" ? B extends "0" | "1" | "2" ? false : true : A extends "4" ? B extends "0" | "1" | "2" | "3" ? false : true : A extends "5" ? B extends "0" | "1" | "2" | "3" | "4" ? false : true : A extends "6" ? B extends "0" | "1" | "2" | "3" | "4" | "5" ? false : true : A extends "7" ? B extends "0" | "1" | "2" | "3" | "4" | "5" | "6" ? false : true : A extends "8" ? B extends "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" ? false : true : A extends "9" ? B extends "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" ? false : true : false; /** * Optimized filter that uses simpler comparison */ type FilterLessThanOrEqual = TValues extends readonly [infer head extends number, ...infer tail extends readonly number[]] ? NumLessThanOrEqual extends true ? FilterLessThanOrEqual : FilterLessThanOrEqual : TOut; type FilterGreaterThan = TValues extends readonly [infer head extends number, ...infer tail extends readonly number[]] ? NumGreaterThan extends true ? FilterGreaterThan : FilterGreaterThan : TOut; /** * Optimized quicksort that uses string comparison instead of Iterator */ type _Sort = TValues extends readonly [infer head extends number, ...infer tail extends readonly number[]] ? TReverse extends true ? [..._Sort, TReverse>, head, ..._Sort, TReverse>] : [..._Sort, TReverse>, head, ..._Sort, TReverse>] : []; /** * Helper to filter containers by offset value comparison */ type FilterContainersLessThanOrEqual = TContainers extends readonly [infer Head extends Container, ...infer Tail extends readonly Container[]] ? NumLessThanOrEqual, number>, As$1, number>> extends true ? FilterContainersLessThanOrEqual : FilterContainersLessThanOrEqual : TOut; type FilterContainersGreaterThan = TContainers extends readonly [infer Head extends Container, ...infer Tail extends readonly Container[]] ? NumGreaterThan, number>, As$1, number>> extends true ? FilterContainersGreaterThan : FilterContainersGreaterThan : TOut; /** * Optimized offset sort using simpler comparisons */ type _SortOffset = TContainers extends readonly [infer Head extends Container, ...infer Rest extends readonly Container[]] ? [..._SortOffset, TOffset>, Head, ..._SortOffset, TOffset>] : []; /** * Extract first elements from numeric array */ /** * Extract elements from array T that appear in the first array, in the order they appear in first array */ type ExtractFirstNumeric = TFirst extends readonly unknown[] ? TFirst extends readonly [infer FirstHead, ...infer FirstTail] ? FirstHead extends number ? [...ExtractAllMatching, ...ExtractFirstNumeric] : ExtractFirstNumeric : TOut : T extends readonly [infer Head extends number, ...infer Tail extends readonly number[]] ? Head extends TFirst ? ExtractFirstNumeric : ExtractFirstNumeric : TOut; /** * Extract all instances of a specific value from an array */ type ExtractAllMatching = T extends readonly [infer Head extends number, ...infer Tail extends readonly number[]] ? Head extends TValue ? ExtractAllMatching : ExtractAllMatching : TOut; /** * Remove first elements from numeric array */ type RemoveFirstNumeric = TFirst extends readonly unknown[] ? T extends readonly [infer Head extends number, ...infer Tail extends readonly number[]] ? Head extends TFirst[number] ? RemoveFirstNumeric : RemoveFirstNumeric : TOut : T extends readonly [infer Head extends number, ...infer Tail extends readonly number[]] ? Head extends TFirst ? RemoveFirstNumeric : RemoveFirstNumeric : TOut; interface NumericSortOptions { /** * by default this is set to sort by _ascending_ order but this can be * reversed by changing order to `DESC` or kept in original order with `Natural`. */ order?: TOrder; /** * by default, the sorting will expect the numeric value to exist * as the base type, however, if you are using some sort of "container" * object you may prefer to _offset_ */ offset?: TOffset; /** * When left as _undefined_ the sorting is a pure ASC/DESC sort. However, * if a value is added here it indicates that any element in the array * (or its offset if the offset is set) which **equals** this value * will be pinned to the beginning. * * If the value of `start` is a tuple/array then we should pin _all/any_ * of the values in `start` to the top (in the order they are specified * in the `start` tuple). * * @default undefined */ start?: unknown; /** * When left as _undefined_ the sorting is a pure ASC/DESC sort. However, * if a value is added here it indicates that any element in the array * (or its offset if the offset is set) which **equals** this value * will be pinned to the end. * * If the value of `end` is a tuple/array then we should pin _all/any_ * of the values in `end` to the bottom (in the order they are specified * in the `end` tuple). * * @default undefined */ end?: unknown; } /** * Main sorting logic without start/end elements */ type _NumericSortMain, TSorted extends readonly number[] = ([IsEqual] extends [true] ? TNumericArray : _Sort] extends [true] ? true : false>)> = TSorted; /** * Sorting logic with start elements */ type _NumericSortWithStart, TNumericStart = (TOpt["start"] extends readonly any[] ? AsNumericArray : AsNumericArray<[TOpt["start"]]> extends readonly [infer N] ? N : TOpt["start"]), TStartElements extends readonly number[] = ExtractFirstNumeric, TRemainingElements extends readonly number[] = RemoveFirstNumeric, TSorted extends readonly number[] = ([IsEqual] extends [true] ? TRemainingElements : _Sort] extends [true] ? true : false>)> = [...TStartElements, ...TSorted]; /** * Sorting logic with end elements */ type _NumericSortWithEnd, TNumericEnd = (TOpt["end"] extends readonly any[] ? AsNumericArray : AsNumericArray<[TOpt["end"]]> extends readonly [infer N] ? N : TOpt["end"]), TEndElements extends readonly number[] = ExtractFirstNumeric, TRemainingElements extends readonly number[] = RemoveFirstNumeric, TSorted extends readonly number[] = ([IsEqual] extends [true] ? TRemainingElements : _Sort] extends [true] ? true : false>)> = [...TSorted, ...TEndElements]; /** * Sorting logic with both start and end elements */ type _NumericSortWithStartAndEnd, TNumericStart = (TOpt["start"] extends readonly any[] ? AsNumericArray : AsNumericArray<[TOpt["start"]]> extends readonly [infer N] ? N : TOpt["start"]), TNumericEnd = (TOpt["end"] extends readonly any[] ? AsNumericArray : AsNumericArray<[TOpt["end"]]> extends readonly [infer N] ? N : TOpt["end"]), TStartElements extends readonly number[] = ExtractFirstNumeric, TEndElements extends readonly number[] = ExtractFirstNumeric, TNumericEnd>, TRemainingElements extends readonly number[] = RemoveFirstNumeric, TNumericEnd>, TSorted extends readonly number[] = ([IsEqual] extends [true] ? TRemainingElements : _Sort] extends [true] ? true : false>)> = [...TStartElements, ...TSorted, ...TEndElements]; /** * **NumericSort**`` * * Sorts the values in a tuple numerically. * * - _values_ can be a `number` or `${number}` * * Options: * - `order`: defaults to `ASC` but can be set to `DESC` or `Natural` (preserves original order) * - `offset`: if you have _containers_ as values, you can specify an offset to use to look for the numeric value * - `start`: pin specific numeric values to the beginning of the sorted array * - `end`: pin specific numeric values to the end of the sorted array */ type NumericSort = IsStringLiteral$1 extends true ? TValues extends readonly Container[] ? [IsEqual] extends [true] ? TValues : [IsEqual] extends [true] ? Reverse<_SortOffset>> : _SortOffset> : never : TOpt extends { start: any; } ? TOpt extends { end: any; } ? _NumericSortWithStartAndEnd : _NumericSortWithStart : TOpt extends { end: any; } ? _NumericSortWithEnd : _NumericSortMain; //#endregion //#region src/lists/sort/Sort.d.ts type SortOrder$1 = "ASC" | "DESC" | "Natural"; type Dotpath = string; /** * **SortOptions**`<[TOrder],[TOffset],[TStart],[TEnd]>` * * Specifies how you'd like a list sorted. */ interface SortOptions { /** * the sorting strategy for the list * * @default "ASC" */ order?: SortOrder$1; /** * by adding a `DotPath` to the offset you are expressing that * the items in your list are some sort of a container and you'd * like the sorting comparison to be done on the offset/index specified. * * @default undefined */ offset?: Dotpath | undefined; /** * allows pinning items to the _start_ of the list * Can be a single value or array of values * * @default undefined */ start?: unknown; /** * allows pinning items to the _end_ of the list * Can be a single value or array of values * * @default undefined */ end?: unknown; } /** * **Sort**`` * * Sorts an array of values `TList` based on the configuration provided. * * Automatically detects the appropriate sort type based on the data: * - Pure string arrays use StringSort * - Pure number arrays use NumericSort * - Pure boolean arrays use BooleanSort * - Container arrays with offset use the type of the offset property * - Mixed type arrays fall back to StringSort with type conversion * * Supports all standard sorting options: * - `order`: ASC, DESC, Natural * - `start`/`end`: Element pinning * - `offset`: Container property sorting */ type Sort = IsStringLiteral$1 extends true ? TList extends readonly Container[] ? TList extends readonly [infer First extends Container, ...any] ? Get extends string ? StringSort : Get extends number ? NumericSort : Get extends boolean ? BooleanSort : StringSort : StringSort : StringSort : TList extends readonly string[] ? StringSort : TList extends readonly number[] ? NumericSort : TList extends readonly boolean[] ? BooleanSort : StringSort; //#endregion //#region src/lists/sort/SortByLength.d.ts /** * Returns true if A is longer than B. * We compare by stripping one char at a time. */ type IsLonger = A extends `${string}${infer ARest}` ? B extends `${string}${infer BRest}` ? IsLonger : true : false; /** Find the longest string in a readonly tuple */ type Longest$1 = T extends readonly [infer H extends string, ...infer R extends readonly string[]] ? Longest$1 extends true ? H : Curr> : Curr; /** * Remove the first occurrence of V from a readonly tuple */ type RemoveFirst$1 = T extends readonly [infer H, ...infer R] ? H extends V ? [...Acc, ...R] : RemoveFirst$1 : Acc; type Sort$1 = T["length"] extends 0 ? Acc : Longest$1 extends infer L extends string ? Sort$1, [...Acc, L]> : never; /** * **SortByLength**`` * * Sorts the elements from longest to shortest. * * - use `Reverse` utility if you want the opposite. */ type SortByLength = Sort$1; //#endregion //#region src/lists/sort/StringSort.d.ts interface StringSortOptions { order?: TOrder; offset?: TOffset; start?: unknown; end?: unknown; } /** * Convert value to string for comparison purposes */ type ToComparisonString = T extends string ? T : T extends number ? `${T}` : T extends boolean ? T extends true ? "true" : "false" : never; /** Mixed type comparison - converts to strings for comparison but handles positioning */ type MixedLessThan = A extends string | number | boolean ? B extends string | number | boolean ? StringLessThan, ToComparisonString> : true : B extends string | number | boolean ? false : false; /** Lexicographic string comparison honoring wide strings as greatest */ type StringLessThan = A extends B ? false : IsWideString extends true ? IsWideString extends true ? false : false : IsWideString extends true ? true : A extends `${infer AFirst}${infer ARest}` ? B extends `${infer BFirst}${infer BRest}` ? AFirst extends BFirst ? StringLessThan : CodePointOf extends infer AC ? CodePointOf extends infer BC ? AC extends number ? BC extends number ? LessThan : false : false : false : false : false : true; type StringGreaterThan = StringLessThan extends true ? false : A extends B ? false : true; /** * Filter values that are less than or equal to the pivot (supports mixed types) */ type FilterMixedLessThanOrEqual = TValues extends readonly [infer Head, ...infer Tail extends readonly unknown[]] ? MixedLessThan extends true ? FilterMixedLessThanOrEqual : Head extends TPivot ? FilterMixedLessThanOrEqual : FilterMixedLessThanOrEqual : TOut; /** * Filter values that are greater than the pivot (supports mixed types) */ type FilterMixedGreaterThan = TValues extends readonly [infer Head, ...infer Tail extends readonly unknown[]] ? MixedGreaterThan extends true ? FilterMixedGreaterThan : FilterMixedGreaterThan : TOut; type MixedGreaterThan = MixedLessThan extends true ? false : A extends B ? false : true; /** * Quicksort implementation for mixed types (string, number, boolean) */ type _SortMixed = TValues extends readonly [infer Head, ...infer Tail extends readonly unknown[]] ? TReverse extends true ? [..._SortMixed, TReverse>, Head, ..._SortMixed, TReverse>] : [..._SortMixed, TReverse>, Head, ..._SortMixed, TReverse>] : []; /** * Helper to filter containers by offset value comparison */ type FilterContainersStringLessThanOrEqual = TContainers extends readonly [infer Head extends Container, ...infer Tail extends readonly Container[]] ? StringLessThan, string>, As$1, string>> extends true ? FilterContainersStringLessThanOrEqual : As$1, string> extends As$1, string> ? FilterContainersStringLessThanOrEqual : FilterContainersStringLessThanOrEqual : TOut; type FilterContainersStringGreaterThan = TContainers extends readonly [infer Head extends Container, ...infer Tail extends readonly Container[]] ? StringGreaterThan, string>, As$1, string>> extends true ? FilterContainersStringGreaterThan : FilterContainersStringGreaterThan : TOut; /** * Sort containers by string offset */ type _SortStringOffset = TContainers extends readonly [infer Head extends Container, ...infer Rest extends readonly Container[]] ? [..._SortStringOffset, TOffset>, Head, ..._SortStringOffset, TOffset>] : []; /** * Partition mixed types: strings into narrow/wide, others stay as-is */ type PartitionWide = T extends readonly [infer Head, ...infer Tail extends readonly unknown[]] ? Head extends string ? IsWideString extends true ? PartitionWide : PartitionWide : PartitionWide : { narrow: TNarrow; wide: TWide; }; /** * Extract first elements from array (supports mixed types) */ type ExtractFirst = TFirst extends readonly unknown[] ? T extends readonly [infer Head, ...infer Tail extends readonly unknown[]] ? Head extends TFirst[number] ? ExtractFirst : ExtractFirst : TOut : T extends readonly [infer Head, ...infer Tail extends readonly unknown[]] ? Head extends TFirst ? ExtractFirst : ExtractFirst : TOut; /** * Remove first elements from array (supports mixed types) */ type RemoveFirst = TFirst extends readonly unknown[] ? T extends readonly [infer Head, ...infer Tail extends readonly unknown[]] ? Head extends TFirst[number] ? RemoveFirst : RemoveFirst : TOut : T extends readonly [infer Head, ...infer Tail extends readonly unknown[]] ? Head extends TFirst ? RemoveFirst : RemoveFirst : TOut; /** * **StringSort**`` * * Sorts a string based tuple `T` or containers with string properties. * * - by default it sorts in ascending order; set `order` to `DESC` for descending or `Natural` to preserve original order * - wide string types are always pushed to the end * - supports pinning with `start` and `end` * - supports container/offset sorting */ type StringSort = IsStringLiteral$1 extends true ? T extends readonly Container[] ? (O extends { order: infer Ord; } ? Ord : undefined) extends infer OOrder ? [IsEqual] extends [true] ? T : [IsEqual] extends [true] ? Reverse<_SortStringOffset>> : _SortStringOffset> : never : never : T extends readonly (string | number | boolean)[] ? Length extends 0 ? T : Length extends 1 ? T : O extends { start: unknown; } ? O extends { end: unknown; } ? _StringSortWithStartAndEnd : _StringSortWithFirst : O extends { end: unknown; } ? _StringSortWithEnd : _StringSortMain : never; /** * Main sorting logic without first elements */ type _StringSortMain, TNatural extends readonly unknown[] = (TPart extends { narrow: infer N; wide: infer W; } ? N extends readonly unknown[] ? W extends readonly unknown[] ? [...N, ...W] : N : [] : []), TSorted extends readonly unknown[] = ([IsEqual] extends [true] ? TNatural : _SortMixed] extends [true] ? true : false>)> = TSorted; /** * Sorting logic with first elements */ type _StringSortWithFirst, TRemainingElements extends readonly unknown[] = RemoveFirst, TPart = PartitionWide, TNatural extends readonly unknown[] = (TPart extends { narrow: infer N; wide: infer W; } ? N extends readonly unknown[] ? W extends readonly unknown[] ? [...N, ...W] : N : [] : []), TSorted extends readonly unknown[] = ([IsEqual] extends [true] ? TNatural : _SortMixed] extends [true] ? true : false>)> = [...TStartElements, ...TSorted]; /** * Sorting logic with end elements */ type _StringSortWithEnd, TRemainingElements extends readonly unknown[] = RemoveFirst, TPart = PartitionWide, TNatural extends readonly unknown[] = (TPart extends { narrow: infer N; wide: infer W; } ? N extends readonly unknown[] ? W extends readonly unknown[] ? [...N, ...W] : N : [] : []), TSorted extends readonly unknown[] = ([IsEqual] extends [true] ? TNatural : _SortMixed] extends [true] ? true : false>)> = [...TSorted, ...TEndElements]; /** * Sorting logic with both start and end elements */ type _StringSortWithStartAndEnd, TEndElements extends readonly unknown[] = ExtractFirst, TEnd>, TRemainingElements extends readonly unknown[] = RemoveFirst, TEnd>, TPart = PartitionWide, TNatural extends readonly unknown[] = (TPart extends { narrow: infer N; wide: infer W; } ? N extends readonly unknown[] ? W extends readonly unknown[] ? [...N, ...W] : N : [] : []), TSorted extends readonly unknown[] = ([IsEqual] extends [true] ? TNatural : _SortMixed] extends [true] ? true : false>)> = [...TStartElements, ...TSorted, ...TEndElements]; //#endregion //#region src/lists/SortByKey.d.ts /** * default options for sorting */ interface SortByKeyOptions { /** Object Key's that should be pinned to the start of the array */ start?: T | readonly T[]; /** Object keys's that should be pinned to the end of the array */ end?: T | readonly T[]; order?: SortOrder; } type ToArray = T extends readonly unknown[] ? T : readonly [T]; type SortByKey = TList extends readonly any[] ? Mutable<_SortByKey> : TList; type _SortByKey = _Reorder : readonly [], TConfig["end"] extends any ? ToArray : readonly []>; type _Reorder = readonly [..._GetStartElements, ..._GetMiddleElements, ..._GetEndElements]; type _GetStartElements = TStart extends readonly [infer First, ...infer Rest] ? [..._FilterByValue, ..._GetStartElements] : []; type _GetEndElements = TEnd extends readonly [infer First, ...infer Rest] ? [..._FilterByValue, ..._GetEndElements] : []; type _GetMiddleElements = _FilterByValues; type _FilterByValue = TList extends readonly [infer First, ...infer Rest extends object[]] ? First extends object ? TKey extends keyof First ? First[TKey] extends TValue ? readonly [First, ..._FilterByValue] : _FilterByValue : _FilterByValue : _FilterByValue : []; type _FilterByValues = TList extends readonly [infer First, ...infer Rest extends object[]] ? First extends object ? TKey extends keyof First ? First[TKey] extends TValues[number] ? _FilterByValues : [First, ..._FilterByValues] : [First, ..._FilterByValues] : [First, ..._FilterByValues] : []; //#endregion //#region src/lists/TakeFirst.d.ts type Take$9 = TDepth["length"] extends TLen ? TResult : number extends TLen ? TContent : TDepth["length"] extends 64 ? TResult : [] extends TContent ? TResult : TContent extends readonly [infer Head, ...infer Tail] ? Take$9 : TResult; type CountOptionalInFirstN = number extends N ? number : GetRequiredElementCount extends infer Req extends number ? GetOptionalElementCount extends infer Opt extends number ? Subtract extends infer Delta extends number ? IsLessThan extends true ? 0 : Min$1<[Opt, Delta]> : 0 : 0 : 0; /** * **TakeFirst**`` * * Takes the first `TLen` items from `TContent` and discards the rest. * * **Note:** * - if `TLen` is larger then the number of elements left in * `TContent` then only the remaining elements will be returned. */ type TakeFirst> = HasOptionalElements extends true ? AllOptionalElements extends true ? Partial> : number extends TLen ? TContent : Take$9 extends infer FirstN extends readonly unknown[] ? CountOptionalInFirstN extends infer Optional extends number ? MakeOptional : never : never : Take$9; //#endregion //#region src/lists/TakeLast.d.ts /** * **TakeLast**`` * * Takes the last `TLen` items from `TContent` and discards the rest. * * Note: * - by default if `TLen` is larger than the size of `TContent` this * is fine and instead of getting precisely `TLen` elements you'll get */ type TakeLast> = HasOptionalElements extends true ? MakeOptional, TLen>> extends readonly unknown[] ? Reverse, TLen>> : [], As$1, TLen]>, number>> : Reverse, TLen>>; //#endregion //#region src/lists/ToCSV.d.ts type Process$64 = T extends [infer Head, ...infer Rest] ? Process$64}` : `${TResult},${AsString}`> : StripLeading; /** * **ToCSV**`` * * Converts a tuple into a CSV string. For any elements * in the tuple which are strings the `,` character will * be replaced with the value of `TReplace` (which defaults * to ``). * * @deprecated use `ToCsv` instead */ type ToCSV = Process$64; /** * **ToCsv**`` * * Converts a tuple into a CSV string. For any elements * in the tuple which are strings the `,` character will * be replaced with the value of `TReplace` (which defaults * to ``). */ type ToCsv = Process$64; //#endregion //#region src/lists/TruthyReturns.d.ts /** * **TruthyReturns**`` * * Given a known Tuple, this utility will return a _union_ type * that represents the _[truthiness](https://frontend.turing.edu/lessons/module-1/js-truthy-falsy-expressions.html)_ * of each element; where: * * - functions are evaluated by their _return type_ * - non-functions are evaluated directly * * **Note:** `true` and `false` will be returned where possible but in cases where * a type can't be evaluated at design time then `boolean` will be returned. * * **See Also**: `ReturnTypes` and `LogicalReturns` */ type TruthyReturns = TupleToUnion<{ [K in keyof T]: T[K] extends TypedFunction ? If>, true, false, boolean> : If, true, false, boolean> }>; //#endregion //#region src/lists/TypeOfArray.d.ts /** * **TypeOfArray**`` * * Determines the _type_ of a wide array type. * * ### Example * ```ts * // string * type T = TypeOfArray; * // string | number * type U = TypeOfArray<(string | number)[]>; * ``` * * **Note:** * - tuples passed into this utility will return `never`! * - however, types such as `["foo", ...string[]]`, are not * tuples and are allowed. * */ type TypeOfArray = IsTuple extends true ? never : T extends (infer Type)[] ? Type : never; //#endregion //#region src/lists/UnionFromProp.d.ts /** * Tests whether any of the object in T are explicitly missing * the property P */ type HasMissingInstance = [] extends T ? false : P extends keyof First$1 ? HasMissingInstance, P> : true; /** * removes objects that do not have the property P */ type RemoveMissing = [] extends T ? R[number] : RemoveMissing, P, P extends keyof First$1 ? [...R, First$1] : R>; /** * **UnionFromProp** * * Given an array of objects `` and a property value `

`, this utility will * return a _union type_ of all the potential values of the objects which have * a keyof `P`. * * If an object in the array _explicitly_ doesn't have the prop in it's definition * then it is ignored, if it is shaped to be an optional property then `undefined` * will be included in the union. * * ```ts * const data = [ * { id: 123, color: "blue" }, * { id: 456, color: "red" }, * ] as const; * // 123 | 456 * type U = UnionFromProp; * ``` */ type UnionFromProp = HasMissingInstance extends true ? Get, P> | undefined : Get; //#endregion //#region src/lists/Variadic.d.ts /** Does T have at least one fixed (non-variadic) element? */ type HasFixedHead = Exclude extends never ? false : true; /** * **SplitAtVariadic**`` * * Split T into: * - Prefix: whatever remains after removing the maximal fixed suffix * - Suffix: the maximal fixed suffix (elements guaranteed to be present at the end) * * For example: * - SplitAtVariadic<[...string[], 1, 2]> -> [[...string[]], [1, 2]] * - SplitAtVariadic<[1, ...string[], 2]> -> [[1, ...string[]], [2]] * - SplitAtVariadic<[1, 2]> -> [[], [1, 2]] * - SplitAtVariadic -> [string[], []] */ type SplitAtVariadic = Depth["length"] extends 30 ? [T, Acc] : T extends readonly [...infer P, infer L] ? SplitAtVariadic : [T, Acc]; /** * **HasVariadicTail**`` * * Boolean operator which tests whether the tuple `T` concludes with * a _variadic_ type. * * - **Note**: while all wide type arrays like `number[]` or even `[...number[]]` ( * which coincidentally are the same type) are by nature _variadic_. This utility, * however, will return `false` for wide types so we can isolate only literal types * that have variadic tails. * * **Related:** * - `HasVariadicHead`, `HasVariadicInterior`, `IsVariadicArray` * - `VariadicType`, `GetNonVariadicLength` */ type HasVariadicTail = [IsAny] extends [true] ? false : [IsNever] extends [true] ? false : IsVariadicArray extends true ? HasFixedHead extends true ? SplitAtVariadic extends [...any[], []] ? true : false : false : false; /** * **HasVariadicHead**`` * * Tests whether if `T` starts with a variadic type with a fixed * type at the end. * * - **Note**: while all wide type arrays like `number[]` or even `[...number[]]` ( * which coincidentally are the same type) are by nature _variadic_. This utility, * however, will return `false` for wide types so we can isolate only literal types * that have variadic tails. * * **Related:** * - `HasVariadicTail`, `HasVariadicInterior`, `IsVariadicArray` * - `VariadicType`, `GetNonVariadicLength` */ type HasVariadicHead = [IsAny] extends [true] ? false : [IsNever] extends [true] ? false : IsVariadicArray extends true ? HasFixedHead extends true ? false : SplitAtVariadic extends [...unknown[], []] ? false : true : false; /** * **HasVariadicInterior**`` * * tests whether `T` has a _variadic_ element in the _interior_ of * the array. * * **Related:** `HasVariadicHead`, `HasVariadicTail`, `IsVariadicArray` */ type HasVariadicInterior = [IsAny] extends [true] ? false : [IsNever] extends [true] ? false : IsVariadicArray extends true ? Not, HasVariadicTail]>> extends true ? SplitAtVariadic extends [...unknown[], []] ? false : true : false : false; /** * **AllOptionalElements** * * Boolean operator which detects whether `T`'s elements are ALL designed as optional (e.g., marked with the * `?` modifier). * * **Related:** `HasOptionalElements` */ type AllOptionalElements = IsEqual, T>; /** * **GetNonVariadicLength**`` * * Determines the length of the tuple when the variadic tail has been stripped off. * * - if `T` is not variadic then this will simply report the length of the tuple` * - _optional_ elements (e.g., marked with the `?` modifier) are always included in the length */ type GetNonVariadicLength = Depth["length"] extends 25 ? F["length"] : [] extends Required ? F["length"] : Required> extends [infer Explicit, ...infer REST] ? GetNonVariadicLength : F["length"]; /** * **NonVariadicRequired**`` * * Get's the elements which have a fixed value (aka, are not * _variadic_) as well as are "required" (aka, no `?` modifier used) */ type NonVariadicRequired = Depth["length"] extends 25 ? F["length"] : [] extends T ? F["length"] : Mutable extends [infer Explicit, ...infer REST] ? NonVariadicRequired : F["length"]; /** * **GetRequiredElementCount**`` * * counts only the **required** elements of `T` * * **Related:** `GetOptionalElementCount`, `TupleMeta` */ type GetRequiredElementCount = NonVariadicRequired; /** * **GetOptionalElementCount**`` * * counts only the **optional** elements of `T` (e.g., those with the `?` modifier). * * **Related:** `GetRequiredElementCount`, `TupleMeta`, `MakeOptional` */ type GetOptionalElementCount = T extends readonly unknown[] ? T["length"] extends number ? GetNonVariadicLength extends infer NonVarLen extends number ? GetRequiredElementCount extends infer ReqLen extends number ? Subtract : 0 : 0 : 0 : never; /** * **ExtractOptionalElements**`` * * returns a tuple of the **optional** elements found in `T` * * ```ts * // [ string?, number? ] * type Test = ExtractOptionalElements<[1,42, string?, number?]>; * ``` * * **Related:** `ExtractRequiredElements`, `ExtractOptionalKeys` */ type ExtractOptionalElements>, readonly unknown[]>> = R extends readonly [...FixedLengthArray>, ...infer Rest] ? Partial : []; type ExtractOptionalKeys>, readonly unknown[]>> = NumericRange>, R["length"]>; type ExtractRequiredElements>, readonly unknown[]>> = R extends readonly [...infer Leading, ...FixedLengthArray>] ? Leading : []; /** * **DropVariadicTail**`` * * Removes the variadic tail found on the tuple `T`. * * - if no variadic tuple is found on `T` then it is just passed through * as is * * ```ts * // [ string, number? ] * type Test = ExcludeVariadicTail<[string, number?, ...string[]]>; * ``` */ type DropVariadicTail = HasVariadicTail extends true ? GetNonVariadicLength extends infer Len extends number ? SliceArray : T : T; /** * **IsVariadicArray**`` * * Boolean operator which determines if this tuple/array is variadic. * * - unlike some other utilities, this does not distinguish between * variadic arrays with fixed type elements versus **wide** array types; * both will return `true` */ type IsVariadicArray = number extends T["length"] ? true : false; /** * **DropVariadicHead**`` * * Removes the variadic head found on the tuple `T`. * * - if no variadic head is found on `T` then it is just passed through * * ```ts * // [ string, number? ] * type Test = ExcludeVariadicHead<[...string[], string, number?]>; * ``` */ type DropVariadicHead = SplitAtVariadic extends [infer Prefix extends readonly unknown[], infer Suffix extends readonly unknown[]] ? IsVariadicArray extends true ? HasFixedHead extends false ? Suffix : T : T : never; /** * **DropVariadic**`` * * Drops any variadic element found in `T` while retaining all the fixed length * elements. * * - if `T` has no variadic elements then it will be returned "as is" * * ```ts * // [1,2,3] * type Test = DropVariadic<[1,2,3, ...string[]]>; * ``` * * **Related:** `DropVariadicHead`, `DropVariadicTail`, `IsVariadicArray` */ type DropVariadic = IsVariadicArray extends false ? T : HasVariadicHead extends true ? DropVariadicHead : HasVariadicTail extends true ? DropVariadicTail : HasVariadicInterior extends true ? SplitAtVariadic extends [...infer Head, ...infer Tail] ? IsVariadicArray extends true ? Tail extends readonly unknown[] ? Tail : never : IsVariadicArray extends true ? Head extends readonly unknown[] ? Head : never : T : T : T; /** * **VariadicType**`` * * Returns the element type of a tuple's variadic tail. * * - Returns `never` if the tuple has no variadic tail * - For tuples with variadic tails like `[1, 2, ...number[]]`, returns the element type (`number`) * - Empty tuples and tuples with only optional elements return `never` * - Wide array types like `string[]`, or `number[]` -- _which are innately variadic types_ -- will correctly * report their variadic type as `string`, `number`, etc. * * **Related:** `GetNonVariadicLength`, `NonVariadic`, `VariadicType` */ type VariadicType = IsVariadicArray extends true ? HasVariadicHead extends true ? DropVariadicHead extends infer DroppedHead extends readonly unknown[] ? R extends readonly [...infer Head, ...DroppedHead] ? Head : never : never : HasVariadicTail extends true ? DropVariadicTail extends infer DroppedTail extends readonly unknown[] ? R extends readonly [...DroppedTail, ...infer Tail] ? Tail : never : never : never : never; //#endregion //#region src/boolean-logic/operators/containers/IsEmptyArray.d.ts /** * Boolean operator which tests `T` for whether it is an array * with zero elements. * * - if `T` is a wide array it will return `boolean` */ type IsEmptyArray = T extends any[] ? number extends T["length"] ? GetNonVariadicLength extends 0 ? boolean : false : T["length"] extends 0 ? true : false : false; //#endregion //#region src/boolean-logic/operators/containers/IsEmptyObject.d.ts /** * **IsEmptyObject**`` * * - T must be an object (but not a function and not an array/tuple) * - T must expose **no known keys** (`keyof T` is `never`) * - `any`, `unknown`, and `never` are rejected */ type IsEmptyObject = IsAny extends true ? false : IsNever extends true ? false : IsNull extends true ? false : IsUndefined extends true ? false : T extends AnyFunction ? false : IsObject extends true ? ObjectKeys extends readonly PropertyKey[] ? TupleMeta>["isEmpty"] : false : false; //#endregion //#region src/boolean-logic/operators/containers/IsIterable.d.ts type Process$63 = T extends Generator ? true : T extends Map ? true : T extends WeakMap ? true : T extends Set ? true : T extends readonly any[] ? true : T extends Dictionary ? Contains, Iterator> extends true ? true : false : false; /** * **IsIterable**`` * * Boolean operator which tests whether `T` is iterable. */ type IsIterable = IsNever extends true ? TNever : T extends Container ? Process$63 : false; //#endregion //#region src/boolean-logic/operators/containers/IsNonEmptyObject.d.ts /** * **IsNonEmptyObject**`` * * Boolean type util which detects whether `T` _is_ an object * and _has at least one property_. * * **Note:** this will report **false** for`ExplicitlyEmptyObject` but * not `EmptyObject` * * **Related:** `IsEmptyObject` */ type IsNonEmptyObject = T extends AnyObject ? IsEqual extends true ? false : Keys$1>["length"] extends 0 ? false : IsNumericLiteral>["length"]> extends true ? true : false : false; //#endregion //#region src/boolean-logic/operators/containers/IsObject.d.ts /** * **IsObject**`` * * Boolean operator which tests whether `T` extends `object` in a non-nullable fashion. */ type IsObject = [IsAny] extends [true] ? false : [IsNever] extends [true] ? false : [IsNull] extends [true] ? false : [IsUndefined] extends [true] ? false : T extends object ? true : false; //#endregion //#region src/boolean-logic/operators/containers/IsReadonlyArray.d.ts /** * **IsReadonlyArray**`` * * Boolean type utility which detects whether `T` is a readonly array. */ type IsReadonlyArray = T extends unknown[] ? false : T extends readonly unknown[] ? true : false; //#endregion //#region src/boolean-logic/operators/containers/IsReadonlyObject.d.ts /** * **IsReadonlyObject**`` * * Boolean operator which tests whether `T` is a _readonly * object_. This is defined as an object where all properties * are readonly. * * - Note: objects with no properties return `false` */ type IsReadonlyObject = T extends Dictionary ? IsEqual, keyof T> : false; //#endregion //#region src/boolean-logic/operators/containers/IsSameContainerType.d.ts /** * test that `A` and `B` are both a Dictionary object or both are an array */ type IsSameContainerType = Or<[And<[IsDictionary, IsDictionary]>, And<[IsArray, IsArray]>]>; //#endregion //#region src/boolean-logic/operators/containers/IsValidIndex.d.ts type HasPositiveIndex = TDepth["length"] extends TKey ? TContainer extends readonly [unknown, ...readonly unknown[]] ? true : false : TContainer extends readonly [unknown, ...infer Rest] ? HasPositiveIndex : false; type HasNegativeIndex = TDepth["length"] extends TKey ? TContainer extends readonly [unknown, ...readonly unknown[]] ? true : false : TContainer extends readonly [unknown, ...infer Rest] ? HasNegativeIndex : false; type PositiveIndexOf = `${T}` extends `-${infer N extends number}` ? N : never; /** * **IsValidIndex**`` * * Provides a boolean check on whether `TKey` is a valid key for `TContainer`. * * - valid responses are `true` or `false` if literal types found; otherwise `boolean` * - negative indexes are allowed when `TContainer` is a tuple */ type IsValidIndex = TContainer extends Tuple$1 ? IsTuple extends true ? TKey extends number ? number extends TKey ? boolean : `${TKey}` extends `-${string}` ? PositiveIndexOf extends infer Positive extends number ? Positive extends 0 ? false : HasNegativeIndex : false : HasPositiveIndex : false : boolean : TContainer extends Dictionary ? IsEqual extends true ? false : [IsLiteralLikeObject] extends [true] ? [IsStringLiteral$1] extends [true] ? [TKey] extends [keyof TContainer] ? true : false : [TKey] extends [symbol] ? [TKey] extends [keyof TContainer] ? true : false : false : boolean : false; //#endregion //#region src/boolean-logic/operators/containers/KeysOverlap.d.ts type Process$62 = [] extends K ? false : First$1 extends keyof O ? true : Process$62, O>; /** * **KeysOverlap**`` * * Boolean operator which tests whether two objects -- `A` and `B` -- have * overlapping keys. */ type KeysOverlap = EmptyObject extends A ? boolean : EmptyObject extends B ? boolean : And<[IsLiteralLikeObject, IsLiteralLikeObject]> extends true ? ObjectKeys extends readonly ObjectKey[] ? Process$62, B> : never : boolean; //#endregion //#region src/boolean-logic/operators/datetime/IsAfter.d.ts type IsSameDateDifferentPrecision$1 = A extends `${infer DatePart}T00:00:00Z` ? B extends DatePart ? true : false : B extends `${infer DatePart}T00:00:00Z` ? A extends DatePart ? true : false : false; type IsCharGreater$1 = A extends "0" ? false : A extends "1" ? B extends "0" ? true : false : A extends "2" ? B extends "0" | "1" ? true : false : A extends "3" ? B extends "0" | "1" | "2" ? true : false : A extends "4" ? B extends "0" | "1" | "2" | "3" ? true : false : A extends "5" ? B extends "0" | "1" | "2" | "3" | "4" ? true : false : A extends "6" ? B extends "0" | "1" | "2" | "3" | "4" | "5" ? true : false : A extends "7" ? B extends "0" | "1" | "2" | "3" | "4" | "5" | "6" ? true : false : A extends "8" ? B extends "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" ? true : false : A extends "9" ? B extends "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" ? true : false : A extends ":" ? B extends "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" ? true : false : A extends "T" ? B extends "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" | "-" | ":" ? true : false : A extends "Z" ? B extends "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" | "-" | ":" | "T" ? true : false : A extends "-" ? B extends "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" ? true : false : false; type LexicographicCompare$1 = A extends B ? false : IsSameDateDifferentPrecision$1 extends true ? false : [A] extends [never] ? false : [B] extends [never] ? false : [A, B] extends [string, string] ? A extends `${infer AFirst}${infer ARest}` ? B extends `${infer BFirst}${infer BRest}` ? AFirst extends BFirst ? LexicographicCompare$1 : IsCharGreater$1 : true : false : false; /** * **IsAfter**`` * * Tests whether `A` is _after_ (in time) `B`. * * Preserves literal types by using string comparison for ISO date strings. * For wide types or complex dates, it returns boolean. */ type IsAfter = A extends object ? boolean : B extends object ? boolean : string extends A ? boolean : string extends B ? boolean : number extends A ? boolean : number extends B ? boolean : A extends number ? B extends number ? IsGreaterThan : boolean : A extends string ? B extends string ? LexicographicCompare$1 : boolean : boolean; //#endregion //#region src/interpolation/ApplyTemplate.d.ts type ToBaseType$1 = { [K in keyof T]: T[K] extends NumberLike ? AsNumber : T[K] extends BooleanLike ? AsBoolean : T[K] }; type Finalize$1 = TOnlyStringLit extends true ? [TContent, ...TApplied] : [TContent, ...ToBaseType$1]; type Apply$1 = [] extends TStatic ? TResults : TStatic extends readonly [infer Head extends string, infer Next extends string, ...infer Rest extends string[]] ? Apply$1, Next>]> : TStatic extends readonly [infer Head extends string] ? [...TResults, RetainAfter] : TResults; /** * **ApplyTemplate**`` * * If the content found in `TContent` is a match for `TTemplate`, then * the type returned will be the dynamic segments defined in the template. * * Alternatively, if `TContent` _does not_ match the dynamic segments * defined in `TTemplate` then a **invalid-content** error will be returned. * * Returns a tuple of the format: * * - [ full, p1, p2, p3, ... ] */ type ApplyTemplate = IsStringLiteral$1 extends true ? FromLiteralTemplate extends infer Template extends string ? Finalize$1>, TOnlyStringLit> : never : string; //#endregion //#region src/interpolation/AsLiteralTemplate.d.ts type Convert$11> = TKeys extends [infer Head extends string & keyof TSegments, ...infer Rest extends readonly string[]] ? [FromInputToken__String>] extends [string | number | boolean] ? Convert$11>}`>, TSegments, Rest> : TContent extends `{{${Head}}}` ? FromInputToken__String> : Err<`invalid-type/template`, `The segment '{{${Head}}}' was configured as a type which can not be embedded inside of a string literal!`, { segment: Head; invalidType: FromInputToken__String>; content: TContent; }> : TContent; /** * **AsLiteralTemplate**`` * * Converts Static Template sections to a Literal Template */ type AsLiteralTemplate = TContent extends number ? `${TContent}` : TContent extends string ? TContent extends `{{${infer Inner extends string}}}` ? Inner extends keyof TSegments ? FromInputToken__String> : Convert$11 : Convert$11 : never; //#endregion //#region src/interpolation/AsStaticTemplate.d.ts type NoBooleanConversion = Err<`invalid-string/boolean-literal`, `An attempt was made to convert a string from a "literal template" to a "static template" but the use of ${boolean} converts to a union type and quickly becomes unmanageable. Use the static {{boolean}} form instead.`, { template: T; }>; type RestoreVocabularyPlaceholders = TContent extends `${infer Before}${"$"}{${infer Name}}${infer After}` ? Name extends Extract ? RestoreVocabularyPlaceholders<`${Before}{{${Name}}}${After}`, TSegments> : `${Before}${"$"}{${Name}}${RestoreVocabularyPlaceholders}` : TContent; type HasVocabularyPlaceholder = TContent extends `${string}${"$"}{${string}}${string}` ? true : false; /** * **FromLiteralTemplate**`` * * Converts a string literal type into a Static Template where: * * - `${string}` is `{{string}}` * - `${number}` is `{{number}}` * - the `${boolean}` literal will produce a union and is too expensive to try and * capture so instead we'll return an error. * * This type utility is the _inverse_ of `StringLiteralTemplate`. */ type FromLiteralTemplate = string extends T ? string | Error : IsUnion extends true ? NoBooleanConversion : ReplaceStringInterpolation, "{{string}}">; type Convert$10> extends readonly string[] ? UnionToTuple> : [])> = TKeys extends [infer Head extends string, ...infer Rest extends readonly string[]] ? Convert$10, TSegments, Rest> : TContent; /** * **AsStaticTemplate**`` * * Converts a string literal type into a Static Template where: * * - `${string}` is `{{string}}` * - `${number}` is `{{number}}` * - the `${boolean}` literal will produce a union and is too expensive to try and * capture so instead we'll throw an error. * * In addition you can optionally add a **template map** which will allow for additional * vocabulary to be used. There are a few pre-configured maps: * * - `TemplateMap__Basics` - this is the default of strings, numbers, and booleans * - `TemplateMap__Generics` - an easy way to allow for generic params to included */ type AsStaticTemplate = As$1 extends true ? HasVocabularyPlaceholder extends true ? RestoreVocabularyPlaceholders : Convert$10, string>, TSegments> : Convert$10, string>, TSegments>, string>; //#endregion //#region src/interpolation/AsTemplateBlock.d.ts /** * **AsTemplateType** * * Converts a static template block tag into the _type_ which will go into * this dynamic segment. * * **Related:** `AsTemplateTypes` */ type AsTemplateType = [T] extends [`{{string}}`] ? string : [T] extends [`{{number}}`] ? number : [T] extends [`{{boolean}}`] ? boolean : never; /** * **AsTemplateTypes**`` * * Converts all elements in `T` from template block tags to the underlying * types that these tags represent. * * **Related:** `AsTemplateType` */ type AsTemplateTypes = { [K in keyof T]: T[K] extends DefaultTemplateBlocks ? AsTemplateType : never }; //#endregion //#region src/interpolation/IntoTemplate.d.ts /** * Process args array helper */ type NextArg = T extends readonly [unknown, ...infer Rest] ? Rest : T; type FirstArg = T extends readonly [infer First, ...unknown[]] ? First : never; /** * Process template character by character, replacing placeholders in order */ type ProcessTemplate = TContent extends `${infer First}${infer Rest}` ? [IsEqual] extends [true] ? TArgs extends readonly [unknown, ...unknown[]] ? ProcessTemplate, `${TResult}${FirstArg & (string | number | boolean)}`> : ProcessTemplate : [IsEqual] extends [true] ? TArgs extends readonly [unknown, ...unknown[]] ? ProcessTemplate, `${TResult}${FirstArg & (string | number | boolean)}`> : ProcessTemplate : [IsEqual] extends [true] ? TArgs extends readonly [unknown, ...unknown[]] ? ProcessTemplate, `${TResult}${FirstArg & (string | number | boolean)}`> : ProcessTemplate : ProcessTemplate : [TContent] extends [""] ? TResult : [IsEqual] extends [true] ? TArgs extends readonly [unknown, ...unknown[]] ? `${TResult}${FirstArg & (string | number | boolean)}` : `${TResult}${TContent}` : [IsEqual] extends [true] ? TArgs extends readonly [unknown, ...unknown[]] ? `${TResult}${FirstArg & (string | number | boolean)}` : `${TResult}${TContent}` : [IsEqual] extends [true] ? TArgs extends readonly [unknown, ...unknown[]] ? `${TResult}${FirstArg & (string | number | boolean)}` : `${TResult}${TContent}` : `${TResult}${TContent}`; /** * **IntoTemplate**`` * * Takes a template literal type and a tuple of values, and returns the * interpolated string literal type. * * This implementation processes template literals in left-to-right order, * correctly matching template placeholders to arguments sequentially. * * ```ts * // "Hello World!" * type Result = IntoTemplate<`Hello ${string}!`, ["World"]>; * // "Age: 42" * type Age = IntoTemplate<`Age: ${number}`, [42]>; * // "Bob is 45 years old and his favorite color is blue." * type Complex = IntoTemplate<`${string} is ${number} years old and his favorite color is ${string}.`, ["Bob", 45, "blue"]>; * ``` */ type IntoTemplate> = TArgs extends readonly unknown[] ? ProcessTemplate : never; //#endregion //#region src/dictionary/AddKeyValue.d.ts /** * **AddKeyValue**`` * * Extends the object `TObj` to include the new KV pair of `TKey` * and `TVal`. * * Any attempt to _override_ an existing key in `TObj` will result * in an **ErrorCondition< "duplicate-key" >**. Use the `UpsertKeyValue` utility if * you want this condition to result in an overwrite. */ type AddKeyValue = If>, K>, Err<"duplicate-key", Concat<["The object passed into AddKeyValue already has the key '", ToString, "'. This is not allowed. If you intended this then consider using UpsertKeyValue instead."]>>, SimplifyObject>>; //#endregion //#region src/dictionary/CamelKeys.d.ts type Convert$9 = [] extends TKeys ? ExpandDictionary : Convert$9, First$1 extends string ? (Record>, TObj[First$1] extends Dictionary ? CamelKeys]> : TObj[First$1]> & TResult) : Record, TObj[First$1]> & TResult>; type Process$61 = CamelCase> extends infer _CC extends readonly ObjectKey[] ? Convert$9, readonly (ObjectKey & keyof T)[]>> : never; /** * Converts an object's keys to the **camelCase** equivalent * while keeping the values the same. */ type CamelKeys = Process$61> extends infer CamelDict extends Dictionary ? OptionalKeysTuple extends infer OptKeys extends readonly ObjectKey[] ? { [K in keyof OptKeys]: OptKeys[K] extends string ? CamelCase : OptKeys[K] } extends infer OptKeys extends readonly ObjectKey[] ? MakeKeysOptional : never : never : never; //#endregion //#region src/dictionary/CombinedKeys.d.ts /** * **CombinedKeys**`` * * Provides a tuple of unique keys which incorporate all key values across * both `A` and `B`. * * ```ts * // [ "foo", "bar", "baz", "bax" ] * type T = CombinedKeys<{foo: 1; bar: 2; baz: 3}, {bar: 4; baz: 5; bax: 6}> * ``` */ type CombinedKeys = Unique<[...(IsLiteralLike extends true ? Keys$1 : []), ...(IsLiteralLike extends true ? Keys$1 : [])]>; //#endregion //#region src/dictionary/ConstrainObject.d.ts /** * Helper type to infer narrow types while constraining to a broad type. */ type ConstrainObject = { [K in keyof TConstraint]: K extends keyof TObj ? TObj[K] & TConstraint[K] : never }; type ConstrainedObjectCallback = (cb: (input: ConstrainObject) => TReturn) => (input: ConstrainObject) => TReturn; /** * A function which will accept any object that meets the * defined constraint and will extract a narrow type from it. * * **Related:** `narrowObjectTo` */ interface ConstrainedObjectIdentity { (input: T & ConstrainObject): T; asCallback: ConstrainedObjectCallback; } //#endregion //#region src/dictionary/CreateKV.d.ts type Process$60 = [] extends TKeys ? TObj : Process$60, TValue, TObj & Record, TValue>>; /** * **CreateKV**`` * * Creates a key value pair with the keys passed in * as `TKeys` and with all properties set to the value * of `TValue` (which defaults to `unknown`) */ type CreateKV = ExpandRecursively>; //#endregion //#region src/dictionary/CreateLookup.d.ts type Process$59[], TKeyProp extends string, TValProp extends string, TOutput extends Record = NonNullable> = [] extends TPayload ? TOutput : TKeyProp extends keyof First$1 ? TValProp extends keyof First$1 ? Process$59, TKeyProp, TValProp, First$1[TKeyProp] extends ObjectKey ? TOutput & Record[TKeyProp], First$1[TValProp]> : TOutput & Record[TKeyProp]>, First$1[TValProp]>> : Process$59, TKeyProp, TValProp, TOutput> : Process$59, TKeyProp, TValProp, TOutput>; /** * **CreateLookup** * * Creates a dictionary lookup from a Tuple of similarly typed objects. */ type CreateLookup[], TKeyProp extends string, TValProp extends string> = ExpandRecursively>; //#endregion //#region src/dictionary/DefaultOptions.d.ts /** * **DefaultOptions**`` * * By providing a shape for an options hash in `TFor`, you can then define * the `Required` variant with type appropriate default values. * * The return type is **explicitly** of `Required` in intersection with * the literal values provided. */ type DefaultOptions> = TDef & Required; //#endregion //#region src/dictionary/DictChangeValue.d.ts /** * Allow a dictionary to have it's value's type changed to `T` while maintaining the keys in * the original object `I` so long as the original value for the KV pair extends `V`. * * If `V` is not specified then it defaults to _any_ and therefore all KVs are preserved. * * ```ts * type Obj = { foo: "hello", bar: 42, baz: () => "world" }; * // { foo: number, bar: number, baz: number }; * type AllNumbers = DictChangeValue; * // { foo: number } * type StringToBool = DictChangeValue * ``` */ type DictChangeValue< /** the object who's value-type we're changing */I extends Record, /** the return type that functions should be modified to have */T, /** *The type we expect in the value; if the value extends type `V` then the value will * be converted to type `O`; if not then the KV pair will be discarded */ V = unknown> = SimplifyObject<{ [K in keyof I]: I[K] extends V ? Record : never }[keyof I]>; //#endregion //#region src/dictionary/EnsureKeys.d.ts type BuildObj = [] extends TKey ? TObj : First$1 extends keyof TObj ? TEnsure extends Dictionary ? First$1 extends keyof TEnsure ? TObj[First$1] extends TEnsure[First$1] ? BuildObj> : Err<`invalid-type/${AsString>}`, `The key '${AsString>}' on the originating object of EnsureKeys is not compatible with the type we are trying to ensure with.`, { fn: "EnsureKeys"; key: First$1; originType: TObj[First$1]; ensureType: TEnsure[First$1]; }> : TObj[First$1] extends TType ? BuildObj> : never : TObj[First$1] extends TType ? BuildObj> : Err<`invalid-type/${AsString>}`, `The key '${AsString>}' on the originating object does not extend the TType property set in EnsureKeys`, { fn: "EnsureKeys"; key: First$1; originType: TObj[First$1]; type: TType; }> : BuildObj, TEnsure extends readonly string[] ? TType : TEnsure extends Dictionary ? First$1 extends keyof TEnsure ? TEnsure[First$1] : never : never>>, TEnsure, TType, AfterFirst>; /** * **EnsureKeys**`` * * Receives an object `TObj` and a specifier `TKeys` which * ensures that the specified _keys_ exist on the object. * * The _keys_ specifier may be either an array of keys or a dictionary of key/value pairs. * * - when _keys_ is a _dictionary_ then both the key and _type_ of that key * are inferred. * - otherwise, the optional `TType` (set to `unknown` by default) is used. */ type EnsureKeys = [IsWideObject] extends [true] ? IsDictionary extends true ? TEnsure : TEnsure extends readonly string[] ? Record : never : TEnsure extends readonly string[] ? BuildObj : BuildObj, readonly ObjectKey[]>>; //#endregion //#region src/dictionary/FromMaybeRef.d.ts /** * **FromMaybeRef**`` * * Dereferences the `value` property on VueJS `Ref`'s otherwise * returns `T` as is. */ type FromMaybeRef = IsVueRef extends true ? "value" extends keyof T ? T["value"] : never : T; //#endregion //#region src/dictionary/Get.d.ts type _Get = K extends `${infer A}.${infer B}` ? A extends keyof T ? _Get> : Acc : K extends keyof T ? _Get : Acc; /** * **Get**`` * * Provides a type utility which allows reaching into * a container using a _dot path_ to get the type * somewhere inside the parent structure. */ type Get = IsNever<_Get> extends true ? TDefVal : _Get extends undefined ? TDefVal : _Get; //#endregion //#region src/dictionary/GetFixedKeys.d.ts /** * **GetFixedKeys**`` * * Returns a union type for all _fixed_ keys found in `T` (aka, not indexed keys). * * **Related:** `GetIndexKeys`, `OnlyFixedKeys`, `RemoveIndexKeys` */ type GetFixedKeys = IsEqual extends true ? ObjectKey[] : T extends Dictionary ? keyof RemoveIndexKeys : never; //#endregion //#region src/dictionary/GetIndexKeys.d.ts /** * **GetIndexKeys`` * * Returns a union type of all the _index_ types found in `T`. * * - an index can be wide-type indexes such as `{ [x: string]: string }` * _or_ `{ [x: symbol]: number }` * - but they can also be _template literal_ indexes like `{ [x: `_${string}`]: string }` * * **Related:** `OnlyIndexKeys` */ type GetIndexKeys = keyof OnlyIndexKeys & (string | symbol); //#endregion //#region src/dictionary/KebabKeys.d.ts type Convert$8, readonly (ObjectKey & keyof T)[]>, O extends Dictionary = EmptyObject> = K extends [infer Head extends ObjectKey & keyof T, ...infer Rest extends readonly (ObjectKey & keyof T)[]] ? Convert$8, string>, T[Head] extends Dictionary ? KebabKeys : T[Head]> : Record : T[Head]>)> : ExpandRecursively; /** * Converts an object's keys to the **kebab-case** equivalent * while keeping the values the same. */ type KebabKeys = Required extends infer ReqDict extends Dictionary ? Convert$8 extends infer ReqDict extends Dictionary ? OptionalKeysTuple extends infer OptKeys extends readonly ObjectKey[] ? { [K in keyof OptKeys]: OptKeys[K] extends string ? KebabCase : OptKeys[K] } extends infer OptKeys extends readonly ObjectKey[] ? MakeKeysOptional : never : never : never : never; //#endregion //#region src/dictionary/KeysEqualValue.d.ts /** * **KeysEqualValue**`` * * The _keys_ on a given object `TObj` which are _equal to_ `TValue`. * * ```ts * // "foo" * type Str = KeysEqualValue<{ foo: string; bar: 5; baz: "bye" }, string>; * ``` * * **Related:** `KeysWithValue` */ type KeysEqualValue = { [K in keyof TObj]: TObj[K] extends readonly unknown[] ? IfEqual : IfEqual }[keyof TObj]; //#endregion //#region src/dictionary/KeysNotEqualValue.d.ts /** * **KeysNotEqualValue**`` * * The _keys_ on a given object `T` which _do not_ explicitly equal the type value of `W`. * * ```ts * // "bar" * type Str = KeysNotEqualValue<{ foo: 6; bar: 5 }, 5>; * ``` * * **Related:** `KeysEqualValue`, `KeysWithoutValue` */ type KeysNotEqualValue = { [K in keyof TObj]: IfEqual> }[keyof TObj]; //#endregion //#region src/dictionary/KeysWithError.d.ts type Process$58, readonly ObjectKey[]>, R extends readonly ObjectKey[] = []> = [] extends K ? R : First$1 extends keyof T ? T[First$1] extends Error ? Process$58, [...R, First$1]> : Process$58, R> : never; /** * **KeysWithError**`` * * Returns all of the keys in a dictionary `T` which _extend_ `Error`. */ type KeysWithError = Process$58; //#endregion //#region src/dictionary/KeysWithoutValue.d.ts /** * **KeysWithoutValue**`` * * The _keys_ on a given object `T` which _do not_ extend the type value of `W`. * * ```ts * // "foo" * type T = KeysWithoutValue<{ foo: "hi"; bar: 5; baz: number }, number>; * ``` */ type KeysWithoutValue = { [K in keyof TObj]: TObj[K] extends TValue ? never : Readonly }[keyof TObj]; //#endregion //#region src/dictionary/KeysWithValue.d.ts /** * **KeysWithValue**`` * * Filter's the key/values found on `TObj` to only those whose * value _extends_ `TValue`. * * ```ts * // "foo" | "baz" * type Str = KeysWithValue<{ foo: "hi"; bar: 5; baz: "bye" }, string>; * ``` * * **Related:** `KeysEqualValue` */ type KeysWithValue = IsLiteralLikeObject extends true ? { [K in keyof TObj]: TObj[K] extends TValue ? TObj[K] extends AnyFunction ? TValue extends AnyFunction ? K : never : And<[TObj[K] extends readonly any[] ? true : false, TValue extends readonly any[] ? false : true]> extends true ? never : K : never }[keyof TObj] : ObjectKey[]; //#endregion //#region src/dictionary/KvFn.d.ts /** * **KvFnDefn** * * Used as input to the `KvFn` utility. */ type KvFnDefn = [key: string, fn: FnDefn]; /** * **KvFn**`` * * A succinct and strong type definition for a KV value pair where the * _value_ is a function. */ type KvFn = Record>; //#endregion //#region src/dictionary/MakeKeysOptional.d.ts type Iterate$6 = ExpandRecursively & { [K in keyof WithKeys]?: K extends keyof TObj ? TObj[K] : never }>; type ConvertArray = IsGreaterThanOrEqual extends true ? Partial : Subtract extends infer ReqNum extends number ? Negative extends infer OptNum extends number ? [Slice, Slice] extends [infer ReqElements extends readonly unknown[], infer OptElements extends readonly unknown[]] ? [...ReqElements, ...Partial] : never : never : never; /** * **MakeKeysOptional**`` * * Makes a set of keys on a known container `T`: * * - if `T` is a **dictionary** object then `U` should: * - be a tuple of keys which you want to force * to _optional_. * - all other keys will be kept "as is" * - if `T` is an **array** then `U` should be: * - in a tuple, only the _last_ items are allowed to be optional * - therefore `U` is a number indicating _how many_ values should be optional * * **Related:** `MakeKeysRequired` */ type MakeKeysOptional = T extends Dictionary ? Iterate$6> : T extends readonly unknown[] ? ConvertArray, As$1> : never; //#endregion //#region src/dictionary/MakeKeysRequired.d.ts /** * **MakeKeysRequired**`` * * Makes a set of keys on a known object `TObj` become * _optional_ parameters while leaving the other properties * "as is". * * **Related:** `MakeKeysOptional` */ type MakeKeysRequired = ExpandDictionary & { [K in keyof WithKeys]: K extends keyof TObj ? TObj[K] : never }>; //#endregion //#region src/dictionary/MakePropsMutable.d.ts /** * **MakePropsMutable**`` * * Given a dictionary of type ``, this utility function will * make the properties of `TMutProps` _mutable_. `TMutProps` can be * a union type (as shown below) or a union. * * ```ts * // { foo: string, bar?: number, readonly baz: number } * type Example = MutableProps<{ * readonly foo: string, * bar?: number, * readonly baz: number * }, "foo" | "bar">; * ``` * * **Related:** `MutablePropsExclusive` */ type MakePropsMutable = SimplifyObject> & WithoutKeys>; /** * **MutablePropsExclusive**`` * * Given a dictionary of type ``, this utility function will * make the properties represented by `M` _mutable_ and all others * immutable. * * ```ts * // { foo: string, readonly bar: number, readonly baz: number } * type Example = MutableProps<{ * readonly foo: string, * bar?: number, * readonly baz: number * }, "foo">; * ``` * * **Related:** `MutableProps` */ type MutablePropsExclusive = ExpandRecursively> & Readonly>>; //#endregion //#region src/dictionary/MapTo.d.ts declare const DEFAULT_ONE_TO_MANY_MAPPING: FinalizedMapConfig<"req", "I -> O[]", "opt">; declare const DEFAULT_ONE_TO_ONE_MAPPING: FinalizedMapConfig<"req", "I -> O", "req">; declare const DEFAULT_MANY_TO_ONE_MAPPING: FinalizedMapConfig<"req", "I[] -> O", "req">; /** * The _default_ One-to-Many mapping that the mapTo() utility provides */ type DefaultOneToManyMapping = typeof DEFAULT_ONE_TO_MANY_MAPPING; /** * The _default_ One-to-One mapping that the mapTo() utility provides */ type DefaultOneToOneMapping = typeof DEFAULT_ONE_TO_ONE_MAPPING; /** * The _default_ Many-to-One mapping that the mapTo() utility provides */ type DefaultManyToOneMapping = typeof DEFAULT_MANY_TO_ONE_MAPPING; /** * Expresses relationship between inputs/outputs: */ declare enum MapCardinality { /** every input results in 0:M outputs */ OneToMany = "I -> O[]", /** every input results in 0:1 outputs */ OneToOne = "I -> O", /** every input is an array of type I and reduced to a single O */ ManyToOne = "I[] -> O" } type MapCardinalityIllustrated = `${string | number}`; /** * The _user_ configuration of a **mapTo** mapper function * which will be finalized by merging it with the appropriate * default mapping type. */ interface MapConfig { input?: IR; output?: OR; cardinality?: D; /** * Whether calls to the final `MapFn` will be logged to stderr * for debugging purposes. Defaults to false; if you specify * a _string_ for a value that will be sent to stderr along * with other debugging info. */ debug?: boolean | string; } /** * A finalized configuration of a **mapTo** mapper functions cardinality * relationships between _inputs_ and _outputs_. * * Note: _this configuration does _not_ yet include the actual mapping * configuration between the input and output._ */ type FinalizedMapConfig, D extends MapCardinalityIllustrated = MapCard, OR extends OptRequired = MapOR> = Required, "debug">> & { finalized: true; debug: boolean | string; }; /** * User configuration exposed by a config function which specifies the * cardinality already (e.g., `oneToMany()`, `manyToOne()`) */ interface MapCardinalityConfig { /** whether we the input can _optionally_ be an `undefined` value or not */ input?: IR; /** whether we the output can _optionally_ be an `undefined` value or not */ output?: OR; /** * Whether calls to the final `MapFn` will be logged to stderr * for debugging purposes. Defaults to false; if you set to a string * value than this will be echoed out with stderr. */ debug?: boolean | string; } /** * **ConfiguredMap** * * A partial application of the mapTo() utility which has expressed the * configuration of the _inputs_ and _outputs_ and provides a `.map()` * method which allows the user configure the specifics of the mapping. */ interface ConfiguredMap> { map: (map: MapTo) => MapperOld; input: MapIR; cardinality: MapCard; output: MapOR; debug: boolean | string; } /** * Extracts the IR, Cardinality, and OR generics from a FinalizedMapConfig */ type DecomposeMapConfig> = M extends MapConfig ? IR extends OptRequired | undefined ? D extends MapCardinalityIllustrated | undefined ? OR extends OptRequired | undefined ? [IR, D, OR] : never : never : never : M extends FinalizedMapConfig ? IR extends OptRequired ? D extends MapCardinalityIllustrated ? OR extends OptRequired ? [IR, D, OR] : never : never : never : never; /** extracts IR from a `FinalizedMapConfig` */ type MapIR> = DecomposeMapConfig[0]; /** * extracts the MapCardinality from a `FinalizedMapConfig` */ type MapCard> = DecomposeMapConfig[1]; /** extracts OR from a `FinalizedMapConfig` */ type MapOR> = DecomposeMapConfig[2]; /** * Merges the types of a userland configuration with a default configuration */ type AsFinalizedConfig, D extends FinalizedMapConfig> = MergeObjects extends FinalizedMapConfig ? FinalizedMapConfig : never; interface MapperApi { /** * Provides opportunity to configure _input_, _output_, and _cardinality_ * prior to providing a mapping function. * * Note: _the defaults for configuration are defined by the_ `DEFAULT_ONE_TO_MANY_MAPPING` * _constant made available as a symbol from this library._ */ config: >(config: C) => ConfiguredMap>; /** * Provides a nice 1:1 ratio between the input and output. * * By default the input and output are considered to be _required_ * properties but this can be changed with the options hash provided. * ```ts * const mapper = mapTo.oneToOne().map(...); * // add in ability to filter out some inputs * const mapAndFilter = mapTo.oneToOne({ output: "opt" }) * ``` */ oneToOne: >(config?: C) => ConfiguredMap>; /** * **manyToOne** _mapping_ * * Provides a configuration where multiple inputs `I[]` will be mapped to a * single output `O`. * * Choosing this configuration will, by default, set both input and output * to be "required" but you can change this default if you so choose. */ manyToOne: >(config?: C) => ConfiguredMap>; oneToMany: >(config?: C) => ConfiguredMap>; } type MapInput = C extends MapCardinality.OneToMany | "I -> O[]" ? IR extends "opt" ? I | undefined : I : C extends MapCardinality.OneToOne | "I -> O" ? IR extends "opt" ? I | undefined : I : C extends MapCardinality.ManyToOne | "I[] -> O" ? IR extends "opt" ? I[] | undefined : I[] : never; type MapOutput = C extends MapCardinality.OneToMany | "I -> O[]" ? OR extends "opt" ? O[] : [O, ...O[]] : C extends MapCardinality.OneToOne | "I -> O" ? OR extends "opt" ? O | null : O : C extends MapCardinality.ManyToOne | "I[] -> O" ? OR extends "opt" ? O | null : O : never; /** * **MapTo** * * A mapping function between an input type `I` and output type `O`. Defaults to using * the _default_ OneToMany mapping config. * * **Note:** this type is designed to guide the userland mapping; refer * to `MapFn` if you want the type output by the `mapFn()` utility. */ type MapTo = DefaultOneToManyMapping> = MapIR extends "opt" ? (source?: MapInput, MapCard>) => MapOutput, MapCard> : (source: MapInput, MapCard>) => MapOutput, MapCard>; type MapFnOutput = C extends "I -> O[]" | MapCardinality.OneToMany ? S extends I[] ? OR extends "opt" ? O[] : [O, ...O[]] : OR extends "opt" ? O[] | null : O[] : C extends MapCardinality.OneToOne | "I -> O" ? S extends I[] ? OR extends "opt" ? O[] : [O, ...O[]] : OR extends "opt" ? O | null : O : C extends MapCardinality.ManyToOne | "I[] -> O" ? S extends I[][] ? OR extends "opt" ? O[] : [O, ...O[]] : OR extends "opt" ? O | null : O : never; type MapFnInput = D extends "I -> O[]" | MapCardinality.OneToMany ? IR extends "opt" ? I | I[] | undefined : I | I[] : D extends MapCardinality.OneToOne | "I -> O" ? IR extends "opt" ? I | I[] | undefined : I | I[] : D extends MapCardinality.ManyToOne | "I[] -> O" ? IR extends "opt" ? I[] | I[][] | undefined : I[] | I[][] : never; /** * The mapping function provided by the `mapFn()` utility. This _fn_ * is intended to be used in two ways: * * 1. Iterative: * ```ts * const m = mapTo(i => [ ... ]); * // maps inputs to outputs * const out = inputs.map(m); * ``` * 2. Block: * ```ts * // maps inputs to outputs (filtering or splitting where appr.) * const out2 = m(inputs); * ``` */ type MapFn> = MapIR extends "opt" ? , MapCard>>(source?: S) => MapFnOutput, MapCard> : , MapCard>>(source: S) => MapFnOutput, MapCard>; /** * **Mapper** * * A fully configured _mapper_ stemming from the **mapTo()** utility. It is both a mapping * function and a dictionary which describes the mapper's properties. * ```ts * const m = mapTo.oneToOne().map( ... ); * const mapped = m(inputs); * const mappedOver = inputs.map(m); * ``` * * Note: the root of a `Mapper` is the mapper function but * this is combined with a dictionary of settings and types * which you can use. For instance, look at the `fnSignature` * property to get the _type_ signature of the map function. */ type MapperOld = FinalizedMapConfig> = { input: MapIR; output: MapOR; cardinality: MapCard; debug: boolean | string; inputType: I; outputType: O; /** * Provides the _type_ information for mapper function. * * Note: _this is just a **type**_ not the actual function which positioned * at the root of the Mapper type */ fnSignature: MapFn; } & MapFn; /** * **MapInputFrom** * * Type utility which extracts the `I` type from a fully configured `Mapper` */ type MapInputFrom = T extends MapperOld ? I : never; /** * **MapOutputFrom** * * Type utility which extracts the output [`O`] type from a fully configured `Mapper` */ type MapOutputFrom = T extends MapperOld ? O : never; /** * **MapCardinalityFrom** * * Type utility which extracts _cardinality_ of a `Mapper`'s inputs to outputs */ type MapCardinalityFrom = T extends MapperOld ? C extends FinalizedMapConfig ? Cardinality : never : never; //#endregion //#region src/dictionary/MaybeRef.d.ts /** * **MaybeRef**`` * * Used to represent a type which is either of the two: * * - `T` * - `VueRef` * * **Related:** `IsRef`, `IfRef` * ```ts * // number | VueRef * type T = MaybeRef; * ``` */ type MaybeRef = T | VueRef; //#endregion //#region src/dictionary/MergeKVs.d.ts type Process$57 = [] extends TInput ? TOutput extends Record ? ExpandRecursively : never : Process$57, First$1 extends keyof TOutput ? TOutput : TOutput & First$1>; /** * **MergeKVs**`` * * Receives an array of `Dictionary` types and merges this to * single dictionary. * * **Note:** _if key is repeated in the set, only the first one's value will be retained_ */ type MergeKVs = Process$57; //#endregion //#region src/dictionary/MixObjects.d.ts type Mix, readonly (PropertyKey & keyof B)[]>> = K extends [infer Head extends keyof B & PropertyKey, ...infer Rest extends readonly (keyof B & PropertyKey)[]] ? Head extends keyof A ? Mix & Record, B, Rest> : Mix, B, Rest> : ExpandDictionary; /** * **MixObjects**`` * * Combines two objects by unionizing the values of shared keys * and adding keys in `B` to `A` which didn't exist. */ type MixObjects = Mix; //#endregion //#region src/dictionary/MutableProps.d.ts /** * **MutableProps**`` * * Reduces an object down to just the key/value pairs which * are mutable. */ type MutableProps = Omit>; //#endregion //#region src/dictionary/NonNumericKeys.d.ts /** * **NonNumericKeys**`` * * The keys in an array/object `T` which are _not_ numeric keys. */ type NonNumericKeys = { [K in keyof T]: K extends number ? never : Readonly }[keyof T]; //#endregion //#region src/dictionary/NonStringKeys.d.ts /** * **NonStringKeys**`` * * Builds a union type of the keys of `T` which are _not_ * _string_ keys. This can be useful as _symbols_ can also * be seen as valid keys and these keys are often used for * "identity" purposes. * * **Related:** `StringKeys` */ type NonStringKeys = { [K in keyof T]: K extends string ? never : Readonly }[keyof T]; //#endregion //#region src/dictionary/ObjectKeys.d.ts type Shaped = [] extends TKeys ? [...L, ...Partial, ...Partial] : IsTemplateLiteral> extends true ? First$1 & string extends infer Pattern extends string ? Shaped, TOpt, L, O, [...V, ...Pattern[]]> : never : Contains> extends true ? Shaped, TOpt, L, [...O, First$1], V> : Shaped, TOpt, [...L, First$1], O, V>; type HandleDict = Required extends Record ? IsNever extends true ? TObj extends Dictionary ? [] : PropertyKey[] : IsEqual extends true ? ObjectKey[] : IsEqual extends true ? string[] : IsEqual extends true ? symbol[] : IsEqual extends true ? number[] : IsNever extends true ? PropertyKey[] : IsNever> extends true ? IsLiteralString extends true ? Shaped, readonly PropertyKey[]>, OptionalKeysTuple> : IsUnion extends true ? Shaped, readonly PropertyKey[]>, OptionalKeysTuple> : K[] : [...UnionToTuple>, ...(GetIndexKeys)[]] : never; /** * **ObjectKeys**`` * * Provides the keys of a given object in a tuple form. * * **Related:** `Keys`, `OptionalKeys`, `RequiredKeys`, `NumericKeys` */ type ObjectKeys = [IsAny] extends [true] ? Err<`invalid-type/object-keys`, `Call to ObjectKeys where T was 'any'!`> : IsNever extends true ? Err<`invalid-type/object-keys`, `Call to ObjectKeys where T was 'never'!`> : TObj extends object ? TObj extends Map ? IsUnion extends true ? IsLiteralUnion extends true ? Required, readonly PropertyKey[]>, OptionalKeysTuple>> : IsWideUnion extends true ? UnionToTuple[] : "mixed" : K[] : TObj extends Set ? Err<`invalid-type/object-keys`, `The type passed into ObjectKeys was a Set. Set's do not have keys`> : TObj extends WeakMap ? IsUnion extends true ? K : K extends Scalar | object | readonly unknown[] ? K[] : unknown : Required extends Record ? IsNever extends true ? TObj extends Dictionary ? [] : PropertyKey[] : IsEqual extends true ? ObjectKey[] : IsEqual extends true ? RemoveIndexKeys> extends Record ? [...(As$1>>, readonly PropertyKey[]>), ...string[]] : PropertyKey[] : IsNever extends true ? PropertyKey[] : TObj extends Dictionary ? HandleDict : K[] : ObjectKey[] : Err<`invalid-type/object-keys`, `The type passed into ObjectKeys was not an object!`, { value: TObj; }>; //#endregion //#region src/dictionary/OnlyFixedKeys.d.ts /** * **OnlyFixedKeys**`` * * Removes all index index keys to leave a dictionary with only the * _fixed_ keys defined in `T`. * * **Related:** `GetFixedKeys`, `OnlyIndexKeys`, `GetIndexKeys` */ type OnlyFixedKeys = T extends Dictionary ? WithKeys, PropertyKey>> : never; //#endregion //#region src/dictionary/OnlyIndexKeys.d.ts type ExtractIndexKeysFromObj = { [K in keyof T as string extends K ? K : number extends K ? K : symbol extends K ? K : never]: T[K] }; type GetTemplateLiteralIndexes = TKeys extends [infer Head extends ObjectKey, ...infer Rest extends readonly ObjectKey[]] ? IsTemplateLiteral extends true ? GetTemplateLiteralIndexes> : GetTemplateLiteralIndexes : ExpandDictionary; /** * **OnlyIndexKeys**<`T`> * * Returns a dictionary with all fixed keys removed and only _index_ * signatures remaining. * * - index can be wide-type indexes such as `{ [x: string]: string }` * - but they can also be _template literal_ indexes like `{ [x: `_${string}`]: string }` * * **Related: `GetIndexKeys` */ type OnlyIndexKeys = ExpandDictionary & GetTemplateLiteralIndexes>>; //#endregion //#region src/dictionary/OptionalKeys.d.ts /** * **OptionalKeys**`` * * Provides a union type of the _keys_ in `T` which are * **optional** properties. * * **Note:** you also may optionally filter further by specifying a value * by the _value_ of the key and then only keys which are required AND * who extend `V` will be included in the union. * * **Related:** `OptionalKeys`, `RequiredProps` * Provides a union type of the _keys_ in `T` which are * **required** properties. * * **Note:** you also may optionally filter further by specifying a value * by the _value_ of the key and then only keys which are required AND * who extend `V` will be included in the union. * * **Related:** `RequiredKeys`, `RequiredProps` */ type OptionalKeys = T extends Dictionary ? { [K in keyof T]-?: EmptyObject extends { [P in K]: T[K] } ? If, K, K extends V ? K : never> : never }[keyof T] : never; /** * **OptionalKeysTuple**`` * * Provides a tuple of the _keys_ in `T` which are * **optional** properties. * * **Related:** `RequiredKeys`, `OptionalProps` */ type OptionalKeysTuple = T extends Dictionary ? As$1>, "equals", [boolean]>, readonly ObjectKey[]> : never; //#endregion //#region src/dictionary/OptionalProps.d.ts /** * **OptionalProps** * * Reduces an object to only key/value pairs where the key is optional */ type OptionalProps = EmptyObject extends RemoveIndexKeys>> ? RemoveIndexKeys>> : never; //#endregion //#region src/dictionary/OptRecord.d.ts /** * **OptRecord**`` * * Create a Record with the optional property set. */ type OptRecord = MakeKeysOptional, [T]>; //#endregion //#region src/dictionary/PascalKeys.d.ts type Convert$7, readonly (ObjectKey & keyof T)[]>, O extends Dictionary = EmptyObject> = K extends [infer Head extends ObjectKey & keyof T, ...infer Rest extends readonly (ObjectKey & keyof T)[]] ? Convert$7, string>, T[Head] extends Dictionary ? PascalKeys : T[Head]> : Record : T[Head]>)> : ExpandRecursively; /** * **PascalKeys**`` * * Converts an object's keys to the **PascalCase** equivalent * while keeping the values the same. */ type PascalKeys = Required extends infer ReqDict extends Dictionary ? Convert$7 extends infer ReqDict extends Dictionary ? OptionalKeysTuple extends infer OptKeys extends readonly ObjectKey[] ? { [K in keyof OptKeys]: OptKeys[K] extends string ? PascalCase : OptKeys[K] } extends infer OptKeys extends readonly ObjectKey[] ? MakeKeysOptional : never : never : never : never; //#endregion //#region src/dictionary/ReadonlyKeys.d.ts type MyEqual = (() => X extends A ? 0 : 1) extends (() => X extends B ? 0 : 1) ? true : false; type isReadonly = MyEqual<{ [P in K]: T[P] }, { readonly [P in K]: T[P] }>; /** * **ReadonlyKeys**`` * * Creates a union of properties in `T` which are readonly. */ type ReadonlyKeys = keyof { [K in keyof T as isReadonly extends true ? K : never]: T[K] }; //#endregion //#region src/dictionary/ReadonlyProps.d.ts /** * **ReadonlyProps**`` * * Reduces an object down to just the key/value pairs which * are readonly. */ type ReadonlyProps = Pick>; //#endregion //#region src/dictionary/RemoveIndexKeys.d.ts type Arr$1 = { [K in keyof T as number extends K ? never : string extends K ? never : symbol extends K ? never : K]: T[K] }; type FilterDictKeys = { [K in keyof T as string extends K ? never : number extends K ? never : symbol extends K ? never : IsTemplateLiteral extends true ? never : K]: T[K] }; /** * **RemoveIndexKeys**`` * * Removes _index_ keys which permit key/values to be added to an object while * retaining all explicit key/values defined on an object. * * - this includes both _wide_ indexes like `string` but also literal template * indexes like `_${string}` * * ```ts * type Obj = { [key: string]: unknown; foo: 42 }; * // { foo: 42 } * type Obj2 = RemoveIndexKeys; * ``` */ type RemoveIndexKeys = T extends Dictionary ? HasIndexKeys extends true ? Required>> extends infer Keys extends readonly PropertyKey[] ? WithKeys : never : T : T extends readonly any[] ? Arr$1 : never; //#endregion //#region src/dictionary/RequiredKeys.d.ts /** * **RequiredKeys**`` * * Provides a union type of the _keys_ in `T` which are * **required** properties. * * **Note:** you also may optionally filter further by specifying a value * by the _value_ of the key and then only keys which are required AND * who extend `V` will be included in the union. * * **Related:** `OptionalKeys`, `RequiredProps`, `RequiredKeysTuple` */ type RequiredKeys = As$1<{ [K in keyof T]-?: EmptyObject extends { [P in K]: T[K] } ? never : IfUnset }[keyof T], ObjectKey>; /** * **RequiredKeysTuple**`` * * Provides a tuple of the _keys_ in `T` which are * **required** properties. * * **Related:** `OptionalKeys`, `RequiredProps`, `RequiredKeys` */ type RequiredKeysTuple = UnionToTuple>; //#endregion //#region src/dictionary/RequiredProps.d.ts /** * **RequiredProps**`` * * Reduces an object `T` to only those key/value pairs where the key is required */ type RequiredProps = Pick>; //#endregion //#region src/dictionary/RequireProps.d.ts /** * Given a dictionary of type ``, this utility function will * make the `` generic property _required_ (use a union to make * more than one prop required). * * ```ts * // { foo: string, bar?: number } * type Example = RequireProps<{foo?: string, bar?: number}, "foo">; * ``` */ type RequireProps = ExpandRecursively> & T>; //#endregion //#region src/dictionary/ReverseLookup.d.ts /** * **ReverseLookup**`` * * Inverts a table of string to string lookups so that the values * can now lookup the keys. * * Uses mapped types for O(1) complexity instead of recursive processing, * significantly improving performance for large mappings while preserving * narrow literal types. */ type ReverseLookup> = { [K in keyof T as T[K]]: K }; //#endregion //#region src/dictionary/Set.d.ts type SetAtIndex = K extends keyof T ? { [P in keyof T]: P extends K ? V : T[P] } : T; type StripLeadingDot = T extends `.${infer Rest}` ? Rest : T; type _Set = StripLeadingDot extends `${infer Head}.${infer Tail}` ? T extends readonly unknown[] ? Head extends keyof T ? { [P in keyof T]: P extends Head ? _Set : T[P] } : T : T extends object ? Head extends keyof T ? { [P in keyof T]: P extends Head ? _Set : T[P] } : T & { [P in Head]: _Set } : T : StripLeadingDot extends keyof T ? T extends readonly unknown[] ? SetAtIndex & string, V> : T extends object ? { [P in keyof T]: P extends StripLeadingDot ? V : T[P] } : T : T extends object ? StripLeadingDot extends string | number | symbol ? T & { [P in StripLeadingDot]: V } : T : T; type Set$1>, TValue> = _Set; //#endregion //#region src/dictionary/SetKey.d.ts /** * **SetKeyStrict**` * * Sets one of the keys `TKey` of an object `TObj` to `TValue` * while ensuring that `TVal` extends the _wide_ type of `TObj[TKey]`. * * - if you want `TVal` to be unconstrained, use `ForceSetKey` instead. * - if you want `TVal` to be less constrained, use `SetKey` instead. */ type SetKeyStrict = { [K in keyof TObj]: K extends TKey ? TVal : TObj[K] }; /** * **SetKey**` * * Sets one of the keys `TKey` of an object `TObj` to `TValue` * while ensuring that `TVal` extends the _wide_ type of `TObj[TKey]`. * * - if you want `TVal` to be unconstrained, use `SetKeyForce` * instead. * - if you want to be constrained to the literal type use `SetKeyStrict` */ type SetKey = { [K in keyof TObj]: K extends TKey ? TVal : TObj[K] extends Widen ? TObj[K] : never }; /** * **ForceSetKey**` * * Sets one of the keys `TKey` of an object `TObj` to `TValue` * even if `TValue` doesn't fit the type which `TObj` proposes. * * - if you want `TVal` to be constrained to valid keys of * `TObj` use `SetKey` instead. */ type SetKeyForce = { [K in keyof TObj]: K extends TKey ? TVal : TObj[K] }; //#endregion //#region src/dictionary/SetKeysTo.d.ts /** * **SetKeysTo**`` * * Mutates the type of `TObj` to have all keys specified in `TKeys` to by * typed to the value of `TValue`. */ type SetKeysTo = [] extends TKeys ? ExpandDictionary : SetKeysTo, TValue>, AfterFirst, TValue>; //#endregion //#region src/dictionary/SharedKeys.d.ts /** * **SharedKeys**`` * * Given two objects `A` and `B`, this type utility will provide the * _keys_ which both objects contain. * ```ts * type O1 = { foo: 1; bar: 2; baz: 88 }; * type O2 = { bar: 5; baz: 3; nada: true }; * // ["bar", "baz"] * type X = SharedKeys; * ``` * * **Note:** this is now just an alias to `IntersectingKeys` */ type SharedKeys | object, B extends Record | object> = IntersectingKeys, As$1>; //#endregion //#region src/dictionary/SimplifyObject.d.ts /** * Often when mutating the shape of an object you will end up with the union of a number of * `Record` and `Record` which is messy to look at and take away meaning. * * This type utility will cleanup an object and return a simple dictionary definition for it. */ type SimplifyObject = ExpandRecursively>>; //#endregion //#region src/dictionary/SnakeKeys.d.ts type Convert$6, readonly (ObjectKey & keyof T)[]>, O extends Dictionary = EmptyObject> = K extends [infer Head extends ObjectKey & keyof T, ...infer Rest extends readonly (ObjectKey & keyof T)[]] ? Convert$6, string>, T[Head] extends Dictionary ? SnakeKeys : T[Head]> : Record : T[Head]>)> : ExpandRecursively; /** * Converts an object's keys to the **kebab-case** equivalent * while keeping the values the same. */ type SnakeKeys = Required extends infer ReqDict extends Dictionary ? Convert$6 extends infer ReqDict extends Dictionary ? OptionalKeysTuple extends infer OptKeys extends readonly ObjectKey[] ? { [K in keyof OptKeys]: OptKeys[K] extends string ? SnakeCase : OptKeys[K] } extends infer OptKeys extends readonly ObjectKey[] ? MakeKeysOptional : never : never : never : never; //#endregion //#region src/dictionary/StringKeys.d.ts /** * **KeysUnion**`` * * Creates a union type of all the _string_ keys in `T`. * * **Related:** `Keys`, `StringKeys` */ type KeysUnion = { [K in keyof T]: K extends string ? Readonly : never }[keyof T]; type _StringKeys = UnionToTuple<{ [K in keyof T]: K extends string ? Readonly : never }[keyof T]>; /** * **SKeys**`` * * Creates a tuple of all _string_ keys of `T`. * * **Related:** `Keys`, `StringKeys` * @deprecated prefer use of `StringKeys` */ type SKeys = IsVueRef extends true ? ["value"] : _StringKeys extends readonly string[] ? _StringKeys : never; /** * **StringKeys**`` * * Creates a tuple of all _string_ keys of `T`. * * **Related:** `Keys` */ type StringKeys = IsVueRef extends true ? ["value"] : _StringKeys extends readonly string[] ? _StringKeys : never; //#endregion //#region src/dictionary/TakeProp.d.ts /** * **TakeProp**`` * * Takes the property `TTest` and determines if `TProp` is a key of * of `TTest`. If it is it will return `TTest[TProp]` otherwise `TElse` * (which is defaulted to _undefined_). */ type TakeProp = TProp extends keyof TTest ? TTest[TProp] : TElse; //#endregion //#region src/dictionary/UpsertKeyValue.d.ts type Process$56 = K extends keyof TObj ? Omit & Record : TObj & Record; /** * **UpsertKeyValue**`` * * Updates the object `TObj` with the provided KV when keys overlap, * otherwise just adds the KV to `TObj`. * * **Related:** `AddKeyValue` */ type UpsertKeyValue = ExpandRecursively>; //#endregion //#region src/dictionary/ValidKey.d.ts /** * **ValidKey** * * Similar to the `Keys` utility but returns a union of values * which are considered valid for the container. * * **Related**: `Keys` */ type ValidKey = TupleToUnion>>; //#endregion //#region src/dictionary/Values.d.ts type Validate$10 = [IsAny] extends [true] ? Err<`invalid-type/values`, `Values was called where T was the 'any' type`> : [IsNever] extends [true] ? Err<`invalid-type/values`, `Values was called where T was the 'never' type`> : T; type GetValues = [] extends TKeys ? TAcc : Required extends readonly [infer First, ...infer Rest] ? First extends keyof TObj ? Rest extends readonly PropertyKey[] ? IsTuple extends true ? UnionMemberEquals extends true ? GetValues : GetValues : GetValues : never : never : TAcc; /** * **Values**`` * * Produces a tuple of all the _values_ in an object. * * - you _can_ run it on a tuple too but this is in effect an identity * function and will just return the tuple's values/types "as is" * - passing in `any` or `never` to this utility will result in an Error */ type Values = As$1 extends Error ? Validate$10 : T extends readonly unknown[] ? T : Keys$1 extends readonly unknown[] ? number extends Keys$1["length"] ? T extends Record ? V[] : T extends readonly (infer V)[] ? V[] : unknown[] : GetValues> extends infer V extends readonly unknown[] ? OptionalKeysTuple["length"] extends infer OptNum extends number ? OptNum extends 0 ? GetValues> : MakeKeysOptional : GetValues> : never : never, readonly unknown[]>; //#endregion //#region src/dictionary/WithKeys.d.ts type MakeIntoUnion = K extends readonly PropertyKey[] ? TupleToUnion : K; type MakeNumericIndex = T; /** * **WithKeys**`` * * This type utility will ensure that the type `T` will _retain_ the key/value * pairs which extend `K`. * * It is very similar to **Pick** but rather `K` being restricted to * being a string union, wth **WithKeys** you can use the union type * or a readonly array of strings. * * ```ts * type Test = { foo: 1, bar: number, baz: string }; * // { foo: 1, bar: number } * type T1 = WithKeys; // Pick syntax * type T2 = WithKeys; * ``` */ type WithKeys = ExpandRecursively extends keyof T ? T extends Tuple$1 ? MakeNumericIndex>> : Pick> : never>>; //#endregion //#region src/dictionary/WithNumericKeys.d.ts /** * **WithNumericKeys**`` * * Reduces an object to only the key/value pairs where the key is numeric. */ type WithNumericKeys = Omit>; //#endregion //#region src/dictionary/WithoutKeys.d.ts /** * **WithoutKeys**`` * * Removes the keys in `TKeys` from an object `TObj`. * * **Note:** This is functionally equivalent to the `Omit` built-in but: * * - allows passing in a union type (like Omit) * - or a tuple of ObjectKey's (distinct from Omit). */ type WithoutKeys = TKeys extends readonly ObjectKey[] ? Omit : TKeys extends ObjectKey ? ExpandDictionary> : never; //#endregion //#region src/dictionary/WithoutValue.d.ts /** * **WithoutValue** * * Reduces an object's type down to only those key/value pairs where the * value is **NOT** of type `W`. * * ```ts * const foo = { a: 1, b: "hi", c: () => "hello" } * // { a: 1, b: "hi" } * type W = WithValue * ``` * * You manually exclude keys as well by setting the optional `E` generic. */ type WithoutValue = Mutable>>>; //#endregion //#region src/dictionary/WithStringKeys.d.ts /** * **WithStringKeys**`` * * Reduces an object to only the key/value pairs where the key is a * string. */ type WithStringKeys = Omit>; //#endregion //#region src/dictionary/WithValue.d.ts type Marked$1 = typeof MARKED$1; type Process$55 = RemoveMarked<{ [K in keyof TObj]: If : Extends, TObj[K], Marked$1> }>; /** * **WithValue**`` * * Reduces an object's type down to only those key/value pairs where the * value is of type `W`. * ```ts * const foo = { a: 1, b: "hi", c: () => "hello" } * // { c: () => "hello" } * type W = WithValue * ``` * * **Related:** `WithoutValue`, `WithKeys`, `WithoutKeys` */ type WithValue = ExpandRecursively>; //#endregion //#region src/interpolation/IsStaticTemplate.d.ts type Curly, O extends string = never> = K extends [infer Head extends string, ...infer Rest extends readonly string[]] ? Curly : O; /** * **IsStaticTemplate**`` * * A boolean operator which indicates whether any of the dynamic segments * defined in `TSegments` was found in `TContent`. */ type IsStaticTemplate = Contains>; //#endregion //#region src/type-conversion/AsBoolean.d.ts /** * **AsBoolean**`` * * Converts any `BooleanLike` value to a boolean value * and return `never` otherwise. */ type AsBoolean = T extends boolean ? T : T extends "true" ? true : T extends "false" ? false : T extends "boolean" ? boolean : never; //#endregion //#region src/type-conversion/AsContainer.d.ts /** * **AsContainer**`` * * Evaluates `T` and if it finds union type which includes a container * type then it narrows it to just the container types. * * - If `T` has no ability to be a container the type `TNever` is returned * (which defaults to the type of `never`) */ type AsContainer = T extends readonly unknown[] ? T & readonly unknown[] : T extends Dictionary ? T & Dictionary : TError; //#endregion //#region src/type-conversion/AsDefined.d.ts /** * **AsDefined**`` * * Ensures that if `T` includes _undefined_ as part of a union, it is * removed. */ type AsDefined = Exclude; //#endregion //#region src/type-conversion/AsDictionary.d.ts type AsDictionary = T extends Dictionary ? T : never; //#endregion //#region src/type-conversion/AsFromTo.d.ts /** converts an object's key values into FromTo tuple */ type ConvertFromTo = Values<{ [K in keyof TObj]: { from: K; to: TObj[K]; } }>; /** * **AsFromTo**`` * * Converts: * - an object KV is converted into a `FromTo[]` tuple * * **Notes:** * - any value which is already a FromTo will be kept as is * - any value which is _not_ a number will be converted to a `NumberLike` string and added * - any value which is neither a string or any of the above will be discarded */ type AsFromTo> = IsLiteralLikeObject extends true ? ConvertFromTo extends readonly FromTo[] ? ConvertFromTo : never : FromTo[]; //#endregion //#region src/type-conversion/AsFunction.d.ts /** * **AsFunction** * * Attempts to narrow `T` to a string type where possible. * * **Related:** `ToString` */ type AsFunction = TTest & ((args: TArgs) => unknown); //#endregion //#region src/type-conversion/AsNonNull.d.ts type InvalidCast = Err<"invalid-cast", `An attempt to cast a type as being non-null based was unsuccessful!`, { library: "inferred-types/constants"; value: T; }>; /** * **AsNonNull**`` * * A narrowing utility which ensures that a union type which includes a `null` * option will have the **null** option removed. * * **Note:** if `T` is _equal to **null** then an `ErrorCondition<"invalid-cast">` * will be raised. */ type AsNonNull = If, InvalidCast, IsUnion extends true ? TupleToUnion, "extends", [null]>> : T> extends null ? never : If, InvalidCast, IsUnion extends true ? TupleToUnion, "extends", [null]>> : T>; //#endregion //#region src/type-conversion/AsNumber.d.ts /** * **ParseInt**`` * * Converts a known string literal representation of a number * to an actual number. */ type ParseInt = T extends `${infer Int}.${infer Dec}` ? StripChars extends "" ? Int extends `${infer N extends number}` ? N : never : `${Int}.${TrimCharEnd}` extends `${infer N extends number}` ? N : never : T extends `${infer N extends number}` ? N : never; type JustZeros = T extends `${infer HEAD extends string}${infer REST extends string}` ? HEAD extends "0" ? JustZeros : false : true; /** * Addresses the possibility of leading zeros for both integer values * and decimal values, positive and negative values */ type Handler = StartsWith extends true ? Contains extends true ? JustZeros> extends true ? As$1<`0.${RetainAfter}`, `${number}`> : As$1, `${number}`> : JustZeros extends true ? "0" : StripWhile : StartsWith extends true ? As$1<`0${T}`, `${number}`> : T; /** * **AsNumber**`` * * Returns a _number_ for `T` where `T` extends a _number_ or * `${number}` type; otherwise return _never_. Literal types are * preserved. * * ```ts * // 4 * type Num = AsNumber<"4">; * ``` * **Related:** `ToNumber` */ type AsNumber = IsBranded extends true ? AsNumber> : T extends number ? T : T extends `${number}` ? StartsWith extends true ? ParseInt<`-${Handler, `${number}`>>}`> : ParseInt> : never; //#endregion //#region src/type-conversion/AsObject.d.ts /** * **AsObject** * * Proxies through any ony existing object, but will also * convert a `KeyValueTuple` into an object. */ type AsObject = T extends Dictionary ? T : T & Dictionary; //#endregion //#region src/type-conversion/AsObjectKeys.d.ts /** * **AsObjectKeys**`` * * Narrows type by validating that `T` extends a tuple of only * values which extend `ObjectKey`. */ type AsObjectKeys = T extends readonly ObjectKey[] ? T : never; /** * **AsObjectKey**`` * * Narrows type by validating that `T` extends `ObjectKey`. */ type AsObjectKey = T extends ObjectKey ? T : never; //#endregion //#region src/type-conversion/AsPropertyKey.d.ts /** * **AsPropertyKey**`` * * Ensures that `T` is a property key or, if a tuple is passed in, that * all values extend `PropertyKey` */ type AsPropertyKey = T extends PropertyKey ? T : never; //#endregion //#region src/type-conversion/AsRecord.d.ts /** * **AsRecord**`` * * Receives a `Record`, `object`, or `Tuple` and ensures the type * is a `Record` type for all object-like types and just passes * Tuples through "as is". */ type AsRecord = T extends Tuple$1 ? T : T extends Dictionary ? T : T extends object ? T extends any[] ? never : NonNullable : never; //#endregion //#region src/type-conversion/AsRef.d.ts type AsRef = T extends Container ? T & { value: unknown; } : never; //#endregion //#region src/type-conversion/AsString.d.ts type OnlyString = As$1, readonly string[]>; /** * **AsString** * * Attempts to convert `T` to a string type where possible. * * - will convert any string, boolean, or numeric value * to a string value * - `42` -> `"42"` * - number -> `${number}` * - true -> `"true"` * - union types who's elements include at least one element of * `string` | `number | `boolean` will be converted to an appropriate * string literal: * - `"foo" | 42 | true` will be converted to `"foo" | "42" | "true"` * - wide `string[]` arrays will be converted to `string` * - a tuple of values will be made into a JS string representing that type: * - `[string, number, "foo"]` -> `"[ string, number 'foo' ]""` * * **Related:** `ToString` */ type AsString = [string] extends [T] ? string : [T] extends [string] ? T : [IsUnion] extends [true] ? OnlyString>[number] : [T] extends [number] ? `${T}` : [T] extends [boolean] ? `${T}` : [T] extends [readonly (unknown)[]] ? IsWideArray extends true ? T extends (infer Type extends string | number | boolean)[] ? `${Type}` : never : ToJsonArray : [T] extends [object] ? [T] extends [Dictionary] ? ToJsonObject : never : never; //#endregion //#region src/type-conversion/AsStringUnion.d.ts type ConvertUnion$1 = TupleToUnion<{ [K in keyof T]: [T[K]] extends [string] ? T[K] : [T[K]] extends [number] ? `${T[K]}` : [T[K]] extends [boolean] ? `${T[K]}` : [THandle] extends ["drop"] ? never : T[K] }>; /** * **AsStringUnion**`` * * A type conversion utility which ensures unions (and a few literals) are * converted to string literal variants: * * - if `T` is a union type, all _numeric_ or _boolean_ elements in the union * will be converted to a string literal equivalent and others will be dropped * - if you would prefer non-convertible types are left as part of the union * you can set the `THandle` to "proxy" (instead of the default "drop") * * For non-union types, the goal is to address a similar outcome which is: * * - if `T` is of type `number` or `boolean` then this is converted to a * string literal equivalent * - all other types result in `never` or are just proxied through if * `THandle` is set to "proxy" */ type AsStringUnion = [IsUnion] extends [true] ? ConvertUnion$1, THandle> : [T] extends [string] ? T : [T] extends [number] ? `${T}` : [T] extends [boolean] ? `${T}` : [THandle] extends ["drop"] ? never : T; //#endregion //#region src/type-conversion/AsTuple.d.ts /** * **AsTuple**`` * * Similar to `AsArray` but will convert union types to tuples as well * as scalar values. */ type AsTuple = IsUnion extends true ? UnionToTuple : IsArray extends true ? T : [T]; //#endregion //#region src/type-conversion/AsUnion.d.ts /** * **AsUnion**`` * * Converts any tuple into a union based on the tuples elements. Otherwise, * simply passes `T` through unchanged. */ type AsUnion = T extends readonly any[] ? T[number] : T; //#endregion //#region src/type-conversion/Awaited.d.ts /** * **Awaited**`` * * Unwraps the expected return value inside a promise-like * result. */ type Awaited$1 = T extends Promise ? Type : T extends PromiseLike ? Type : T extends Thenable ? ReturnType : never; //#endregion //#region src/type-conversion/BaseType.d.ts type BaseType = T extends string ? string : T extends number ? number : IsNull extends true ? null : IsUndefined extends true ? undefined : T extends boolean ? boolean : T extends readonly unknown[] ? readonly unknown[] : T extends Dictionary ? Dictionary : T extends AnyMap ? AnyMap : T extends AnySet ? AnySet : T extends AnyWeakMap ? AnyWeakMap : unknown; //#endregion //#region src/type-conversion/Break.d.ts /** * **Break** * * Takes a string `T`, and splits it into a tuple of the form `[F, R]`. * ```ts * // ["the", " long and winding road"] * type T1 = Break<"the long and winding road", " ">; * // ["there", " I was, there I was"] * type T2 = Break<"there I was, there I was", " ">; * ``` * * **Related:** `Split` */ type Break$1 = (string extends T ? [string, string] : (T extends `${infer F}${D}${infer _R}` ? (F extends `${infer _X}${D}${infer _Y}` ? never : (T extends `${F}${infer R}` ? [F, R] : never)) : [T, ""])); //#endregion //#region src/type-conversion/encoding/EncodingDefinition.d.ts /** * **EncodingDefinition**`` * * An encoding and decoding tuple for converting one * string literal type to another. */ interface EncodingDefinition> { kind: "EncodingDefinition"; defn: TDefn; } //#endregion //#region src/type-conversion/encoding/EncodingLookups.d.ts type SafeEncoding__Quotes = Mutable; type SafeEncoding__Whitespace = Mutable; type SafeEncoding__Brackets = Mutable; type SafeEncodingKey__Quotes = keyof SafeEncoding__Quotes; type SafeEncodingKey__Whitespace = keyof SafeEncoding__Whitespace; type SafeEncodingKey__Brackets = keyof SafeEncoding__Brackets; type SafeDecodingKey__Quotes = Values[number]; type SafeDecodingKey__Whitespace = Values[number]; type SafeDecodingKey__Brackets = Values[number]; type SafeEncodingConversion = [] extends T ? R : SafeEncodingConversion, [...R, ...(First$1 extends "quotes" ? AsFromTo : First$1 extends "brackets" ? AsFromTo : First$1 extends "whitespace" ? AsFromTo : [])]>; type Esc = { [K in keyof T]: { from: Concat<[BackTick, T[K]["from"]]>; to: T[K]["to"]; } }; type EscapedSafeEncodingConversion = [] extends T ? R : SafeEncodingConversion, [...R, ...(First$1 extends "quotes" ? Esc> : First$1 extends "brackets" ? Esc> : First$1 extends "whitespace" ? Esc> : [])]>; type SafeDecodingConversion = [] extends T ? R : SafeDecodingConversion, [...R, ...(First$1 extends "quotes" ? AsFromTo> : First$1 extends "brackets" ? AsFromTo> : First$1 extends "whitespace" ? AsFromTo> : [])]>; //#endregion //#region src/type-conversion/encoding/SafeDecode.d.ts /** * **SafeDecode**`` * * Decodes an encoded `SafeString` back to a normal string. * Groups are: * * - "whitespace" * - "quotes" * - and "brackets" * * By default ALL are used. */ type SafeDecode = IsStringLiteral$1 extends true ? ReplaceAllFromTo> : string; //#endregion //#region src/type-conversion/encoding/SafeEncode.d.ts /** * **SafeEncode**`` * * Encodes string into a `SafeString` using some or all of the * "safe key" groups. Groups are: * * - "whitespace" * - "quotes" * - and "brackets" * * By default ALL are used. * * **Related:** `SafeEncodeEscaped` */ type SafeEncode = IsStringLiteral$1 extends true ? ReplaceAllFromTo> : SafeString; /** * **SafeEncodingEscaped**`` * * Looks for _escaped characters_ in `T` and applies safe encoding to * only those characters which have been explicitly marked via the `\` * escape notation. */ type SafeEncodeEscaped = IsStringLiteral$1 extends true ? ReplaceAllFromTo> : SafeString; //#endregion //#region src/type-conversion/encoding/SafeEncodingGroup.d.ts type SafeEncodingGroup = "whitespace" | "brackets" | "quotes"; //#endregion //#region src/type-conversion/encoding/SafeString.d.ts /** * **SafeString** * * A string which was encoded using `safeEncode()` runtime utility or `SafeEncode` type * utility. It is a string which has had one of several "groups" of characters replaced * (aka., encoded) into a safe token value. * * - use `safeDecode()` or `SafeDecode` utilities to move back to the original string value. */ type SafeString = Brand; encoded: T; }>; //#endregion //#region src/type-conversion/encoding/StringEncoder.d.ts /** * **StringEncoder** * * A base type for _string encoders_ which take a string and convert * to anther type of string. */ type StringEncoder = (input: T) => R; //#endregion //#region src/type-conversion/form-fields.d.ts /** * **Email** * * A simple email address representation * * **Related:** `IsEmail`, `isEmail()` */ type Email = `${string}@${string}.${T}`; //#endregion //#region src/type-conversion/Immutable.d.ts type NeverOnSet = T extends `set${infer Name}` ? Name extends Capitalize ? never : T : T; /** * **Immutable**`` * * An alternative to `Readonly` but adds: * * - removes the types of all _setter_ methods in the values of `T` * - deeply sets container properties as read-only (rather than just top level properties) * * **Related:** `immutable()`, `freeze()`, `var Object.freeze()` */ type Immutable = Expand<{ readonly [K in keyof T as T[K] extends AnyFunction ? NeverOnSet : K]: T[K] extends object ? TDeep extends false ? T[K] : Immutable : T[K] }>; //#endregion //#region src/type-conversion/IntersectionToTuple.d.ts type IntersectionToTuple = (T extends any ? (x: T) => void : never) extends ((x: infer U) => void) ? [...IntersectionToTuple>, U] : []; //#endregion //#region src/type-conversion/LeftWhitespace.d.ts /** * Provides the _left_ whitespace of a string * ```ts * // "\n\t " * type T = LeftWhitespace<"\n\t foobar">; * ``` */ type LeftWhitespace = string extends S ? string : Replace extends string ? TrimLeft : never, "">; //#endregion //#region src/type-conversion/MapKeys.d.ts type CaseOptions = "none" | "PascalCase" | "CamelCase" | "SnakeCase" | "KebabCase"; interface MapKeysOptions { /** * Indicates whether to replace _all_ `from` instances in the key or * just the first one. Default is `true`. */ replaceAll: boolean; /** * switch the _casing_ standard of all keys (camelCase, PascalCase, etc.) */ casing: CaseOptions; } interface DEFAULT extends MapKeysOptions { replaceAll: true; casing: "none"; } type Process$54 = DEFAULT> = TConfig extends readonly FromTo[] ? TOpt["replaceAll"] extends false ? { [K in keyof TObj as ReplaceFromTo]: TObj[K] extends Dictionary ? Process$54 : TObj[K] } : { [K in keyof TObj as ReplaceAllFromTo]: TObj[K] extends Dictionary ? Process$54 : TObj[K] } : TConfig extends Dictionary ? AsFromTo extends infer Config extends readonly FromTo[] ? Process$54 : never : TConfig extends EmptyObject ? TObj : never; type Go | readonly FromTo[]> = T extends readonly FromTo[] ? T : T extends Dictionary ? AsFromTo : never; /** * **MapKeys**`` * * Maps a given `TObj`'s keys to a variant set of keys. * * - keys are mapped with `TMap` * - `TMap` can either be a dictionary config or a tuple of `FromTo` instructions * - the TMap transforms are done _before_ any "case-based" transforms from * the options hash. * * - `TOpt` allows you to express: * - `deep` - whether the traversal should be deep or not (default is **true**) * - `replaceAll` - whether _all instances_ of `from` in the key should be replaced * or just the first instance (default is **true**) * * ```ts * // { Foo: { Bar: 2 }} * type Obj = MapKeys<{ _foo_: { _bar_: 2 }}, [ * { from: "f"; to: "F" }, * { from: "b"; to: "B" }, * { from: "_"; to: "" } * ]> * ``` */ type MapKeys, TOpt extends Partial = DEFAULT> = Go extends infer Config extends readonly FromTo[] ? TOpt["casing"] extends "CamelCase" ? Process$54 extends infer Camel extends Dictionary ? CamelKeys : never : TOpt["casing"] extends "PascalCase" ? PascalKeys> : TOpt["casing"] extends "KebabCase" ? KebabKeys> : TOpt["casing"] extends "SnakeCase" ? SnakeKeys> : Process$54 : never; //#endregion //#region src/type-conversion/Merge.d.ts /** * **MergeScalars**`` * * Provides a `Scalar` value by evaluating whether `TDefault` * and `TOverride` extends `TEmpty` (which is `null` | `undefined` * by default). * * Note: if both `TDefault` and `TOverride` are _undefined_ then the * exiting type will be _undefined_ (which isn't strictly a `Scalar` * value). */ type MergeScalars = TDefault extends TEmpty ? TOverride : TOverride extends TEmpty ? TDefault : TOverride; type MergeTuplesAcc = TOverride extends [infer Override, ...infer Rest extends unknown[]] ? If, MergeTuplesAcc, Rest, TKey, [...TResults, First$1]>, MergeTuplesAcc, Rest, TKey, [...TResults, Override]>> : readonly [...TResults, ...TDefault]; /** * **MergeTuples** * * Merges two tuple arrays by position in the tuple: * * - if `TOverride` is longer than `TDefault` then no defaults will be provided * - if `TDefault` is longer than `TOverride` then `TDefault` will be extended */ type MergeTuples = MergeTuplesAcc<[...TDefault], [...TOverride], TKey>; type Process$53 = And<[DoesExtend, DoesExtend]> extends true ? MergeObjects, AsDictionary> : And<[DoesExtend, DoesExtend]> extends true ? MergeScalars : And<[DoesExtend, DoesExtend]> extends true ? MergeTuples : never; /** * **Merge**`` * * A type utility that will merge any two like values together. * * **Related:** `MergeObjects`, `MergeScalars`, `MergeTuples` */ type Merge = AreSameType extends true ? Process$53 : IsNothing extends true ? TOverride : Err<"invalid-merge", `Merge received two empty values; at least one needs to have a value!`, { library: "inferred-types/constants"; TDef: TDefault; TOver: TOverride; }>; //#endregion //#region src/type-conversion/MergeObjects.d.ts /** * **MergeObjects**`` * * A type utility that _shallowly merges_ two object types. * * Properties in TOverride will override properties in TDef. * This implementation avoids excessive recursion when dealing with optional properties. */ type MergeObjects = ExpandDictionary & TOverride>; //#endregion //#region src/type-conversion/Mutable.d.ts type MutableObject = [T] extends [boolean] ? T : { -readonly [K in keyof T]: T[K] extends Dictionary ? Mutable> : IsTuple extends true ? Mutable : T[K] extends readonly (infer R)[] ? [...R[]] : Mutable }; type MutableArray = [...{ [K in keyof T]: Mutable }]; /** * **Mutable**`` * * Makes a readonly type -- either a dictionary or an array -- into a mutable value without * widening the type. */ type Mutable = [IsUnion] extends [true] ? T : [T] extends [infer Arr extends readonly unknown[]] ? MutableArray : [T] extends [infer Dict extends Dictionary] ? MutableObject : T; //#endregion //#region src/type-conversion/numeric/HexToDecimal.d.ts type H2D = Lowercase extends "f" ? 15 : Lowercase extends "e" ? 14 : Lowercase extends "d" ? 13 : Lowercase extends "c" ? 12 : Lowercase extends "b" ? 11 : Lowercase extends "a" ? 10 : Lowercase extends "9" ? 9 : Lowercase extends "8" ? 8 : Lowercase extends "7" ? 7 : Lowercase extends "6" ? 6 : Lowercase extends "5" ? 5 : Lowercase extends "4" ? 4 : Lowercase extends "3" ? 3 : Lowercase extends "2" ? 2 : Lowercase extends "1" ? 1 : 0; type _HexToDecimalArray = As$1<{ [K in keyof T]: H2D }, readonly number[]>; type HexByte = Lowercase extends "0" ? H2D : Lowercase extends "1" ? [16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31][H2D] : Lowercase extends "2" ? [32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47][H2D] : Lowercase extends "3" ? [48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63][H2D] : Lowercase extends "4" ? [64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79][H2D] : Lowercase extends "5" ? [80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95][H2D] : Lowercase extends "6" ? [96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111][H2D] : Lowercase extends "7" ? [112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127][H2D] : Lowercase extends "8" ? [128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143][H2D] : Lowercase extends "9" ? [144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159][H2D] : Lowercase extends "a" ? [160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175][H2D] : Lowercase extends "b" ? [176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191][H2D] : Lowercase extends "c" ? [192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207][H2D] : Lowercase extends "d" ? [208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223][H2D] : Lowercase extends "e" ? [224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239][H2D] : [240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255][H2D]; type HexCharsToDecimal = T extends readonly [infer A extends HexadecimalChar, infer B extends HexadecimalChar, ...infer Rest extends readonly HexadecimalChar[]] ? TDepth["length"] extends 64 ? number[] : HexCharsToDecimal], [...TDepth, unknown]> : T extends readonly [infer A extends HexadecimalChar] ? [...V, H2D] : V; /** * **HexToDecimal**`` * * Iterates left-to-right, peeling off two hexadecimal digits at a time * until there are only 0 or 1 digits left (adds final digit if 1 is left). * What is left is an array of decimal numbers ranging from 0-255. * * ```ts * // [15] * type T1 = HexToDecimal<"f">; * // [255] * type T2 = HexToDecimal<"ff"> * // [255] * type T3 = HexToDecimal<"0xFF"> * // [255, 238, 9] * type T4 = HexToDecimal<"ffee09"> * ``` */ type HexToDecimal = T extends number ? number extends T ? number[] : [T] : T extends `0x${infer Rest}` ? HexToDecimal : T extends "" ? [0] : string extends T ? number[] | Err<"invalid-type/hexadecimal"> : IsHexadecimal extends true ? string extends T ? number | Error : Chars> extends readonly HexadecimalChar[] ? HexCharsToDecimal>> : never : Err<"invalid-type/hexadecimal">; /** * HexToDecimalArray * * convert a hexadecimal number into an array of decimal numbers * on a digit by digit basis. * * **Related:** `HexToDecimal` */ type HexToDecimalArray = string extends T ? number | Error : T extends `0x${infer Rest}` ? HexToDecimalArray : T extends "" ? [0] : IsHexadecimal extends true ? Chars> extends readonly HexadecimalChar[] ? _HexToDecimalArray>> : never : Err<"invalid-type/hexadecimal">; //#endregion //#region src/type-conversion/ObjectToCssString.d.ts type Prefix$4 = As$1; type Process$52 = Join<{ [K in keyof T]: T[K]["key"] extends infer Key extends string ? `${Prefix$4}${Key}: ${AsString}` : never }, "; ">; /** * **ObjectToCssString**`` * * Converts a Javascript object into a CSS representation. * * **Related:** `ObjectToJsString`, `ObjectToJsonString`, `ObjectToTuple` */ type ObjectToCssString = Keys$1["length"] extends 0 ? "{}" : IsWideObject extends true ? IsEqual extends true ? "{}" : `{${string}}` : TObj extends ExplicitlyEmptyObject ? "{}" : Process$52>, false> extends infer P extends string ? Surround : never; //#endregion //#region src/type-conversion/ObjectToJsonString.d.ts type Prefix$3 = T extends true ? "\n " : ""; type Process$51 = Join<{ [K in keyof T]: T[K]["key"] extends string ? T[K]["value"] extends string ? `${Prefix$3}"${T[K]["key"]}": "${T[K]["value"]}"` : `${Prefix$3}"${T[K]["key"]}": ${AsString}` : never }, ", ">; /** * **ObjectToJsonString**`` * * Converts a Javascript object into a JSON string representation. * * **Related:** `ObjectToCssString`, `ObjectToJsString`, `ObjectToTuple` */ type ObjectToJsonString = TObj extends ExplicitlyEmptyObject ? "{}" : IsWideContainer extends true ? string : `{ ${Process$51, TExpand>} }`; //#endregion //#region src/type-conversion/ObjectToJsString.d.ts type Prefix$2 = T extends true ? "\n " : ""; type Process$50 = Join<{ [K in keyof T]: T[K]["key"] extends string ? T[K]["value"] extends string ? `${Prefix$2}${T[K]["key"]}: "${T[K]["value"]}"` : `${Prefix$2}${T[K]["key"]}: ${AsString}` : T[K]["key"] extends symbol ? T[K]["value"] extends string ? `${Prefix$2}[key: symbol]: "${T[K]["value"]}"` : `${Prefix$2}[key: symbol]: ${AsString}` : never }, ", ">; /** * **ObjectToJsString**`` * * Converts a Javascript object into a string representation. * * **Related:** `ObjectToCssString`, `ObjectToJsonString`, `ObjectToTuple` */ type ObjectToJsString = TObj extends ExplicitlyEmptyObject ? "{}" : IsWideContainer extends true ? string : `{ ${Process$50, TExpand>} }`; //#endregion //#region src/type-conversion/ObjectToKeyframeString.d.ts type Prefix$1 = T extends true ? "\n " : ""; type Process$49[], E extends boolean> = Join<{ [K in keyof T]: T[K] extends Record ? Value extends AnyObject ? `${Prefix$1}${Key} ${AsString}` : never : never }, "\n ">; /** * **ObjectToKeyframeString**`` * * Converts a Javascript object into a CSS Keyframe representation. * * **Related:** `ObjectToJsString`, `ObjectToJsonString`, `ObjectToTuple`, `ObjectToCssString` */ type ObjectToKeyframeString = TObj extends ExplicitlyEmptyObject ? "{}" : IsWideContainer extends true ? string : Surround, false>, TExpand extends false ? "{ " : "{\n ", TExpand extends false ? " }" : "\n}">; //#endregion //#region src/type-conversion/Promised.d.ts /** * **Promised**`` * * Ensures that the value `T` is a _thenable_ `PromiseLike` * structure by converting non-`Thenable` values to * `Promise`. * * **Related:** `Synchronous`, `Thenable`, `Awaited` */ type Promised = T extends Thenable ? T : Promise; /*** * **Asynchronous**`` * * - An alias for the `Promised` type * - Ensures `T` is returned as a `PromiseLike` type * * **Related:** `Promised`, `Synchronous`, `Thenable`, `Awaited` */ type Asynchronous = Promised; //#endregion //#region src/type-conversion/ReduceValues.d.ts type ProcessTuple$2 = [] extends TArray ? TResults : First$1 extends TypedFunction ? ProcessTuple$2, [...TResults, ReturnType>]> : ProcessTuple$2, [...TResults, First$1]>; /** * **ReduceValues**`` * * Reduces a container to it's _values_ where if it's a function then the * `ReturnType` is returned, if not a function than just it's normal value. * * ```ts * // [true, "blue"] * type T = ReduceValues<[true, false, () => true, () => "blue"] * ``` * * **Related:** `ReturnValues`, `Values` */ type ReduceValues = TContainer extends readonly unknown[] ? ProcessTuple$2 : IsDictionary extends true ? ProcessTuple$2> : never; //#endregion //#region src/type-conversion/RemoveFromEnd.d.ts /** * **RemoveFromEnd**`` * * Type utility which removes selected text -- `TRemove` -- from the end of `TContent`. * * Note: if `TRemove` is not found then `TContent is left unchanged */ type RemoveFromEnd = TContent extends `${infer Start}${TRemove}` ? Start : TContent; //#endregion //#region src/type-conversion/RemoveFromStart.d.ts /** * **RemoveFromStart**`` * * Type utility which removes selected text -- `TRemove` -- from the beginning of `TContent`. * * Note: if `TRemove` is not found then `TContent is left unchanged */ type RemoveFromStart = TContent extends `${TRemove}${infer Rest}` ? Rest : TContent; //#endregion //#region src/type-conversion/RemoveIndex.d.ts /** * **RemoveIndex**`` * * Removes an index like below while retaining other key/value pairs. * ```ts * interface Foo { * foo: string; * [key: string]: any; * } * // { foo: string } * type T = RemoveIndex; * ``` * * @deprecated use `RemoveIndexKeys` instead * */ type RemoveIndex> = { [P in keyof T as string extends P ? never : number extends P ? never : symbol extends P ? never : P]: T[P] }; //#endregion //#region src/type-conversion/RenameKey.d.ts /** * **RenameKey**`` * * Renames a key in `T`. */ type RenameKey = MapKeys; //#endregion //#region src/type-conversion/Replace.d.ts type Process$48 = TText extends "" ? If, TReplace, ""> : TFind extends "" ? TText : TText extends `${infer F}${TFind}${infer E}` ? `${F}${TReplace}${E}` : TText; /** * **Replace**`` * * Type utility which takes a string `TText` and finds the _first instance_ of * `TFind` and replaces it with `TReplace`. * * ```ts * type Fooy = "fooy"; * // "Foo" * type Foo = Replace; * ``` * * Alternatively you can pass in `TFind` as an array of `FromTo` objects to describe * multiple transformations at once. * * ```ts * type Fooy = "fooy"; * // "Pooey" * type Pooey = Replace; * ``` * * **Related:** `ReplaceAll`, `ReplaceToFrom`, `ReplaceAllToFrom` */ type Replace = IsStringLiteral$1 extends true ? As$1, string> : string; //#endregion //#region src/type-conversion/ReplaceAll.d.ts type ReplaceAllLiterals$2 = TText extends `${infer Head}${TFind}${infer Tail}` ? `${Head}${TReplace}${ReplaceAllLiterals$2}` : TText; type Iterate$5 = [] extends TFind ? TText : Iterate$5, TReplace>, AfterFirst, TReplace>; type Singular = IsStringLiteral$1 extends true ? IsStringLiteral$1 extends true ? IsUnion extends true ? UnionToTuple extends readonly string[] ? Iterate$5, TReplace> : never : ReplaceAllLiterals$2 : string : string; type EachTupleElement = { [K in keyof TText]: ReplaceAll }; /** * **ReplaceAll**`` * * Type utility which takes a string `TText` and finds _all_ instances of * `TFind` and replaces it with `TReplace`. * * ```ts * const fooy = "fooy, Joey"; * // "foo, Joe" * type Foo = ReplaceAll; * ``` * * **Related:** `Replace` * * - **Note:** this utility has been upgraded to take either a _string_ or a * _tuple_ of strings for `TText`. */ type ReplaceAll = TText extends readonly string[] ? IsLiteralLike extends true ? EachTupleElement : string[] : TText extends string ? Singular : never; //#endregion //#region src/type-conversion/ReplaceAllFromTo.d.ts type ReplaceAllFromToLiteral$1 = Mappings extends readonly [infer First extends { from: string; to: string; }, ...infer Rest extends { from: string; to: string; }[]] ? ReplaceAllFromToLiteral$1, Rest> : S; type ReplaceAllLiterals$1 = TText extends `${infer Head}${TFind}${infer Tail}` ? `${Head}${TReplace}${ReplaceAllLiterals$1}` : TText; type ApplyMapping$1 = ReplaceAllLiterals$1; /** * **ReplaceAllFromTo**`` * * Replaces the _all instances_ of the `from` element of `TFromTo` found in * `TText` with the corresponding `to` value in `TFromTo`. * * ```ts * // "Foo-bar-baz" * type Dashing = Replace<"Foo Bar Baz", [ * { from: " "; to: "-" }, * { from: "B"; to: "b" } * ]>; * ``` * **Related:** `Replace`, `ReplaceAll` * * **Notes:** * - does allow TText to be passed in as a _symbol_ but when it is * it is ignored and passed through * - it also allows numeric values to be passed through and in those cases * the numbers are converted to a `NumberLike` type */ type ReplaceAllFromTo = TText extends string ? ReplaceAllFromToLiteral$1 : TText extends number ? ReplaceAllFromTo<`${TText}`, TMappings> : TText; //#endregion //#region src/type-conversion/ReplaceAllToFrom.d.ts type ReplaceAllFromToLiteral = Mappings extends readonly [infer First extends { from: string; to: string; }, ...infer Rest extends { from: string; to: string; }[]] ? ReplaceAllFromToLiteral, Rest> : S; type ReplaceAllLiterals = TText extends `${infer Head}${TFind}${infer Tail}` ? `${Head}${TReplace}${ReplaceAllLiterals}` : TText; type ApplyMapping = ReplaceAllLiterals; /** * **ReplaceAllToFrom**`` * * Intended to be used to produce a "reverse FromTo". * Replaces the _all instances_ of the `to` element of `TFromTo` found in * `TText` with the cooresponding `from` value in `TFromTo`. * * ```ts * // "Foo-bar-baz" * type Dashing = Replace<"Foo Bar Baz", [ * { from: " "; to: "-" }, * { from: "B"; to: "b" } * ]>; * ``` * **Related:** `ReplaceAllFromTo` * * **Notes:** * - does allow TText to be passed in as a _symbol_ but when it is * it is ignored and passed through * - it also allows numeric values to be passed through and in those cases * the numbers are converted to a `NumberLike` type */ type ReplaceAllToFrom = TText extends string ? ReplaceAllFromToLiteral : TText extends number ? ReplaceAllToFrom<`${TText}`, TMappings> : TText; //#endregion //#region src/type-conversion/ReplaceFromTo.d.ts type ProcessFromTo = [] extends TFromTo ? TText : First$1 extends { from: infer From extends string; to: infer To extends string; } ? ProcessFromTo, AfterFirst> : never; type MAX = 35; type ExcessProcessor = TakeFirst extends infer FirstItems extends readonly FromTo[] ? ProcessFromTo : never; /** * **ReplaceFromTo**`` * * Replaces the first instance of each `from` element of `TFromTo` found in * `TText` with the cooresponding `to` value in `TFromTo`. * * ```ts * type Fooy = "fooy"; * // "Pooey" * type Pooey = Replace; * * **Related:** `Replace`, `ReplaceAll`, `ReplaceAllToFrom` * - does allow TText to be passed in as a _symbol_ but when it is * it is ignored and passed through * - it also allows numeric values to be passed through and in those cases * the numbers are converted to a `NumberLike` type */ type ReplaceFromTo = TText extends string ? IsStringLiteral$1 extends true ? IsGreaterThan extends true ? ExcessProcessor : ProcessFromTo : string : TText extends number ? ReplaceFromTo<`${TText}`, TFromTo> : TText; //#endregion //#region src/type-conversion/ReplaceType.d.ts /** * **ReplaceType** * * Replaces types which extend `TFind` with `TReplace` within `TContent`. * * - will work where `TContent` is a tuple, a union type or just a bare type */ type ReplaceType = TContent extends readonly any[] ? { [K in keyof TContent]: ReplaceType } : [TContent] extends [TFind] ? TReplace : TContent; //#endregion //#region src/type-conversion/RetainChars.d.ts type Retention = TChar extends `${infer Head}${infer Rest}` ? Head extends TRemove ? Retention : Retention : TRetain; /** * **RetainChars**`` * * Converts a string `TContent` into a string with all * of the characters in `TRetain` _retained_ while all * other characters are removed. */ type RetainChars = string extends TContent ? string : string extends TRetain ? string : Retention; //#endregion //#region src/type-conversion/ReturnValues.d.ts type ProcessTuple$1 = [] extends TArray ? TResults : First$1 extends TypedFunction ? ProcessTuple$1, [...TResults, ReturnType>]> : ProcessTuple$1, TResults>; /** * **ReturnValues**`` * * Reduces a container's values down to just the return type of the * functions. * ```ts * // [true, "blue"] * type T = ReturnValues<[true, false, () => true, () => "blue"] * ``` * * **Related:** `ReduceValues` */ type ReturnValues = TContainer extends readonly unknown[] ? ProcessTuple$1 : TContainer extends Dictionary ? ProcessTuple$1> : never; //#endregion //#region src/type-conversion/RightWhitespace.d.ts /** * Provides the _left_ whitespace of a string * ```ts * // "\n\t " * type T = LeftWhitespace<"\n\t foobar">; * ``` */ type RightWhitespace = string extends S ? string : Replace, "">; //#endregion //#region src/type-conversion/StringLength.d.ts /** * Type utility that provides the _length_ of a given string type in a way which * is _not_ limited to TS's recursive string length of roughly 48. * * ```ts * // 3 * type Three = StringLength<"foo">; * ``` */ type StringLength = S extends `${infer _First}${infer _Second}${infer _Third}${infer _Fourth}${infer _Fifth}${infer _Sixth}${infer _Seventh}${infer _Eighth}${infer _Ninth}${infer _Tenth}${infer Rest}` ? StringLength : S extends `${infer _First}${infer _Second}${infer _Third}${infer _Fourth}${infer _Fifth}${infer _Sixth}${infer _Seventh}${infer _Eighth}${infer _Ninth}${infer Rest}` ? StringLength : S extends `${infer _First}${infer _Second}${infer _Third}${infer _Fourth}${infer _Fifth}${infer _Sixth}${infer _Seventh}${infer _Eighth}${infer Rest}` ? StringLength : S extends `${infer _First}${infer _Second}${infer _Third}${infer _Fourth}${infer _Fifth}${infer _Sixth}${infer _Seventh}${infer Rest}` ? StringLength : S extends `${infer _First}${infer _Second}${infer _Third}${infer _Fourth}${infer _Fifth}${infer _Sixth}${infer Rest}` ? StringLength : S extends `${infer _First}${infer _Second}${infer _Third}${infer _Fourth}${infer _Fifth}}${infer Rest}` ? StringLength : S extends `${infer _First}${infer _Second}${infer _Third}${infer _Fourth}${infer Rest}` ? StringLength : S extends `${infer _First}${infer _Second}${infer _Third}${infer Rest}` ? StringLength : S extends `${infer _First}${infer _Second}${infer Rest}` ? StringLength : S extends `${infer _First}${infer Rest}` ? StringLength : [...R]["length"]; //#endregion //#region src/type-conversion/StringLiteralFromTuple.d.ts type LitString = [] extends TItems ? TLiteral : LitString, First$1 extends string ? IsStringLiteral$1> extends true ? `${TLiteral}${First$1}` : `${TLiteral}${string}` : First$1 extends number ? IsNumericLiteral> extends true ? `${TLiteral}${First$1}` : `${TLiteral}${number}` : TLiteral>; /** * **StringLiteralFromTuple**`` * * Receives a tuple and creates a string literal type based * on the sequence of elements in the tuple. * * ```ts * // `${string}(${number})${string}` * type Lit=StringLiteralFromTuple<[ * string, "(", number, ")", string * ]>; * ``` */ type StringLiteralFromTuple = LitString; //#endregion //#region src/type-conversion/StripChars.d.ts type Removal = TContent extends `${infer Head}${infer Remaining}` ? Removal : TCollect; /** * **StripChars**`` * * Converts a string `TContent` into a string with all * of the characters in `TStrip` removed. * * - `TStrip` must be a single character or a union * of single characters */ type StripChars = string extends TContent ? string : string extends TStrip ? string : Removal; //#endregion //#region src/type-conversion/Synchronous.d.ts /** * **Synchronous**`` * * Ensures that the value `T` is a _thenable_ `PromiseLike` * structure by converting non-`Thenable` values to * `Promise`. * * **Related:** `Promised`, `Asynchronous`(alias), `Thenable`, `Awaited` */ type Synchronous = T extends Thenable ? Awaited$1 : T; //#endregion //#region src/type-conversion/ToBoolean.d.ts /** * **ToBoolean**`` * * Type utility which converts `T` into a boolean type regardless of * `T`'s underlying type. * * - _boolean_ values are proxied through * - _scalar_ values are tested with the JS Truthy test to return a true/false value * - _containers_ with no keys evaluate to false, with keys to true * - _never_, _null_, and _undefined_ map to false * - all other values return the wide "boolean" type */ type ToBoolean = If, false, T extends boolean ? T : T extends Scalar ? If, true, If, false, boolean>> : T extends readonly unknown[] ? If["length"], 0>, false, true> : T extends AnyObject ? If>["length"], 0>, false, true> : If, false, boolean>>; //#endregion //#region src/type-conversion/ToJson.d.ts type Enc$1> = TOpt["encode"] extends true ? SafeEncode : T; type AsJsonArray = Join<["[ ", ...ToStringArray, " ]"]>; /** * **ToJsonValue**`` * * Converts the value in `T` to a form appropriate for a * JSON value. * * Note: all outputs are a _string_ but: * * - string are placed in double quotes * - tuples are processed recursively */ type ToJsonValue = T extends string ? `${Q}${T}${Q}` : T extends number ? `${T}` : T extends boolean ? `${T}` : T extends undefined ? "undefined" : T extends null ? "null" : T extends readonly unknown[] ? AsJsonArray }, string>> : never; type InnerArray$1> = As$1<{ [K in keyof T]: T[K] extends string ? `${O["quote"]}${T[K]}${O["quote"]}` : Or<[Extends, Extends, Extends, Extends]> extends true ? `${As$1}` : T[K] extends readonly any[] ? ToJsonArray : T[K] extends Dictionary ? `{ ${InnerObject$2, O>} }` : never }, readonly string[]>; /** * **ToJsonArray**`` * * Converts an array to a JSON string of the same type. * * **Related:** `ToJson`, `ToJsonObject`, `ToJsonScalar` */ type ToJsonArray = InnerArray$1> extends readonly string[] ? Join>, ", "> extends infer Inner extends string ? `[ ${Inner} ]` : never : never; type InnerObject$2 = { quote: "\""; encode: false; }, R extends readonly string[] = []> = [] extends K ? Join : InnerObject$2, O, [...R, Or<[Extends], number>, Extends], boolean>, Equals], null>, Equals], undefined>]> extends true ? `${O["quote"]}${First$1}${O["quote"]}: ${As$1], boolean | number | null | undefined>}` : T[First$1] extends string ? `${O["quote"]}${First$1}${O["quote"]}: ${O["quote"]}${T[First$1]}${O["quote"]}` : T[First$1] extends readonly unknown[] ? `${O["quote"]}${First$1}${O["quote"]}: ${ToJsonArray], O>}` : T[First$1] extends Dictionary ? `${O["quote"]}${First$1}${O["quote"]}: ${ToJsonObject]>}` : never]>; /** * **ToJsonObject**`` * * Converts an object type `T` to a JSON string of the same type. * * **Related:** `ToJson`, `ToJsonArray`, `ToJsonScalar` */ type ToJsonObject = { quote: "\""; encode: false; }> = `{ ${InnerObject$2, O>} }`; /** * **ToJsonScalar**`` * * Converts a scalar value to the JSON string representation. * * **Related:** `ToJson`, `ToJsonArray`, `ToJsonObject` */ type ToJsonScalar, O extends Required = { quote: "\""; encode: false; }> = T extends string ? `${O["quote"]}${Enc$1}${O["quote"]}` : `${As$1}`; interface ToJsonOptions { quote?: QuoteCharacter; encode?: boolean; } /** * Merges user options with defaults to create `Required` */ type O$2 = As$1>, Required>; /** * Converts an object, array or scalar value to a * strongly typed JSON string. * * **Related:** * - `ToJsonObject`, `ToJsonArray`, `ToJsonScalar` * - `ToStringLiteral` */ type ToJson | Dictionary | Tuple$1, Opt extends ToJsonOptions = { quote: "\""; encode: false; }> = T extends Exclude ? ToJsonScalar, Required>> : T extends Dictionary ? ToJsonObject, Required>> : T extends Tuple$1 ? ToJsonArray, Required>> : never; //#endregion //#region src/type-conversion/ToNumber.d.ts /** * **ToNumber**`` * * - Converts `T` into a numeric type: * - if `T` is a Scalar/Object it's converted to a number where possible * - if `T` is an array then each element will be converted to a number where possible * - any non-numeric content which can not be converted to a number will be convert to `never` * - a number or a numeric array will be proxied through "as is" */ type ToNumber = IsTuple extends true ? TValue extends readonly unknown[] ? ToNumericArray extends readonly (number | never)[] ? ToNumericArray : Err<"can-not-convert", `Attempt to convert a tuple into a numeric tuple failed!`, { library: "inferred-types/constants"; value: TValue; }> : never : TValue extends number ? TValue : TValue extends `${infer Num extends number}` ? Num : If, IsEqual]>, 1, If, IsEqual]>, 0, If, readonly (number | never)[], never>>>; //#endregion //#region src/type-conversion/ToString.d.ts /** * Converts a union type to a string representation of the type. */ type UnionToString, O extends Required = { quote: "'"; encode: false; }, TOut extends readonly string[] = []> = [] extends TEl ? Join : UnionToString, O, ToString> extends string ? [...TOut, ToString>] : TOut>; type _ArrayToString = { quote: "'"; encode: false; }, TOut extends string = "[ "> = [] extends T ? `${TOut} ]` : _ArrayToString, O, ToString> extends string ? TOut extends "[ " ? `[ ${ToString>}` : `${TOut}, ${ToString>}` : never>; type ArrayToString = { quote: "'"; encode: false; }> = IsWideContainer extends true ? T extends (infer Kind)[] ? `${ToString}[]` : `unknown[]` : _ArrayToString; type InnerObject$1 = { quote: "'"; encode: false; }, R extends readonly string[] = []> = [] extends K ? Join : InnerObject$1, O, [...R, Or<[Extends], number>, Extends], boolean>, Equals], null>, Equals], undefined>]> extends true ? `${First$1}: ${As$1], boolean | number | null | undefined>}` : T[First$1] extends string ? `${First$1}: ${O["quote"]}${T[First$1]}${O["quote"]}` : T[First$1] extends readonly unknown[] ? `${First$1}: ${ArrayToString], O>}` : T[First$1] extends Dictionary ? `${First$1}: ${ObjectToString]>}` : never]>; type ObjectToString = { quote: "'"; encode: false; }> = IsLiteralLikeObject extends true ? `{ ${InnerObject$1, O>} }` : T extends Record ? `Record}>` : "object"; type MapToString> = T extends Map ? `Map<${ToString}, ${ToString}>` : `Map`; type SetToString> = T extends Set ? `Set<${ToString}>` : `Set`; type WeakMapToString> = T extends WeakMap ? `WeakMap<${ToString}, ${ToString}}` : `WeakMap`; /** * **ToString** * * Converts _any_ type into a string representation of that type. * * **Related:** `AsString`, `ToJson` */ type ToString = { quote: "'"; encode: false; }> = [T] extends [readonly unknown[]] ? ArrayToString : [T] extends [string] ? [IsStringLiteral$1] extends [true] ? `${O["quote"]}${T}${O["quote"]}` : "string" : [T] extends [number] ? [IsNumericLiteral] extends [true] ? `${T}` : "number" : [T] extends [boolean] ? [IsBooleanLiteral] extends [true] ? `${T}` : "boolean" : [T] extends [null] ? `null` : [T] extends [undefined] ? `undefined` : [T] extends [Set] ? SetToString : [T] extends [Map] ? MapToString : [T] extends [WeakMap] ? WeakMapToString : [T] extends [Dictionary] ? ObjectToString : [IsUnion] extends [true] ? "Union<...>" : "unknown"; //#endregion //#region src/type-conversion/ToStringArray.d.ts /** * **ToStringArray**`` * * Receives a tuple of values and converts each item * into a _string_ value using the `ToString` utility. */ type ToStringArray = As$1<{ [K in keyof T]: AsString }, readonly string[]>; //#endregion //#region src/type-conversion/ToStringLiteral.d.ts interface ToLiteralOptions { quote?: QuoteCharacter; encode?: boolean; /** * by default all scalar values are taken to be _what they are_ * but if this flag is set to `true` then string literals will * be evaluated as being an `InputToken`. */ tokensAllowed?: boolean; /** * for containers which support the concept of "optional" keys */ isOptional?: boolean; } type Enc = TOpt["encode"] extends true ? SafeEncode : T; /** * Converts the elements in an array to tokens. */ type InnerArray = As$1<{ [K in keyof T]: T[K] extends string ? `${O["quote"]}${T[K]}${O["quote"]}` : Or<[Extends, Extends, Extends, Extends]> extends true ? `${As$1}` : T[K] extends readonly any[] ? ToStringLiteral__Array : T[K] extends Dictionary ? ToStringLiteral__Object : never }, readonly string[]>; type Wrap = `(${T})[]`; type AsUnionArrayString = [] extends T ? Wrap, string>> : AsUnionArrayString, ToStringLiteral> extends infer Type extends string ? [...O, Type] : O>; type Splitter$1 = T extends [infer Head, ...infer Rest extends readonly unknown[]] ? IsGreaterThan extends true ? Splitter$1, [...R, Head], O> : Splitter$1, R, [...O, Head]> : [R, T extends [infer Last] ? [...O, Last] : O]; type ArrayWithOptionalElements> = Required extends infer Tuple extends readonly unknown[] ? Splitter$1 extends [infer Req extends readonly unknown[], infer Opt extends readonly unknown[]] ? InnerArray extends infer Req extends readonly string[] ? InnerArray extends infer Opt extends readonly string[] ? Join<[...Req, ...Each], ", "> extends infer Inner extends string ? `[ ${Inner} ]` : never : never : never : never : never; /** * **ToStringLiteral__Array**`` * * Converts an array to a string literal representing that array. * * ```ts * // "[ 1, 2, 3 ]"" * type Test = ToStringLiteral__Array<[1,2,3]>; * ``` * * **Related:** * - `ToStringLiteral`, `ToStringLiteral__Object` * - `ToJson`, `ToJsonObject`, `ToJsonScalar` */ type ToStringLiteral__Array = [TupleMeta["hasOptionalElements"]] extends [true] ? ArrayWithOptionalElements : [TupleMeta["isWide"]] extends [true] ? [T] extends [readonly (infer Type)[]] ? [IsUnion] extends [true] ? [UnionToTuple] extends [readonly unknown[]] ? AsUnionArrayString> : never : [Type] extends [Scalar] ? `${ToStringLiteral__Scalar}[]` : [Type] extends [Dictionary] ? ToStringLiteral__Object extends infer Obj extends string ? `${Obj}[]` : never : never : never : [T["length"]] extends [0] ? `[]` : InnerArray extends (infer Arr extends readonly string[]) ? Join extends infer Inner extends string ? `[ ${Inner} ]` : never : never; /** * Object keys typically do not need be surrounded by quotations * marks at least if they are of the `PascalCase` or `camelCase` * variety but if they contain spaces, dashes, or really any character * other than alphanumeric characters then they must be quoted. */ type IsObjectKeyRequiringQuotes> = [] extends TChars ? false : First$1 extends AlphanumericChar ? IsObjectKeyRequiringQuotes> : true; type KeyName = As$1; type Quote$1 = As$1}${O["quote"]}` : `"${Enc}"`, string>; /** * Builds out the key/value pairs in the an object */ type InnerObject & ObjectKey)[] = As$1>, readonly (keyof Required & ObjectKey)[]>, TOptKeys extends string | symbol = OptionalKeys, TReq extends Dictionary = Required, TResult extends readonly string[] = []> = TKeys extends [infer K extends ObjectKey & keyof TDict, ...infer Rest extends readonly ObjectKey[]] ? TReq[K] extends infer Value ? Value extends Error ? Value : [IsUnion] extends [true] ? InnerObject, TOpt> extends infer Union extends string ? [...TResult, `${KeyName}: ${Union}`] : never> : Value extends Scalar ? InnerObject}: ${ToStringLiteral__Scalar}`]> : Value extends readonly unknown[] ? InnerObject}: ${ToStringLiteral__Array}`]> : Value extends Dictionary ? ToStringLiteral__Object extends infer ObjResult ? ObjResult extends Error ? ObjResult : ObjResult extends string ? InnerObject}: ${ObjResult}`]> : never : never : never : never : TKeys extends [infer Last extends keyof Required & ObjectKey] ? [...TResult, ToStringLiteral] : TResult; /** * **ToStringLiteral__Object**`` * * Converts an object type `T` to a JSON string of the same type. * * **Related:** `ToJson`, `ToJsonArray`, `ToJsonScalar` */ type ToStringLiteral__Object = InnerObject extends infer Inner ? Inner extends Error ? Inner : Inner extends readonly string[] ? `{ ${Join} }` : never : never; /** * **ToJsonScalar**`` * * Converts a scalar value to the JSON string representation. * * **Related:** `ToJson`, `ToJsonArray`, `ToJsonObject` */ type ToStringLiteral__Scalar = [IsAny] extends [true] ? `any` : [IsNever] extends [true] ? `never` : [T] extends [string] ? [string] extends [T] ? `string` : `${Quote$1}` : [T] extends [number] ? [number] extends [T] ? `number` : `${T}` : [T] extends [bigint] ? [bigint] extends [T] ? `bigint` : `${T}` : [IsNull] extends [true] ? `null` : [IsUndefined] extends [true] ? `undefined` : [IsUnknown] extends [true] ? `unknown` : [IsTrue] extends [true] ? `true` : [IsFalse] extends [true] ? `false` : [IsBoolean] extends [true] ? `boolean` : [T] extends [void] ? `void` : [T] extends [symbol] ? `symbol` : never; type ToStringLiteral__Union = Join<{ [K in keyof T]: ToStringLiteral }, " | ">; interface O$1 { quote: T["quote"] extends QuoteCharacter ? T["quote"] : "\""; encode: T["encode"] extends boolean ? T["encode"] : false; } /** * Converts any Typescript type into a string literal * _representation_ of that type. * * **Related:** * - `ToStringLiteral__Scalar`, `ToStringLiteral__Object` * - `ToJsonObject`, `ToJsonArray`, `ToJsonScalar` */ type ToStringLiteral = [IsAny] extends [true] ? "any" : [IsNever] extends [true] ? "never" : [T] extends [Error] ? T : [IsUnion] extends [true] ? ToStringLiteral__Union, Opt> : [T] extends [Scalar] ? ToStringLiteral__Scalar : [T] extends [readonly unknown[]] ? ToStringLiteral__Array> : [T] extends [Dictionary] ? ToStringLiteral__Object> : never; //#endregion //#region src/type-conversion/ToUnion.d.ts /** * **ToUnion**`` * * Converts `T` -- which must be an array of something -- to * a Union type. * * **Related:** `TupleToUnion` */ type ToUnion = T[number]; //#endregion //#region src/type-conversion/TrimDictionary.d.ts type _TrimDict = [] extends K ? Expand : _TrimDict, R & Record, T[First$1] extends string ? Trim]> : T[First$1]>>; /** * **TrimDictionary**`` * * Trims all of the _values_ of a Dictionary which are strings. Non-string * values are proxied through unchanged. * * **Related:** `TrimEach` */ type TrimDictionary = _TrimDict, readonly (keyof T & ObjectKey)[]>>; //#endregion //#region src/type-conversion/TrimEach.d.ts /** * **TrimEach**`` * * Trims each element of a Tuple/Array which extends _string_. * * - Non-string values are left as-is * * **Related:** `TrimDictionary` */ type TrimEach = { [K in keyof T]: T[K] extends string ? Trim : T[K] }; //#endregion //#region src/type-conversion/TupleToIntersection.d.ts type Break$4 = E extends "error" ? Err<"invalid-intersection", TMsg, TCtx> : never; type Set$2 = IsUnset extends true ? W : V & W; type Intersect$1 = T extends [infer Head, ...infer Rest] ? Head extends TypedFunction ? IsNever>> extends true ? Break$4<`A function with a key-value dictionary caused the intersection type to become 'never'`, { intersection: V; conflict: Head; }, E> : Intersect$1>> : IsNever> extends true ? Break$4<`TupleToIntersection hit an element which caused the intersection type to become 'never'`, { intersection: V; conflict: Head; }, E> : Intersect$1> : F extends undefined ? ExpandRecursively : F extends TypedFunction ? F & ExpandRecursively : never; /** * **TupleToIntersection**`` * * Recursively intersects all the elements of a tuple. * * - Empty tuples will return `unknown` as type * - if you want an Error instead of the `never` type you can set `E` to * "error" and the conflicting element which _caused_ the intersection to * become `never` will be highlighted. */ type TupleToIntersection = [] extends T ? unknown : Intersect$1; //#endregion //#region src/type-conversion/TupleToUnion.d.ts /** * Converts a Tuple type into a _union_ of the tuple elements * * ```ts * const arr = [1, 3, 5] as const; * // 1 | 3 | 5 * type U = TupleToUnion; * ``` * * **Note:** an empty array will be converted to a `string` type. */ type TupleToUnion = [T] extends [readonly unknown[]] ? [Keys$1["length"]] extends [0] ? never : T[number] : never; //#endregion //#region src/type-conversion/TypeReplace.d.ts /** * **TypeReplace**`` * * @deprecated use `ReplaceType` instead */ type TypeReplace = ReplaceType; //#endregion //#region src/type-conversion/UnionArrayToTuple.d.ts type UnionToIntersection$2 = (U extends unknown ? (arg: U) => 0 : never) extends ((arg: infer I) => 0) ? I : never; type LastInUnion$1 = UnionToIntersection$2 0 : never> extends ((x: infer L) => 0) ? L : never; type UnionToTuple$1> = [U] extends [never] ? [] : [...UnionToTuple$1>, Last]; /** * **UnionArrayToTuple**`` * * If you have a type which is an _array_ of a Union type but you want to * represent this as a Tuple, this utility will make this conversion for you. * * **Related:** `UnionToTuple` */ type UnionArrayToTuple = T extends any[] ? UnionToTuple$1> : never; //#endregion //#region src/type-conversion/UnionToIntersection.d.ts /** * **UnionToIntersection**`` * * Type utility which converts a union type to an intersection */ type UnionToIntersection = (U extends U ? (x: U) => unknown : never) extends ((x: infer R) => unknown) ? R : never; //#endregion //#region src/type-conversion/UnionToTuple.d.ts /** * UnionToIntersection<{ foo: string } | { bar: string }> = * { foo: string } & { bar: string }. */ type UnionToIntersection$1 = (U extends unknown ? (arg: U) => 0 : never) extends ((arg: infer I) => 0) ? I : never; /** * LastInUnion<1 | 2> = 2. */ type LastInUnion = UnionToIntersection$1 0 : never> extends ((x: infer L) => 0) ? L : never; /** * ExcludeExact - Excludes from T only members that are EXACTLY equal to U * (not just extending U). This prevents tuples like [1,2,3] from being excluded * when excluding number[], since [1,2,3] extends number[] but is not equal to it. */ type ExcludeExact = T extends U ? U extends T ? never : T : T; type PreserveBoolean = Contains extends true ? Contains extends true ? [...RemoveBoolean, boolean] : T : T; /** * **UnionToTuple**`<1 | 2> => [1, 2]` * * Converts union members into a tuple. * * **Related**: `UnionArrayToTuple`, `UnionToTuple__PreserveBoolean` */ type UnionToTuple> = [U] extends [never] ? [] : [...UnionToTuple>, Last]; /** * **UnionToTuple__PreserveBoolean**`<1 | 2 | boolean> => [1, 2, boolean]` * * Converts union members into a tuple and makes sure if both `true` and `false` * are found in the resulting tuple that this is replaced with just `boolean`. * * - ensuring that the `boolean` type is _preserved_ adds a small amount of * type complexity and often doesn't matter. * - if you don't care about preserving the wide `boolean` type then use * `UnionToTuple` instead. * * **Related**: `UnionArrayToTuple`, `UnionToTuple` */ type UnionToTuple__PreserveBoolean = PreserveBoolean>; //#endregion //#region src/type-conversion/UnionWithAll.d.ts /** * **UnionWithAll**`` * * Type utility which iterates through each element of `TList` and creates a * a union between the current value and `TUnion`. * ```ts * type Arr = [1,2,"foo"]; * // [1,2, "foo" | number] * type Num = UnionWithAll; * ``` */ type UnionWithAll = { [K in keyof TList]: TList[K] | TUnion }; //#endregion //#region src/type-conversion/ValueOrReturnValue.d.ts type Process$47 = { [K in keyof T]: T[K] extends TypedFunction ? ReturnType : T[K] }; /** * **ValueOrReturnValue**`` * * Takes a value or a tuple of values in `TEval` and evaluates what * the item's _return type_ is when an element is a function; otherwise it just proxies * the element's type forward. * * ### Example * ```ts * // [true, "foo", "bar"] * type T = ValueOrReturns<[true, "foo", () => "bar"]>; * ``` */ type ValueOrReturnValue = TEval extends readonly unknown[] ? Process$47 : Process$47<[TEval]>[0]; //#endregion //#region src/type-conversion/Widen.d.ts /** * **WidenScalar**`` * * Widens any _scalar_ type `T`. */ type WidenScalar = T extends string ? string : T extends number ? number : T extends boolean ? boolean : T extends bigint ? bigint : T extends symbol ? symbol : T extends null ? null : T extends undefined ? undefined : never; type Process$46 = T extends Scalar ? WidenScalar : T extends AnyFunction ? T extends TypedFunction ? WidenFunc : AnyFunction : T extends readonly unknown[] ? WidenTuple : T extends Dictionary ? WidenDictionary> : T; type WidenDictionary, readonly ObjectKey[]>, TResults extends Dictionary = EmptyObject> = K extends [infer Head extends ObjectKey, ...infer Rest extends ObjectKey[]] ? WidenDictionary>> : ExpandRecursively; type WidenTuple = { [K in keyof T]: IsLiteralLike extends true ? WidenLiteral : Process$46 }; /** * **WidenUnion** * * Widens all the elements in the union type. */ type WidenUnion = WidenTuple>[number]; type WidenLiteral = T extends Scalar ? WidenScalar : IsUnion extends true ? WidenUnion : T extends readonly unknown[] ? WidenTuple : T extends Dictionary ? WidenDictionary> : never; /** * Widens each element of a _fixed-length_ tuple, accumulating into `R`. * * The recursion peels elements with a **readonly** head/rest pattern so it * matches both mutable and `readonly` tuples (a mutable-only pattern would * fail to match a `readonly` tuple and collapse the result to `[]`). */ type WidenArrayInner = T extends readonly [infer Head, ...infer Rest] ? WidenArrayInner]> : R; /** * Widens the elements of an array/tuple `T` by one level while preserving its * structure. _Wide_ (variadic-length) arrays pass through untouched; a * fixed-length tuple has each element widened and its `readonly` modifier * re-applied so that, e.g., `readonly [string, 1 | 2 | 3]` widens to * `readonly [string, number]` (not the narrower mutable form). */ type WidenArray = number extends T["length"] ? T : [IsReadonlyArray] extends [true] ? readonly [...WidenArrayInner] : WidenArrayInner; type WidenFnProps = [] extends TKeys ? ExpandDictionary : WidenFnProps, First$1 extends keyof TObj ? TResult & Record, TObj[First$1] extends Scalar ? WidenScalar]> : TObj[First$1]> : TResult>; /** * Widens the parameter tuple of a function. * * Delegates to `WidenArray`, which already passes _wide_ tuples through * untouched and otherwise widens each parameter via `Widen`. */ type WidenFunctionParams = WidenArray; /** * Widens a function's return type. * * A function's return is frequently a _scalar_ (or a scalar union) and is * often supplied via the built-in `ReturnType`. For a **generic** * function that produces a lazy template-literal union (e.g. the return of * `(name: T) => `hi ${T}``, i.e. * `` `hi ${"Bob" | "Nancy"}` ``), routing straight through `Widen` forces the * expensive `UnionToTuple` materialization and can blow past TypeScript's * instantiation limits. * * To stay cheap we first test scalar assignability with a **non-distributive** * `[TReturn] extends [...]` check — this widens the common scalar cases * without ever materializing the union — and only fall back to the full * `Widen` for genuinely structural returns (objects, tuples, mixed unions). */ type WidenFunctionReturn = [TReturn] extends [string] ? string : [TReturn] extends [number] ? number : [TReturn] extends [boolean] ? boolean : [TReturn] extends [bigint] ? bigint : [TReturn] extends [symbol] ? symbol : [TReturn] extends [null] ? null : [TReturn] extends [undefined] ? undefined : Widen; /** * Widens the intersection props stored alongside a function, collapsing * to `EmptyObject` when there are none. */ type WidenFunctionProps = [IsNonEmptyContainer] extends [true] ? WidenFnProps> : EmptyObject; interface WidenFn { narrowing: IsNarrowingFn; literal: StaticFn; parameters: Parameters; returns: TFn extends ((...args: T) => infer R) ? R : never; props: FnKeyValue; } /** * Recovers a function's return type **without** the `any`-collapse that the * built-in `ReturnType` suffers for a _union_-constrained generic whose type * parameter is woven into a template literal (e.g. * `` (name: T) => `hi ${T}` ``). Re-inferring `R` * through a fresh call signature keeps the concrete (often _union_) return. */ type RecoverFnReturn = T extends { (...args: infer _A): infer R; } ? R : never; /** * Widens a _recovered_ function return value. * * For string (or string-union) returns we collapse to the widest template * literal that still preserves the shared prefix — e.g. * `"hi Bob" | "hi Nancy"` becomes `` `hi ${string}` ``. Non-string returns * defer to the ordinary `Widen`. */ type WidenFnReturnValue = [R] extends [string] ? LongestCommonPrefix> extends infer TPrefix extends string ? [TPrefix] extends [""] ? string : `${TPrefix}${string}` : string : Widen; /** * **WidenFunc**`` * * Widens a function `T` while preserving its _narrowing_ vs _static_ character: * * - a **narrowing** function keeps its generic input constraint and widens * only its return value; a single-parameter narrowing function is rebuilt * in the ergonomic `` (x: X) => R `` form. * - a **static** function widens through `FnFrom`. * * Unlike the (now deprecated) `WidenFunction`, `WidenFunc` receives the whole * function and can therefore _recover_ template-literal returns that * `ReturnType` would otherwise collapse to `any`. * * The widened pieces are computed **once** in the `_Params`/`_Return`/`_Props` * helper parameters; hoisting `FnMeta["params"]` into an eager type * parameter is also what keeps the rebuilt parameter tuple at the correct * _arity_ (passing it lazily lets TypeScript collapse `[P]` to `P[]`). */ type WidenFunc["params"] : []), _Return = (T extends TypedFunction ? WidenFnReturnValue> : never), _Props extends Dictionary = (T extends TypedFunction ? ExpandDictionary> : EmptyObject)> = Function extends T ? Function : T extends TypedFunction ? [IsNarrowingFn] extends [true] ? _Params extends readonly [infer P0] ? [IsNonEmptyContainer<_Props>] extends [true] ? ((x: X) => _Return) & _Props : (x: X) => _Return : FnFrom<_Params, _Return, _Props> : FnFrom<_Params, _Return, _Props> : never; /** * **WidenFunction**`` * * @deprecated Prefer {@link WidenFunc}, which receives the whole function * rather than its pre-split constituent parts. Because `WidenFunction` is * handed `TReturn` (typically `ReturnType`) it cannot recover a * template-literal return that TypeScript has already collapsed to `any` * (which happens for _union_-constrained generics), so the shared prefix of * the return is lost. `WidenFunc` re-infers the return directly from the * function and preserves it. * * Widens a Function from its constituent parts (parameters, return value, * and any props hung off the function), producing a _narrowing_ function * when `TNarrowing` is `true` and a _static_ function otherwise. * * The widened pieces are computed **once** via the `_P`/`_R`/`_Props` helper * parameters rather than inline in each branch. `TNarrowing` is commonly a * _deferred_ boolean (e.g. `IsNarrowingFn`), and inlining the widening * into both branches makes TypeScript instantiate it twice — needless work * that pushes complex signatures toward the instantiation limit. */ type WidenFunction< /** whether the functioning is a "narrowing function" or not */TNarrowing extends boolean, /** parameters */TParams extends readonly unknown[], /** return value */TReturn, /** key/value props stored at same level as function */TProps extends Dictionary, _P extends readonly unknown[] = WidenFunctionParams, _R = WidenFunctionReturn, _Props extends Dictionary = WidenFunctionProps> = [TNarrowing] extends [true] ? AsNarrowingFn<_P, _R, _Props> : AsStaticFn<_P, _R, _Props>; type WidenContainer = [T] extends [readonly unknown[]] ? TForce extends true ? readonly unknown[] : WidenArray : [T] extends [Dictionary] ? TForce extends true ? Dictionary : WidenDictionary : [T] extends [Map] ? TForce extends true ? AnyMap : Map> : [T] extends [WeakMap] ? TForce extends true ? AnyWeakMap : WeakMap> : [T] extends [Set] ? TForce extends true ? AnySet : Set> : T; /** * **Widen**`` * * Converts a literal type to a _wider_ type. * * - for _scalar values_ `T` will just become wide variant (e.g., `5` → `number`) * - for _union types_ all elements of the union will be made wide * - for _container values_ it will widen the items inside the container * * **Note:** should you want the container values to be fully widened you * can set `TForce` to true. */ type Widen = [IsUnion] extends [true] ? WidenUnion : [T] extends [TypedFunction] ? FnFrom> extends true ? Parameters : WidenArray>, Widen>, WidenDictionary>> : [T] extends [Scalar] ? WidenScalar : [T] extends [Container] ? WidenContainer : T extends Scalar ? WidenScalar : Process$46; //#endregion //#region src/type-conversion/WidenValues.d.ts type ProcessArr = { [K in keyof T]: Widen }; type ProcessObj$1 = [] extends TKeys ? TResults : ProcessObj$1, TResults & Record, TObj[First$1]>>; /** * **WidenValues**`` * * Type utility which _widens_ the values of a container. * * **Related:** `Widen` */ type WidenValues = T extends readonly unknown[] ? ProcessArr : T extends Dictionary ? ProcessObj$1 extends readonly (keyof T)[] ? Keys$1 : never> : never; //#endregion //#region src/type-conversion/WithDefault.d.ts /** * **WithDefault**`` * * Provided a type `TVal`, this utility will proxy any value which is * _not_ `null` or `undefined` through as `TVal`; otherwise it will * substitute in `TDef`. * * **Note:** you may optionally set the criteria for using the default * value from `null` or `undefined` to any _falsy_ value. * * ### Examples * ```ts * // "foo" * type T1 = WithDefault<"foo","bar">; * // "bar" * type T2 = WithDefault; * // "bar" * type T3 = WithoutDefault<"", "bar", "falsy">; * ``` */ type WithDefault = TPolicy extends "nothing" ? If, TDef, TVal> : TPolicy extends "falsy" ? If, TDef, TVal> : never; //#endregion //#region src/interpolation/IsTemplateLiteral.d.ts type CountTemplates = string extends T ? 1 : T extends `${infer First}${infer Rest}` ? Or<[string extends First ? true : false, `${number}` extends First ? true : false]> extends true ? CountTemplates : CountTemplates : C["length"]; /** * **isTemplateLiteral**`` * * A boolean operator which evaluates if `T` has dynamic types * like `${string}`, `${number}`, or `${boolean}` included in * it. * * - Note a wide `string` and a `${string}` type will result in `false` as they * are both equivalent to a wide string in the type system. */ type IsTemplateLiteral = IsUnion extends true ? Every, "containsSome", ["true", "false"]> : T extends string ? string extends T ? false : T extends "" ? false : [CountTemplates<`|${T}|`>] extends [0] ? false : true : false; //#endregion //#region src/interpolation/ReplaceInterpolation.d.ts /** * determine replacement type */ type R$1 = T extends string ? T : T extends readonly (string | number | boolean)[] ? T["length"] extends 0 ? D : First$1 : never; type Next$1 = T extends string ? T : T extends readonly (string | number | boolean)[] ? AfterFirst : never; /** * **ReplaceStringInterpolation**`` * * Replaces all instances of `${string}` in `TContent` with `TReplace` */ type ReplaceStringInterpolation = TContent extends `${infer First}${infer Rest}` ? [IsEqual] extends [true] ? ReplaceStringInterpolation, `${TResult}${R$1}`> : ReplaceStringInterpolation : [TContent] extends [""] ? TResult : [IsEqual] extends [true] ? `${TResult}${R$1}` : `${TResult}${TContent}`; /** * **ReplaceNumericInterpolation**`` * * Replaces all instances of `${number}` in `TContent` with `TReplace` * * - when `TReplace` is single string then all instances are replaced with * this value * - when `TReplace` is an array of strings then strings are pulled off in a FIFO * manner to replace * * **Related:** `ReplaceStringInterpolation` */ type ReplaceNumericInterpolation = TContent extends `${infer First}${infer Rest}` ? [IsEqual] extends [true] ? ReplaceNumericInterpolation, `${TResult}${R$1}`> : ReplaceNumericInterpolation : [TContent] extends [""] ? TResult : [IsEqual] extends [true] ? `${TResult}${R$1}` : `${TResult}${TContent}`; type ReplaceTrueFalse = [] extends T ? TResult[number] : ReplaceTrueFalse, R, [...TResult, ReplaceAll, "true" | "false", R>]>; /** * **ReplaceBooleanInterpolation**`` * * Replaces all instances of `${boolean}` in `TContent` with `TReplace` * * **Note:** * - the `${boolean}` type is far more difficult to work with then * the `${string}` and `${number}` template literals. * - this is due to the fact that Typescript immediately converts a `${boolean}` into a union type * * **Related:** `ReplaceStringInterpolation`, `ReplaceNumericInterpolation` */ type ReplaceBooleanInterpolation = IsUnion extends true ? UnionToTuple["length"] extends number ? IsLessThan["length"], 10> extends true ? UnionToTuple extends readonly string[] ? ReplaceTrueFalse, TReplace> : TContent : TContent : TContent : TContent; //#endregion //#region src/interpolation/StartsWithTemplateLiteral.d.ts type UnionStartsBoolean = And<{ [K in keyof T]: T[K] extends string ? StartsWith : never }>; /** * **HasLeadingTemplateLiteral**`` * * tests whether `T` _starts with_ a leading template literal * such as `${string}`, `${number}`, or `${boolean}` */ type StartsWithTemplateLiteral = T extends string ? [IsUnion] extends [true] ? [UnionToTuple] extends [readonly string[]] ? UnionStartsBoolean> : never : T extends `${infer First}${infer _Rest}` ? IsEqual<`${string}`, First> extends true ? true : IsEqual<`${number}`, First> extends true ? true : false : false : false; //#endregion //#region src/interpolation/StaticTemplateSections.d.ts type Finalize = TWithType extends true ? { [K in keyof TResults]: StringLiteralTemplate } : TResults; type Section$1

= TWithType extends null ? THead : `${THead}${TBlock}`; type Scan = TTemplate extends `{{string}}${infer Rest}` ? Scan]> : TTemplate extends `{{number}}${infer Rest}` ? Scan]> : TTemplate extends `{{boolean}}${infer Rest}` ? Scan]> : TTemplate extends `{{true}}${infer Rest}` ? Scan]> : TTemplate extends `{{false}}${infer Rest}` ? Scan]> : TTemplate extends `${infer Head}${infer Rest}` ? Scan : TResults; /** * **StaticTemplateSections**`` * * Segments the various static sections defined in the `TTemplate`. * * - if you optionally set the `TWithType` generic to `true` then the * string literal templates will be added * - if you set `TWithType` generic to `false` then the template blocks * like `{{string}}`, etc. will be added. */ type StaticTemplateSections = Finalize extends infer Template extends string ? As$1, readonly string[]> : [], TWithType>; //#endregion //#region src/interpolation/StringLiteralTemplate.d.ts type _StringLiteralTemplate = T extends number ? `${number}` : T extends boolean ? `${boolean}` : T extends `${infer Before}{{string}}${infer After}` ? StringLiteralTemplate<`${Before}${string}${After}`> : T extends `${infer Before}{{number}}${infer After}` ? StringLiteralTemplate<`${Before}${number}${After}`> : T extends `${infer Before}{{boolean}}${infer After}` ? StringLiteralTemplate<`${Before}${boolean}${After}`> : T extends `${infer Before}{{true}}${infer After}` ? StringLiteralTemplate<`${Before}${true}${After}`> : T extends `${infer Before}{{false}}${infer After}` ? StringLiteralTemplate<`${Before}${false}${After}`> : T; /** * **StringLiteralTemplate**`` * * Converts a string literal into a "template" by replacing tokens * like `{{string}}`, `{{number}}`, or `{{boolean}}` with the * corresponding string literal equivalent. * * **Related:** `EachAsStringLiteralTemplate`, `ObjectValuesAsStringLiteralTemplate` */ type StringLiteralTemplate = IsStringLiteral$1 extends true ? _StringLiteralTemplate : never; /** * **EachAsStringLiteralTemplate**`` * * Convert a tuple of values which are easily made into string literal types * into a tuple of literal template strings. * * **Related:** `StringLiteralTemplate` */ type EachAsStringLiteralTemplate = [] extends T ? R : EachAsStringLiteralTemplate, [...R, StringLiteralTemplate>]>; /** * **ObjectValuesAsStringLiteralTemplate**`` * * Convert the values of an object into String Literal Templates. * * **Related:** `StringLiteralTemplate`, `EachAsStringLiteralTemplate` */ type ObjectValuesAsStringLiteralTemplate> = { [K in keyof T]: T[K] extends string ? StringLiteralTemplate : never }; //#endregion //#region src/interpolation/StripLeadingTemplate.d.ts type Check$3 = [K] extends ["all"] ? Or<[IsEqual, IsEqual]> : [K] extends ["string"] ? IsEqual : [K] extends ["number"] ? IsEqual : false; type FixUnion = IsUnion extends true ? First$1> extends `${"true" | "false"}${infer Rest}` ? Rest : T : T; /** * **StripLeadingTemplate**`` * * Strips a dynamic segment (e.g., `${string}`, `${number}`, `${boolean}`) * out of `T` if it exists. Otherwise proxies `T` through. */ type StripLeadingTemplate = [IsWideString] extends [true] ? string : [T] extends [`${infer First}${infer Rest}`] ? [Check$3] extends [true] ? Rest : FixUnion : ""; //#endregion //#region src/interpolation/StripSurroundingStringTemplate.d.ts /** * **StripLeadingStringTemplate**`` * * Strips any existing `${string}` type when it starts the type T. * * ```ts * // `FooBar${string}` * type Foobar = StripLeadingStringTemplate<`${string}Foobar${string}`> * ``` */ type StripLeadingStringTemplate = T extends `${infer First}${infer Rest}` ? IsEqual extends true ? StripLeadingStringTemplate : T : never; /** * **StripTrailingStringTemplate**`` * * Strips any existing `${string}` type when ity terminates the type T. * * ```ts * // `${string}FooBar` * type Foobar = StripTailingStringTemplate<`${string}Foobar${string}`> * ``` */ type StripTrailingStringTemplate = IsStringLiteral$1 extends true ? Join> : never; /** * **StripSurroundingStringTemplate**`` * * Strips any existing `${string}` type when it _leads_ or _terminates_ the type T. * * ```ts * // `FooBar` * type Foobar = StripTailingStringTemplate<`${string}Foobar${string}`> * ``` */ type StripSurroundingStringTemplate = IsStringLiteral$1 extends true ? StripTrailingStringTemplate> : never; //#endregion //#region src/interpolation/template-maps.d.ts interface TemplateMap__Basic { string: "string"; number: "number"; boolean: "boolean"; } type AddGeneric = { [K in keyof G | T["name"]]: K extends T["name"] ? T["token"] : K extends keyof G ? G[K] : never }; /** * **TemplateMap__Generics**`` * * Provides a static template based on the generic types provided. It also * always includes the basics for `string`, `number`, and `boolean`. */ type TemplateMap__Generics = T extends [infer Head extends GenericParam, ...infer Rest extends readonly GenericParam[]] ? TemplateMap__Generics> : G; /** * **TemplateMap**`<[T]>` * * By default it provides the basics of _string_, _number_, and _boolean_ but when * you set the generic `T` using a `DefineObject` this map will be combined with the * basics. */ type TemplateMap = MergeObjects, As$1>; //#endregion //#region src/interpolation/TemplateBlock.d.ts type Blocks = Mutable; /** * **DefaultTemplateBlocks** * * A static string which represents a _future_ dynamic segment * (of the specified type). */ type DefaultTemplateBlocks = Blocks[number]; /** * A `TemplateBlock` with the curly braces surrounding it stripped off. */ type TemplateBlock__BARE = { [K in keyof Blocks]: Blocks[K] extends `{{${infer Bare extends string}}}` ? Bare : never }[number]; //#endregion //#region src/interpolation/TemplateBlocks.d.ts /** * **TemplateBlocks**`` * * Given a template string `T`, this utility will extract all of the * dynamic blocks -- in the correct order -- found in the template string. * * @deprecated use `GetTemplateBlocks` instead */ type TemplateBlocks = string extends T ? DefaultTemplateBlocks[] : As$1, string>, DefaultTemplateBlocks, "inline">, "extends", [DefaultTemplateBlocks]>, readonly DefaultTemplateBlocks[]>; /** * **GetTemplateBlocks**`` * * A more flexible variant of `TemplateBlocks` where by default the "blocks" which are * used are the standard blocks used for interpolation: `{{string}} | {{number}} | {{boolean}}`. * * - if you want to define your own block vocabulary you can simply express it as a union type * and pass into the optional `B` parameter. */ type GetTemplateBlocks = As$1 extends infer Elements extends readonly string[] ? Filter : never, readonly string[]>; //#endregion //#region src/interpolation/TemplateParams.d.ts interface Map$1 { "{{string}}": string; "{{number}}": number; "{{boolean}}": boolean; } /** * **TemplateParams**`` * * Extracts a tuple of wide types which are needed to complete a given literal template. * * @deprecated use `GetTemplateParams` instead */ type TemplateParams> = { [K in keyof B]: B[K] extends keyof Map$1 ? Map$1[B[K]] : never }; type StripCurly = T extends `{{${infer Inner}}}` ? Inner : T; type AsMap = T extends [infer Head extends string | DefineObject, ...infer Rest extends readonly (string | DefineObject)[]] ? Head extends string ? AsMap, FromInputToken__String>>> : Head extends DefineObject ? AsMap> : never : ExpandRecursively; /** * converts all union members into a DefineObject where the _keys_ * represent the dynamic segments and the _values_ are the type * this segment needs to extend. */ type SegmentMap = IsUnion extends true ? UnionToTuple extends infer Config extends readonly (string | DefineObject)[] ? AsMap : never : T extends string ? string extends T ? { string: string; number: number; boolean: boolean; } : Record : T extends DefineObject ? FromDefineObject : never; type AsDynamicSegment> = As$1 extends infer Keys extends readonly string[] ? { [K in keyof Keys]: `{{${Keys[K]}}}` }[number] : never, string>; type Lookup$25> = T extends keyof M ? M[T] : unknown; /** * **GetTemplateParams**`` * * Extracts the _types_ of the dynamic segments from left to right found in the template. * * ```ts * // [string, number] * type T = GetTemplateParams<"Hi {{string}}, you're age is {{number}}">; * ``` * * However, you can also add your own dynamic segments by providing a dictionary who's _keys_ * represent the segment name (you don't need to surround with curly braces) and the _values_ * are the **type** you would like to map to (in the form of a string `InputToken`). * * ```ts * // [ string, `${string}@`${string}.${string}` ] * type T = GetTemplateParams< * "Hi {{string}}, you're email is {{email}}", * { string: "string", email: `${string}@`${string}.${string}` } * >; * ``` * * **Note:** * - when creating your own segments, consider using one of the helper utils: * - `TemplateMap` - adds your definition from `T` to the standard set of segments * - `TemplateMap__Generics` - provided a tuple of `GenericParam`'s, this will use the generic's types * as part of the template. * * **Related:** `TemplateBlocks`, `IntoTemplate`, `Interpolate` */ type GetTemplateParams = SegmentMap, TFoundSegments extends readonly string[] = GetTemplateBlocks>> = { [K in keyof TFoundSegments]: Lookup$25, TMap> }; //#endregion //#region src/boolean-logic/operators/datetime/IsBefore.d.ts type IsSameDateDifferentPrecision = A extends `${infer DatePart}T00:00:00Z` ? B extends DatePart ? true : false : B extends `${infer DatePart}T00:00:00Z` ? A extends DatePart ? true : false : false; type IsCharGreater = A extends "0" ? false : A extends "1" ? B extends "0" ? true : false : A extends "2" ? B extends "0" | "1" ? true : false : A extends "3" ? B extends "0" | "1" | "2" ? true : false : A extends "4" ? B extends "0" | "1" | "2" | "3" ? true : false : A extends "5" ? B extends "0" | "1" | "2" | "3" | "4" ? true : false : A extends "6" ? B extends "0" | "1" | "2" | "3" | "4" | "5" ? true : false : A extends "7" ? B extends "0" | "1" | "2" | "3" | "4" | "5" | "6" ? true : false : A extends "8" ? B extends "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" ? true : false : A extends "9" ? B extends "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" ? true : false : A extends ":" ? B extends "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" ? true : false : A extends "T" ? B extends "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" | "-" | ":" ? true : false : A extends "Z" ? B extends "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" | "-" | ":" | "T" ? true : false : A extends "-" ? B extends "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" ? true : false : false; type LexicographicCompare = A extends B ? false : IsSameDateDifferentPrecision extends true ? false : [A] extends [never] ? false : [B] extends [never] ? false : [A, B] extends [string, string] ? A extends `${infer AFirst}${infer ARest}` ? B extends `${infer BFirst}${infer BRest}` ? AFirst extends BFirst ? LexicographicCompare : IsCharGreater : true : false : false; /** * **IsBefore**`` * * Tests whether `A` is _before_ (in time) `B`. */ type IsBefore = A extends object ? boolean : B extends object ? boolean : string extends A ? boolean : string extends B ? boolean : IsTemplateLiteral extends true ? boolean : IsTemplateLiteral extends true ? boolean : number extends A ? boolean : number extends B ? boolean : A extends number ? B extends number ? IsLessThan : boolean : A extends string ? B extends string ? LexicographicCompare : boolean : boolean; //#endregion //#region src/boolean-logic/operators/datetime/IsDateLike.d.ts type Member$1 = { [K in keyof T]: IsIsoDate }; /** * **IsDateLike**`` * * Boolean operator which tests whether `T` is truly `DateLike` * * - this includes testing any number to be sure it is an Integer number * - the static _type_ `DateLike` is an approximation but allows for "false positives" * so this utility will get you to a literal `true`/`false`. */ type IsDateLike = [IsAny] extends [true] ? false : [IsNever] extends [true] ? false : [IsUnknown] extends [true] ? boolean : [IsUnion] extends [true] ? Every>, "equals", true> extends true ? true : Some>, "equals", true> extends true ? boolean : false : [T] extends [object] ? [IsJsDate] extends [true] ? true : [IsMoment] extends [true] ? true : [IsLuxonDateTime] extends [true] ? true : [IsDayJs] extends [true] ? true : false : [number] extends [T] ? boolean : [T] extends [number] ? IsNegativeNumber extends true ? false : IsInteger extends true ? true : false : [IsString] extends [true] ? [IsIsoFullDate] extends [true] ? true : [IsIsoYear] extends [true] ? true : [IsIsoMonthDate] extends [true] ? true : [IsIsoYearMonth] extends [true] ? true : [IsIsoDateTime] extends [true] ? true : false : false; //#endregion //#region src/boolean-logic/operators/datetime/IsDayJs.d.ts interface Shape$4 { add: AnyFunction; clone: AnyFunction; date: AnyFunction; endOf: AnyFunction; isAfter: AnyFunction; isBefore: AnyFunction; daysInMonth: AnyFunction; millisecond: AnyFunction; calendar: unknown; } /** * **IsDayJs**`` * * Boolean utility to test whether `T` is DayJS date object. */ type IsDayJs = [IsAny] extends [true] ? false : [IsNever] extends [true] ? false : [IsUnknown] extends [true] ? boolean : [IsUnion] extends [true] ? true extends (T extends Shape$4 ? true : false) ? T extends Shape$4 ? true : boolean : false : IsDictionary extends true ? T extends Shape$4 ? true : false : false; //#endregion //#region src/datetime/AsDateMeta.d.ts type ParsedDateType = T extends [infer Year, infer Month, infer Date, infer Time] ? Date extends null ? Month extends null ? "year" : "year-month" : Year extends null ? "year-independent" : Time extends null ? "date" : "datetime" : never; type HasTime = ParsedDateType extends "datetime" ? T[3] extends [infer Hour, infer Minute, infer Second, infer MS, infer TZ] ? Hour extends "00" ? Minute extends "00" ? Or<[Extends, IsNull]> extends true ? Or<[Extends, IsNull]> extends true ? Or<[Extends, IsNull]> extends true ? false : true : true : true : true : true : never : false; type Hour$1 = T extends null ? null : T extends ParsedTime ? T[0] : never; type Minute$1 = T extends null ? null : T extends ParsedTime ? T[1] : never; type Second$2 = T extends null ? null : T extends ParsedTime ? T[2] : never; type Millisecond = T extends null | undefined ? null : T extends ParsedTime ? T[3] : never; type Offset = T extends null ? null : T extends ParsedTime ? T[4] : never; type SetParsed = { dateType: ParsedDateType; hasTime: HasTime; year: T[0]; month: T[1]; date: T[2]; hour: Hour$1; minute: Minute$1; second: Second$2; ms: Millisecond; timezone: Offset; }; /** * **AsDateMeta**`` * * Tests to see if `T` can be parsed into a `DateMeta` type. * * - a valid ISO string _or_ a `ParsedData` array should be * able to be parsed. * - if it can then `DateMeta` is returned * - if not then an `Error` will be returned * * Note: if the value passed in as `T` is a `ParsedDate` type * then this utility will never return an error as the validation * has already been done. */ type AsDateMeta = T extends ParsedDate ? SetParsed : ParseDate extends infer P ? P extends Error ? P : P extends ParsedDate ? SetParsed

: never : never; //#endregion //#region src/datetime/AsFourDigitYear.d.ts type Digit$8 = "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9"; type IsDigits = T extends "" ? false : T extends `${Digit$8}${infer Rest}` ? Rest extends "" ? true : IsDigits : false; type IsFourDigits = T extends `${Digit$8}${Digit$8}${Digit$8}${Digit$8}` ? true : false; type BrandYear = IsTrue extends true ? FourDigitYear> : T; type ConvertNumericString = T extends `-${string}` ? Err<`year-invalid/negative`, `The generic passed into AsFourDigitYear was a NEGATIVE number. This is not allowed!`, { T: T; }> : T extends `${string}.${string}` ? TNumberInput extends true ? Err<`year-invalid/float`, `The generic passed into AsFourDigitYear was a number but not an integer!`, { T: T; }> : Err<"year-invalid/type"> : IsDigits extends true ? PadStart extends infer Padded extends string ? IsFourDigits extends true ? BrandYear : TNumberInput extends true ? Err<`year-invalid/too-large`, `The generic passed into AsFourDigitYear was an integer number but it was larger than 9999 so it will not fit into the ISO FourDigitYear format!`, { T: T; }> : Err<"year-invalid/type"> : Err<"year-invalid/type"> : Err<"year-invalid/type">; type Convert$5 = T extends string ? IsBranded extends true ? Convert$5, B> : ConvertNumericString : T extends number ? number extends T ? IsTrue extends true ? FourDigitYear<"branded"> | Error : FourDigitYear | Error : ConvertNumericString<`${T}`, B, true> : Err<`year-invalid/wrong-type`, `The type passed in as T to AsFourDigitYear was an invalid type! T must be a number or a string literal that can be converted into a number`, { T: T; }>; /** * **AsFourDigitYear**`` * * A type conversion utility which tries to convert `T` into a valid `FourDigitYear` type. * * - by default the conversion is done but the type returned is _not_ a branded type * - to switch this behavior then pass in `true` to the generic `B` * * If there is no way to convert `T` to a `FourDigitYear` then an Error will be returned. */ type AsFourDigitYear = [IsAny] extends [true] ? IsTrue extends true ? FourDigitYear<"branded"> | Error : FourDigitYear | Error : As$1, IsTrue extends true ? FourDigitYear<"branded"> | Error : FourDigitYear | Error>; //#endregion //#region src/errors/Err.d.ts /** * **TypedError** * * An `Error` which is guaranteed to have a `type` property * and may optionally have a `subType` property. */ type TypedError = Expand; type _Err$1 = EmptyObject> = TType extends `${infer Type}/${infer Subtype}` ? Expand<{ name: PascalCase extends string ? RetainUntil : never>; type: KebabCase; subType: Subtype extends string ? KebabCase : undefined; message: TMsg extends "" ? string : TMsg; cause?: unknown; stack?: string; } & TCtx> & Error : Expand<{ name: PascalCase>; message: TMsg extends "" ? string : TMsg; type: TType; cause?: unknown; stack?: string; } & TCtx> & Error; /** * handles when the "type" is a wide string */ type WideErrType$1 = EmptyObject> = string extends TMsg ? IsEqual extends true ? Error : _Err$1 : _Err$1; /** * **Err**`` * * Create a strongly typed error with type and subType information. * * - TType assigns the type to the errors `type` property until a `/` character is found * - the `subType` property is the string literal portion of `TType` after the `/` character * - any key/value pairs on `TCtx` will be available on the error too * * **Related:** * - `err(type, msg, ctx)` mirrors same functionality for runtime * - `ErrContext` allows _adding_ context to an existing Error * - `WhenErr` allows conditionally adding context to an Error * when/if `T` extends Error. Otherwise proxies `T` through "as is" */ type Err = EmptyObject> = string extends TType ? WideErrType$1 : _Err$1; /** * Adds "context" to an existing `Error`. */ type ErrContext = Expand & C> extends Error ? Expand & C> & Error : never; /** * **WhenErr**`` * * When `T` extends **Error** then the "context" of `C` will be added to the **Error**. * * - if `T` is _not_ an error then it will be proxied through "as is". */ type WhenErr = T extends Error ? ErrContext & Error : T; //#endregion //#region src/errors/ErrMsg.d.ts type ErrMsg = TContext extends string ? TType & { desc: TContext; kind: "ErrMsg"; } : TType & ExpandDictionary; //#endregion //#region src/errors/ErrType.d.ts /** * **ErrType**`` * * Return the `type` property of `T` if: * * - T is an Error * - T has the property `type` * * **Related:** `Err`, `ErrSubType` */ type ErrType = T extends Error ? "type" extends keyof T ? T["type"] extends infer Type ? Type : undefined : undefined : undefined; //#endregion //#region src/errors/HasErrors.d.ts type CheckArray$1 = T extends [infer Head, ...infer Rest] ? U extends string ? Head extends Err ? true : CheckArray$1 : Head extends Error ? true : CheckArray$1 : false; type CheckDictionary$1 = CheckArray$1, U>; /** * **HasErrors**`` * * Checks whether a container `T` has _values_ which extend Error. */ type HasErrors = T extends readonly unknown[] ? CheckArray$1 : T extends Dictionary ? CheckDictionary$1 : never; //#endregion //#region src/errors/IsolateErrors.d.ts /** * The results produced by the `IsolateErrors` utility */ interface IsolatedResults { successes: readonly unknown[]; errors: readonly Error[]; otherErrors: readonly Error[]; } type CheckArray = T extends readonly [infer Head, ...infer Rest] ? Head extends Error ? U extends string ? CheckArray ? { successes: R["successes"]; errors: [...R["errors"], Head]; otherErrors: R["otherErrors"]; } : { successes: R["successes"]; errors: R["errors"]; otherErrors: [...R["otherErrors"], Head]; }, IsolatedResults>> : CheckArray> : CheckArray> : R; type CheckDictionary = CheckArray, U>; /** * **IsolateErrors**`` * * Isolates error's from successful outcomes in the _values_ of `T`. * * - When `U` is unset then you will be returned a dictionary with `successes` and `errors` properties. * - When `U` **is** set then it represents a type/subtype of the error. The result this utility * returns is `successes`, `errors`, and `otherErrors` (for errors which were found but not errors * of the specified type) */ type IsolateErrors = T extends readonly unknown[] ? CheckArray : T extends Dictionary ? CheckDictionary : never; //#endregion //#region src/errors/ProxyError.d.ts /** * **ProxyErr**`` * * Tests `TError` to see if it extends the Javascript `Error` class * and if so it proxies it forward. If it is not then TElse is returned in * it's place. */ type ProxyErr = TError extends Error ? As$1>, TypedError> : TElse; //#endregion //#region src/errors/StackTrace.d.ts type SymbolKind = "function" | "method"; interface StackFrame { type: string; fn_name: string; method_name: string; filename: string; line_number: number; col_number: number; is_native: boolean; is_constructor: boolean; } type StackTrace = StackFrame[]; //#endregion //#region src/string-literals/AsTypeSubtype.d.ts type AsTypeSubtype = IsWideString extends true ? [string, string | undefined] : T extends `${infer Type}/${infer Subtype}` ? [Type, Subtype] : [T, undefined]; //#endregion //#region src/string-literals/BackTick.d.ts /** * The unicode representation of a back tick character (e.g., `\`). */ type BackTick = "\u005C"; //#endregion //#region src/string-literals/Cardinality.d.ts type OneToOne = `1:1`; type OneToMany = `1:M`; type OneToZero = `1:0`; type ZeroToOne = `0:1`; type ZeroToMany = `0:M`; type ZeroToZero = `0:0`; type ManyToMany = "M:M"; type ManyToOne = "M:1"; type ManyToZero = "M:0"; type CardinalityNode = "0" | "1" | "M"; /** * Cardinality which expects a singular input and requires * 1 or many outputs. * * Note: choose `CardinalityFilter1` if you want to allow output * to have no outputs. */ type Cardinality1 = OneToOne | OneToMany; /** * Cardinality which expects a singular input and maps to 0, * 1, or many outputs. */ type CardinalityFilter1 = OneToOne | OneToMany | OneToZero; /** * Cardinality which expects a singular input which is allowed to be * _undefined_ or the expected type. */ type Cardinality0 = ZeroToOne | ZeroToMany | OneToOne | OneToMany; /** * Cardinality which expects a singular input -- which is allowed to be * _undefined_ -- and maps to 0, * 1, or many outputs. */ type CardinalityFilter0 = ZeroToOne | ZeroToMany | OneToOne | OneToMany | OneToZero | ZeroToZero; type CardinalityExplicit = `${number}:${number}`; /** * Cardinality of any sort between two types */ type Cardinality = CardinalityFilter0 | CardinalityFilter1 | ManyToMany | ManyToOne | ManyToZero | CardinalityExplicit; /** * The first or _input_ part of the Cardinality relationship */ type CardinalityIn = T extends `${infer IN}:${string}` ? IN : never; /** * The second or _output_ part of the Cardinality relationship */ type CardinalityOut = T extends `${string}:${infer OUT}` ? OUT : never; type CardinalityInput = UnionToTuple extends readonly unknown[] ? First$1> extends 1 ? T : T[] : T | undefined; //#endregion //#region src/string-literals/casing/AllCaps.d.ts type Process$45 = { [K in keyof TChars]: Capitalize }; /** * **AllCaps**`` * * Type utility which converts all alphabetic characters to their * UPPERCASE variant. */ type AllCaps = If, Chars extends readonly string[] ? Process$45> extends readonly string[] ? Concat>> : never : Chars, string>; //#endregion //#region src/string-literals/casing/CamelCase.d.ts /** * Direct camelCase conversion that leverages optimized PascalCase */ type CamelCaseSimple = IsAllCaps extends true ? Uncapitalize>>> : Uncapitalize>>; /** * **CamelCase**`` * * Converts a string to `CamelCase` format. */ type CamelCase = string extends T ? string : T extends string ? CamelCaseSimple : T extends readonly unknown[] ? { [K in keyof T]: T[K] extends string ? CamelCase : T[K] } : never; //#endregion //#region src/string-literals/casing/CapFirstAlpha.d.ts /** * Strips the non-alpha characters that lead a string */ type StripLeftNonAlpha = S extends `${infer First}${infer Rest}` ? First extends NonAlphaChar ? StripLeftNonAlpha : S : never; /** * identifies the leading characters which are _not_ alphabetical */ type LeadingNonAlpha = Replace, "">; /** * Capitalize the first alphabetical character in the string */ type CapFirstAlpha = LeadingNonAlpha extends string ? `${LeadingNonAlpha}${Capitalize, "">>}` : Capitalize; //#endregion //#region src/string-literals/casing/CapitalizeWords.d.ts /** * Capitalize all words in a string */ type CapitalizeWords = S extends `${infer L} ${infer R}` ? `${CapitalizeWords} ${CapitalizeWords}` : S extends `${infer L},${infer R}` ? `${CapitalizeWords},${CapitalizeWords}` : S extends `${infer L}.${infer R}` ? `${CapitalizeWords}.${CapitalizeWords}` : Capitalize; //#endregion //#region src/string-literals/casing/DashToSnake.d.ts type DashToSnake = T extends `${infer HEAD}-${infer TAIL}` ? DashToSnake<`${HEAD}_${TAIL}`> : T; //#endregion //#region src/string-literals/casing/DashUppercase.d.ts type _DU = T extends Lowercase ? T : `-${Lowercase}`; /** * Converts uppercase characters to a dash and then the lowercase equivalent * * ```ts * // "one-two-three" * type T = DashUppercase<"oneTwoThree">; * ``` * * _Intended to be used as a lower level utility; prefer `Dasherize` for more full-fledged * dash solution_. */ type DashUppercase = HasUppercase extends false ? T : T extends `${infer C0}${infer C1}${infer R}` ? `${_DU}${_DU}${DashUppercase}` : T extends `${infer C0}${infer R}` ? `${_DU}${DashUppercase}` : ""; //#endregion //#region src/string-literals/casing/KebabCase.d.ts type Process$44 = TPreserve extends true ? Concat<[LeftWhitespace, KebabCase, RightWhitespace]> : string extends TString ? string : DashUppercase>> extends `${infer Begin}${"_" | " "}${infer Rest}` ? KebabCase<`${Lowercase}-${Rest}`> : Replace>>>>, "--", "-">; /** * **KebabCase**`` * * Converts a string literal into a `kebab-case` format while optionally * allowing surrounding whitespace. * * ```ts * // "foo-bar" * type Dash = Dasherize<"foo_bar">; * type Dash = Dasherize<"fooBar">; * type Dash = Dasherize<"FooBar">; * // "\n foo-bar \t" * type Dash = Dasherize<"\n foo bar \t">; * ``` */ type KebabCase = TInput extends string ? Process$44 extends string ? Process$44 : never : TInput extends readonly unknown[] ? As$1<{ [K in keyof TInput]: TInput[K] extends string ? KebabCase : TInput[K] }, readonly unknown[]> : never; //#endregion //#region src/string-literals/casing/LowerAllCaps.d.ts /** * **LowerAllCaps**` * * Type utility which will convert an "all caps" string to a string where all characters are lowercase; in * all other cases it will do nothing and simply return `T` as `T`. * * **Related:** `RaiseAllLowercase` */ type LowerAllCaps = IsAllCaps extends true ? Lowercase : T; //#endregion //#region src/string-literals/casing/NamingConvention.d.ts /** * **NamingConvention**`<[T]>` * * A type union between all common naming conventions for * variables in programming. * * **Related:** `NamingModifier` */ type NamingConvention = "camelCase" | "PascalCase" | "kebab-case" | "snake_case"; //#endregion //#region src/string-literals/casing/PascalCase.d.ts /** * Limited depth PascalCase - processes up to 20 segments to avoid deep recursion */ type LimitedPascalCase = Depth["length"] extends 20 ? T : T extends `${infer Before}-${infer After}` ? `${Capitalize}${LimitedPascalCase}` : T extends `${infer Before}_${infer After}` ? `${Capitalize}${LimitedPascalCase}` : T extends `${infer Before} ${infer After}` ? `${Capitalize}${LimitedPascalCase}` : Capitalize; /** * Recursive PascalCase for strings with delimiters * Processes one character at a time to handle mixed delimiters correctly */ type RecursivePascalCase = T extends `${string}${"-" | "_" | " "}${string}` ? LimitedPascalCase : T extends `${infer First}${infer Rest}` ? First extends "-" | "_" | " " ? RecursivePascalCase : CapNext extends true ? `${Uppercase}${RecursivePascalCase}` : `${Lowercase}${RecursivePascalCase}` : ""; /** * Handles camelCase strings by detecting uppercase letters as word boundaries */ type HandleCamelCase = T extends `${infer First}${infer Rest}` ? Uppercase extends First ? Lowercase extends First ? HandleCamelCase : Result extends "" ? HandleCamelCase : HandleCamelCase : Rest extends `${infer Next}${string}` ? Uppercase extends Next ? Lowercase extends Next ? HandleCamelCase}`> : HandleCamelCase}-`> : HandleCamelCase}`> : `${Result}${Lowercase}` : Result; /** * Simplified PascalCase conversion that uses recursive approach for delimited strings */ type PascalCaseSimple = T extends `${string}-${string}` | `${string}_${string}` | `${string} ${string}` ? RecursivePascalCase : T extends `${infer _First}${infer Rest}` ? Rest extends `${string}${Uppercase}${string}` ? RecursivePascalCase> : Capitalize : Capitalize; /** * Converts a string literal type to a **PascalCase** representation. * ```ts * // "FooBar" * type T = PascalCase<"fooBar">; * type T = PascalCase<"foo-bar">; * type T = PascalCase<"foo_bar">; * type T = PascalCase<"\n foo_bar \t">; * ``` */ type PascalCase = string extends T ? string : T extends string ? IsAllCaps extends true ? PascalCaseSimple>> : PascalCaseSimple> : T extends readonly unknown[] ? { [K in keyof T]: T[K] extends string ? PascalCase : T[K] } : never; //#endregion //#region src/string-literals/casing/SnakeCase.d.ts /** * Direct snake_case conversion in a single pass * Handles camelCase, PascalCase, kebab-case, spaces, and existing snake_case */ type SnakeCaseCore = T extends `${infer First}${infer Rest}` ? First extends "-" | " " ? SnakeCaseCore : First extends "_" ? SnakeCaseCore : Uppercase extends First ? Lowercase extends First ? SnakeCaseCore : PrevWasLower extends true ? SnakeCaseCore}`, false> : SnakeCaseCore}`, false> : SnakeCaseCore}`, true> : Result; /** * Limited depth snake_case to avoid deep recursion on very long strings */ type LimitedSnakeCase = Depth["length"] extends 25 ? T : T extends `${infer Before}-${infer After}` ? `${Lowercase}_${LimitedSnakeCase}` : T extends `${infer Before} ${infer After}` ? `${Lowercase}_${LimitedSnakeCase}` : Lowercase; /** * Optimized SnakeCase that tries fast paths first */ type SnakeCaseSimple = T extends `${string}${"-" | " "}${string}` ? LimitedSnakeCase : IsAllCaps extends true ? Lowercase : SnakeCaseCore; /** * **SnakeCase**`` * * Converts a string literal type to _snake_case_. * ```ts * // "foo_bar" * type T = SnakeCase<"fooBar">; * type T = SnakeCase<"foo bar">; * type T = SnakeCase<"foo-bar">; * ``` */ type SnakeCase = string extends T ? string : T extends string ? SnakeCaseSimple> : T extends readonly unknown[] ? { [K in keyof T]: T[K] extends string ? SnakeCase : T[K] } : never; //#endregion //#region src/string-literals/character-sets/AlphaChar.d.ts /** * **AlphaChar** * * Alphabetical character (both upper and lowercase). * * **Related:** `UpperAlphaChar`, `LowerAlphaChar`, `Alpha` */ type AlphaChar = UpperAlphaChar | LowerAlphaChar; //#endregion //#region src/string-literals/character-sets/AlphanumericChar.d.ts /** * **AlphanumericChar** * * A character which is either a letter (upper or lower) or a number. */ type AlphanumericChar = AlphaChar | NumericChar; //#endregion //#region src/string-literals/character-sets/BCP.d.ts /** * The [BCP47 standard](https://en.wikipedia.org/wiki/IETF_language_tag) is * used to specify a country or region. * * Notes: * * - it is also used heavily in Javascript, such as the for Locale strings, etc. * - this type is not exhaustive but rather just suggests some and allows all */ type BCP47 = Suggest<"af" | "be" | "bg" | "cy" | "en" | "es" | "fi" | "ga" | "it" | "ja" | "ko" | "hy" | "nl" | "no" | "pl" | "pt" | "sa" | "sv" | "ru" | "th" | "tr" | "uk" | "ur" | "zh">; //#endregion //#region src/string-literals/character-sets/brackets/Brackets.d.ts /** * Opening and closing brackets. Where brackets are parenthesis, square brackets, and curly brackets. * * **Related:** `OpeningBracket`, `ClosingBracket` */ type Bracket = "(" | "[" | "{" | "<" | ")" | "]" | "}" | ">"; //#endregion //#region src/string-literals/character-sets/brackets/ClosingBracket.d.ts /** * **ClosingBracket** */ type ClosingBracket = ")" | "]" | "}" | ">"; //#endregion //#region src/string-literals/character-sets/brackets/OpeningBracket.d.ts /** * **OpeningBracket** */ type OpeningBracket = "(" | "[" | "{" | "<"; //#endregion //#region src/string-literals/character-sets/CarriageReturn.d.ts /** The **carriage return** character */ type Cr = "\n"; /** An _optional_ **carriage return** character */ type OptCr = "\n" | ""; /** * a **carriage return** character followed by indentation * * **Related:** `OptCrThenIndent`, `Cr`, `OptCr` */ type CrThenIndent = `${Cr}${Indent}`; /** * an _optional_ **carriage return** character followed by indentation * * **Related:** `CrThenIndent`, `Cr`, `OptCr` */ type OptCrThenIndent = CrThenIndent | ""; //#endregion //#region src/string-literals/character-sets/Char.d.ts /** * **Char** * * Meant to represent a single character. Includes: * * - Alphanumeric characters * - Punctuation ( . , ; ! ? ) * - Whitespace ( " " "\t" "\n" "\b" ) * - Bracket characters ( { [ ( ) ] } ) * - Quote characters ( " ' ` ) * - Currency characters ( $ ¢ £ € ฿ ¥ ₹ ₽ ) * - Math characters ( + - * / ^ ✕ ÷ = ≄ > < ) * - Special Chars ( @ ~ # & | \ # ) */ type Char$1 = AlphanumericChar | Punctuation | Whitespace | Bracket | SpecialChar | QuoteCharacter | PlusMinus | NBSP | CurrencyChar | MatchChar | EscapeCodeChars; //#endregion //#region src/string-literals/character-sets/CodePointOf.d.ts interface CharCodeMap { "A": 65; "B": 66; "C": 67; "D": 68; "E": 69; "F": 70; "G": 71; "H": 72; "I": 73; "J": 74; "K": 75; "L": 76; "M": 77; "N": 78; "O": 79; "P": 80; "Q": 81; "R": 82; "S": 83; "T": 84; "U": 85; "V": 86; "W": 87; "X": 88; "Y": 89; "Z": 90; "a": 97; "b": 98; "c": 99; "d": 100; "e": 101; "f": 102; "g": 103; "h": 104; "i": 105; "j": 106; "k": 107; "l": 108; "m": 109; "n": 110; "o": 111; "p": 112; "q": 113; "r": 114; "s": 115; "t": 116; "u": 117; "v": 118; "w": 119; "x": 120; "y": 121; "z": 122; "0": 48; "1": 49; "2": 50; "3": 51; "4": 52; "5": 53; "6": 54; "7": 55; "8": 56; "9": 57; " ": 32; "!": 33; "\"": 34; "#": 35; "$": 36; "%": 37; "&": 38; "'": 39; "(": 40; ")": 41; "*": 42; "+": 43; ",": 44; "-": 45; ".": 46; "/": 47; ":": 58; ";": 59; "<": 60; "=": 61; ">": 62; "?": 63; "@": 64; "[": 91; "\\": 92; "]": 93; "^": 94; "_": 95; "`": 96; "{": 123; "|": 124; "}": 125; "~": 126; } type CodePointsTuple = T extends [infer H extends string, ...infer R extends string[]] ? H extends keyof CharCodeMap ? [CharCodeMap[H], ...CodePointsTuple] : [1, ...CodePointsTuple] : []; /** * **CodePointOf**`` * * A type utility which will convert a single character passed in * to a numeric code point for that character. * * - if you pass in _more_ than just a single character then it will * return a tuple of code points * - if you pass in an empty string literal or a wide string type * you will get an `invalid-value/empty` or `invalid-value/wide-string` * error back respectively. */ type CodePointOf = IsWideString extends true ? Err<`invalid-value/wide-string`, `Call to the type utility CodePointOf with a wide string value is not allowed!`> : Chars extends [infer Char extends string] ? Char extends keyof CharCodeMap ? CharCodeMap[Char] : 1 : Chars["length"] extends 0 ? Err<`invalid-value/empty`, `Call to the type utility CodePointOf with an empty string literal value!`> : CodePointsTuple>; //#endregion //#region src/string-literals/character-sets/Consonants.d.ts /** * **Consonants** * * An array of all consonant characters/letters. * * **Related:** `Consonant` */ type Consonants = typeof CONSONANTS$1; /** * **Consonant** * * A union type that includes all _consonants_. * * **Related:** `Consonants` */ type Consonant = typeof CONSONANTS$1[number]; //#endregion //#region src/string-literals/character-sets/Country.d.ts type Iso3166_1_Lookup = typeof ISO3166_1$1; type Props = "alpha2" | "alpha3" | "countryCode" | "name"; /** * **Iso3166_1_Alpha2** * * A union of all 2 character country codes defined by the ISO3166-1 * standard. */ type Iso3166_1_Alpha2 = { [K in keyof Iso3166_1_Lookup]: "alpha2" extends keyof Iso3166_1_Lookup[K] ? Iso3166_1_Lookup[K]["alpha2"] : never }[number]; /** * **Iso3166_1_Alpha3** * * A union of all 2 character country codes defined by the ISO3166-1 * standard. */ type Iso3166_1_Alpha3 = { [K in keyof Iso3166_1_Lookup]: "alpha3" extends keyof Iso3166_1_Lookup[K] ? Iso3166_1_Lookup[K]["alpha3"] : never }[number]; /** * **Iso3166_1_Alpha3** * * A union of all 2 character country codes defined by the ISO3166-1 * standard. */ type Iso3166_1_CountryCode = { [K in keyof Iso3166_1_Lookup]: "countryCode" extends keyof Iso3166_1_Lookup[K] ? Iso3166_1_Lookup[K]["countryCode"] : never }[number]; /** * **Iso3166_1_Alpha3** * * A union of all 2 character country codes defined by the ISO3166-1 * standard. */ type Iso3166_1_CountryName = { [K in keyof Iso3166_1_Lookup]: "name" extends keyof Iso3166_1_Lookup[K] ? Iso3166_1_Lookup[K]["name"] : never }[number]; /** * Any identifying aspect of an ISO3166-1 country (alpha2, alpha3, code, name) */ type Iso3166_1_Token = Iso3166_1_Alpha2 | Iso3166_1_Alpha3 | Iso3166_1_CountryCode | Iso3166_1_CountryName; type LookupAlpha2 = [] extends Lookup ? undefined : T extends First$1["alpha2"] ? First$1[`${Prop}`] : LookupAlpha2, Prop>; type LookupAlpha3 = [] extends Lookup ? undefined : T extends First$1["alpha3"] ? First$1[`${Prop}`] : LookupAlpha3, Prop>; type LookupCountryCode = [] extends Lookup ? undefined : T extends First$1["countryCode"] ? First$1[`${Prop}`] : LookupCountryCode, Prop>; type LookupCountryName = [] extends Lookup ? undefined : T extends First$1["name"] ? First$1[`${Prop}`] : LookupCountryName, Prop>; /** * **Iso3166Country**`` * * Provides the ISO3166-1 **country name** if provided a valid lookup value ( * aka, a alpha-2, alpha-3, or country code). If not valid returns _undefined_. */ type Iso3166CountryLookup = T extends number ? Iso3166CountryLookup<`${T}`> : T extends string ? IsStringLiteral$1 extends true ? T extends Iso3166_1_Alpha2 ? LookupAlpha2 : T extends Iso3166_1_Alpha3 ? LookupAlpha3 : T extends Iso3166_1_CountryCode ? LookupCountryCode : T extends Iso3166_1_CountryName ? LookupCountryName : IsStringLiteral$1 extends true ? undefined : If, Iso3166_1_CountryCode | undefined, undefined> : undefined : undefined; /** * **Iso3166Alpha2Lookup**`` * * Provides the ISO3166-1 **Alpha 2** code if provided a valid lookup value ( * aka, a alpha-3, country code, or country name). If not valid returns _undefined_. */ type Iso3166Alpha2Lookup = T extends number ? Iso3166CountryLookup<`${T}`> : T extends string ? IsStringLiteral$1 extends true ? T extends Iso3166_1_Alpha2 ? LookupAlpha2 : T extends Iso3166_1_Alpha3 ? LookupAlpha3 : T extends Iso3166_1_CountryCode ? LookupCountryCode : T extends Iso3166_1_CountryName ? LookupCountryName : IsStringLiteral$1 extends true ? undefined : If, Iso3166_1_Alpha2 | undefined, undefined> : undefined : undefined; /** * **Iso3166Alpha33Lookup**`` * * Provides the ISO3166-1 **Alpha 3** code if provided a valid lookup value ( * aka, a alpha-3, country code, or country name). If not valid returns _undefined_. */ type Iso3166Alpha3Lookup = T extends number ? Iso3166CountryLookup<`${T}`> : T extends string ? IsStringLiteral$1 extends true ? T extends Iso3166_1_Alpha2 ? LookupAlpha2 : T extends Iso3166_1_Alpha3 ? LookupAlpha3 : T extends Iso3166_1_CountryCode ? LookupCountryCode : T extends Iso3166_1_CountryName ? LookupCountryName : IsStringLiteral$1 extends true ? undefined : If, Iso3166_1_Alpha3 | undefined, undefined> : undefined : undefined; /** * **Iso3166Alpha33Lookup**`` * * Provides the ISO3166-1 **Alpha 3** code if provided a valid lookup value ( * aka, a alpha-3, country code, or country name). If not valid returns _undefined_. */ type Iso3166CodeLookup = T extends number ? Iso3166CountryLookup<`${T}`> : T extends string ? IsStringLiteral$1 extends true ? T extends Iso3166_1_Alpha2 ? LookupAlpha2 : T extends Iso3166_1_Alpha3 ? LookupAlpha3 : T extends Iso3166_1_CountryCode ? LookupCountryCode : T extends Iso3166_1_CountryName ? LookupCountryName : IsStringLiteral$1 extends true ? undefined : If, Iso3166_1_CountryCode | undefined, undefined> : undefined : undefined; //#endregion //#region src/string-literals/character-sets/css/absolute.d.ts interface CssAbsolutionPositioningProperties { /** [Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/top) */ "top"?: CssSizing; /** [Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/bottom) */ "bottom"?: CssSizing; /** [Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/left) */ "left"?: CssSizing; /** [Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/right) */ "right"?: CssSizing; /** * The inset CSS property is a shorthand that corresponds to the top, right, bottom, * and/or left properties. It has the same multi-value syntax of the margin shorthand. * * This inset properties, including inset, have no effect on non-positioned elements. * * - [Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/inset) */ "inset"?: CssSizing | `${CssSizing} ${string}`; /** * The `inset-block` CSS property defines the logical block start and end offsets of an * element, which maps to physical offsets depending on the element's writing mode, * directionality, and text orientation. It corresponds to the top and bottom, or * right and left properties depending on the values defined for writing-mode, direction, * and text-orientation. * * This inset property has no effect on non-positioned elements. * * - [Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/inset-block) */ "inset-block"?: CssSizing | `${CssSizing} ${string}`; /** [Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/inset-block-end) */ "inset-block-end"?: CssSizing; /** [Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/inset-block-start) */ "inset-block-start"?: CssSizing; /** * The `inset-inline` CSS property defines the logical start and end offsets of an element * in the inline direction, which maps to physical offsets depending on the element's * * writing mode, directionality, and text orientation. It corresponds to the top and * bottom, or right and left properties depending on the values defined for writing-mode, * direction, and text-orientation. * * This inset property has no effect on non-positioned elements. * * - [Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/inset-inline) */ "inset-inline"?: CssSizing | `${CssSizing} ${string}`; /** [Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/inset-inline-end) */ "inset-inline-end"?: CssSizing; /** [Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/inset-inline-start) */ "inset-inline-start"?: CssSizing; } //#endregion //#region src/string-literals/character-sets/css/align.d.ts type Positions$1 = "normal" | "start" | "center" | "end" | "flex-start" | "flex-end" | "baseline" | "first baseline" | "space-between" | "space-around" | "space-evenly" | "stretch" | "safe center" | "unsafe center" | CssGlobal; type CssAlignContent = Positions$1; type CssAlignItems = Positions$1 | "anchor-center"; type CssAlignSelf = Positions$1 | "anchor-center"; interface CssAlignProperties { /** [Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/align-content) */ "align-content"?: CssAlignContent; /** [Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/align-items) */ "align-items"?: CssAlignItems; /** [Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/align-self) */ "align-self"?: CssAlignSelf; /** [Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/vertical-align) */ "vertical-align"?: "baseline" | "top" | "middle" | "bottom" | "sub" | "text-top"; } //#endregion //#region src/string-literals/character-sets/css/animation.d.ts type CssAnimationDelay = CssTiming; type Direction$1 = "normal" | "reverse" | "alternate" | "alternate-reverse"; type CssAnimationDirection = Direction$1 | `${Direction$1}${Opt$1<`, ${Direction$1}`>}` | `${Direction$1}${Opt$1<`, ${Direction$1}`>}${Opt$1<`, ${Direction$1}`>}${string}`; type CssAnimationDuration = CssTiming; type FillMode = "none" | "forwards" | "backwards" | "both"; type CssAnimationFillMode = FillMode | `${FillMode}${Opt$1<`, ${FillMode}`>}` | `${FillMode}${Opt$1<`, ${FillMode}`>}${Opt$1<`, ${FillMode}`>}${string}`; type Count$2 = `${number}` | "infinite"; type CssAnimationIterationCount = Count$2 | `${Count$2}${Opt$1<`, ${Count$2}`>}` | `${Count$2}${Opt$1<`, ${Count$2}`>}${Opt$1<`, ${Count$2}`>}${string}`; type Composition = "replace" | "add" | "accumulate"; type CssAnimationComposition = Composition | `${Composition}${Opt$1<`, ${Composition}`>}` | `${Composition}${Opt$1<`, ${Composition}`>}${Opt$1<`, ${Composition}`>}${string}`; type TimingFunction = "ease" | "ease-in" | "ease-out" | "ease-in-out" | "linear" | "step-start" | "step-end" | `cubic-bezier(${string})` | `linear(${string})` | `steps(${string})`; type CssAnimationTimingFunction = TimingFunction | `${TimingFunction}${Opt$1<`, ${TimingFunction}`>}${string}`; type PlayState = "paused" | "running"; type CssAnimationPlayState = PlayState | `${PlayState}${Opt$1<`, ${PlayState}`>}` | `${PlayState}${Opt$1<`, ${PlayState}`>}${Opt$1<`, ${PlayState}`>}${string}`; type CssAnimation = `${CssAnimationDuration} ${CssAnimationTimingFunction}${string}` | `${string} ${CssAnimationTimingFunction}${string}`; interface CssAnimationProperties { /** [Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/animation) */ "animation"?: string; /** [Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/animation-composition) */ "animation-composition"?: CssAnimationComposition | CssGlobal; /** [Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/animation-delay) */ "animation-delay"?: CssAnimationDelay | CssGlobal; /** [Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/animation-direction) */ "animation-direction"?: CssAnimationDirection | CssGlobal; /** [Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/animation-fill-mode) */ "animation-fill-mode"?: CssAnimationFillMode | CssGlobal; /** [Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/animation-name) */ "animation-name"?: string; /** [Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/animation-play-state) */ "animation-play-state"?: CssAnimationPlayState | CssGlobal; /** [Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/animation-range) */ "animation-range"?: string; /** [Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/animation-range-end) */ "animation-range-end"?: string; /** [Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/animation-range-start) */ "animation-range-start"?: string; /** [Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/animation-timeline) */ "animation-timeline"?: string; /** [Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/animation-timing-function) */ "animation-timing-function"?: CssAnimationTimingFunction | CssGlobal; } //#endregion //#region src/string-literals/character-sets/css/aria.d.ts /** * [**Document Structure Aria Roles**]([**Aria Role**](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles#1._document_structure_roles) */ type AriaDocStructureRoles = "alert" | "toolbar" | "tooltip" | "feed" | "math" | "presentation" | "none" | "note"; type AriaWidgetRoles = "scrollbar" | "searchbox" | "separator" | "slider" | "spinbutton" | "switch" | "tab" | "tabpanel" | "treeitem" | "combobox" | "grid" | "menu" | "menubar" | "tablist" | "tree" | "treegrid"; type AriaLandmarkRoles = "banner" | "complementary" | "contentinfo" | "form" | "main" | "navigation" | "region" | "search"; type AriaLiveRegionRoles = "alert" | "log" | "marquee" | "status" | "timer"; type AriaWindowRoles = "alertdialog" | "dialog"; /** * [**Aria Role**](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles) * Includes roles from: * - `AriaDocStructureRoles` * - `AriaWidgetRoles` * - `AriaLandmarkRoles` * - `AriaLiveRegionRoles` * * > [Role definitions](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles#roles_defined_on_mdn). */ type AriaRole = AriaDocStructureRoles | AriaWidgetRoles | AriaLandmarkRoles | AriaLiveRegionRoles | AriaWindowRoles; //#endregion //#region src/string-literals/character-sets/css/background.d.ts interface CssBackgroundProperties { "background"?: string; "background-attachment"?: string; "background-blend-mode"?: string; "background-clip"?: string; "background-color"?: Suggest; "background-image"?: string; "background-origin"?: string; "background-position"?: string; "background-position-x"?: string; "background-position-y"?: string; "background-repeat"?: string; "background-size"?: CssSizing; } //#endregion //#region src/string-literals/character-sets/css/border.d.ts /** * CSS Border Styles * ([reference](https://developer.mozilla.org/en-US/docs/Web/CSS/border-style)) */ type CssBorderStyle = "none" | "hidden" | "dotted" | "dashed" | "solid" | "double" | "groove" | "ridge" | "inset" | "outset"; /** * CSS Border Width * ([reference](https://developer.mozilla.org/en-US/docs/Web/CSS/border-width)) */ type CssBorderWidth = "thin" | "medium" | "thick" | CssSizing; type CssBorderImageSource = `url(${string})` | `url(${string}) ${number}` | `url(${string}) ${number} space` | `linear-gradient(${string},${string}) ${number} / ${CssSizing}` | `url(${string}) ${number} ${number} / ${CssSizing} ${string} / ${string}` | CssGlobal; /** * **CssBorderCollapse** * * The border-collapse CSS property sets whether cells inside a

have shared * or separate borders. * * - [reference](https://developer.mozilla.org/en-US/docs/Web/CSS/border-collapse) */ type CssBorderCollapse = "collapse" | "separate" | CssGlobal; /** * The border-image-repeat CSS property defines how the edge regions and * middle region of a source image are adjusted to fit the dimensions of * an element's border image. The middle region can be displayed by using * the keyword "fill" in the border-image-slice property. */ type CssBorderImageRepeat = "stretch" | "repeat" | "round" | "space"; type CssBorderInlineSizing = CssBorderStyle | CssSizing | `${CssSizing} ${CssBorderStyle}` | `${CssSizing} ${CssBorderStyle} ${string}`; type CssBorderProperties = { "border"?: string; /** * The border-spacing CSS property sets the distance between the borders of * adjacent cells in a
. * This property applies only when border-collapse is separate. */ "border-spacing"?: CssSizing | `${CssSizing} ${string}`; "border-radius"?: CssSizing | `${CssSizing} ${string}`; "border-collapse"?: CssBorderCollapse; /** * Formats: * - single * - two: `[top & bottom, left & right]` * - three: `[top, left & right, bottom]` * - four: `[top, left, right, bottom]` */ "border-style"?: CssBorderStyle | `${CssBorderStyle} ${CssBorderStyle}` | `${CssBorderStyle} ${CssBorderStyle} ${string}`; /** * Formats: * - single * - two: `[top & bottom, left & right]` * - three: `[top, left & right, bottom]` * - four: `[top, left, right, bottom]` */ "border-width"?: CssBorderWidth | `${CssBorderWidth} ${string}`; "border-image"?: CssBorderImageSource; /** * The `border-image-outset` CSS property sets the distance by which an * element's border image is set out from its border box. * * The parts of the border image that are rendered outside the element's * border box with `border-image-outset` do not trigger overflow scrollbars * and don't capture mouse events. */ "border-image-outset"?: CssSizing; /** * The border-image-repeat CSS property defines how the edge regions and * middle region of a source image are adjusted to fit the dimensions of * an element's border image. The middle region can be displayed by using * the keyword "fill" in the border-image-slice property. * * Format: * - use once for all edges * - use two -- `CssBorderImageRepeat` x 2 - for: `[ top & bottom, left & right ]` */ "border-image-repeat"?: CssBorderImageRepeat | `${CssBorderImageRepeat} ${CssBorderImageRepeat}`; /** * The `border-image-slice` CSS property divides the image specified by * `border-image-source` into regions. These regions form the components * of an element's border image. * * - [Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/border-image-slice) */ "border-image-slice"?: `${number}` | `${number} fill`; "border-image-source"?: CssBorderImageSource | "none"; /** * The `border-end-end-radius` CSS property defines a logical border * radius on an element, which maps to a physical border radius * that depends on the element's writing-mode, direction, and * text-orientation. This is useful when building styles to work * regardless of the text orientation and writing mode. */ "border-end-end-radius"?: CssSizing; /** * The `border-end-start-radius` CSS property defines a logical border * radius on an element, which maps to a physical border radius depending * on the element's writing-mode, direction, and text-orientation. This is * useful when building styles to work regardless of the text orientation * and writing mode. */ "border-end-start-radius"?: CssSizing; /** * Formats: * - single * - two: `[top & bottom, left & right]` * - three: `[top, left & right, bottom]` * - four: `[top, left, right, bottom]` */ "border-color"?: CssColor | `${CssColor} ${string}`; /** * The border-block-color CSS property defines the color of the logical * block borders of an element, which maps to a physical border color * depending on the element's writing mode, directionality, and text * orientation */ "border-block-color"?: CssColor; /** * The border-block-end-color CSS property defines the color of the logical * block-end border of an element, which maps to a physical border color * depending on the element's writing mode, directionality, and text orientation. */ "border-block-end-color"?: CssColor; /** * The border-block-end-color CSS property defines the color of the logical * block-end border of an element, which maps to a physical border color * depending on the element's writing mode, directionality, and text * orientation. */ "border-block-start-color"?: CssColor; /** * The border-inline CSS property is a shorthand property for setting * the individual logical inline border property values in a single place * in the style sheet. * * - [Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/border-inline) */ "border-inline"?: `${CssBorderWidth} ${string}` | `${CssColor} ${string}` | `${CssBorderStyle} ${string}`; "border-inline-style"?: CssBorderStyle; /** * The `border-inline-width` CSS property defines the width of the logical inline * borders of an element, which maps to a physical border width depending on the * element's writing mode, directionality, and text orientation. It corresponds to the * border-top-width and border-bottom-width, or border-left-width, and border-right-width * property depending on the values defined for writing-mode, direction, and text-orientation. * * - [Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/border-inline-width) */ "border-inline-width"?: CssBorderWidth | `${CssBorderWidth} ${string}`; "border-inline-color"?: CssColor; "border-inline-start-style"?: CssBorderStyle; "border-inline-start-color"?: CssColor; "border-inline-start-width"?: CssBorderWidth; "border-inline-end-style"?: CssBorderStyle; "border-inline-end-color"?: CssColor; "border-inline-end-width"?: CssBorderWidth; "border-left"?: `${CssColor} ${string}` | `${CssBorderStyle} ${string}` | `${CssBorderWidth} ${string}`; "border-left-style"?: CssBorderStyle; "border-left-color"?: CssColor; "border-left-width"?: CssBorderWidth; "border-left-top-radius"?: CssSizing; "border-left-bottom-radius"?: CssSizing; "border-right"?: `${CssColor} ${string}` | `${CssBorderStyle} ${string}` | `${CssBorderWidth} ${string}`; "border-right-style"?: CssBorderStyle; "border-right-color"?: CssColor; "border-right-width"?: CssBorderWidth; "border-right-top-radius"?: CssSizing; "border-right-bottom-radius"?: CssSizing; "border-bottom"?: `${CssColor} ${string}` | `${CssBorderStyle} ${string}` | `${CssBorderWidth} ${string}`; "border-bottom-style"?: CssBorderStyle; "border-bottom-color"?: CssColor; "border-bottom-width"?: CssBorderWidth; "border-bottom-left-radius"?: CssSizing; "border-bottom-right-radius"?: CssSizing; "border-top"?: `${CssColor} ${string}` | `${CssBorderStyle} ${string}` | `${CssBorderWidth} ${string}`; "border-top-style"?: CssBorderStyle; "border-top-color"?: CssColor; "border-top-width"?: CssBorderWidth; "border-top-left-radius"?: CssSizing; "border-top-right-radius"?: CssSizing; /** * The `border-inline-end` CSS property is a shorthand property for setting the * individual logical inline-end border property values in a single place in * the style sheet. * * - [Refererence](https://developer.mozilla.org/en-US/docs/Web/CSS/border-inline-end) */ "border-inline-end"?: CssBorderInlineSizing; /** * The `border-inline-start` CSS property is a shorthand property for setting the * individual logical inline-start border property values in a single place in * the style sheet. * * - [Refererence](https://developer.mozilla.org/en-US/docs/Web/CSS/border-inline-start) */ "border-inline-start"?: CssBorderInlineSizing; } | { [key: `border-${string}`]: string; }; //#endregion //#region src/string-literals/character-sets/css/box.d.ts type CssBoxAlign = "start" | "center" | "end" | "baseline" | "stretch" | CssGlobal; /** * [Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/box-decoration-break) */ type CssBoxDecorationBreak = "slice" | "clone" | CssGlobal; /** [Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/box-shadow) */ type CssBoxShadow = "none" | `inset ${string}${CssColorLight}` | `${CssSizingLight}${string}${CssColorLight}` | `${CssSizingLight}${string},${string}` | CssGlobal; /** [Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/box-sizing) */ type CssBoxSizing = "border-box" | "content-box" | CssGlobal; interface CssBoxProperties { "box-decoration-break"?: CssBoxDecorationBreak; "box-shadow"?: CssBoxShadow; "box-sizing"?: CssBoxSizing; } //#endregion //#region src/string-literals/character-sets/css/break.d.ts type CssBreak = "auto" | "avoid" | "always" | "all" | "avoid-page" | "page" | "left" | "right" | "recto" | "verso" | "avoid-column" | "region" | CssGlobal; type CssBreakInside = "auto" | "avoid" | "avoid-page" | "avoid-column" | "avoid-region" | CssGlobal; interface CssBreakProperties { /** [Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/break-after) */ "break-after"?: CssBreak; /** [Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/break-before) */ "break-before"?: CssBreak; /** [Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/break-inside) */ "break-inside"?: CssBreakInside; } //#endregion //#region src/string-literals/character-sets/css/color.d.ts type CssNamedColor = typeof CSS_NAMED_COLORS$1[number]; /** * Type lookup table with _keys_ of CSS Named Colors and _values_ * being the string `RgbColor` definition. */ type CssNamedColorLookup = typeof CSS_COLOR_LOOKUP$1; type CssColorModel = "rgb" | "hsl" | "hsb" | "lab" | "oklch"; type CssColorSpace = "srgb" | "srgb-linear" | "display-p3" | "rec2020" | "a98-rgb" | "prophoto-rgb" | "xyz" | "xyz-d50" | "xyz-d65" | "hsl" | "hwb" | "lch" | "oklch"; type CssColorSpacePrimary = "srgb" | "display-p3" | "rec2020" | "hsl" | "hwb" | "lch" | "oklch"; /** * **CssRgb** * * CSS RGB colors (e.g., `rgb(123,86,255)`) */ type CssRgb = `rgb(${OptionalSpace}${number} ${number} ${number}${OptionalSpace})` | `rgb(${OptionalSpace}${number},${OptionalSpace}${number},${OptionalSpace}${number}${OptionalSpace})`; type CssRgba = `rgba(${number} ${number} ${number} ${number})` | `rgba(${number},${OptionalSpace}${number},${OptionalSpace}${number},${OptionalSpace}${number})`; /** * Hue, Saturation, and Lightness level (**HSL** color model) */ type CssHsl = `hsl(${number} ${number} ${number})` | `hsl(${number},${OptionalSpace}${number},${OptionalSpace}${number})`; /** * Hue, Saturation, and Brightness (**HSB** color model) */ type CssHsb = `hsb(${number} ${number} ${number})` | `hsb(${number},${OptionalSpace}${number},${OptionalSpace}${number})`; type OptionalPercent = "%" | ""; /** * [**CssOkLch**](https://oklch.com/)`(lightness, chroma, hue)` * * - Lightness is critical to **contrast** between _background_ and _foreground_ elements * - Saturation levels are seen in _chroma_ values. * - Hue distinguishes the actual color you're viewing */ type CssOkLch = `oklch(${number}${OptionalPercent} ${number}${OptionalPercent} ${number})`; /** * a hexadecimal color representation for CSS */ type CssHexColor = `#${HexadecimalChar}${HexadecimalChar}${string}`; type ColorFnValue = `${number}` | `${number}%` | "none"; type ColorFnOptOpacity = "" | ` / ${number}`; /** * **CssColor** * * Intended to represent _any_ CSS color value. */ type CssColor = CssNamedColor | CssHexColor | CssRgb | CssRgba | CssOkLch | CssHsb | CssHsl | "currentcolor" | `color(${string})`; type CssColorLight = CssNamedColor | `#${number}` | "currentcolor" | `${"rgb" | "rgba" | "hsb" | "hsl"}(${string})` | `color(${string})`; /** * The new CSS 4 `color(colorspace v1 v2 v3 [/ alpha])` function. * * **Related:** `CssColorSpace`, `ColorFnValue`, `ColorFnOptOpacity` */ type CssColorFn = `color(${TColorSpace} ${TV1} ${TV2} ${TV3})${TOp}` | `color(${CssColor} from ${TColorSpace} ${TV1} ${TV2} ${TV3})${TOp}`; type CssColorMix = `color-mix(in ${CssColorSpace}, ${CssColor}${string})`; type CssColorMixLight = `color-mix(in ${CssColorSpacePrimary}, ${string})`; /** * **ColorParam** * * A union of color options which might be presented as user input. It includes: * * - all CSS named colors * - any valid CSS hex color * - any Tailwind Color/Luminosity pairing * - a `color-mix(...)` color */ type ColorParam = CssNamedColor | CssHexColor | TwColorWithLuminosity | CssColorMixLight; //#endregion //#region src/string-literals/character-sets/css/definition.d.ts /** * **CssDefinition** * * Provides a means to define a CSS selector in a type strong manner. * * - each _key_ is a possible CSS property with a type definition provided to constrain it * - it is also indexed so that any property without a strong type definition can still be * added as a string value. */ type CssDefinition = { /** [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/appearance) */"appearance"?: Suggest; /** [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/backdrop-filter) */ "backdrop-filter"?: Suggest; /** * The valid values for the * [**display**](https://developer.mozilla.org/en-US/docs/Web/CSS/display) * property in CSS. */ "display"?: Suggest; /** [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/position) */ "position"?: Suggest; /** [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/aspect-ratio) */ "aspect-ratio"?: Suggest; /** [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/opacity) */ "opacity"?: Suggest; /** [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/gap) */ "gap"?: Suggest; /** [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/flex) */ "flex"?: Suggest; /** [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/flex-grow) */ "flex-grow"?: Suggest; /** [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/flex-shrink) */ "flex-shrink"?: CssFlexShrink; /** [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/flex-direction) */ "flex-direction"?: Suggest; /** [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/flex-flow) */ "flex-flow"?: Suggest; /** [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/flex-basis) */ "flex-basis"?: Suggest; /** [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/float) */ "float"?: Suggest; /** * a union of valid values for the **CSS** [`list-style`](https://developer.mozilla.org/en-US/docs/Web/CSS/list-style) property. * * The list-style CSS shorthand property allows you to set all the list style properties * at once. */ "list-style"?: Suggest; /** * The block-size CSS property defines the horizontal or vertical size of an element's block, * depending on its writing mode. It corresponds to either the width or the height property, * depending on the value of writing-mode. * * If the writing mode is vertically oriented, the value of block-size relates to the width of * the element; otherwise, it relates to the height of the element. A related property is * inline-size, which defines the other dimension of the element. * /** [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/block-size) */ "block-size"?: Suggest; /** [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/border-size) */ "border-size"?: Suggest; /** [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/content) */ "content"?: Suggest; /** [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/color) */ "color"?: Suggest; /** [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/cursor) */ "cursor"?: Suggest; /** [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/height) */ "height"?: Suggest; /** [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/width) */ "width"?: Suggest; /** [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/perspective) */ "perspective"?: Suggest; "perspective-origin"?: Suggest; /** [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/mix-blend-mode) */ "mix-blend-mode"?: Suggest; /** [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/letter-spacing) */ "letter-spacing"?: Suggest; /** * The lighting-color CSS property defines the color of the light source for the * and SVG lighting filter primitives within an * SVG . If present, it overrides the element's lighting-color attribute. * * - [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/lighting-color) */ "lighting-color"?: Suggest; /** [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/object-fit) */ "object-fit"?: Suggest; /** [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/object-position) */ "object-position"?: Suggest; "order"?: Suggest<`${number}` | CssGlobal>; /** [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/image-orientation) */ "image-orientation"?: Suggest; /** [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/image-rendering) */ "image-rendering"?: Suggest; /** [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/image-resolution) */ "image-resolution"?: Suggest; /** [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/hanging-punction) */ "hanging-punctuation"?: Suggest; /** [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/min-height) */ "min-height"?: Suggest; /** [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/min-width) */ "min-width"?: Suggest; /** [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/min-block-size) */ "min-block-size"?: Suggest; /** [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/min-inline-size) */ "min-inline-size"?: Suggest; /** [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/stop-color) */ "stop-color"?: Suggest; /** [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/stop-opacity) */ "stop-opacity"?: Suggest<`${number}` | `${number}%` | CssGlobal>; /** [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/tab-size) */ "tab-size"?: Suggest<`${number}` | CssSizingLight | CssGlobal>; /** [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/table-layout) */ "table-layout"?: Suggest<"auto" | "fixed" | CssGlobal>; /** [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/translate) */ "translate"?: Suggest; /** [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/quotes) */ "quotes"?: Suggest; /** [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/r) */ "r"?: Suggest; /** [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/pointer-events) */ "pointer-events"?: string; /** [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/resize) */ "resize"?: Suggest<"both" | "horizontal" | "vertical" | "none" | CssGlobal>; /** [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/rotate) */ "rotate"?: Suggest; "row-gap"?: Suggest; /** [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/rx) */ "rx"?: Suggest; /** [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/ry) */ "ry"?: Suggest; /** [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/x) */ "x"?: Suggest; /** [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/y) */ "y"?: Suggest; /** [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/white-space) */ "white-space"?: Suggest; /** [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/white-space-collapse) */ "white-space-collapse"?: Suggest; /** [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/widows) */ "widows"?: Suggest; /** [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/will-change) */ "will-change"?: Suggest; /** [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/word-break) */ "word-break"?: Suggest; /** [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/word-spacing) */ "word-spacing"?: Suggest<"normal" | CssSizing>; /** [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/writing-mode) */ "writing-mode"?: Suggest; /** [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/z-index) */ "z-index"?: Suggest<`${number}` | "auto" | CssGlobal>; /** [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/zoom) */ "zoom"?: Suggest<`${number}` | `${number}%` | "normal" | "reset" | CssGlobal>; } & CssBorderProperties & CssBackgroundProperties & CssAbsolutionPositioningProperties & CssOffsetProperties & CssBreakProperties & CssBoxProperties & CssTextProperties & CssStrokeProperties & CssJustifyProperties & CssAlignProperties & CssPlaceProperties & CssAnimationProperties & CssMarginProperties & CssPaddingProperties & CssOutlineProperties & CssOverflowProperties & CssOffsetProperties & CssTransformProperties & CssFontProperties & { [key: string]: string; }; //#endregion //#region src/string-literals/character-sets/css/display-position.d.ts type Ratio = `${number}${OptionalSpace}/${OptionalSpace}${number}`; type One = `1`; type Special = "inherit" | "initial" | "revert" | "revert-layer" | "unset"; type Auto = "auto" | `auto ${Ratio}` | `${Ratio} auto`; /** * **CssAspectRatio** * * Allowed values for CSS's `aspect-ratio` property. */ type CssAspectRatio = Ratio | One | Special | Auto; /** * **CssPosition** * * The valid values for the `position` property in CSS. */ type CssPosition = "static" | "relative" | "absolute" | "fixed" | "sticky" | "inherit" | "initial" | "revert" | "revert-layer" | "unset"; /** * **CssDisplay** * * The valid values for the [**display**](https://developer.mozilla.org/en-US/docs/Web/CSS/display) * property in CSS. */ type CssDisplay = "block" | "flex" | "inline" | "inline-block" | "inline-flex" | "inline-grid" | "grid" | "flow-root" | "none" | "contents" | "block flex" | "block flow" | "block flow-root" | "block grid" | "inline flex" | "inline flow" | "inline flow-root" | "inline-grid" | "table" | "table-row" | "list-item" | CssGlobal; //#endregion //#region src/string-literals/character-sets/css/font.d.ts type CssFontFamily = `"${string}"` | "serif" | "san-serif" | "monospace" | "cursive" | "fantasy" | "system-ui" | "ui-serif" | "ui-sans-serif" | "ui-monospace" | "ui-rounded" | "emoji" | "math" | "fansong"; type CssFontFeatureSetting = "normal" | "liga" | "tnum" | "smcp"; type CssFontKerning = "auto" | "normal" | "none" | CssGlobal; type CssFontPalette = "normal" | "light" | "dark" | `--${string}` | `palette-mix(in ${ColorGamut},${string})`; type CssFontWidth = "normal" | "ultra-condensed" | "extra-condensed" | "condensed" | "semi-condensed" | "expanded" | "extra-expanded" | "ultra-expanded" | `${number}%` | CssGlobal; type CssFontStyle = "normal" | "italic" | "oblique" | `oblique ${CssRotation}` | CssGlobal; type CssFontSynthesis = "none" | "weight" | "style" | "position" | "small-caps"; type CssFontWeight = "normal" | "bold" | "100" | "200" | "300" | "400" | "500" | "600" | "700" | "800" | "900" | "lighter" | "bolder" | CssGlobal; /** * The font-language-override CSS property controls the use of language-specific glyphs in a typeface. * * By default, HTML's lang attribute tells browsers to display glyphs designed specifically * for that language. For example, a lot of fonts have a special character for the digraph * fi that merge the dot on the "i" with the "f." However, if the language is set to Turkish * the typeface will likely know not to use the merged glyph; Turkish has two versions of * the "i," one with a dot (i) and one without (ı), and using the ligature would incorrectly * transform a dotted "i" into a dotless "i." * * The font-language-override property lets you override the typeface behavior for a specific * language. This is useful, for example, when the typeface you're using lacks proper support * for the language. For instance, if a typeface doesn't have proper rules for the Azeri * language, you can force the font to use Turkish glyphs, which follow similar rules. */ type CssFontLanguageOverride = string; interface CssFontProperties { "font-family"?: CssFontFamily | `${CssFontFamily}, ${CssFontFamily}${string}` | CssGlobal; "font-feature-settings"?: CssFontFeatureSetting | `${CssFontFeatureSetting} ${number | "on" | "off"}` | `${CssFontFeatureSetting} ${number | "on" | "off"},${string}`; "font-kerning"?: CssFontKerning; "font-language-override"?: CssFontLanguageOverride; "font-size"?: CssSizing | "xx-small" | "x-small" | "small" | "medium" | "large" | "x-large" | "xx-large" | "xxx-large"; /** * The font-size-adjust CSS property provides a way to modify the size of lowercase * letters relative to the size of uppercase letters, which defines the overall * font-size. This property is useful for situations where font fallback can * occur. * * - [Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/font-size-adjust) */ "font-size-adjust"?: CssSizingLight | "none" | `${number}` | `from-font${Opt$1<` ${CssSizingLight}`>}` | `cap-height${Opt$1<` ${CssSizingLight}`>}` | `ex-height${Opt$1<` ${CssSizingLight}`>}` | `ch-width${Opt$1<` ${CssSizingLight}`>}` | `ic-width${Opt$1<` ${CssSizingLight}`>}` | `ic-height${Opt$1<` ${CssSizingLight}`>}`; /** * The font-palette CSS property allows specifying one of the many palettes contained in a * color font that a user agent may use for the font. Users can also override the values in * a palette or create a new palette by using the @font-palette-values at-rule. * * - [Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/font-palette) */ "font-palette"?: CssFontPalette; /** * An alias for `font-width` */ "font-stretch"?: CssFontWidth; /** * The font-stretch CSS property selects a normal, condensed, or expanded face from a font. * * - [Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/font-width) */ "font-width"?: CssFontWidth; /** [Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/font-style) */ "font-style"?: CssFontStyle; /** * The `font-synthesis` shorthand CSS property lets you specify whether or not the browser * may synthesize the bold, italic, small-caps, and/or subscript and superscript typefaces * when they are missing in the specified font-family. * * - [Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/font-synthesis) */ "font-synthesis"?: CssFontSynthesis | `${CssFontSynthesis} ${CssFontSynthesis}` | `${CssFontSynthesis} ${CssFontSynthesis} ${CssFontSynthesis}${string}` | CssGlobal; /** [Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/font-weight) */ "font-weight"?: CssFontWeight; } //#endregion //#region src/string-literals/character-sets/css/functions.d.ts type CssVar = `var(--${string})`; /** * A CSS variable declaration with a [fallback](https://developer.mozilla.org/en-US/docs/Web/CSS/var#syntax) * choice or choices. */ type CssVarWithFallback = `var(--${string}, ${CssVar | CssColor})`; /** * The CSS `translate()` function */ type CssTranslateFn = `translate(${CssSizing})` | `translate(0)` | `translate(${CssSizing}, ${CssSizing})`; /** * The CSS [`round()`](https://developer.mozilla.org/en-US/docs/Web/CSS/round) function */ type CssRound = `round(${CssVar}, ${CssSizing})` | `round(${"up" | "down" | "nearest" | "to-zero"}, ${CssVar | CssSizing}, ${string})`; /** * The CSS [clamp](https://developer.mozilla.org/en-US/docs/Web/CSS/clamp) function */ type CssClamp = `clamp(${CssSizing}, ${string}, ${string})`; /** * The CSS [calc()](https://developer.mozilla.org/en-US/docs/Web/CSS/calc) function. * * ```css * calc(100% - 80px) * calc(100px * sin(pi / 2)) * calc(var(--hue) + 180) * lch(from aquamarine l c calc(h + 180)) * ``` */ type CssCalc = `calc(${CssSizing | CssVarWithFallback}${string})`; //#endregion //#region src/string-literals/character-sets/css/global.d.ts type CssGlobal = "inherit" | "initial" | "revert" | "unset" | "revert-layer"; //#endregion //#region src/string-literals/character-sets/css/html-element.d.ts type OldSchoolHtmlElement = "b" | "center" | "u" | "big" | "small" | "strong"; type EsotericHtmlElement = OldSchoolHtmlElement | "base" | "bdi" | "bdo" | "datalist" | "dd" | "del" | "dir" | "dl" | "dt" | "fencedframe" | "ins" | "kbd" | "nobr" | "noembed" | "rb" | "rt" | "rtc" | "ruby" | "s" | "samp" | "map" | "marquee" | "meter" | "noframes" | "object" | "param" | "portal" | "q" | "sub" | "sup" | "tt" | "track" | "var" | "wbr" | "xmp"; type HtmlTableElement = "col" | "colgroup" | "hgroup" | "table" | "tbody" | "td" | "tfoot" | "th" | "thead" | "time" | "tr"; type HtmlSymantecElement = "abbr" | "acronym" | "address" | "area" | "article" | "aside" | "blockquote" | "caption" | "cite" | "details" | "dfn" | "dialog" | "fieldset" | "figure" | "figcaption" | "header" | "footer" | "legend" | "nav" | "menu" | "search" | "summary" | "section"; type HtmlInputElement = "button" | "form" | "label" | "optgroup" | "option" | "select" | "input" | "textarea"; type HtmlFunctionalElement = "a" | "br" | "canvas" | "code" | "data" | "embed" | "em" | "font" | "hr" | "i" | "iframe" | "img" | "mark" | "strike" | "progress" | "p" | "picture" | "plaintext" | "pre"; type HtmlMediaElement = "audio" | "video"; type HtmlFrameworkElement = "template" | "slot"; type HtmlStructuralElement = "div" | `h${"1" | "2" | "3" | "4" | "5" | "6"}` | "frame" | "frameset" | "html" | "head" | "span"; type HtmlListElement = "li" | "ol" | "ul"; type HtmlHeaderElement = "meta" | "link" | "noscript" | "script" | "title" | "style" | "source"; type HtmlBodyElement = "body" | "main" | HtmlListElement | HtmlStructuralElement | HtmlSymantecElement | HtmlMediaElement | HtmlInputElement | HtmlFunctionalElement | HtmlFrameworkElement | HtmlTableElement; /** * Combines all _common_ HTML tags for both * the header and body of an HTML page. * * **Related:** * - `HtmlElement` _(all including esoteric)_ * - `HtmlHeaderElement` * - `HtmlBodyElement` */ type CommonHtmlElement = HtmlHeaderElement | HtmlBodyElement; /** * All HTML elements. * * **Related:** * - `CommonHtmlElement` _(just the most common elements)_ * - `HtmlHeaderElement`, `HeaderBodyElement` */ type HtmlElement = CommonHtmlElement | EsotericHtmlElement; //#endregion //#region src/string-literals/character-sets/css/justify.d.ts type CssJustifyContent = "center" | "start" | "end" | "flex-start" | "flex-end" | "left" | "right" | "normal" | "space-between" | "space-around" | "space-evenly" | "stretch" | "safe center" | "unsafe center" | CssGlobal; type Positions = "stretch" | "center" | "start" | "end" | "flex-start" | "flex-end" | "self-start" | "self-end" | "left" | "right" | "anchor-center" | "baseline" | "first baseline" | "last baseline" | "safe center" | "unsafe center" | "legacy left" | "legacy right" | "legacy center" | CssGlobal; type CssJustifyItems = Positions; type CssJustifySelf = Positions; interface CssJustifyProperties { /** [Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/justify-content) */ "justify-content"?: CssJustifyContent; /** [Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/justify-items) */ "justify-items"?: CssJustifyItems; /** [Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/justify-self) */ "justify-self"?: CssJustifySelf; } //#endregion //#region src/string-literals/character-sets/css/keyframe.d.ts /** * The _timestamp_ of a [CSS keyframe animation](https://developer.mozilla.org/en-US/docs/Web/CSS/@keyframes) * (e.g., "from", "to", "50%") */ type CssKeyframeTimestamp = "from" | "to" | `${number}%` | `${number}%${string},${number}%`; type CssKeyframeTimestampSuggest = Suggest<"from" | "to" | "10%" | "20%" | "30%" | "40%" | "50%" | "60%" | "70%" | "80%" | "90%" | "100%" | "45%, 55%">; //#endregion //#region src/string-literals/character-sets/css/margin.d.ts type CssMargin = CssSizingLight | `${CssSizingLight}, ${CssSizingLight}${Opt$1<`, ${CssSizingLight}`>}${string}`; type CssMarginBlock = `${CssSizingLight}${Opt$1<`, ${CssSizingLight}`>}${string}`; type CssMarginBlockEnd = CssSizingLight; type CssMarginBlockStart = CssSizingLight; type CssMarginInline = `${CssSizingLight}${Opt$1<`, ${CssSizingLight}`>}${string}`; type CssMarginInlineEnd = CssSizingLight; type CssMarginInlineStart = CssSizingLight; type CssMarginLeft = CssSizingLight; type CssMarginRight = CssSizingLight; type CssMarginTop = CssSizingLight; type CssMarginBottom = CssSizingLight; interface CssMarginProperties { "margin"?: CssMargin; "margin-block"?: CssMarginBlock; "margin-block-end"?: CssMarginBlockEnd; "margin-block-start"?: CssMarginBlockStart; "margin-inline"?: CssMarginInline; "margin-inline-end"?: CssMarginInlineEnd; "margin-inline-start"?: CssMarginInlineStart; "margin-left"?: CssMarginLeft; "margin-right"?: CssMarginRight; "margin-top"?: CssMarginTop; "margin-bottom"?: CssMarginBottom; "margin-trim"?: string; } //#endregion //#region src/string-literals/character-sets/css/object.d.ts /** * **CssObjectFit** * * The [object-fit](https://developer.mozilla.org/en-US/docs/Web/CSS/object-fit) CSS property sets how the * content of a replaced element, such as an or

(protocol: P, domain: D, basePath: B) => `${P}://${D}/${B}`) | ((url: U) => U); /** * **Uri** * * A simple type to allow for any HTTP, File, or Websocket based URI. */ type Uri = `${T}://${string}`; /** * **AddUrlPathSegment**`` * * Adds a new URL path segment, ensuring that appropriate * `/` representation is preserved. */ type AddUrlPathSegment = TExisting extends `${string}/` ? `${TExisting}${UrlSegment}` : `${TExisting}/${UrlSegment}`; type UrlSegment = string extends T ? string : T extends `/${infer Rest}` ? UrlSegment : T extends `${infer Rest}/` ? UrlSegment : T; type _Path = GetUrlPath extends infer P extends string ? P : never; type _Proto = NetworkProtocolPrefix<[] extends TOpt["protocols"] ? "https" : TupleToUnion>; type _QP = TOpt["queryParameters"] extends "none" ? "" : `${AnyQueryParams}`; type _UrlsFrom = [TOpt["protocolOptional"]] extends [true] ? `${_Proto}${GetUrlSource}${UrlPort}${AddUrlPathSegment<_Path, `${string}`>}` | `${_Proto}${GetUrlSource}${UrlPort}${_Path}${_QP}` | `${GetUrlSource}${UrlPort}${_Path}${_QP}` | `${GetUrlSource}${UrlPort}${AddUrlPathSegment<_Path, `${string}`>}` : `${_Proto}${GetUrlSource}${UrlPort}${AddUrlPathSegment<_Path, `${string}`>}` | `${_Proto}${GetUrlSource}${UrlPort}${_Path}${_QP}`; /** * **UrlsFrom**`` * * Utility which generates a type for all valid URLs in the given * partial URL. * * - you can configure whether the protocol should be _optional_ * and whether _insecure_ URL's should be allowed with `TOpt` * - you can also switch the protocol between `http`,`ws`, or `both` * - the default protocol is `https` */ type UrlsFrom = T extends string ? _UrlsFrom : T extends readonly string[] ? TupleToUnion<{ [K in keyof T]: IsStringLiteral$1 extends true ? _UrlsFrom, TOpt> : never }> : never; /** * the inclusion of query parameters at the end of a URL parameter */ type UrlQueryParameters = `?${string}`; /** * the _optional_ inclusion of query parameters at the end of a URL */ type OptUrlQueryParameters = "" | UrlQueryParameters; //#endregion //#region src/string-literals/character-sets/urls/UrlDynamics.d.ts type SegmentType = ("string" | "number" | "boolean" | "Opt" | "Opt" | "Opt") & SimpleToken; /** * **DynamicSegment** * * Is a simple token which expresses a dynamic * type which might show up in a URL, query params, etc. * * - this placeholder token can be converted to an actual * _type_ with `FromDynamicSegment` * - at runtime you can use `isDynamicSegment()` or * `hasDynamicSegment()` * * **Related:** `NamedDynamicSegment` */ type DynamicSegment = `<${SegmentType}>`; type FromDynamicSegment = T extends `` ? string : T extends `` ? number : T extends `` ? boolean : T extends `>` ? string | undefined : T extends `>` ? number | undefined : T extends `>` ? boolean | undefined : T extends `` ? CsvToUnion : never; type NamedDynamicSegment = `<${SegmentType}::${string}>` | ``; type FromNamedDynamicSegment = T extends `` ? string : T extends `<${string} as number>` ? number : T extends `<${string} as boolean>` ? boolean : T extends `<${string} as Opt>` ? string | undefined : T extends `${string} as Opt>` ? number | undefined : T extends `::${string}>` ? boolean | undefined : T extends `` ? CsvToUnion : T extends `<${AlphaChar}${string}${AlphanumericChar}>` ? string : never; type ParseUrlPath = EmptyObject> = TParts extends [infer Head extends string, ...infer Rest extends readonly string[]] ? Head extends `${infer Name}>${infer _Remaining}` ? Name extends `${infer VarName} as number` ? ParseUrlPath> : Name extends `${infer VarName} as string(${infer Enum})` ? ParseUrlPath>> : ParseUrlPath> : ParseUrlPath : ExpandDictionary; /** * **GetUrlPathDynamics**`` * * A URL's path can include dynamic segments in the path. If the string `T` has a * `` segment inside the path part of a URL then this will be consider a dynamic * segment and assume the "name" given. All dynamic segments in the URL are of the * the type `string`. * * **Related:** `GetQueryParameterDynamics`, `GetUrlDynamics` */ type GetUrlPathDynamics, "http://" | "https://">> = Split extends infer Parts extends readonly string[] ? ParseUrlPath : never; type QueryParameterDynamics = [] extends T ? As$1, Record> : QueryParameterDynamics, First$1 extends `${infer Var}=` ? R & Record> : First$1 extends `${infer Var}=<${infer Type extends SegmentType}>` ? R & Record> : First$1 extends `${infer Var}=${infer Val}` ? R & Record : R>; type GetQueryParameterDynamics = QueryParameterDynamics extends `?${infer REST}` ? Split : Split, "&">>; type PathAndQueryDynamics = GetUrlPathDynamics> extends Dictionary ? GetQueryParameterDynamics> extends Dictionary ? Some>>, "extends", StringKeys>>> extends true ? ErrMsg<"overlapping-keys", { path: Keys$1>>; qp: Keys$1>>; }> : MergeObjects>, GetQueryParameterDynamics>> : never : never; interface GetUrlDynamics { /** * A key/value of dynamic path variables found */ pathVars: GetUrlPathDynamics>; /** * A key/value of dynamic (and fixed) query parameters found in the URL */ qpVars: GetQueryParameterDynamics>; /** A key/value of both path and query parameter variables */ allVars: PathAndQueryDynamics; } //#endregion //#region src/string-literals/character-sets/ValueAtDotPath.d.ts type Process$42 = [] extends TIndexes ? TContainer : First$1 extends keyof TContainer ? TContainer[First$1] extends Container ? Process$42], AfterFirst> : AfterFirst["length"] extends 0 ? TContainer[First$1] : false : IsVueRef extends true ? First$1 extends keyof AsRef["value"] ? TIndexes["length"] extends 1 ? AsRef["value"][First$1] : AsRef["value"][First$1] extends Container ? Process$42["value"][First$1], AfterFirst> : AfterFirst["length"] extends 0 ? AsRef["value"][First$1] : false : false : false; type ValueAtDotPath = [IsValidDotPath] extends [true] ? IsLiteralLike extends true ? IsStringLiteral$1 extends true ? Split extends readonly string[] ? Process$42> : never : string : string : never; //#endregion //#region src/string-literals/character-sets/Variable.d.ts /** * **VariableChar** * * Characters allowed in a variable name. * * **Related:** `PropertyChar` */ type VariableChar = AlphanumericChar | "_" | "."; /** * **VariableChar** * * Characters allowed as an object property name. * * **Related:** `VariableChar` */ type PropertyChar = VariableChar | "-"; //#endregion //#region src/string-literals/character-sets/Whitespace.d.ts /** * **Whitespace** * * Characters typically representing "white space" * * **Related:** `OptWhitespace`, `WhitespaceAll` */ type Whitespace = typeof WHITESPACE_CHARS$1[number]; /** * **WhitespaceAll** * * Characters typically representing "white space" (but also including * all variants of `SpaceChars` such as non-break spaces, em-space, etc.) * * **Related:** `WhiteSpace`, `OptWhitespace` */ type WhitespaceAll = typeof WHITESPACE_CHARS$1[number] | SpaceChars; /** * Allows for a whitespace character (optionally) * * **Related:** * - `Whitespace`, `WhitespaceAll` * - `OptWhitespaceAll` */ type OptWhitespace = Whitespace | ""; /** * Allows for any whitespace character (optionally) * * **Related:** * - `WhitespaceAll`, `Whitespace` * - `OptWhitespace` */ type OptWhitespaceAll = WhitespaceAll | ""; //#endregion //#region src/string-literals/character-sets/YouTube.d.ts /** * **YouTubePageType** * * A union type enumeration of the _types_ of pages on YouTube. */ 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"; type YouTubeFeedType = "history" | "playlists" | "liked" | "subscriptions" | "trending" | "other"; /** * **YouTubeUrl** * * A type which should match all URL's pointing to YouTube */ type YouTubeUrl = UrlsFrom<["www.youtube.com", "youtube.com", "youtu.be"]>; /** * **YouTubeHome** * * The URLs representing the home page of YouTube */ type YouTubeHome = `https://www.youtube.com${AnyQueryParams}` | `https://youtube.com${AnyQueryParams}`; /** * **YouTubeShareUrl** * * a URL which comes from YouTube's _URL shortened_ `https://youtu.be` site. */ type YouTubeShareUrl = UrlsFrom<"youtu.be">; /** * **YouTubeVideo** * * Type pattern which will match all URL's which relate to * a YouTubeVideo. * * **Note:** there can be some _false positives_ when the query parameters * may state that this is a video to watch in a list of videos. You can avoid * this ambiguity with the `IsYouTubeVideo` and `IsYouTubeList` operators. */ type YouTubeVideoUrl = `https://www.youtube.com/watch?${string}v=${string}` | `https://youtube.com/watch?${string}v=${string}` | YouTubeShareUrl; /** * **YouTubeCreatorUrl** * * Pages associated with a YouTube creator. This can include your own * pages even if you don't consider yourself a full creator (yet). */ type YouTubeCreatorUrl = UrlsFrom<[`www.youtube.com/channel/${string}`, `youtube.com/channel/${string}`]> | `https://www.youtube.com/@${string}${Opt$1<"/featured" | "/videos" | "/playlists">}`; type YouTubeEmbedUrl = UrlsFrom<[`www.youtube.com/embed/${TVideo}`, `youtube.com/embed/${TVideo}`]>; /** * **YouTubePlaylistUrl** * * A URL pattern which should match all playlist URL's on YouTube. * That includes both the logged in user's as well as other peoples. * * **Related:** `YouTubeUsersPlaylistUrl` */ type YouTubePlaylistUrl = UrlsFrom<[`www.youtube.com/channel/playlists`, `www.youtube.com/@${string}/playlists`, `youtube.com/channel/playlists`, `youtube.com/@${string}/playlists`]> | YouTubeUsersPlaylistUrl; /** * **YouTubeFeedUrl**`<[T]>` * * A URL pattern which matches all "feeds" on YouTube where * "feeds" are pages that organize videos/content for a logged * in user based on their configuration. * * By default, all feed URLs are matched but you can narrow * this matching down by choosing a value for `T` in the * `YouTubeFeedType` union. */ type YouTubeFeedUrl = `https://www.youtube.com/feed/${T}${string}` | `https://youtube.com/feed/${T}${string}`; /** * **YouTubeUsersPlaylistUrl** * * The URL which brings a logged in user to their own playlists. * * **Related:** `YouTubePlaylistUrl` */ type YouTubeUsersPlaylistUrl = `https://www.youtube.com/feed/playlists${AnyQueryParams}`; /** * **YouTubeLikedPlaylistUrl** * * The URL which brings a logged in user to a playlist of their _liked_ * videos. */ type YouTubeLikedPlaylistUrl = `https://www.youtube.com/playlist?${string}list=LL${string}`; /** * **YouTubeVideosInPlaylist** * * A URL which shows all the videos in a given playlist */ type YouTubeVideosInPlaylist = `https://www.youtube.com/playlist?${string}list=${string}`; /** * **YouTubeHistoryUrl** * * The URL which brings a logged in user to a list of their previously watched * videos. */ type YouTubeHistoryUrl = `https://www.youtube.com/feed/history${AnyQueryParams}`; /** * **YouTubeSubscriptionsUrl** * * The URL which brings a logged in user to their list of subscriptions. */ type YouTubeSubscriptionsUrl = `https://www.youtube.com/feed/subscriptions${AnyQueryParams}`; /** * **GetYouTubePageType**`` * * Given a URL passed into `T`, this utility will give you an indication * of what type of YouTube content you'll find at this location (or return * _never_ if it's not a YouTube URL). */ type GetYouTubePageType = T extends YouTubeUrl ? T extends YouTubeHome ? "home" : T extends YouTubeVideoUrl ? HasQueryParameter extends true ? T extends YouTubeShareUrl ? HasQueryParameter extends true ? "play::video::in-list::share-link::with-timestamp" : "play::video::in-list::share-link" : "play::video::in-list" : T extends YouTubeShareUrl ? HasQueryParameter extends true ? "play::video::solo::share-link::with-timestamp" : "play::video::solo::share-link" : "play::video::solo" : T extends YouTubeCreatorUrl ? GetUrlPath extends `${string}/videos` ? "creator::videos" : GetUrlPath extends `${string}/playlists` ? "creator::playlists" : Last$1, "/">> extends `@${string}` ? "creator::featured" : GetUrlPath 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; //#endregion //#region src/string-literals/EmptyString.d.ts /** * **EmptyString** * * A string literal of an _empty_ string; */ type EmptyString = ""; //#endregion //#region src/string-literals/ensure/EnsureLeading.d.ts type Process$41 = TContent extends `${TLeading}${string}` ? TContent : `${TLeading}${TContent}`; type IterateOver$1 = { [K in keyof TContent]: TContent[K] extends string ? Process$41> : TContent[K] extends number ? AsNumber>> : never }; type WideContent = IsString extends true ? `${TLeading}${string}` : number; type WideLeading = TContent extends string ? `${TLeading}${TContent}` : number; /** * **EnsureLeading**`` * * Will ensure that `TContent` _starts with_ the `TLeading`; adding * it when it wasn't present or proxying the value through when it was. * * **Note:** * - you can use both _string_ or _numeric_ values for both * parameters. * - you can provide a tuple for content and each item will be processed * separately * * ```ts * type T = "World"; * type U = "Hello "; * // "Hello World" * type R = EnsureLeading; * ``` * * **Related:** `EnsureLeadingEvery`, `EnsureTrailing`, `EnsureSurround`, `Surround` */ type EnsureLeading = TContent extends readonly (string | number)[] ? IterateOver$1 : IsWideType extends true ? WideContent, TLeading> : IsWideType extends true ? WideLeading, TLeading> : TContent extends string ? Process$41> : TContent extends number ? AsNumber>> : never; //#endregion //#region src/string-literals/ensure/EnsureLeadingEvery.d.ts /** * **EnsureLeadingEvery**`` * * Ensures that each item in `TList` starts with `TLeader`. * * - `TList` can be made up of strings or numbers * - `TLeader` can be made up of string, number, or boolean values * - all non-string values are converted to string with `ToString` * * **Related:** `EnsureLeading`, `EnsureTrailing` */ type EnsureLeadingEvery = UnionToTuple<{ [K in keyof TList]: AsString extends string ? EnsureLeading, TLeader> : never }[number]>; //#endregion //#region src/string-literals/ensure/EnsureSurround.d.ts /** * **EnsureSurround** * * Ensures that `TInput` is _surrounded_ by `TPrefix` and `TPostfix` * * **Related:** `Surround` */ type EnsureSurround = EnsureTrailing, TPostfix>; //#endregion //#region src/string-literals/ensure/EnsureTrailing.d.ts type P$1 = TContent extends `${string}${TTrailing}` ? TContent : `${TContent}${TTrailing}`; type IterateOver = { [K in keyof TContent]: TContent[K] extends string ? P$1 : TContent[K] extends number ? AsNumber> : P$1<`${AsString}`, TTrailing> }; /** * **EnsureTrailing**`` * * Will ensure that `T` ends with the substring `U` when * both are string literals. * * ```ts * type T = "Hello"; * type U = " World"; * // "Hello World" * type R = EnsureTrailing; * ``` */ type EnsureTrailing = IsWideType extends true ? IsWideType extends true ? TContent : `${string}${TTrailing}` : IsWideType extends true ? IsString extends true ? `${AsString}${string}` : never : TContent extends number ? AsNumber> : TContent extends string ? P$1 : TContent extends readonly unknown[] ? IterateOver : never; //#endregion //#region src/string-literals/finance/CreditCard.d.ts /** the shae for an American Express long number */ type AmericanExpress = `${"34" | "37"}${number} ${number} ${number}`; /** the shape of Visa long numbers */ type Visa = `4${number} ${number} ${number} ${number}`; type Mastercard = `${"51" | "55"}${number} ${number} ${number} ${number}` | `2${"2" | "3" | "4" | "5" | "6" | "7"}${number} ${number} ${number} ${number}`; type Discover = `${"6011" | "6221"} ${number} ${number} ${number}` | `64${"4" | "5" | "6" | "7" | "8" | "9"}${number} ${number} ${number} ${number}` | `65${number} ${number} ${number} ${number}`; type Jcb = `35${number} ${number} ${number} ${number}` | `2131 ${number} ${number} ${number}` | `1800 ${number} ${number} ${number}`; /** * The shape of a DinersClub card (4d 6d 4d) */ type DinersClub = `30${"0" | "1" | "2" | "3" | "4" | "5"} ${number} ${number}` | `${"36" | "38"}${number} ${number} ${number}`; type Maestro = `5018${string}` | `5020${string}` | `5038${string}` | `6304${string}`; type Solo = `6334${string}` | `6767${string}`; /** the shape for a VISA/Mastercard long number */ type VisaMastercard = Visa | Mastercard; /** * Represents the string literal type for either a Mastercard/VISA * format or an American Express card. * * **Related:** * - `IsVisaMastercard`, `IsAmericanExpress`, `IsCreditCard` * - `isVisaMastercard()`, `isAmericanExpress()`, `isCreditCard()` */ type CreditCard = VisaMastercard | AmericanExpress; /** * **IsVisaMastercard**`` * * Boolean operator determining if `T` is a long number for * a VISA/Mastercard. */ type IsVisaMastercard = T extends string ? IsWideString extends true ? boolean : Split extends [`${number}`, `${number}`, `${number}`, `${number}`] ? EveryLength, 4> extends true ? true : false : false : false; /** * **IsAmericanExpress**`` * * Boolean operator determining if `T` is a long number for * a VISA/Mastercard. */ type IsAmericanExpress = T extends string ? IsWideString extends true ? boolean : Split extends [`${number}`, `${number}`, `${number}`] ? Split[0]["length"] extends 4 ? Split[1]["length"] extends 6 ? Split[2]["length"] extends 5 ? true : false : false : false : false : false; /** * **IsCreditCard**`` * * Boolean operator determining if `T` is a "Credit Card" _long * number_. This tests for the American Express and VISA/Mastercard * numeric sequences. */ type IsCreditCard = IsVisaMastercard extends true ? true : IsAmericanExpress extends true ? true : false; //#endregion //#region src/string-literals/finance/Percentage.d.ts /** * **Percentage** * * A type meant to represent the _shape_ of a percentage. * * - to keep the type complexity low we make no effort to * force the type to be between 0 and 100%; in fact there * are cases where this is not even desirable. * * **Related:** * - `IsPercentage` validates that the numeric percentage * fits withing expected bounds */ type Percentage = `${number}%`; //#endregion //#region src/string-literals/finance/IsPercentage.d.ts type Process = IsBetweenInclusively; type IsDefaultNumericPercentage = `${T}` extends `-${string}` ? false : T extends 0 | 1 ? true : `${T}` extends `0.${string}` ? true : false; type HandleErr = T extends string ? Err<`invalid-type/percentage`, `A string literal '${T}' was passed into IsPercentage but it did not match the expected pattern provided by the 'Percentage' format.`, { input: T; min: TMin; max: TMax; }> : Err<`invalid-type/percentage`, `The IsPercentage boolean operator received the wrong type for T! T must be a string or number and if a number should follow the 'Percentage' shape with a trailing '%' character.`, { input: T; min: TMin; max: TMax; }>; /** * **IsPercentage**`` * * Boolean operator which tests whether `T` represents a valid * percentage. * * - the `TMin` and `TMax` optional parameters allow adjusting the * expected/allowed percentage range but default to 0-100 percent. * - the base types which will be evaluated are _strings_ and _numbers_ * - if a _number_ is present then the percentage is expected to be * a numeric value where the "percentage" is represented as a number * between `${TMin}/100` to `${TMax}/100`. * - if a _string_ is present it will expect a literal value of the shape * of `${number}%`. * - a wide string passed in as `T` will convert to `Percentage | Error` union type * - a wide number passed in as `T` will convert to `number | Error` union type * * ```ts * // true * type T1 = IsPercentage<"50%">; * type T2 = IsPercentage<0.5>; * // false * type F1 = IsPercentage<"150%">; * type F2 = IsPercentage<50>; * ``` * * Note: * - if a type other than _number_ or _string_ is passed in for `T` then this utility * will return an Error of the type `invalid-type/percentage` * - likewise, if a string literal is passed in with a type that doesn't extend the * shape defined by `Percentage` then an error of `invalid-type/percentage` will * also be returned. * - if you want to avoid errors and ONLY get a true/false value then wrap this * utility with `AssertTrue` */ type IsPercentage = string extends T ? Percentage | Error : number extends T ? number | Error : T extends `${infer Num extends number}%` ? Process : T extends number ? TMin extends 0 ? TMax extends 100 ? IsDefaultNumericPercentage : boolean : boolean : HandleErr; //#endregion //#region src/string-literals/geo/global.d.ts /** * Whether a given focus is in the northern or souther hemisphere */ type Hemisphere = typeof HEMISPHERE$1[number]; /** * A continent on planet earth */ type Continent = typeof CONTINENTS$1[number]; //#endregion //#region src/string-literals/geo/state.d.ts type UsStateLookup = Mutable; type UsProvinceLookup = Mutable; type _UsStateAbbrev = { [K in keyof UsStateLookup]: UsStateLookup[K] extends { abbrev: infer A extends string; } ? A : never }[number]; type _UsProvinceAbbrev = { [K in keyof UsProvinceLookup]: UsProvinceLookup[K] extends { abbrev: infer A extends string; } ? A : never }[number]; /** * **UsStateAbbrev**`` * * A union type which includes all state abbreviations. * * By default it will also include all US provinces and territories which have * a state abbreviation. If you prefer to just use the strict state list then * set `TStrict` to **true**. * * **Related:** `UsStateAbbrev` */ type UsStateAbbrev = IsTrue extends true ? Exclude<_UsStateAbbrev, _UsProvinceAbbrev> : _UsStateAbbrev; type _UsStateName = { [K in keyof UsStateLookup]: UsStateLookup[K] extends { name: infer A extends string; } ? A : never }[number]; type _UsProvinceName = { [K in keyof UsProvinceLookup]: UsProvinceLookup[K] extends { name: infer A extends string; } ? A : never }[number]; /** * **UsStateName**`` * * A union type which includes all US state names (and provinces with state codes) * fully spelled out. If you want _only_ US states set the `TStrict` generic to `true`. * * **Related:** `UsStateAbbrev` */ type UsStateName = IsTrue extends true ? Exclude<_UsStateName, _UsProvinceName> : _UsStateName; //#endregion //#region src/string-literals/geo/zip.d.ts /** * **Zip5** * * A five digit zip code. * * **Related:** `ZipPlus4`, `ZipCode` */ type Zip5 = `${NumericChar}${number}${NumericChar}${number}${NumericChar}`; type Z2S = Mutable; /** * **ZipToState**`` * * Converts a zip code into a _union type_ of */ type ZipToState = First$1> extends keyof Z2S ? TupleToUnion>]> : never; type ZipPlus4 = `${Zip5}-${number}`; /** * A relatively strong type for Zip5 or Zip5+4 zip codes */ type ZipCode = ZipPlus4 | Zip5; //#endregion //#region src/string-literals/info/HasUppercase.d.ts /** * Indicates whether `T` has uppercase characters in it. * ```ts * // true * type T = HasUppercase<"Foobar">; * // false * type T = HasUppercase<"foobar">; * // "unknown" * type T = HasUppercase; * ``` */ type HasUppercase = string extends T ? "unknown" : T extends `${string}${UpperAlphaChar}${string}` ? true : false; //#endregion //#region src/string-literals/info/IsCapitalized.d.ts /** * Returns true or false value based on whether the string literal is capitalized. * ```ts * // true * type T2 = IsCapitalized<"One">; * // false * type T1 = IsCapitalized<"one">; * // "unknown" * const a: string = "Hi"; * type T3 = IsCapitalized; * ``` * * Note: _if the value passed in is a "string" then the result will be "unknown"_ */ type IsCapitalized = string extends T ? "unknown" : T extends Capitalize ? true : false; //#endregion //#region src/string-literals/info/StrLen.d.ts type Compute = TStr extends `${infer _Char}${infer Rest}` ? Compute : TLen["length"]; /** * **StrLen**`` * * Provides the length of a string if T is a string literal, * otherwise just returns `number` type. */ type StrLen = IsBranded extends true ? Compute> : Compute; //#endregion //#region src/string-literals/metrics/acceleration.d.ts type AccelerationMetricsLookup = typeof ACCELERATION_METRICS_LOOKUP$1; /** * The singular name for metrics associated with **distance**. */ type AccelerationMetrics = { [K in keyof AccelerationMetricsLookup]: "name" extends keyof AccelerationMetricsLookup[K] ? AccelerationMetricsLookup[K]["name"] : never }[number]; /** * Unit of measure for metrics associated with **Acceleration**. */ type AccelerationUom = { [K in keyof AccelerationMetricsLookup]: "abbrev" extends keyof AccelerationMetricsLookup[K] ? AccelerationMetricsLookup[K]["abbrev"] : never }[number]; /*** * **Acceleration** * * A _acceleration_ based measurement which leads with a number and follows with * a metric name. * * **Related:** `AccelerationAbbrev` */ type Acceleration = `${number}${OptSpace}${AccelerationUom}`; //#endregion //#region src/string-literals/metrics/area.d.ts type AreaMetricsLookup = typeof AREA_METRICS_LOOKUP$1; /** * The singular name for metrics associated with **distance**. */ type AreaMetrics = { [K in keyof AreaMetricsLookup]: "name" extends keyof AreaMetricsLookup[K] ? AreaMetricsLookup[K]["name"] : never }[number]; /** * Unit of measure for metrics associated with **Area**. */ type AreaUom = { [K in keyof AreaMetricsLookup]: "abbrev" extends keyof AreaMetricsLookup[K] ? AreaMetricsLookup[K]["abbrev"] : never }[number]; /*** * **Area** * * A _Area_ based measurement which leads with a number and follows with * a metric name. * * **Related:** `AreaAbbrev` */ type Area = `${number}${OptSpace}${AreaUom}`; //#endregion //#region src/string-literals/metrics/current.d.ts type CurrentMetricsLookup = typeof CURRENT_METRICS_LOOKUP$1; /** * The singular name for metrics associated with **Current**. */ type CurrentMetrics = { [K in keyof CurrentMetricsLookup]: "name" extends keyof CurrentMetricsLookup[K] ? CurrentMetricsLookup[K]["name"] : never }[number]; /** * Unit of measure for metrics associated with **Current**. */ type CurrentUom = { [K in keyof CurrentMetricsLookup]: "abbrev" extends keyof CurrentMetricsLookup[K] ? CurrentMetricsLookup[K]["abbrev"] : never }[number]; /*** * **Current** * * A _current_ based measurement which leads with a number and follows with * a metric name. * * **Related:** `CurrentAbbrev` */ type Current = `${number}${OptSpace}${CurrentUom}`; //#endregion //#region src/string-literals/metrics/distance.d.ts type DistanceMetricsLookup = typeof DISTANCE_METRICS_LOOKUP$1; /** * The singular name for metrics associated with **distance**. */ type DistanceMetrics = { [K in keyof DistanceMetricsLookup]: "name" extends keyof DistanceMetricsLookup[K] ? DistanceMetricsLookup[K]["name"] : never }[number]; /** * Unit of measure for metrics associated with **distance**. */ type DistanceUom = { [K in keyof DistanceMetricsLookup]: "abbrev" extends keyof DistanceMetricsLookup[K] ? DistanceMetricsLookup[K]["abbrev"] : never }[number]; /*** * **Distance** * * A _distance_ based measurement which leads with a number and follows with * a metric name. * * **Related:** `DistanceAbbrev` */ type Distance = `${number}${OptSpace}${DistanceUom}`; //#endregion //#region src/string-literals/metrics/energy.d.ts type EnergyMetricsLookup = typeof ENERGY_METRICS_LOOKUP$1; /** * The singular name for metrics associated with **Energy**. */ type EnergyMetrics = { [K in keyof EnergyMetricsLookup]: "name" extends keyof EnergyMetricsLookup[K] ? EnergyMetricsLookup[K]["name"] : never }[number]; /** * Unit of measure for metrics associated with **Energy**. */ type EnergyUom = { [K in keyof EnergyMetricsLookup]: "abbrev" extends keyof EnergyMetricsLookup[K] ? EnergyMetricsLookup[K]["abbrev"] : never }[number]; /*** * **Energy** * * A _energy_ based measurement which leads with a number and follows with * a metric name. * * **Related:** `EnergyAbbrev` */ type Energy = `${number}${OptSpace}${EnergyUom}`; //#endregion //#region src/string-literals/metrics/frequency.d.ts type FrequencyMetricsLookup = typeof FREQUENCY_METRICS_LOOKUP$1; /** * The singular name for metrics associated with **Frequency**. */ type FrequencyMetrics = { [K in keyof FrequencyMetricsLookup]: "name" extends keyof FrequencyMetricsLookup[K] ? FrequencyMetricsLookup[K]["name"] : never }[number]; /** * Unit of measure for metrics associated with **Frequency**. */ type FrequencyUom = { [K in keyof FrequencyMetricsLookup]: "abbrev" extends keyof FrequencyMetricsLookup[K] ? FrequencyMetricsLookup[K]["abbrev"] : never }[number]; /*** * **Frequency** * * A _frequency_ based measurement which leads with a number and follows with * a metric name. * * **Related:** `FrequencyAbbrev` */ type Frequency = `${number}${OptSpace}${FrequencyUom}`; //#endregion //#region src/string-literals/metrics/global.d.ts /** * **MetricCategory** * * A valid "category" for a `Metric` or `Uom`. * * **Related:** `Uom`, `Metric` */ type MetricCategory = "Acceleration" | "Area" | "Current" | "Distance" | "Frequency" | "Luminosity" | "Mass" | "Power" | "Pressure" | "Resistance" | "Speed" | "Temperature" | "Time" | "Voltage" | "Volume"; type UnitsByCategory = [] extends M ? R : UnitsByCategory, T extends First$1[0] ? R | First$1[1] : R>; /** * **Uom**`<[T]>` * * A _unit of measure_ for a **metric**. * * - you may filter down to only units of a certain category(s) of `MetricCategory` * by adjusting `T`. * * **Related:** `Metric`, `MetricCategory`, `AreaUom`, `SpeedUom`, ... */ type Uom = UnitsByCategory; /** * **Metric**`` * * A measurement which includes a numeric value plus the Unit of Measure (UOM). * * - you may filter down to only metrics of a certain category(s) of `MetricCategory` * by adjusting `T`. * * **Related:** `Uom`, `MetricCategory` */ type Metric = UnitsByCategory; //#endregion //#region src/string-literals/metrics/luminosity.d.ts type LuminosityMetricsLookup = typeof LUMINOSITY_METRICS_LOOKUP$1; /** * The singular name for metrics associated with **luminosity**. */ type LuminosityMetrics = { [K in keyof LuminosityMetricsLookup]: "name" extends keyof LuminosityMetricsLookup[K] ? LuminosityMetricsLookup[K]["name"] : never }[number]; /** * Unit of measure for metrics associated with **Luminosity**. */ type LuminosityUom = { [K in keyof LuminosityMetricsLookup]: "abbrev" extends keyof LuminosityMetricsLookup[K] ? LuminosityMetricsLookup[K]["abbrev"] : never }[number]; /*** * **Luminosity** * * A _luminosity_ based measurement which leads with a number and follows with * a metric name. * * **Related:** `LuminosityAbbrev` */ type Luminosity = `${number}${OptSpace}${LuminosityUom}`; //#endregion //#region src/string-literals/metrics/mass.d.ts type MassMetricsLookup = typeof MASS_METRICS_LOOKUP$1; /** * The singular name for metrics associated with **distance**. */ type MassMetrics = { [K in keyof MassMetricsLookup]: "name" extends keyof MassMetricsLookup[K] ? MassMetricsLookup[K]["name"] : never }[number]; /** * Unit of measure for metrics associated with **Mass**. */ type MassUom = { [K in keyof MassMetricsLookup]: "abbrev" extends keyof MassMetricsLookup[K] ? MassMetricsLookup[K]["abbrev"] : never }[number]; /*** * **Mass** * * A _mass_ based measurement which leads with a number and follows with * a metric name. * * **Related:** `MassAbbrev` */ type Mass = `${number}${OptSpace}${MassUom}`; //#endregion //#region src/string-literals/metrics/power.d.ts type PowerMetricsLookup = typeof POWER_METRICS_LOOKUP$1; /** * The singular name for metrics associated with **Power**. */ type PowerMetrics = { [K in keyof PowerMetricsLookup]: "name" extends keyof PowerMetricsLookup[K] ? PowerMetricsLookup[K]["name"] : never }[number]; /** * Unit of measure for metrics associated with **Power**. */ type PowerUom = { [K in keyof PowerMetricsLookup]: "abbrev" extends keyof PowerMetricsLookup[K] ? PowerMetricsLookup[K]["abbrev"] : never }[number]; /*** * **Power** * * A _power_ based measurement which leads with a number and follows with * a metric name. * * **Related:** `PowerAbbrev` */ type Power = `${number}${OptSpace}${PowerUom}`; //#endregion //#region src/string-literals/metrics/pressure.d.ts type PressureMetricsLookup = typeof PRESSURE_METRICS_LOOKUP$1; /** * The singular name for metrics associated with **Pressure**. */ type PressureMetrics = { [K in keyof PressureMetricsLookup]: "name" extends keyof PressureMetricsLookup[K] ? PressureMetricsLookup[K]["name"] : never }[number]; /** * Unit of measure for metrics associated with **Pressure**. */ type PressureUom = { [K in keyof PressureMetricsLookup]: "abbrev" extends keyof PressureMetricsLookup[K] ? PressureMetricsLookup[K]["abbrev"] : never }[number]; /*** * **Pressure** * * A _pressure_ based measurement which leads with a number and follows with * a metric name. * * **Related:** `PressureAbbrev` */ type Pressure = `${number}${OptSpace}${PressureUom}`; //#endregion //#region src/string-literals/metrics/resistance.d.ts type ResistanceMetricsLookup = typeof RESISTANCE_METRICS_LOOKUP$1; /** * The singular name for metrics associated with **resistance**. */ type ResistanceMetrics = { [K in keyof ResistanceMetricsLookup]: "name" extends keyof ResistanceMetricsLookup[K] ? ResistanceMetricsLookup[K]["name"] : never }[number]; /** * Unit of measure for metrics associated with **resistance**. */ type ResistanceUom = { [K in keyof ResistanceMetricsLookup]: "abbrev" extends keyof ResistanceMetricsLookup[K] ? ResistanceMetricsLookup[K]["abbrev"] : never }[number]; /*** * **Resistance** * * A_ resistance_ based measurement which leads with a number and follows with * a metric name. * * **Related:** `ResistanceAbbrev` */ type Resistance = `${number}${OptSpace}${ResistanceUom}`; //#endregion //#region src/string-literals/metrics/speed.d.ts type SpeedMetricsLookup = typeof SPEED_METRICS_LOOKUP$1; /** * The singular name for metrics associated with **Speed**. */ type SpeedMetrics = { [K in keyof SpeedMetricsLookup]: "name" extends keyof SpeedMetricsLookup[K] ? SpeedMetricsLookup[K]["name"] : never }[number]; /** * Unit of measure for metrics associated with **Speed**. */ type SpeedUom = { [K in keyof SpeedMetricsLookup]: "abbrev" extends keyof SpeedMetricsLookup[K] ? SpeedMetricsLookup[K]["abbrev"] : never }[number]; /*** * **Speed** * * A _speed_ based measurement which leads with a number and follows with * a speed UOM. */ type Speed = `${number}${OptSpace}${SpeedUom}`; //#endregion //#region src/string-literals/metrics/temperature.d.ts type TemperatureMetricsLookup = typeof TEMPERATURE_METRICS_LOOKUP$1; /** * The singular name for metrics associated with **Temperature**. */ type TemperatureMetrics = { [K in keyof TemperatureMetricsLookup]: "name" extends keyof TemperatureMetricsLookup[K] ? TemperatureMetricsLookup[K]["name"] : never }[number]; /** * Unit of measure for metrics associated with **Temperature**. */ type TemperatureUom = { [K in keyof TemperatureMetricsLookup]: "abbrev" extends keyof TemperatureMetricsLookup[K] ? TemperatureMetricsLookup[K]["abbrev"] : never }[number]; /*** * **Temperature** * * A _Temperature_ based measurement which leads with a number and follows with * a metric name. * * **Related:** `TemperatureUom` */ type Temperature = `${number}${OptSpace}${TemperatureUom}`; //#endregion //#region src/string-literals/metrics/time.d.ts type TimeMetricsLookup = typeof TIME_METRICS_LOOKUP$1; /** * The singular name for metrics associated with **Time**. */ type TimeMetrics = { [K in keyof TimeMetricsLookup]: "name" extends keyof TimeMetricsLookup[K] ? TimeMetricsLookup[K]["name"] : never }[number]; /** * Unit of measure for metrics associated with **Time**. */ type TimeUom = { [K in keyof TimeMetricsLookup]: "abbrev" extends keyof TimeMetricsLookup[K] ? TimeMetricsLookup[K]["abbrev"] : never }[number]; /*** * **Time** * * A _time_ based measurement which leads with a number and follows with * a metric name. * * **Related:** `TimeUom` */ type TimeMetric = `${number}${OptSpace}${TimeUom}`; //#endregion //#region src/string-literals/metrics/voltage.d.ts type VoltageMetricsLookup = typeof VOLTAGE_METRICS_LOOKUP$1; /** * The singular name for metrics associated with **Voltage**. */ type VoltageMetrics = { [K in keyof VoltageMetricsLookup]: "name" extends keyof VoltageMetricsLookup[K] ? VoltageMetricsLookup[K]["name"] : never }[number]; /** * Unit of measure for metrics associated with **Voltage**. */ type VoltageUom = { [K in keyof VoltageMetricsLookup]: "abbrev" extends keyof VoltageMetricsLookup[K] ? VoltageMetricsLookup[K]["abbrev"] : never }[number]; /*** * **Voltage** * * A_ Voltage_ based measurement which leads with a number and follows with * a metric name. * * **Related:** `VoltageUom` */ type Voltage = `${number}${OptSpace}${VoltageUom}`; //#endregion //#region src/string-literals/metrics/volume.d.ts type VolumeMetricsLookup = typeof VOLUME_METRICS_LOOKUP$1; /** * The singular name for metrics associated with **distance**. */ type VolumeMetrics = { [K in keyof VolumeMetricsLookup]: "name" extends keyof VolumeMetricsLookup[K] ? VolumeMetricsLookup[K]["name"] : never }[number]; /** * Unit of measure for metrics associated with **Volume**. */ type VolumeUom = { [K in keyof VolumeMetricsLookup]: "abbrev" extends keyof VolumeMetricsLookup[K] ? VolumeMetricsLookup[K]["abbrev"] : never }[number]; /*** * **Volume** * * A _volume_ based measurement which leads with a number and follows with * a metric name. * * **Related:** `VolumeUom` */ type Volume = `${number}${OptSpace}${VolumeUom}`; //#endregion //#region src/string-literals/mutation/Append.d.ts /** * **Append**`` * * Appends the string `U` after the existing `T` string. * ```ts * // "Bob, you're the best" * type T = Append<"Bob, ", "you're the best">; * ``` * * **Related:** `Prepend`, `EnsureLeading` */ type Append = U extends string ? `${U}${T}` : `${AsString}${T}`; //#endregion //#region src/string-literals/mutation/Chars.d.ts type Process$40 = TStr extends `${infer Char}${infer Rest}` ? Process$40 : TResult; /** * **Chars**`` * * Takes a literal string and converts it to an array of characters. */ type Chars = string extends TStr ? string[] : TStr extends "" ? [] : Process$40 extends string[] ? Process$40 : never; //#endregion //#region src/string-literals/mutation/Concat.d.ts type ElementLiteral = [T] extends [string] ? IsStringLiteral$1 extends true ? T : string : [T] extends [number] ? IsNumericLiteral extends true ? T : `${number}` : [T] extends [boolean] ? IsBooleanLiteral extends true ? T : `${boolean}` : never; type Process$39 = [] extends T ? Result : Process$39, `${Result}${ElementLiteral>}`>; /** * **Concat**`` * * A type utility which converts an array of strings into a * _concatenated_ string type. * * ```ts * // `${string}-${string}` * type T1 = Concat; * // `foo-bar-baz` * type T2 = Concat<"foo", "-", "bar", "-", "baz">; * ``` * * **Related:** `Join` */ type Concat = Process$39 extends string ? Process$39 : never; //#endregion //#region src/string-literals/mutation/FromNesting.d.ts /** * Reconstructs a single child with its enter/exit characters */ type ReconstructChild = T["enterChar"] extends string ? T["exitChar"] extends string ? `${T["enterChar"]}${ReconstructSegment}${T["exitChar"]}` : `${T["enterChar"]}${ReconstructSegment}` : ReconstructSegment; /** * Reconstructs a single NestedString segment */ type ReconstructSegment = T["children"] extends readonly [] ? ReplaceAll : ReplaceChildMarkers; /** * Replaces successive `{{child}}` markers in content with each reconstructed child */ type ReplaceChildMarkers = TChildren extends readonly [infer Head extends NestedString, ...infer Rest extends readonly NestedString[]] ? TContent extends `${infer Before}{{child}}${infer After}` ? `${Before}${ReconstructChild}${ReplaceChildMarkers}` : `${TContent}${JoinChildren}` : ReplaceAll; /** * Joins multiple children by reconstructing each with enter/exit chars */ type JoinChildren = TChildren extends readonly [infer Head extends NestedString, ...infer Rest extends readonly NestedString[]] ? `${ReconstructChild}${JoinChildren}` : ""; /** * Joins multiple segments by reconstructing each and concatenating */ type JoinSegments = TSegments extends readonly [infer Head extends NestedString, ...infer Rest extends readonly NestedString[]] ? `${ReconstructSegment}${JoinSegments}` : ""; /** * **FromNesting**`` * * Converts a nested string back to originating string. * * **Related:** `Nest` */ type FromNesting = TNest extends readonly NestedString[] ? JoinSegments : TNest extends NestedString ? ReconstructSegment : never; //#endregion //#region src/string-literals/mutation/Join.d.ts type Process$38 = [] extends TTuple ? TResult : Process$38, TSeparator, TResult extends "" ? First$1 extends "" ? TResult : `${First$1}` : First$1 extends "" ? TResult : `${TResult}${TSeparator}${First$1}`>; type Slicer = TEllipsis extends string ? [...As$1, readonly string[]>, TEllipsis] : TakeFirst; /** * **Join**`` * * Joins together an array of items into a string. * * - the _separator_ between items defaults to an empty string this can be * changed to whatever is needed * - non-string types will be converted to strings as best as possible * - specifying a value for `TMax` will truncate tuples which are greater * than the specified length and add an ellipsis marker as the last element * * **Related:** `Concat` */ type Join = IsWideArray extends true ? TTuple extends (infer Type)[] ? Type extends number ? `${number}` : string : string : TMax extends number ? IsGreaterThan extends true ? Slicer, TMax, TEllipsis> extends infer StrTup extends readonly string[] ? Process$38 : never : Process$38, readonly string[]>, TSeparator> : Process$38, readonly string[]>, TSeparator>; //#endregion //#region src/string-literals/mutation/Nest.d.ts type CHILD_MARKER = `{{child}}`; /** * **TakeNestedString**`` * * Builds recursive structure based on Nesting strategy */ type TakeNestedString = Depth["length"] extends 128 ? NestedString | Err<"unbalanced"> : GetExitToken extends infer ExitChar extends string | null ? TParse extends `${infer Head extends string}${infer Rest extends string}` ? Head extends ExitChar ? { node: As$1<{ content: TContent; level: TLevel; enterChar: TEnter; exitChar: ExitChar; children: TChildren; }, NestedString>; rest: Rest; } : IsEntryToken extends true ? TakeNestedString, "", [], [unknown, ...Depth]> extends infer Child extends { node: NestedString; rest: string; } ? TakeNestedString : TakeNestedString, "", [], [unknown, ...Depth]> extends infer E extends Error ? E extends Err<"unbalanced/throw"> & { level: number; enterChar: string; } ? ErrContext : ErrContext : Err<`invalid-node`, `Call to TakeNestedString<..> did not produce a recognized type; should have been an Error or a { node, rest } object.`, { node: TakeNestedString, "", [], [unknown, ...Depth]>; }> : TakeNestedString : TLevel extends 0 ? { content: TContent; level: TLevel; enterChar: TEnter; exitChar: ExitChar; children: TChildren; } : Err<"unbalanced/throw", // caught by parent ``, { level: TLevel; enterChar: TEnter; exitChar: ExitChar; }> : never; /** * **Nest**` -> NestedString` * * Adds a nesting structure to a string based on certain "entry" and "exit" characters * which stack or unstack nesting layers. This is useful when you want to evaluate the * text of a string based on it's semantic grouping. * * By default a useful `BracketNesting` strategy is used which nests based on _bracket_ characters. * You can express a different bracketing strategy by passing in either a `KeyValueNesting` or * `TupleNesting` configuration to build your own or choose from the other "named" strategies: `quotes`, * and `brackets-and-quotes`. * * The output of this utility is an _array_ of `NestedString` types; all of which start at level 0. The * `NestedString` type then exposes the `children` property to move hierarchically into deeper levels. * * ```ts * // [ * // { * // content: "Hello", enterChar: null, exitChar: null, level: 0, * // children: [{ content: "hi", enterChar: "(", exitChar: ")", level: 1, children: [] }] * // }, * // { content: " World", enterChar: null, exitChar: null, level: 0, children: [] } * // ] * type Test = Nest<"Hello(hi) World">; * ``` * * **Related:** `FilterByNestingLevel` */ type Nest = string extends TContent ? NestedString[] | Err<"unbalanced"> : TakeNestedString; //#endregion //#region src/string-literals/mutation/NestedSplit.d.ts type NestedSplitPolicy = "omit" | "before" | "inline" | "after"; /** when a split character is found and there is no stack depth */ type SplitWithNoStack = TChar extends TSplit ? TStack["length"] extends 0 ? true : false : false; type NormalizeNesting = AsNestingConfig extends infer N ? N extends Nesting ? N : never : never; type ParentConfigAfterPop = Pop extends infer ParentStack extends readonly string[] ? Last$1 extends infer ParentEntry extends string ? GetNextLevelConfig : never : never; /** * Checks if TContent starts with TSplit at the current position */ type StartsWith$1 = TContent extends `${TSplit}${infer _Rest}` ? true : false; /** * Gets the rest of the string after removing TSplit from the beginning */ type AfterSplit = TContent extends `${TSplit}${infer Rest}` ? Rest : never; /** * Multi-character conversion using direct string processing * Now supports hierarchical nesting by switching configs at each level */ type MultiConvertDirect = TContent extends `${infer Head}${infer Rest}` ? TStack["length"] extends 0 ? StartsWith$1 extends true ? MultiConvertDirect, TSplit, TNesting, TPolicy, TStack, TPolicy extends "before" ? TSplit : "", TPolicy extends "omit" ? [...TResult, TWaiting] : TPolicy extends "inline" ? [...TResult, TWaiting, TSplit] : TPolicy extends "before" ? TWaiting extends "" ? TResult["length"] extends 0 ? [] : [...TResult, TWaiting] : [...TResult, TWaiting] : TPolicy extends "after" ? [...TResult, `${TWaiting}${TSplit}`] : never, true, TRootNesting> : IsEntryToken extends true ? MultiConvertDirect, TPolicy, [...TStack, Head], `${TWaiting}${Head}`, TResult, false, TRootNesting> : MultiConvertDirect : IsNestingMatchEnd> extends true ? Pop["length"] extends 0 ? MultiConvertDirect, `${TWaiting}${Head}`, TResult, false, TRootNesting> : MultiConvertDirect, TPolicy, Pop, `${TWaiting}${Head}`, TResult, false, TRootNesting> : IsEntryToken extends true ? MultiConvertDirect, TPolicy, [...TStack, Head], `${TWaiting}${Head}`, TResult, false, TRootNesting> : MultiConvertDirect : TStack["length"] extends 0 ? TLastWasSplit extends true ? TWaiting extends "" ? [...TResult, ""] : [...TResult, TWaiting, ""] : TWaiting extends "" ? TResult : [...TResult, TWaiting] : Err<`unbalanced/nested-split`, `The nesting stack was unbalanced, so the nested split can not be completed!`, { stack: ToStringLiteral__Array; }>; /** * convert when split characters are more than 1 character in length */ type MultiConvert = MultiConvertDirect; /** * convert when split characters are only 1 character in length * Now supports hierarchical nesting by switching configs at each level */ type Convert$4 = [] extends TChars ? TStack["length"] extends 0 ? [...TResult, TWaiting] : Err<`unbalanced/nested-split`, `The nesting stack was unbalanced, so the nested split can not be completed!`, { stack: ToStringLiteral__Array; }> : SplitWithNoStack, TSplit, TStack> extends true ? Convert$4, TSplit, TNesting, TPolicy, TStack, TPolicy extends "before" ? First$1 : "", TPolicy extends "omit" ? [...TResult, TWaiting] : TPolicy extends "inline" ? [...TResult, TWaiting, First$1] : TPolicy extends "before" ? And<[TWaiting extends "" ? true : false, TResult["length"] extends 0 ? true : false]> extends true ? [] : [...TResult, TWaiting] : TPolicy extends "after" ? [...TResult, `${TWaiting}${First$1}`] : never, TRootNesting> : IsNestingMatchEnd, TStack, GetParentConfig> extends true ? Pop["length"] extends 0 ? Convert$4, TSplit, TRootNesting, TPolicy, Pop, `${TWaiting}${First$1}`, TResult, TRootNesting> : Convert$4, TSplit, ParentConfigAfterPop, TPolicy, Pop, `${TWaiting}${First$1}`, TResult, TRootNesting> : IsEntryToken, TNesting> extends true ? Convert$4, TSplit, GetNextLevelConfig, TNesting>, TPolicy, [...TStack, First$1], `${TWaiting}${First$1}`, TResult, TRootNesting> : Convert$4, TSplit, TNesting, TPolicy, TStack, `${TWaiting}${First$1}`, TResult, TRootNesting>; /** * **NestedSplit**`` * * A split utility which splits `TContent` by `TSplit` * but unlike the `Split` utility it recognizes parts * of the string as being _nested_ into a different layer. * * - The `TNesting` generic defines the various "entry" and * "exit" characters involved the split. * - the _keys_ are the entry conditions * - the _values_ can be either: * - simple string (exit token) for uniform nesting * - `[exit, nextLevel]` tuple for hierarchical nesting * - Splits only take place when the nesting level is at * zero * - An error of the type `unbalanced/nested-split` will * occur when the nesting does not resolve back to zero * before completion * - The `TPolicy` setting defaults to "omit" which removes * split characters from the result * - If no nesting config is provided, the default is bracket * nesting (parens, square brackets, angle brackets, curlies) */ type NestedSplit = string extends TContent ? string[] : string extends TSplit ? string[] : TSplit extends readonly string[] ? AllLengthOf extends true ? Convert$4, TSplit[number], NormalizeNesting, TPolicy, [], "", [], NormalizeNesting> : Err<`invalid-nesting/nested-split`, `A tuple of strings were passed into to form a union type of characters which would provide the 'split', however, at least one of these were longer than a single character!`, { split: ToStringLiteral; content: TContent; }> : TSplit extends string ? StrLen extends 1 ? Convert$4, TSplit, NormalizeNesting, TPolicy, [], "", [], NormalizeNesting> : MultiConvert, TPolicy> : never; //#endregion //#region src/string-literals/mutation/PathJoin.d.ts type StripSlash = { [K in keyof T]: T[K] extends `/${infer Middle}/` ? Middle : T[K] extends `/${infer Trailing}` ? Trailing : T[K] extends `${infer Leading}/` ? Leading : T[K] }; type Process$37 = TFirst extends `/${string}` ? TLast extends `${string}/` ? `/${TPath}/` : `/${TPath}` : TLast extends `${string}/` ? `${TPath}/` : TPath; /** * **PathJoin**`` * * Type utility meant to bring 2 or more "path" strings together into * a valid "path". Where a "path" is represented as nothing more than * string characters delimited by a Posix `/` character. * * Note that the first part of the path will retain it's `/` if present * and the last one will preserve it's `/` character if present. You can * combine this utility with `EnsureTrailing`, `StripTrailing`, * `EnsureStarting`, and `StripStarting` to further shape * the type. */ type PathJoin = StripSlash extends readonly string[] ? Process$37, "/">, First$1, Last$1> : never; //#endregion //#region src/string-literals/mutation/Pluralize.d.ts type ExceptionLookup = typeof PLURAL_EXCEPTIONS$1; /** * Core pluralization logic with optimized direct pattern matching */ type _Pluralize = T extends keyof ExceptionLookup ? ExceptionLookup[T] : T extends `${infer Head}is` ? `${Head}ises` : T extends `${infer Head}f` ? `${Head}ves` : T extends `${infer Head}fe` ? `${Head}ves` : T extends `${infer Head}by` ? `${Head}bies` : T extends `${infer Head}cy` ? `${Head}cies` : T extends `${infer Head}dy` ? `${Head}dies` : T extends `${infer Head}fy` ? `${Head}fies` : T extends `${infer Head}gy` ? `${Head}gies` : T extends `${infer Head}hy` ? `${Head}hies` : T extends `${infer Head}jy` ? `${Head}jies` : T extends `${infer Head}ky` ? `${Head}kies` : T extends `${infer Head}ly` ? `${Head}lies` : T extends `${infer Head}my` ? `${Head}mies` : T extends `${infer Head}ny` ? `${Head}nies` : T extends `${infer Head}py` ? `${Head}pies` : T extends `${infer Head}qy` ? `${Head}qies` : T extends `${infer Head}ry` ? `${Head}ries` : T extends `${infer Head}sy` ? `${Head}sies` : T extends `${infer Head}ty` ? `${Head}ties` : T extends `${infer Head}vy` ? `${Head}vies` : T extends `${infer Head}wy` ? `${Head}wies` : T extends `${infer Head}xy` ? `${Head}xies` : T extends `${infer Head}yy` ? `${Head}yies` : T extends `${infer Head}zy` ? `${Head}zies` : T extends `${string}${"s" | "sh" | "ch" | "x" | "z" | "o"}` ? `${T}es` : `${T}s`; /** * **Pluralize**`` * * Pluralizes the word `T`, using _language rules_ on pluralization for English as well as * leveraging many known exceptions to the linguistic rules. */ type Pluralize = IsStringLiteral$1 extends true ? T extends `${infer Word} ${infer Rest}` ? `${_Pluralize} ${Rest}` : T extends `${infer Word}\t${infer Rest}` ? `${_Pluralize}\t${Rest}` : T extends `${infer Word}\n${infer Rest}` ? `${_Pluralize}\n${Rest}` : _Pluralize : string; //#endregion //#region src/string-literals/mutation/Prepend.d.ts /** * **Prepend**`` * * Prepends the string `TPrepend` prior to existing `TStr` string. * ```ts * // "Bob, you're the best" * type T = Prepend<"you're the best", "Bob, ">; * ``` * * **Related:** `Append`, `EnsureTrailing` */ type Prepend = TPrepend extends string ? `${TPrepend}${TStr}` : `${AsString}${TStr}`; //#endregion //#region src/string-literals/mutation/PrependAll.d.ts type PrependAcc = [] extends TList ? TResults : PrependAcc, TPrepend, [...TResults, `${TPrepend}${First$1}`]>; type PrependAll = PrependAcc>; //#endregion //#region src/string-literals/mutation/RemoveWhitespace.d.ts /** * **RemovesWhitespace**`` * * Removes _all_ whitespace in a string literal type. Unlike utilities like `Trim` * which only focus on the the extremities of the string, this will remove ALL whitespace. * * ```ts * // "onetwothree" * type None = RemoveWhitespace<"one two\n three">; * ``` */ type RemoveWhitespace = IsStringLiteral$1 extends true ? StripChars : string; //#endregion //#region src/string-literals/mutation/Repeat.d.ts type Repeater = TDepth["length"] extends TCount ? TResult : TDepth["length"] extends 64 ? string : Repeater; /** * **Repeat**`` * * Creates a string literal by repeating a given string -- `TStr` -- `TCount` times. */ type Repeat = number extends TCount ? string : TCount extends 0 ? "" : `${TCount}` extends `-${infer Positive extends number}` ? Repeater : Repeater; //#endregion //#region src/string-literals/mutation/Split.d.ts type Policy$2 = "omit" | "before" | "inline"; interface Get$3 { before: StripAfter; sep: TContent extends `${StripAfter}${infer Sep}${RetainAfter}` ? Sep : never; after: RetainAfter; } type Process$36 = IsSubstring extends true ? Get$3 extends infer G extends { before: string; sep: string; after: string; } ? Process$36 : never : TContent extends "" ? TParts : [...TParts, TContent]; /** * **Split**`` * * Splits a string into a tuple of strings; based on the `TSep` _separator_ * character. * * ```ts * // [ "Foo", "Bar"] * type FooBar = Split<"FooBar", UpperAlphaChar, "before">; * // [ "foo", "bar", "baz"] * type FooBarBaz = Split<"foo, bar, baz", ", ">; * ``` */ type Split = IsWideString extends true ? string[] : TContent extends "" ? [] : AsUnion extends infer Sep extends string ? Process$36 : never; //#endregion //#region src/string-literals/mutation/Split2.d.ts type Policy$1 = "omit" | "before" | "after" | "inline"; interface Get$2 { before: StripAfter; sep: TContent extends `${StripAfter}${infer Sep}${RetainAfter}` ? Sep : never; after: RetainAfter; } type Process$35 = IsSubstring extends true ? Get$2 extends infer G extends { before: string; sep: string; after: string; } ? Process$35 extends 0 ? [G["before"]] : TParts extends readonly [...infer Head extends string[], infer Tail extends string] ? [...Head, `${G["sep"]}${Tail}`, G["before"]] : [G["before"]] : never> : never : TContent extends "" ? TParts : [...TParts, TContent]; /** * **Split**`` * * Splits a string into a tuple of strings; based on the `TSep` _separator_ * character. * * ```ts * // [ "Foo", "Bar"] * type FooBar = Split<"FooBar", UpperAlphaChar, "before">; * // [ "foo", "bar", "baz"] * type FooBarBaz = Split<"foo, bar, baz", ", ">; * ``` */ type Split2 = IsWideString extends true ? string[] : TContent extends "" ? [] : AsUnion extends infer Sep extends string ? Process$35 : never; //#endregion //#region src/string-literals/mutation/SplitOnWhitespace.d.ts type Splitter = TContent extends `${infer Head extends string}${infer Rest extends string}` ? IsWhitespace extends true ? TAcc extends "" ? Splitter : Splitter : Splitter : TAcc extends "" ? TResult : [...TResult, TAcc]; /** * **SplitOnWhitespace**`` * * Splits a string into a tuple of non-whitespace strings. * * - whitespace includes spaces, tabs, and new line characters * * ```ts * // [ "foo", "bar" ] * type FooBar = SplitOnWhitespace<" foo\tbar">; * ``` * * **Related:** `Split` */ type SplitOnWhitespace = string extends TContent ? string[] : As$1, readonly string[]>; //#endregion //#region src/string-literals/mutation/Surround.d.ts type Process$34 = As$1<`${TPrefix}${TContent}${TPostfix}` extends infer Surrounded extends string ? Surrounded : never, string>; type ProcessEach = { [K in keyof TContent]: Process$34 }; /** * **Surround**`` * * Receives content -- either a string or an array of strings -- and then * proceeds to _surround_ the content with the prefix and postfix content. * * ```ts * // "(hi)" * type T1 = Surround<"hi", "(", ")">; * // [ "", "" ] * type T2 = Surround<["one","two"], "<",">">; * ``` */ type Surround = TContent extends number ? Surround<`${TContent}`, TPrefix, TPostfix> : TContent extends readonly unknown[] ? TContent extends readonly string[] ? ProcessEach : ProcessEach extends readonly string[] ? ToStringArray : never, TPrefix, TPostfix> : TContent extends string ? Process$34 : never; //#endregion //#region src/string-literals/mutation/Truncate.d.ts type Ellipsis = T extends string ? T : T extends true ? "..." : ""; type _Truncate = TakeFirst extends readonly string[] ? Concat<[...TakeFirst, TEllipsis]> : never; /** * **Truncate**`` * * Type utility which ensures that strings and/or tuples beyond the length * of `TMaxLen` are truncated at this length. * * - if the optional `TEllipsis` is set to **true** three * period characters will be added after the truncation * in cases where text was actually truncated. * - if you want to create your own terminal ellipsis representation you can * add a string literal value to the `TEllipsis` property */ type Truncate = TContent extends string ? If, never, If, TMaxLen>, _Truncate, TMaxLen, Ellipsis>, TContent>> : never; //#endregion //#region src/string-literals/mutation/UnderlyingType.d.ts type Process$33 = T extends NumberLike ? AsNumber : T extends BooleanLike ? AsBoolean : T; /** * **UnderlyingType**`` * * - if `T` is a string literal which is `NumberLike` or `BooleanLike` * then it converts it to the appropriate numeric or boolean type. * - if `T` is a tuple then it will apply this logic to all elements * in the tuple. * * In all other cases it simply proxies the type of `T` through. */ type UnderlyingType = T extends readonly unknown[] ? { [K in keyof T]: Process$33 } : Process$33; //#endregion //#region src/string-literals/options/DropChars.d.ts /** * Handles dropping a non-union type which can be a single * character OR a sequence of characters */ type DropSequence = [] extends TDrop ? TContent : DropSequence, "">, AfterFirst>; /** * **DropChars**`` * * Removes all character sequences found in `TDrop` from the string content * in `TContent`. If you use a _union_ type for `TDrop` then each of the * union members will be extracted (but union member must only be a single * character). * * ```ts * // "foobarbaz" * DropChars<"foo, bar, baz", ", ">; * // "oo, ar, az" * DropChars<"foo, bar, baz", "f" | "b">; * ``` */ type DropChars = IsUnion extends true ? UnionToTuple extends string[] ? DropSequence> : never : DropSequence>; //#endregion //#region src/string-literals/options/TypeRequired.d.ts /** * **TypeRequired** * * Some types provide a generic which indicate whether the type should be * considered _optional_, _required_, or just fully _excluded_. */ type TypeRequired = "required" | "optional" | "exclude"; //#endregion //#region src/string-literals/options/TypeStrength.d.ts /** * **TypeStrength** * * Some types provide a generic which allows users to choose * between a "strong but complex" versus a "simpler but effective" * typing. */ type TypeStrength = "strong" | "simple"; //#endregion //#region src/string-literals/sort/SortOrder.d.ts /** * the direction of the sort */ type SortOrder = "ascending" | "descending" | "natural"; //#endregion //#region src/string-literals/sort/StringIsAfter.d.ts /** * **StringIsAfter**`` * * tests whether `A` is _after_ `B` in alphabetic order. */ type StringIsAfter = A extends B ? false : A extends `${infer AHead}${infer ATail}` ? B extends `${infer BHead}${infer BTail}` ? AHead extends BHead ? StringIsAfter : AHead extends keyof CharOrder ? BHead extends keyof CharOrder ? CharOrder[AHead] extends number ? CharOrder[BHead] extends number ? IsGreaterThan : false : false : false : false : true : false; interface CharOrder { "0": 0; "1": 1; "2": 2; "3": 3; "4": 4; "5": 5; "6": 6; "7": 7; "8": 8; "9": 9; "A": 10; "B": 11; "C": 12; "D": 13; "E": 14; "F": 15; "G": 16; "H": 17; "I": 18; "J": 19; "K": 20; "L": 21; "M": 22; "N": 23; "O": 24; "P": 25; "Q": 26; "R": 27; "S": 28; "T": 29; "U": 30; "V": 31; "W": 32; "X": 33; "Y": 34; "Z": 35; "a": 36; "b": 37; "c": 38; "d": 39; "e": 40; "f": 41; "g": 42; "h": 43; "i": 44; "j": 45; "k": 46; "l": 47; "m": 48; "n": 49; "o": 50; "p": 51; "q": 52; "r": 53; "s": 54; "t": 55; "u": 56; "v": 57; "w": 58; "x": 59; "y": 60; "z": 61; "-": 62; "_": 63; ".": 64; ":": 65; "/": 66; " ": 67; } //#endregion //#region src/string-literals/sub-strings/after/AfterFirstChar.d.ts type Iterate$4 = { [K in keyof TInput]: TInput[K] extends string ? AfterFirstChar : never }; /** * **RemainingChar**`` * * Receives either a string or a tuple of strings. Based on the input * it is converted to: * * - **String:** * - when a string is received it will return the string with the first * character removed * - when a wide string type is provided it will return the _never_ type. * - **Tuple:** * - when a tuple of strings is received it will process * each element in the array independently and return each element's _remaining characters_ * after the first character has been removed * - any wide strings encountered will be ignored in the returned array */ type AfterFirstChar = TContent extends readonly string[] ? Iterate$4, readonly string[]>> : TContent extends string ? string extends TContent ? never : TContent extends "" ? "" : TContent extends `${string}${infer Rest}` ? Rest : never : never; //#endregion //#region src/string-literals/sub-strings/after/AfterLast.d.ts type After$1 = Split extends readonly [...[string, ...string[]], infer Last extends string] ? StripLeading : never; /** * Helper type to handle the break character logic without excessive type depth. * Extracts the portion before the break and the portion after the break. */ type WithBreak = RetainUntil extends infer BeforeBreak extends string ? Replace extends infer AfterBreak extends string ? TTrim extends true ? Trim, AfterBreak]>> : Join<[After$1, AfterBreak]> : never : never; /** * ***AfterLast**`` * * Provides the text in `TText` _after_ the last instance of the `TFind` * character. * * - if the `TFind` character is not found in `TText` then an empty * string will be returned * - if a `TBreak` character is provided then all text after the _first_ * occurrence of this break character will be excluded for purposes of * the `TFind` matching but will be added back into the final resulting * text output. * - by default the whitespace found on both sides of the returned string * are maintained but if you'd prefer to have it trimmed you can set * `TTrim` to **true**. * * **Related:** `UntilLast` */ type AfterLast = Contains extends true ? IsUnset extends true ? After$1 : WithBreak, TTrim> : IsSet extends true ? TTrim extends true ? Trim> : RetainAfter : ""; //#endregion //#region src/string-literals/sub-strings/FillStringHole.d.ts /** * **FillStringHole**`` * * Fills in a template literal string with the contents of `U`. * * - if there are more than one `${string}` holes the same value will be * placed into all of them * - if you prefer to have more control over which ones you're filling in * then you likely should be using the `IntoTemplate` utility * * ```ts * // 1,2,3 * const Filled = FillStringHole<`1,${string},3`, "2">; * ``` * * **Related:** `IntoTemplate` */ type FillStringHole = ReplaceAll, string | readonly string[]>, "{{string}}", U>; //#endregion //#region src/string-literals/sub-strings/FilterByNestingLevel.d.ts type NestingFormat = "string" | "string[]" | "template"; interface FilterByNestingLevel__Options { /** * The nesting level you want returned; the default is `0`. */ level?: number; /** * The nesting strategy to use. * * - by default the `brackets` nesting strategy is used * - _named_ strategies include `brackets`, `quotes`, and `brackets-and-quotes` * - you can define your own strategy by passing in a `NestingKeyValue` or * `NestingTuple` configuration */ strategy?: Nesting | KnownNestingConfig; /** * The type of output desired: * * - `string` (default) - _produces a single string with all text at the given * level concatenated together._ * - `string[]` - _each string _segment_ at the given level is returned as a tuple of strings_ * - `template` - _returns a single string representing the text at the specified level * but where the text has content a level higher being removed, instead of just removing it * we will instead add in the `${string}` to indicate a "hole"._ */ output?: NestingFormat; } type FormatWithBrackets = T["enterChar"] extends string ? T["exitChar"] extends string ? `${T["enterChar"]}${ReplaceAll}${T["exitChar"]}` : `${T["enterChar"]}${ReplaceAll}` : T["level"] extends 0 ? T["content"] : ReplaceAll; type FilterByLevelRecursive = TNodes extends readonly [infer First extends NestedString, ...infer Rest extends readonly NestedString[]] ? L extends First["level"] ? FilterByLevelRecursive : FilterByLevelRecursive<[...Rest, ...(First["children"] extends readonly NestedString[] ? First["children"] : [])], L, TResult> : TResult; type FilterByLevel = FilterByLevelRecursive<[T], L>; type ExtractSegments = TContent extends `${infer Before}{{child}}${infer After}` ? ExtractSegments : TContent extends "" ? TAcc : [...TAcc, TContent]; type ToTemplate = AsLiteralTemplate; type FormatOutput = T extends readonly [] ? F extends "string[]" ? [] : "" : T extends readonly [infer Single extends NestedString] ? Single["level"] extends 0 ? F extends "string" ? ReplaceAll : F extends "string[]" ? ExtractSegments : F extends "template" ? ToTemplate : never : F extends "string" ? FormatWithBrackets : F extends "string[]" ? [FormatWithBrackets] : F extends "template" ? FormatNodeForTemplate : never : CombineMultiple; type FormatNodeForTemplate = T["content"] extends `${string}{{child}}${string}` ? T["enterChar"] extends string ? T["exitChar"] extends string ? `${T["enterChar"]}${ToTemplate}${T["exitChar"]}` : `${T["enterChar"]}${ToTemplate}` : ToTemplate : FormatWithBrackets; type FormatLevel1PlusForTemplate = T["enterChar"] extends string ? T["exitChar"] extends string ? `${T["enterChar"]}${ToTemplate}${T["exitChar"]}` : `${T["enterChar"]}${ToTemplate}` : ToTemplate; type CombineMultiple = T extends readonly [] ? TAcc : T extends readonly [infer First extends NestedString, ...infer Rest extends readonly NestedString[]] ? F extends "string" ? CombineMultiple}` : ""> : F extends "string[]" ? CombineMultiple] : []> : F extends "template" ? First["level"] extends 0 ? CombineMultiple}` : ""> : Rest extends readonly [] ? CombineMultiple}` : ""> : CombineMultiple}${string}` : ""> : never : TAcc; /** * **FilterByNestingLevel**` -> string | string[] | template` * * Takes a string, applies _nesting_ logic to it, and returns only the content * at a specific level of the content (defaults to root/base level). * * - the default nesting layer that will be returned is root/base (aka, 0) * - the default nesting strategy is on bracketing * - the default output is a concatenated string * * These defaults can be modified by using the optional `TOpt` generic. * * **Related:** `Nest` */ type FilterByNestingLevel = Nest, Nesting> : BracketNesting> extends infer Structured ? Structured extends NestedString ? FilterByLevel extends infer Filtered extends readonly NestedString[] ? FormatOutput : never : Structured extends { name: string; message: string; } ? Structured : Structured extends Err ? Structured : Err<"unknown", "An unknown error occurred during nesting", { structured: Structured; }> : never; //#endregion //#region src/string-literals/sub-strings/FirstChar.d.ts type Process$32 = T extends `${infer Head}${string}` ? Head : E; type Iterate$3 = { [K in keyof TContent]: Process$32 }; /** * **FirstChar**`` * * When `TContent` extends a _string_: * - will return the first character in a string literal * - returns `string` when a wide type is encountered * - returns `never` when an empty string is passed in * - Note: you can choose a different value than `never` if you * like for when a string literal is empty by setting the `TEmpty` * generic. * * When `TContent` is a tuple of strings: * - each item will be processed as described above * * **Related:** `LastChar`, `AfterFirstChar` */ type FirstChar = TContent extends readonly string[] ? Iterate$3 : TContent extends string ? string extends TContent ? string : Process$32 : never; //#endregion //#region src/string-literals/sub-strings/InBetween.d.ts interface InBetweenOptions { policy?: "inclusive" | "exclusive"; noMatch?: unknown; } /** * **InBetween**`` * * Returns the _substring_ of `T` starting at `TStart` and ending * with `TEnd`. * * - by default the `TStart` and `TEnd` literals will be excluded * from the substring returned * - if you want to change this default set `TOpt["policy"]` to `inclusive` * - If either the `TStart` or `TEnd` strings are not found in `T` then no * match is possible and the value of `TOpt["noMatch"]` is returned * - by default the `TOpt["noMatch"]` value is an empty strings */ type InBetween = Or<[IsWideString, IsWideString, IsWideString]> extends true ? string : And<[Contains, Contains]> extends true ? TOpt["policy"] extends "inclusive" ? Concat<[TStart, StripBefore, TStart>, TEnd]> : StripBefore, TStart> : TOpt["noMatch"]; //#endregion //#region src/string-literals/sub-strings/LastChar.d.ts type Process$31 = Last$1>; type Iterate$2 = { [K in keyof TContent]: Process$31 }; /** * **LastChar**`` * * When `TContent` extends a _string_: * - will return the last character in a string literal * - returns `string` when a wide type is encountered * - returns `never` when an empty string is passed in * * When `TContent` is a tuple of strings: * - each item will be processed as described above * * **Related:** `FirstChar`, `AfterFirstChar` */ type LastChar = TContent extends readonly string[] ? Iterate$2 : TContent extends string ? string extends TContent ? string : Process$31 : never; //#endregion //#region src/string-literals/sub-strings/LongestCommonPrefix.d.ts /** * The longest common prefix shared by the two _concrete_ string literals * `A` and `B`, compared a character at a time. */ type CommonPrefix2 = A extends `${infer AHead}${infer ARest}` ? B extends `${infer BHead}${infer BRest}` ? AHead extends BHead ? BHead extends AHead ? CommonPrefix2 : TAcc : TAcc : TAcc : TAcc; /** * Reduces a tuple of string literals down to the single prefix common to * every element. A _wide_ `string` element collapses the result to `""` * because no literal prefix can be guaranteed (and it also protects the * character recursion from a non-terminating wide-string match). */ type CommonPrefixReduce = T extends readonly [infer Head extends string, ...infer Rest extends readonly string[]] ? [IsWideString] extends [true] ? "" : CommonPrefixReduce> : [TAcc] extends [null] ? "" : TAcc & string; /** * **LongestCommonPrefix**`` * * Given a string literal `T` — most usefully a _union_ of string literals — * resolves to the longest character sequence that prefixes **every** member * of the union. * * ```ts * // "hi " * type P = LongestCommonPrefix<"hi Bob" | "hi Nancy">; * // "hi Bob" (a single literal is its own prefix) * type S = LongestCommonPrefix<"hi Bob">; * // "" (nothing shared / wide string) * type N = LongestCommonPrefix<"foo" | "bar">; * ``` * * **Related:** `Widen`, `StartsWith` */ type LongestCommonPrefix = [IsWideString] extends [true] ? "" : CommonPrefixReduce, readonly string[]>>; //#endregion //#region src/string-literals/sub-strings/LongestToStartWith.d.ts type FindMatch = U extends [infer Head extends string, ...infer Rest extends readonly string[]] ? StartsWith extends true ? Head : FindMatch : false; /** * **LongestToStartWith**`` * * Given some text `T`, this utility iterates over a set of candidate strings `U` * which _may_ match the start of `T`. If there are 1 or more matches where * `T` _starts with_ any element in `U`, then the **longest** of these will be returned. * * If no matches are found then `false` is returned. * * @example * ```ts * // Returns "Foo" (longest match) * type Result = LongestToStartWith<"FooBar", ["F", "Fo", "Foo"]>; * * // Returns never (no match) * type NoMatch = LongestToStartWith<"FooBar", ["X", "Y", "Z"]>; * ``` */ type LongestToStartWith = ToStringArray extends infer Arr extends readonly string[] ? SortByLength extends infer Sorted extends readonly string[] ? FindMatch : never : never; //#endregion //#region src/string-literals/sub-strings/pad/PadEnd.d.ts /** * **PadEnd**`` * * A type utility which ensures that `TContent` reaches a length * of `TLen` by adding an appropriate number of `TChar` characters * to the end of the string. * * - if `TContent` is _equal to_ or _longer_ then `TLen` it will be passed * through unchanged * - if `TChar` is not exactly 1 character in length then an `Err<"invalid-char/pad-end">` * error will be returned. */ type PadEnd = StringLength extends 1 ? IsGreaterThanOrEqual>, TLen> extends true ? TContent : AsString extends infer Content extends string ? StringLength extends infer ContentLen extends number ? Subtract extends infer PadCount extends number ? Concat<[Content, Repeat]> : TContent : TContent : TContent : Err<`invalid-char/pad-end`, `The PadEnd utility expects TChar to have exactly 1 character!`, { char: TChar; content: TContent; len: TLen; }>; //#endregion //#region src/string-literals/sub-strings/pad/PadStart.d.ts /** * **PadStart**`` * * A type utility which ensures that `TContent` reaches a length * of `TLen` by adding an appropriate number of `TChar` characters * to the beginning of the string. * * - if `TContent` is _equal to_ or _longer_ then `TLen` it will be passed * through unchanged * - if `TChar` is not exactly 1 character in length then an `Err<"invalid-char/pad-start">` * error will be returned. */ type PadStart = StringLength extends 1 ? IsGreaterThanOrEqual>, TLen> extends true ? AsString : AsString extends infer Content extends string ? StringLength extends infer ContentLen extends number ? Subtract extends infer PadCount extends number ? Concat<[Repeat, Content]> : AsString : AsString : AsString : Err<`invalid-char/pad-start`, `The PadStart utility expects TChar to have exactly 1 character that condition was not met!`, { char: TChar; content: TContent; len: TLen; }>; //#endregion //#region src/string-literals/sub-strings/retain/RetainAfter.d.ts type _RetainAfter = As$1, `${TBreak}${Rest}`, Rest> : never : never, string>, string>; /** * **RetainAfter**`` * * Receives a string `TStr` and _retains_ characters after * the first occurrence of `TBreak` is found. * * By default the first `TBreak` found will _not_ be included * in the returned string but you can set `TInclude` to true * to reverse this behavior. * * ### Example * ```ts * // "blue green" * type T = RetainAfter<"red blue green", " ">; * // " blue green" * type T2 = RetainAfter<"red blue green", " ", true>; * ``` */ type RetainAfter = IsNever<_RetainAfter> extends true ? "" : IsUnion<_RetainAfter> extends true ? FindMaxLength>> : _RetainAfter; type RetainAfterLast = IfAllLiteral<[TStr, TBreak], TStr extends `${string}${infer Break extends TBreak}${infer REST}` ? If, `${Break}${REST}`, `${REST}`> : TStr, string>; //#endregion //#region src/string-literals/sub-strings/retain/RetainBetween.d.ts type RetainBetween = StripAfter, TEnd>; //#endregion //#region src/string-literals/sub-strings/retain/RetainUntil.d.ts /** * Optimized string-based processing without array conversion */ type ProcessDirect = TStr extends `${infer First}${infer Rest}` ? First extends TComparator ? TInclude extends true ? `${TResult}${First}` : TResult : ProcessDirect : TResult; /** * **RetainUntil**`` * * Proxies the content of `TContent` character-by-character _until_ * a character _extends_ `TComparator`. * * ```ts * // "1984" * type Num = RetainUntil<"1984 is a number", WhiteSpace>; * ``` * * **Related:** `RetainWhile` */ type RetainUntil = string extends TContent ? string : As$1, string>; //#endregion //#region src/string-literals/sub-strings/retain/RetainUntil__Nested.d.ts type FindLast = [] extends TChars ? TStack["length"] extends 0 ? Err<`not-found/retain-until-nested`, `The character '${TFind}' was not found anywhere at the base level of the nesting stack!`, { find: TFind; content: TRtn; nesting: ToStringLiteral; }> : Err<`unbalanced/retain-until-nested`, `After reaching the end of the characters of the string, it appears that the nesting stack is not balanced! There are still the following items on the stack: ${Join}`> : And<[First$1 extends TFind ? true : false, TStack["length"] extends 0 ? true : false]> extends true ? [TInclude] extends [true] ? `${TRtn}${First$1}` : TRtn : And<[IsExitToken, TNesting>, TStack["length"] extends 1 ? true : false, IsNestingMatchEnd, TStack, As$1, Nesting>>, First$1 extends TFind ? true : false]> extends true ? [TInclude] extends [true] ? `${TRtn}${First$1}` : TRtn : IsNestingMatchEnd, TStack, GetParentConfig> extends true ? Pop["length"] extends 0 ? FindLast, TFind, TRootNesting, TInclude, `${TRtn}${First$1}`, Pop, TRootNesting> : FindLast, TFind, Last$1> extends infer V extends string ? As$1, Nesting> : never, TInclude, `${TRtn}${First$1}`, Pop, TRootNesting> : IsEntryToken, TNesting> extends true ? FindLast, TFind, As$1, TNesting>, Nesting>, TInclude, `${TRtn}${First$1}`, And<[IsNestingTuple, IsGreaterThan]> extends true ? TStack : [...TStack, First$1], TRootNesting> : FindLast, TFind, TNesting, TInclude, `${TRtn}${First$1}`, TStack, TRootNesting>; interface RetainUntil__NestedOptions { include?: boolean; config?: Nesting; } /** * **RetainUntil__Nested**`` * * A _nesting aware_ variant of `RetainUntil`: * * - will retain characters in `TStr` until it finds `TFind` * at the root nesting level * - if `TNesting` is not defined then the `ShallowBracketAndQuoteNesting` * configuration will be used but any config from `Nesting` or * named config is valid. * - the `TInclude` value determines whether the `TFind` character * is included or not in the returned string. It defaults to true. * - **NEW**: Supports hierarchical nesting configurations where each * level can specify different tokens for the next level */ type RetainUntil__Nested = TStr extends string ? string extends TStr ? string : FindLast, TFind, AsNestingConfig extends Nesting ? AsNestingConfig : never, TInclude, "", [], As$1, Nesting>> : TStr extends Error ? TStr : Err<"invalid-type/string", `The AfterLast__Nested utility was passed a non-string value to TStr!`, { str: TStr; }>; //#endregion //#region src/string-literals/sub-strings/retain/RetainWhile.d.ts type Process$30 = [] extends TChars ? TResponse : TOp extends "extends" ? First$1 extends TComparator ? Process$30, TOp, TComparator, `${TResponse}${First$1}`> : TResponse : First$1 extends TComparator ? TResponse : Process$30, TOp, TComparator, `${TResponse}${First$1}`>; /** * **RetainWhile**`` * * Proxies the content of `TContent` character-by-character _until_ * a character _does not extend_ `TComparator`. * * ```ts * // "1984" * type Num = RetainWhile<"1984 is a number", NumericChar>; * ``` * * **Related:** `RetainUntil` */ type RetainWhile = string extends TContent ? string : string extends TComparator ? string : Process$30, TOp, TComparator>; //#endregion //#region src/string-literals/sub-strings/strip/StripAfter.d.ts type ProcessUnion$2 = Shortest, readonly string[]>>; /** * **StripAfter**`` * * Receives a string `TStr` and truncates all characters in * the first occurrence of `TBreak` and all remaining chars. * * ### Example * ```ts * // "hello" * type T = StripAfter<"hello world", " ">; * ``` */ type StripAfter = As$1 extends true ? IsStringLiteral$1 extends true ? IsUnion extends true ? UnionToTuple extends readonly string[] ? ProcessUnion$2> : never : TStr extends `${infer Before}${TBreak}${string}` ? Before : TStr : string : string, string>; //#endregion //#region src/string-literals/sub-strings/strip/StripAfterLast.d.ts /** * **StripAfterLast**`` * * Receives a string `TStr` and truncates all characters in * the first occurrence of `TBreak` and all remaining chars. * * ### Example * ```ts * // "hello" * type T = StripAfter<"hello world", " ">; * ``` */ type StripAfterLast = IsStringLiteral$1 extends true ? IsStringLiteral$1 extends true ? Split extends readonly [...infer Front, string, string] ? Join : [] : string : string; //#endregion //#region src/string-literals/sub-strings/strip/StripBefore.d.ts /** * **StripBefore**`` * * Receives a string `TStr` and truncates all characters in * the first occurrence of `TBreak` and all remaining chars. * * ### Example * ```ts * // "world" * type T = StripBefore<"hello world", " ">; * ``` */ type StripBefore = IsStringLiteral$1 extends true ? IsStringLiteral$1 extends true ? TStr extends `${string}${TBreak}${infer REST}` ? `${REST}` : TStr : string : string; //#endregion //#region src/string-literals/sub-strings/strip/StripFirst.d.ts /** * **StripFirst**`` * * Strips the first element of `U` which is found at the HEAD * of `T`. * * ```ts * // "bar" * type Test = StripFirst<"foobar", ["bar", "baz", "foo"]>; * ``` */ type StripFirst = [] extends U ? T : First$1 extends "" ? StripFirst> : StartsWith> extends true ? StripLeading> : StripFirst>; //#endregion //#region src/string-literals/sub-strings/strip/StripLeading.d.ts type HandleWideTypes = [string] extends [TContent] ? string : [string] extends [TStrip] ? string : [number] extends [TContent] ? number : [number] extends [TStrip] ? [TContent] extends [`${number}${infer Rest extends string}`] ? Rest | TContent : [TContent] extends [string] ? string : [TContent] extends [number] ? number : null : null; /** * **StripLeading**`` * * **StripLeading**`` * * Strips a leading string from another string when both are * string literals. * * ```ts * // "world" * type T = StripLeading<"hello world", "hello ">; * ``` */ type StripLeading = As$1 ? [TContent] extends [string] ? [TStrip] extends [string] ? [TContent] extends [`${TStrip}${infer After}`] ? After : TContent : TContent : [TContent] extends [number] ? TStrip extends string | number ? [`${TContent}`] extends [`${TStrip}${infer After}`] ? [After] extends [`${infer N extends number}`] ? N : After : TContent : TContent : never : HandleWideTypes, TContent extends string ? string : number>; //#endregion //#region src/string-literals/sub-strings/strip/StripSurround.d.ts type Process$29 = TContent extends `${TLeading}${infer Remaining}` ? Remaining extends `${infer Remaining}${TTrailing}` ? Remaining : Remaining : TContent extends `${infer Remaining}${TTrailing}` ? Remaining : TContent; /** * **StripSurround**`` * * Strips the content found in `TSurround` from the leading or trailing * edge of the content passed in as `TContent`. * * ```ts * // "Hi there" * type Hello = StripSurround<"(Hi there)", "(" | ")">; * ``` * * @deprecated use `StripSurrounding` instead */ type StripSurround = IsWideType extends true ? TContent : TContent extends string ? Process$29, AsStringUnion> : AsNumber, AsStringUnion>>; /** * **StripSurrounding**`` * * Strips the content found in `TSurround` from the leading or trailing * edge of the content passed in as `TContent`. * * - you can express `TSurround` as either a single `single|number` type (unions are allowed) * - or alternatively you can provide a tuple `[leading, trailing]` when you want to have * different/discrete types to look for the leading versus trailing character(s). * * ```ts * // "Hi there" * type Hello = StripSurrounding<"(Hi there)", "(" | ")">; * type Hello2 = StripSurrounding<"(Hi there)", ["(", ")"]>; * ``` */ type StripSurrounding = As$1<[string] extends [TContent] ? string : [number] extends [TContent] ? number | string : [TSurround] extends [[infer Leading extends string | number, infer Trailing extends string | number]] ? [TContent] extends [number] ? AsNumber> : [TContent] extends [string] ? Process$29 : never : [TContent] extends [number] ? AsNumber, As$1>> : [TContent] extends [string] ? Process$29, As$1> : never, TContent extends string ? string : number>; //#endregion //#region src/string-literals/sub-strings/strip/StripTrailing.d.ts type Process$28 = TContent extends `${infer Before}${TStrip}` ? Before : TContent; /** * **StripEnding**`` * * Will strip off `TStrip` from the ending of `TContent` when * it is found. * * ```ts * type T = "Hello World"; * type U = " World"; * // "Hello"re * type R = StripEnding; * ``` */ type StripTrailing = TContent extends number ? number extends TContent ? number : IsWideType extends true ? number : AsNumber> : TContent extends string ? string extends TContent ? string : IsWideType extends true ? string : Process$28 : never; //#endregion //#region src/string-literals/sub-strings/strip/StripUntil.d.ts type Process$27 = [] extends TChars ? TResult : First$1 extends TComparator ? TOp extends "is" ? Process$27, TOp, TComparator, Shift extends string ? Shift : ""> : TResult : TOp extends "is" ? TResult : Process$27, TOp, TComparator, Shift extends string ? Shift : "">; /** * **StripUntil**`` * * Strip characters from the start of `TContent` _until_ a * character extends `TComparator`. */ type StripUntil = Process$27, "not", TComparator, TContent>; /** * **StripWhile**`` * * Strip characters from the start of `TContent` _while_ those * characters extend `TComparator`. */ type StripWhile = Process$27, "is", TComparator, TContent>; //#endregion //#region src/string-literals/sub-strings/trim/Trim.d.ts type Process$26 = string extends S ? string : S extends `${Whitespace}${infer Right}` ? Process$26 : S extends `${infer Left}${Whitespace}` ? Process$26 : S; /** * Trims off blank spaces, `\n` and `\t` characters from both sides of a _string literal_. * ```ts * // "foobar" * type T = Trim<"\n\t foobar ">; * // string * type T = Trim; * ``` */ type Trim = As$1 extends string ? Process$26 : never, string>; //#endregion //#region src/string-literals/sub-strings/trim/TrimCharEnd.d.ts type Strip = TChars extends `${TWhile}${infer Rest}` ? Strip : Reverse; /** * **TrimCharEnd**`` * * Trims the character `U` from the end of the string `T`. * * **Related:** * - `TrimStart`, `TrimEnd` */ type TrimCharEnd = string extends T ? string : string extends U ? string : Strip, U>; //#endregion //#region src/string-literals/sub-strings/trim/TrimEnd.d.ts /** * Trims off whitespace on right of string * ```ts * // "\n foobar" * type T = TrimRight<"\n foobar \t">; * // string * type T = TrimRight; * ``` * * @deprecated use `TrimEnd` instead */ type TrimRight = string extends S ? string : S extends `${infer Right}${Whitespace}` ? TrimRight : S; /** * Trims off whitespace on end of the string * * ```ts * // "\n foobar" * type T = TrimEnd<"\n foobar \t">; * // string * type T = TrimEnd; * ``` */ type TrimEnd = string extends S ? string : S extends `${infer Right}${Whitespace}` ? TrimEnd : S; //#endregion //#region src/string-literals/sub-strings/trim/TrimStart.d.ts /** * Trims off whitespace on left of string * ```ts * // "foobar " * type T = TrimLeft<"\n\t foobar ">; * // string * type T = TrimLeft; * ``` * * @deprecated use `TrimStart` instead */ type TrimLeft = string extends S ? string : S extends `${Whitespace}${infer Right}` ? TrimLeft : S; /** * **TrimStart**`` * * Trims off whitespace at the start of the string * * ```ts * // "foobar " * type T = TrimStart<"\n\t foobar ">; * // string * type T = TrimStart; * ``` */ type TrimStart = string extends T ? string : T extends `${Whitespace}${infer Right}` ? TrimStart : T; //#endregion //#region src/string-literals/sub-strings/UntilLast.d.ts type Until = Last$1 extends TFind ? Join> : Last$1 extends `${infer Lead}${TFind}` ? Lead : Last$1> extends `${string}${TFind}` ? Join> extends `${infer Value extends string}${TFind}` ? Value : Join> : Err<`until`, ``>; interface UntilLastOptions { break?: Unset | string; handle?: Error | string; } type Break$3 = T["break"] extends string ? T["break"] : Unset; type Handle$1 = Or<[O["handle"] extends string ? true : false, O["handle"] extends Error ? true : false]> extends true ? O["handle"] : T; /** * **UntilLast**`` * * Provides the text in `TText` up to (but not including) the `TFind` * character. * * - if the `TBreak` character is provided then all text in `TText` * after the _first_ occurrence of the break character will be discarded * before looking for the last `TFind` character. * - if no instances of `TFind` are found then `THandle` will be returned * - by default `THandle` is just `TText` but you can set it * what ever is most appropriate * - note that any string literal value provided will have the content * _after_ the `TBreak` character removed from the string literal * * **Related:** `AfterLast` */ type UntilLast = Contains extends true ? As$1 extends string ? Until, string>>, TFind, "before">, TFind> : Until, TFind>, string> : Handle$1 extends string ? Break$3 extends string ? StripAfter, Break$3> : Handle$1 : Handle$1; //#endregion //#region src/string-literals/Suggest.d.ts /** * **Suggest**`` * * Type utility that helps to build a enumerated set * of string literals which _could_ be the value for * a string based property but _allows_ a string that * is not part of the suggestion to be typed in too. * * - `T` can be a _union_ of string literals or an * _array_ of string literals. * - If T is a wide string then we must return * just a wide string as no suggestions are possible */ type Suggest = T extends readonly string[] ? T[number] | (string & {}) : T extends string ? T | (string & {}) : never; //#endregion //#region src/string-literals/take/TakeDate.d.ts type InvalidDate = Err<"parse-date/date", `unable to parse the date component [${T}] of this ISO string`, { date: T; }>; /** * */ type Take$8 = T extends `${infer C1}${infer C2}${infer Rest}` ? C1 extends NumericChar ? C1 extends "0" ? C2 extends "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" ? { take: TwoDigitDate<`${C1}${C2}`>; rest: Rest; } : InvalidDate : C1 extends "1" ? C2 extends NumericChar ? { take: TwoDigitDate<`${C1}${C2}`>; rest: Rest; } : InvalidDate : C1 extends "2" ? C2 extends NumericChar ? { take: TwoDigitDate<`${C1}${C2}`>; rest: Rest; } : InvalidDate : C1 extends "3" ? C2 extends "0" | "1" ? { take: TwoDigitDate<`${C1}${C2}`>; rest: Rest; } : InvalidDate : InvalidDate : InvalidDate : InvalidDate; /** * works with the year/month info to refine what a valid date is * (when these are provided) */ type WithContext = Take$8 extends infer R ? R extends Error ? R : R extends { take: infer _Date extends TwoDigitDate<"branded">; rest: infer _Rest extends string; } ? R : Err<`parse-date/date`, `Validation against the ISO date failed. This is likely due to the date being too large for the month of the date (leap and double leap is considered when both year and month were provided to TakeDate)`, { year: TYear; month: TMonth; date: TwoDigitDate<"branded">; leap: IsLeapYear; }> : never; /** * **TakeDate**`` * * Looks for `TwoDigitDate` at front of the string and if it finds * it will return: * * - `{ take: TwoDigitDate, rest: Rest }` * * If there is no match: * * - `Err<'date'>` * * @param TIgnoreLeading - Optional character to ignore if found at the beginning of the string */ type TakeDate = string extends T ? Error | { take: TwoDigitDate<"branded">; rest: string; } : StartsWithTemplateLiteral extends true ? Error | { take: TwoDigitDate<"branded">; rest: string; } : TIgnoreLeading extends string ? string extends TIgnoreLeading ? Error | { take: TwoDigitDate<"branded">; rest: string; } : string extends T ? Error | { take: TwoDigitDate<"branded">; rest: string; } : WithContext, Unbrand, Unbrand> : string extends T ? Error | { take: TwoDigitDate<"branded">; rest: string; } : WithContext, Unbrand>; //#endregion //#region src/string-literals/take/TakeHours.d.ts type HoursErr = Err<`parse-time/hours`, `Could not find or parse out the TwoDigitHour string from the head of: '${TParse}'`, { parse: TParse; }>; type Take$7 = string extends T ? Error | { take: TwoDigitHour<"branded">; rest: string; } : StartsWithTemplateLiteral extends true ? Error | { take: TwoDigitHour<"branded">; rest: string; } : T extends `${infer C1}${infer C2}${infer Rest}` ? C1 extends "0" ? C2 extends NumericChar ? { take: TwoDigitHour<`${C1}${C2}`>; rest: Rest; } : HoursErr : C1 extends "1" ? C2 extends NumericChar ? { take: TwoDigitHour<`${C1}${C2}`>; rest: Rest; } : HoursErr : C1 extends "2" ? C2 extends "0" | "1" | "2" | "3" ? { take: TwoDigitHour<`${C1}${C2}`>; rest: Rest; } : HoursErr : HoursErr : HoursErr; /** * **TakeHours**`` * * Looks for `TwoDigitHour` at front of the string and if it finds * it will return: * * - `{ take: TwoDigitHour | null, rest: string }` * * Valid hours are 00-23. * * @param TIgnoreLeading - Optional character to ignore if found at the beginning of the string */ type TakeHours = TIgnoreLeading extends string ? string extends TIgnoreLeading ? never : As$1, string>>, Error | { take: TwoDigitHour<"branded">; rest: string; }> : Take$7; //#endregion //#region src/string-literals/take/TakeMilliseconds.d.ts type E$3 = Err<"parse-time/ms", `Unable to take the milliseconds at head of the parse string: ${T}`, { parse: T; }>; type Take$6 = As$1 | { take: ThreeDigitMillisecond<"branded">; rest: string; } : StartsWithTemplateLiteral extends true ? Err<"parse-time/ms"> | { take: ThreeDigitMillisecond<"branded">; rest: string; } : T extends `${infer C1}${infer C2}${infer C3}${infer Rest}` ? C1 extends NumericChar ? C2 extends NumericChar ? C3 extends NumericChar ? { take: ThreeDigitMillisecond<`${C1}${C2}${C3}`>; rest: Rest; } : E$3 : E$3 : E$3 : E$3, Err<"parse-time/ms"> | { take: ThreeDigitMillisecond<"branded">; rest: string; }>; /** * **TakeMilliseconds**`` * * Looks for `ThreeDigitMillisecond` at front of the string and if it finds * it will return: * * - `{ take: ThreeDigitMillisecond, rest: Rest }` * * If there is no match: * * - `{ take: null, rest: Rest }` * * @param TIgnoreLeading - Optional character to ignore if found at the beginning of the string */ type TakeMilliseconds = TIgnoreLeading extends string ? string extends TIgnoreLeading ? Err<"parse-time/ms"> | { take: ThreeDigitMillisecond<"branded">; rest: string; } : As$1, string>>, Err<"parse-time/ms"> | { take: ThreeDigitMillisecond<"branded">; rest: string; }> : As$1, Err<"parse-time/ms"> | { take: ThreeDigitMillisecond<"branded">; rest: string; }>; //#endregion //#region src/string-literals/take/TakeMinutes.d.ts type E$2 = Err<`parse-time/min`, `Unable to take minutes from '${T}'!`>; type Take$5 = string extends T ? E$2 | { take: TwoDigitMinute<"branded">; rest: string; } : StartsWithTemplateLiteral extends true ? E$2 | { take: TwoDigitMinute<"branded">; rest: string; } : T extends `${infer C1}${infer C2}${infer Rest}` ? C1 extends NumericChar__ZeroToFive ? C2 extends NumericChar ? { take: TwoDigitMinute<`${C1}${C2}`>; rest: Rest; } : E$2 : E$2 : E$2; /** * **TakeMinutes**`` * * Looks for valid two-digit minutes (00-59) at front of the string and if it finds * it will return: * * - `{ take: TwoDigitMinute, rest: Rest }` * * If there is no match: * * - `{ take: null, rest: T }` * * @param TIgnoreLeading - Optional character to ignore if found at the beginning of the string */ type TakeMinutes = TIgnoreLeading extends string ? string extends TIgnoreLeading ? Err<`parse-time/min`> | { take: TwoDigitMinute<"branded">; rest: string; } : As$1, string>>, Err<`parse-time/min`> | { take: TwoDigitMinute<"branded">; rest: string; }> : As$1, Err<`parse-time/min`> | { take: TwoDigitMinute<"branded">; rest: string; }>; //#endregion //#region src/string-literals/take/TakeMonth.d.ts type InvalidMonth = Err<`parse-date/month`, `The value '${T}' can not be parsed into a valid TwoDigitMonth!`, { month: T; }>; type Take$4 = string extends T ? Error | { take: TwoDigitMonth<"branded">; rest: string; } : StartsWithTemplateLiteral extends true ? Error | { take: [TwoDigitMonth<"branded">]; rest: string; } : T extends `${infer C1}${infer C2}${infer Rest}` ? C1 extends NumericChar ? C2 extends NumericChar ? `${C1}${C2}` extends TwoDigitMonth<"normal"> ? { take: TwoDigitMonth<`${C1}${C2}`>; rest: Rest; } : InvalidMonth : InvalidMonth : InvalidMonth : InvalidMonth; /** * **TakeMonth**`` * * Looks for `TwoDigitMonth` at front of the string and if it finds * it will return: * * - `{ take: TwoDigitMonth, rest: Rest }` * * If there is no match: * * - `{ take: null, rest: T }` * * @param TIgnoreLeading - Optional character to ignore if found at the beginning of the string */ type TakeMonth = As$1, string>> : Take$4, Error | { take: TwoDigitMonth<"branded">; rest: string; }>; //#endregion //#region src/string-literals/take/TakeNumeric.d.ts interface TakeNumericOptions { /** * require a string (or string union) which must immediately * follow the end of numeric characters. */ mustFollow?: string; /** * meant as string literal or union type which expresses * characters which should be ignored: * * - the sequence continues but the ignored character * is not added to the result * - a common choice would be the `,` character */ ignore?: string; } type Chars$1 = [IsTrue] extends [true] ? NumericChar : NumericChar | "."; type Finish = TOpt["mustFollow"] extends string ? IsWideType extends true ? Err<`invalid-follow`, `The TakeNumeric utility was passed a wide string for the optional 'mustFollow' property!`> : StartsWith extends true ? [TTake, TRemaining] : [undefined, `${TTake}${TRemaining}`] : [TTake, TRemaining]; type Take$3 = TRemaining extends `${infer First extends Chars$1}${infer Rest extends string}` ? Take$3 : TOpt["ignore"] extends string ? TRemaining extends `${infer _Ignore extends TOpt["ignore"]}${infer Rest extends string}` ? Take$3 : Finish : Finish; /** * **TakeNumeric**`` * * Takes the numeric value from the front of the string and returns * a tuple of the form: * * - `[`${number}`, string ]` * * If there are no numeric characters at the start of the string * then _undefined_ is returned: * * - `[ undefined, string ]` * * This utility will work decimals and with negative numbers but you can't use * the literal `-.001`, use `-0.001` instead. * * ### Options * * - `mustFollow` * * - When defined as a string literal, it will _require_ that * the character(s) immediately following the numeric characters * must _extend_ this value. * - a common use case would be require _white space_ after the number * * - `ignore` * * - When we're _taking_ in characters we take in all numeric characters * and the `.` character to pick up decimal values. * - Sometimes -- like in the case of `,` -- we might want to continue * moving into the numeric value while ignoring some characters */ type TakeNumeric = As$1 extends true ? [`${number}` | undefined, string] : StartsWithTemplateLiteral extends true ? [`${number}` | undefined, string] : T extends `-.${Chars$1}${string}` ? Take$3, TOpt, "-.", true> : T extends `.${Chars$1}${string}` ? Take$3, TOpt, ".", true> : T extends `-${Chars$1}${string}` ? Take$3, TOpt, "-"> : T extends `${Chars$1}${string}` ? Take$3 : [undefined, T], [take: `${number}` | undefined, remaining: string] | Error>; //#endregion //#region src/string-literals/take/TakeSeconds.d.ts type E$1 = Err<`parse-time/seconds`, `TakeSeconds<${T}> was unable to find seconds at the head of the parse string.`, { parse: T; }>; type Take$2 = string extends T ? Error | { take: TwoDigitSecond<"branded">; rest: string; } : StartsWithTemplateLiteral extends true ? Error | { take: TwoDigitSecond<"branded">; rest: string; } : T extends `${infer C1}${infer C2}${infer Rest}` ? C1 extends NumericChar__ZeroToFive ? C2 extends NumericChar ? { take: TwoDigitSecond<`${C1}${C2}`>; rest: Rest; } : E$1 : E$1 : E$1; /** * **TakeSeconds**`` * * Looks for valid two-digit seconds (00-59) at front of the string and if it finds * it will return: * * - `{ take: TwoDigitSecond, rest: Rest }` * * If there is no match: * * - `{ take: null, rest: T }` * * @param TIgnoreLeading - Optional character to ignore if found at the beginning of the string */ type TakeSeconds = TIgnoreLeading extends string ? string extends TIgnoreLeading ? never : As$1, string>>, Error | { take: TwoDigitSecond<"branded">; rest: string; }> : As$1, Error | { take: TwoDigitSecond<"branded">; rest: string; }>; //#endregion //#region src/string-literals/take/TakeTimezone.d.ts type TZ$1 = Err<`parse-time/tz`, `The string '${T}' was unable to be parsed into a Timezone offset`, { parse: T; }>; type Take$1 = string extends T ? Error | { take: TimezoneOffset<"branded">; rest: string; } : StartsWithTemplateLiteral extends true ? Error | { take: TimezoneOffset<"branded">; rest: string; } : T extends `Z${infer Rest}` ? { take: TimezoneOffset<"Z">; rest: Rest; } : T extends `${infer Sign}${infer H1}${infer H2}${infer Rest}` ? Sign extends "+" | "-" ? H1 extends NumericChar ? H2 extends NumericChar ? H1 extends "0" | "1" ? H1 extends "1" ? H2 extends "0" | "1" | "2" | "3" | "4" ? Rest extends `:${infer M1}${infer M2}${infer Rest2}` ? M1 extends NumericChar ? M2 extends NumericChar ? M1 extends "0" | "1" | "2" | "3" | "4" | "5" ? { take: TimezoneOffset<`${Sign}${H1}${H2}:${M1}${M2}`>; rest: Rest2; } : { take: TimezoneOffset<`${Sign}${H1}${H2}`>; rest: Rest; } : { take: TimezoneOffset<`${Sign}${H1}${H2}`>; rest: Rest; } : { take: TimezoneOffset<`${Sign}${H1}${H2}`>; rest: Rest; } : Rest extends `${infer M1}${infer M2}${infer Rest2}` ? M1 extends NumericChar ? M2 extends NumericChar ? M1 extends "0" | "1" | "2" | "3" | "4" | "5" ? { take: TimezoneOffset<`${Sign}${H1}${H2}${M1}${M2}`>; rest: Rest2; } : { take: TimezoneOffset<`${Sign}${H1}${H2}`>; rest: Rest; } : { take: TimezoneOffset<`${Sign}${H1}${H2}`>; rest: Rest; } : { take: TimezoneOffset<`${Sign}${H1}${H2}`>; rest: Rest; } : { take: TimezoneOffset<`${Sign}${H1}${H2}`>; rest: Rest; } : TZ$1 : Rest extends `:${infer M1}${infer M2}${infer Rest2}` ? M1 extends NumericChar ? M2 extends NumericChar ? M1 extends "0" | "1" | "2" | "3" | "4" | "5" ? { take: TimezoneOffset<`${Sign}${H1}${H2}:${M1}${M2}`>; rest: Rest2; } : { take: TimezoneOffset<`${Sign}${H1}${H2}`>; rest: Rest; } : { take: TimezoneOffset<`${Sign}${H1}${H2}`>; rest: Rest; } : { take: TimezoneOffset<`${Sign}${H1}${H2}`>; rest: Rest; } : Rest extends `${infer M1}${infer M2}${infer Rest2}` ? M1 extends NumericChar ? M2 extends NumericChar ? M1 extends "0" | "1" | "2" | "3" | "4" | "5" ? { take: TimezoneOffset<`${Sign}${H1}${H2}${M1}${M2}`>; rest: Rest2; } : { take: TimezoneOffset<`${Sign}${H1}${H2}`>; rest: Rest; } : { take: TimezoneOffset<`${Sign}${H1}${H2}`>; rest: Rest; } : { take: TimezoneOffset<`${Sign}${H1}${H2}`>; rest: Rest; } : { take: TimezoneOffset<`${Sign}${H1}${H2}`>; rest: Rest; } : TZ$1 : TZ$1 : TZ$1 : TZ$1 : TZ$1; /** * **TakeTimezone**`` * * Looks for `TimezoneOffset` at front of the string and if it finds * it will return: * * - `{ take: TimezoneOffset, rest: Rest }` * * If there is no match an Error is returned. * * Valid timezone formats: * - "Z" for UTC * - "+HH:MM" or "-HH:MM" format (e.g., "+05:30", "-08:00") * - "+HH" or "-HH" format (e.g., "+05", "-08") * * Valid hour offsets range from 00-14. * * @param TIgnoreLeading - Optional character to ignore if found at the beginning of the string */ type TakeTimezone = TIgnoreLeading extends string ? string extends TIgnoreLeading ? never : As$1, string>>, Error | { take: TimezoneOffset<"branded">; rest: string; }> : As$1, Error | { take: TimezoneOffset<"branded">; rest: string; }>; //#endregion //#region src/string-literals/take/TakeYear.d.ts type InvalidYear = Err<`parse-date/year`, `The year [${T}] passed in is not a valid ISO four digit year!`, { year: T; }>; type Take = string extends T ? Error | { take: FourDigitYear<"branded">; rest: string; } : StartsWithTemplateLiteral extends true ? Error | { take: FourDigitYear<"branded">; rest: string; } : T extends `${infer C1}${infer C2}${infer C3}${infer C4}${infer Rest}` ? C1 extends NumericChar ? C2 extends NumericChar ? C3 extends NumericChar ? C4 extends NumericChar ? { take: FourDigitYear<`${C1}${C2}${C3}${C4}`>; rest: Rest; } : InvalidYear : InvalidYear : InvalidYear : InvalidYear : InvalidYear; /** * **TakeYear**`` * * Looks for `FourDigitYear` at front of the string and if it finds * it will return: * * - `{ take: FourDigitYear, rest: Rest }` * * If there is no match: * * - `Err<'year'>` * * @param TIgnoreLeading - Optional character to ignore if found at the beginning of the string */ type TakeYear = string extends T ? Error | { take: FourDigitYear<"branded">; rest: string; } : As$1, string>> : Take, Error | { take: FourDigitYear<"branded">; rest: string; }>; //#endregion //#region src/string-literals/TypeSubtype.d.ts /** * A string literal which is divided by the `/` character to represent * a Type-and-Subtype relationship. */ type TypeSubtype = `${T}/${S}`; //#endregion //#region src/string-literals/UUID.d.ts /** * **UUID** - _**U**niversally **U**nique **ID**entifier_ * * A unique identifer as defined by [RFC 4122](https://datatracker.ietf.org/doc/html/rfc4122#section-4.1) * * A UUID is 128 bits long, and can guarantee uniqueness across space and time. * UUIDs were originally used in the Apollo Network Computing System and later in * the Open Software Foundation's (OSF) Distributed Computing Environment (DCE), and * then in Microsoft Windows platforms. * * - each region is composed of Hexedecimal notation * - there are 5 regions of varying lengths * - in total a UUID is composed of 16 octets * * **Related:** `UUID_Urn` */ type UUID = `${string}-${string}-${string}-${string}-${string}`; /** * A URN representation of a UUID string * * **Related:** `UUID` */ type UUID_Urn = `urn:uuid:${UUID}`; //#endregion //#region src/numeric-literals/Abs.d.ts type Process$25 = If, StripLeading, string>; /** * **Abs**`` * * Converts any literal numeric into the **absolute value** of the number. * * - you can pass in a numeric string literal and it perform ABS func while * preserving string literal type */ type Abs = T extends number ? number extends T ? number : number extends 0 ? 0 : IsNegativeNumber extends true ? AsNumber> : T : T extends `${number}` ? Process$25 : never; //#endregion //#region src/numeric-literals/AbsMaybe.d.ts /** * **AbsMaybe**`` * * Converts any literal numeric into the **absolute value** of the number. * * - you can pass in a numeric string literal and it perform ABS func while * preserving string literal type * - if a wide numeric type is used for `T` this utility will resolve to `number` * as the absolute value can not be known at design time; if you'd prefer to * block any wide types then use `Abs` instead */ type AbsMaybe = If, IsStringLiteral$1]>, T extends string ? StripLeading : ToNumber, "-">>, number>; //#endregion //#region src/numeric-literals/Add.d.ts type Either = left extends true ? true : right extends true ? true : false; type DecrementDigit$2 = digit extends "1" ? "0" : digit extends "2" ? "1" : digit extends "3" ? "2" : digit extends "4" ? "3" : digit extends "5" ? "4" : digit extends "6" ? "5" : digit extends "7" ? "6" : digit extends "8" ? "7" : digit extends "9" ? "8" : digit extends "10" ? "9" : never; type IncrementDigit$1 = digit extends "0" ? { result: "1"; carry: false; } : digit extends "1" ? { result: "2"; carry: false; } : digit extends "2" ? { result: "3"; carry: false; } : digit extends "3" ? { result: "4"; carry: false; } : digit extends "4" ? { result: "5"; carry: false; } : digit extends "5" ? { result: "6"; carry: false; } : digit extends "6" ? { result: "7"; carry: false; } : digit extends "7" ? { result: "8"; carry: false; } : digit extends "8" ? { result: "9"; carry: false; } : digit extends "9" ? { result: "0"; carry: true; } : never; interface SingleDigitSumResult { result: result; carry: carry; } type SumSingleDigits = carryIn extends true ? IncrementDigit$1 extends SingleDigitSumResult ? SumSingleDigits : never : right extends "0" ? { result: left; carry: carryOut; } : IncrementDigit$1 extends SingleDigitSumResult ? SumSingleDigits, false, Either> : never; interface RightMostDigitResult { rest: rest; digit: digit; } type RightMostDigit$1 = s extends `${infer rest}${NumericChar}` ? s extends `${rest}${infer digit}` ? { rest: rest; digit: digit; } : never : never; type SumStrings = Depth["length"] extends 32 ? `${number}` : "" extends left ? "" extends right ? carry extends true ? `1${accumulatedResultDigits}` : accumulatedResultDigits : RightMostDigit$1 extends RightMostDigitResult ? SumSingleDigits<"0", rightDigit, carry> extends SingleDigitSumResult ? SumStrings<"", remainingRight, `${resultDigit}${accumulatedResultDigits}`, resultCarry, [unknown, ...Depth]> : never : never : "" extends right ? RightMostDigit$1 extends RightMostDigitResult ? SumSingleDigits<"0", leftDigit, carry> extends SingleDigitSumResult ? SumStrings : never : never : RightMostDigit$1 extends RightMostDigitResult ? RightMostDigit$1 extends RightMostDigitResult ? SumSingleDigits extends SingleDigitSumResult ? SumStrings : never : never : never; type Process$24 = A extends `-${infer AAbs extends `${number}`}` ? B extends `-${infer BAbs extends `${number}`}` ? `-${SumStrings}` : `${number}` : B extends `-${number}` ? `${number}` : SumStrings; type CheckWide$1 = IsWideType extends true ? true : IsWideType extends true ? true : false; type PreProcess$2 = CheckWide$1 extends true ? If, string, number> : A extends `-${number}` ? B extends `-${number}` ? A extends `${number}` ? B extends `${number}` ? As$1, `${number}`> : As$1}`>, `${number}`> : never : A extends `${number}` ? `${number}` : number : B extends `-${number}` ? A extends `${number}` ? `${number}` : number : A extends `${number}` ? B extends `${number}` ? As$1, `${number}`> : As$1}`>, `${number}`> : A extends number ? B extends number ? AsNumber> : AsNumber>> : never; /** * **Add**`` * * Adds two `NumberLike` values together and returns the appropriate numeric type: * * - if either or both `A` and `B` are a `${number}` then a `${number}` type is returned * - if both are numeric values than the type is `number`. * * **Related:** * - `AddPositive` - a simpler utility that only handles positive numbers */ type Add = A extends number ? As$1, number> : A extends `${number}` ? As$1, `${number}`> : never; //#endregion //#region src/tuples/FirstKey.d.ts /** * Returns the _first_ key in an object. * * **Note:** key order is not guaranteed so typically this is used * for a key/value pair where only one key is expected */ type FirstKey = T extends Tuple$1 ? T extends [infer First extends unknown, ...unknown[]] ? First : never : UnionToTuple> extends readonly unknown[] ? UnionToTuple>[0] : never; //#endregion //#region src/tuples/FirstOfEach.d.ts /** * **FirstOfEach**`` * * Expects `TList` to consist of an array of arrays and then this utility will reduce * this to a _tuple_ of all the first elements in `TList`. * * ```ts * // ["foo", "bar"] * type A = FirstOfEach<[ ["foo", 1], ["bar", 2] ]>; * ``` */ type FirstOfEach = T[number][0] extends T[number][number] ? T[number][0] : never; //#endregion //#region src/tuples/FixedLengthArray.d.ts type MapItemType = { [K in keyof T]: I }; type Shift$1 = T extends readonly [unknown[], ...infer Rest extends unknown[][]] ? Rest : []; type GrowExpRev = T["length"] extends N ? T : [...T, ...P[0]][N] extends undefined ? GrowExpRev<[...T, ...P[0]], N, P> : GrowExpRev>; type GrowExp = L extends N ? T : L extends 8192 ? unknown[] : [...T, ...T][N] extends undefined ? GrowExp<[...T, ...T], N, [T, ...P]> : GrowExpRev; type Process$23 = number extends N ? T[] : N extends 0 ? [] : GrowExp<[unknown], N, []> extends infer R extends readonly unknown[] ? MapItemType : never; /** * **FixedLengthArray**`` * * Creates a fixed length `TLen` array of a given type `T`. * * - if `TOpt` is set to true then it will add an optional * continuation of the type to unlimited length * * **Related:** `NumericSequence` */ type FixedLengthArray = TExtends extends true ? AsNumber extends infer Len extends number ? Process$23 extends infer Fixed extends readonly unknown[] ? number extends Len ? TType[] : [...Fixed, ...TType[]] : never : never : AsNumber extends infer Len extends number ? Process$23 : never; //#endregion //#region src/tuples/LastOfEach.d.ts /** * **LastOfEach**`` * * Expects `TList` to consist of an array of arrays and then this utility will reduce * this to a _tuple_ of all the _last_ elements in `TList` * * ```ts * // [1, 2] * type A = LastOfEach<[ ["foo", 1], ["bar", 2] ]>; * ``` */ type LastOfEach = { [K in keyof T]: T[K] extends readonly unknown[] ? Last$1 : never }; //#endregion //#region src/tuples/MinLengthArray.d.ts /** * **MinLengthArray**`` * * Creates a fixed length `` array of a given type `` and then * allows additional items of `T` to be added beyond this minimum * required length. * * **Related:** `FixedLengthArray` */ type MinLengthArray = [...FixedLengthArray, ...T[]]; //#endregion //#region src/tuples/NumericSequence.d.ts /** * General-purpose increment that works with any integer (positive or negative) * * - For positive numbers: uses AddPositive * - For negative numbers: uses Subtract (subtracting negative = addition) */ type LocalIncrement = IsNegativeNumber extends true ? Subtract : AddPositive; /** * General-purpose decrement that works with any integer (positive or negative) * * - Uses Subtract for both positive and negative numbers */ type LocalDecrement = Subtract; type MoveUpward = TTracker extends [infer _Head, ...infer Rest extends readonly unknown[]] ? LocalIncrement extends infer Next extends number ? MoveUpward : never : [...TResult, TStart]; type MoveDownward = TTracker extends [infer _Head, ...infer Rest extends readonly unknown[]] ? LocalDecrement extends infer Next extends number ? MoveDownward : never : [...TResult, TStart]; /** * **NumericSequence** * * Produces a tuple with values starting with `TStart` and ending with `TEnd`. * * - numbers must be integers or an Error will be returned * - if `TEnd` is greater than `TStart` the numeric sequence will move downward * * **Related:** `FixedLengthArray` * * ```ts * // [ 3, 4, 5, 6, 7, 8 ] * type Seq = NumericSequence<3,8>; * ``` */ type NumericSequence = number extends TStart ? number[] : number extends TEnd ? number[] : TStart extends TEnd ? [] : Or<[IsFloat, IsFloat]> extends true ? Err<"invalid-range", `TStart and TEnd must be integer values!`, { symbol: "NumericSequence"; start: TStart; end: TEnd; }> : Delta$1 extends infer Diff extends number ? FixedLengthArray<".", Diff> extends infer Tracker extends readonly unknown[] ? IsGreaterThan extends true ? MoveDownward : MoveUpward : never : never; //#endregion //#region src/tuples/SecondOfEach.d.ts /** * For a two-dimensional array, returns a _union type_ which combines the first element of the interior * array. * * ```ts * // 1 | 2 * type F = SecondOfEach<[ ["foo", 1], ["bar", 2] ]>; * ``` */ type SecondOfEach = T[number][1] extends T[number][number] ? T[number][1] : never; //#endregion //#region src/tuples/TupleMeta.d.ts /** * **TupleMeta**`` * * Provides metadata about the passed in array/tuple in `T` * including: * * - `range` * - `minLength` * - `maxLength` * - `length` * - `isOptional` * - `isEmpty` * - `isVariadic` * - `hasOptionalElements` */ interface TupleMeta { /** textual description of the range of lengths available */ range: And<[IsEqual, 0>, IsEqual, 0>]> extends true ? `empty` : `[ ${MinLength}..${If, number>, "*", As$1, number>>} ]`; minLength: As$1, number>; /** * The maximum allowable length which this Tuple can take on. * * - If the tuple is unbounded because the last element is typed * as a _variadic_ type then this value will be set to the `MaxSafeInteger` * value as this is the largest value that can be represented by **number**. */ maxLength: As$1, number> extends true ? MaxSafeInteger : MaxLength, number>; length: Length; /** * Returns a boolean flag indicating whether the number of parameters is a known and _fixed_ * number. */ isTuple: IsTuple; /** * whether the number of elements in the array is _unconstrained_ */ isUnconstrained: IsEqual["maxLength"], MaxSafeInteger>; /** * The length of `T` after stripping off the _variadic_ tail. * * - if there is no variadic tail on `T` then this number will match `length` */ nonVariadicLength: DropVariadic extends readonly unknown[] ? DropVariadic["length"] : number; /** * whether or not `T` has a _variadic_ signature (but is NOT * a wide type) */ isVariadic: And<[IsVariadicArray, IsLiteralLikeArray]>; /** * boolean indicator on whether the length of the array is * known and fixed. */ isFixedLength: number extends T["length"] ? false : IsEqual, MaxLength>; /** * the _head_ position of the array is a _variadic_ type */ hasVariadicHead: HasVariadicHead; /** * the _tail_ position of the array is a _variadic_ type */ hasVariadicTail: HasVariadicTail; /** * whether the tuple/array is consider to be "wide" * which means that the number of elements is **not** fixed */ isWide: Not>; /** * if the minimum length of `T` is 0 then this * property will be `true`. */ isOptional: IsEqual, 0>; /** * if both **min** and **max** length are 0 then this is * set as `true`. */ isEmpty: And<[IsEqual, 0>, IsEqual, 0>]>; excludingVariadicElement: DropVariadic; /** * whether or not the given array as one or more elements * who's type includes a template literal like `${string}`, * `${number}`, etc. */ hasTemplateLiterals: HasTemplateLiteral; hasNonTemplateLiterals: HasNonTemplateLiteral; /** * The _type_ of the variadic elements in the array; `never` * if there is no variadic type. */ variadicType: VariadicType; /** * has one or more _optional_ elements defined (e.g., defined with * the `?` modifier) */ hasOptionalElements: NotEqual, T>; /** * a numeric count of the elements which are of the required type * (e.g., do not have a `?` modifier) */ requiredElementCount: GetRequiredElementCount; /** * a numeric count of the elements which are of the optional type * (e.g., marked with the `?` modifier) */ optionalElementCount: GetOptionalElementCount; } //#endregion //#region src/numeric-literals/AddPositive.d.ts type Process$22 = [...FixedLengthArray<"0", A>, ...FixedLengthArray<"0", B>]["length"]; /** * **AddPositive*`` * * Adds two positive numbers. */ type AddPositive = Process$22; //#endregion //#region src/numeric-literals/AsNegativeNumber.d.ts type Process$21 = EnsureLeading; /** * **AsNegativeNumber** * * Ensures that the number-like value for `T` is a negative number. * * **Related**: `Abs`, `InvertNumericSign` */ type AsNegativeNumber = T extends Zero ? T : T extends number ? AsNumber> extends number ? AsNumber> : never : T extends `${number}` ? Process$21 extends `${number}` ? Process$21 : never : never; //#endregion //#region src/numeric-literals/AsNumberWhenPossible.d.ts type Convert$3 = T extends `${number}` ? ToNumber : T; type ConvertTuple = T extends unknown[] ? { [K in keyof T]: Convert$3 } : never; type ConvertUnion = If, TupleToUnion>>, never>; /** * **AsNumberWhenPossible**`` * * Takes any value `T` and either returns `T` as an _identity value_ or where * it finds a string literal which can be converted to a number it will convert * it to that number value. * * - if an array of values is passed in then the values are iterated over and * the same process is applied to each. * - if the type of `T` is a _union type_ then any numeric string literal in the * literal values will be converted to a numeric literal but the return type will * still be a _union_. */ type AsNumberWhenPossible = If, ConvertUnion, T extends readonly unknown[] ? ConvertTuple : Convert$3>; //#endregion //#region src/numeric-literals/CharCount.d.ts /** * **CharCount**`` * * Provides the number of characters identified by `C` are present * in `T`. */ type CharCount = Or<[IsWideString, IsWideString]> extends true ? number : Length>; //#endregion //#region src/numeric-literals/CompareNumbers.d.ts interface SimpleCompareMap { 0: { 0: "equal"; 1: "less"; 2: "less"; 3: "less"; 4: "less"; 5: "less"; 6: "less"; 7: "less"; 8: "less"; 9: "less"; 10: "less"; }; 1: { 0: "greater"; 1: "equal"; 2: "less"; 3: "less"; 4: "less"; 5: "less"; 6: "less"; 7: "less"; 8: "less"; 9: "less"; 10: "less"; }; 2: { 0: "greater"; 1: "greater"; 2: "equal"; 3: "less"; 4: "less"; 5: "less"; 6: "less"; 7: "less"; 8: "less"; 9: "less"; 10: "less"; }; 3: { 0: "greater"; 1: "greater"; 2: "greater"; 3: "equal"; 4: "less"; 5: "less"; 6: "less"; 7: "less"; 8: "less"; 9: "less"; 10: "less"; }; 4: { 0: "greater"; 1: "greater"; 2: "greater"; 3: "greater"; 4: "equal"; 5: "less"; 6: "less"; 7: "less"; 8: "less"; 9: "less"; 10: "less"; }; 5: { 0: "greater"; 1: "greater"; 2: "greater"; 3: "greater"; 4: "greater"; 5: "equal"; 6: "less"; 7: "less"; 8: "less"; 9: "less"; 10: "less"; }; 6: { 0: "greater"; 1: "greater"; 2: "greater"; 3: "greater"; 4: "greater"; 5: "greater"; 6: "equal"; 7: "less"; 8: "less"; 9: "less"; 10: "less"; }; 7: { 0: "greater"; 1: "greater"; 2: "greater"; 3: "greater"; 4: "greater"; 5: "greater"; 6: "greater"; 7: "equal"; 8: "less"; 9: "less"; 10: "less"; }; 8: { 0: "greater"; 1: "greater"; 2: "greater"; 3: "greater"; 4: "greater"; 5: "greater"; 6: "greater"; 7: "greater"; 8: "equal"; 9: "less"; 10: "less"; }; 9: { 0: "greater"; 1: "greater"; 2: "greater"; 3: "greater"; 4: "greater"; 5: "greater"; 6: "greater"; 7: "greater"; 8: "greater"; 9: "equal"; 10: "less"; }; 10: { 0: "greater"; 1: "greater"; 2: "greater"; 3: "greater"; 4: "greater"; 5: "greater"; 6: "greater"; 7: "greater"; 8: "greater"; 9: "greater"; 10: "equal"; }; } /** * **CompareNumbers**`` * * Compares two numbers -- `A` and `B` -- and reports back * the numeric relationship `A` _has to_ `B`. * * - should handle _positive_ and _negative_ numbers * - should handle both _integer_ values and _decimal_ numbers * * Values are: * * - `equal` * - `greater` * - `less` * * ```ts * // "greater" * CompareNumbers<5,4> * ``` */ type CompareNumbers = A extends `${number}` ? CompareNumbers, AsNumber> : B extends `${number}` ? CompareNumbers, AsNumber> : number extends A ? "equal" | "greater" | "less" : number extends B ? "equal" | "greater" | "less" : A extends B ? "equal" : `${A}` extends `${B}` ? "equal" : `${A}` extends keyof SimpleCompareMap ? `${B}` extends keyof SimpleCompareMap[`${A}`] ? SimpleCompareMap[`${A}`][`${B}`] : ComplexCompare : ComplexCompare; type ComplexCompare = `${A}` extends `-${string}` ? `${B}` extends `-${string}` ? CompareNegative<`${A}`, `${B}`> : "less" : `${B}` extends `-${string}` ? "greater" : ComparePositive<`${A}`, `${B}`>; type CompareNegative = A extends `-${infer A_abs}` ? B extends `-${infer B_abs}` ? ComparePositive : never : never; type ComparePositive = A extends "0" ? B extends "0" ? "equal" : "less" : B extends "0" ? "greater" : ManualCompare; type ManualCompare = A extends `${string}.${string}` ? B extends `${string}.${string}` ? CompareDecimals : CompareDecimalToInteger : B extends `${string}.${string}` ? CompareIntegerToDecimal : CompareIntegers; type CompareDecimals = A extends `${infer A_int}.${infer A_dec}` ? B extends `${infer B_int}.${infer B_dec}` ? A_int extends B_int ? CompareDecimalParts : CompareIntegers : never : never; type CompareDecimalToInteger = A extends `${infer A_int}.${infer A_dec}` ? A_int extends B ? A_dec extends "0" | "00" | "000" | "0000" | "00000" ? "equal" : "greater" : CompareIntegers : never; type CompareIntegerToDecimal = B extends `${infer B_int}.${infer B_dec}` ? A extends B_int ? B_dec extends "0" | "00" | "000" | "0000" | "00000" ? "equal" : "less" : CompareIntegers : never; type CompareDecimalParts = CompareDecimalPartsWithDepth; type CompareDecimalPartsWithDepth = Depth["length"] extends 32 ? "equal" | "greater" | "less" : A extends B ? "equal" : A extends `${infer A_first}${infer A_rest}` ? B extends `${infer B_first}${infer B_rest}` ? A_first extends B_first ? CompareDecimalPartsWithDepth : CompareDigit$1 : A extends `${string}${string}${string}${string}${string}${string}` ? "greater" : CompareDecimalPartsWithDepth : B extends `${string}${string}${string}${string}${string}${string}` ? "less" : CompareDecimalPartsWithDepth<`${A}0`, B, [unknown, ...Depth]>; type CompareDigit$1 = A extends "0" ? B extends "0" ? "equal" : "less" : A extends "1" ? B extends "0" ? "greater" : B extends "1" ? "equal" : "less" : A extends "2" ? B extends "0" | "1" ? "greater" : B extends "2" ? "equal" : "less" : A extends "3" ? B extends "0" | "1" | "2" ? "greater" : B extends "3" ? "equal" : "less" : A extends "4" ? B extends "0" | "1" | "2" | "3" ? "greater" : B extends "4" ? "equal" : "less" : A extends "5" ? B extends "0" | "1" | "2" | "3" | "4" ? "greater" : B extends "5" ? "equal" : "less" : A extends "6" ? B extends "0" | "1" | "2" | "3" | "4" | "5" ? "greater" : B extends "6" ? "equal" : "less" : A extends "7" ? B extends "0" | "1" | "2" | "3" | "4" | "5" | "6" ? "greater" : B extends "7" ? "equal" : "less" : A extends "8" ? B extends "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" ? "greater" : B extends "8" ? "equal" : "less" : A extends "9" ? B extends "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" ? "greater" : "equal" : never; type CompareIntegers = A extends B ? "equal" : LengthBasedCompare; type LengthBasedCompare = GetStringLength extends GetStringLength ? CompareSameLength : GetStringLength extends infer LA ? GetStringLength extends infer LB ? LA extends number ? LB extends number ? SimpleNumberCompare : never : never : never : never; type GetStringLength = T extends `${any}${any}${any}${any}${any}${any}${any}${any}${any}${any}` ? 10 : T extends `${any}${any}${any}${any}${any}${any}${any}${any}${any}` ? 9 : T extends `${any}${any}${any}${any}${any}${any}${any}${any}` ? 8 : T extends `${any}${any}${any}${any}${any}${any}${any}` ? 7 : T extends `${any}${any}${any}${any}${any}${any}` ? 6 : T extends `${any}${any}${any}${any}${any}` ? 5 : T extends `${any}${any}${any}${any}` ? 4 : T extends `${any}${any}${any}` ? 3 : T extends `${any}${any}` ? 2 : 1; type SimpleNumberCompare = A extends 1 ? B extends 1 ? "equal" : "less" : A extends 2 ? B extends 1 ? "greater" : B extends 2 ? "equal" : "less" : A extends 3 ? B extends 1 | 2 ? "greater" : B extends 3 ? "equal" : "less" : A extends 4 ? B extends 1 | 2 | 3 ? "greater" : B extends 4 ? "equal" : "less" : A extends 5 ? B extends 1 | 2 | 3 | 4 ? "greater" : B extends 5 ? "equal" : "less" : A extends 6 ? B extends 1 | 2 | 3 | 4 | 5 ? "greater" : B extends 6 ? "equal" : "less" : A extends 7 ? B extends 1 | 2 | 3 | 4 | 5 | 6 ? "greater" : B extends 7 ? "equal" : "less" : A extends 8 ? B extends 1 | 2 | 3 | 4 | 5 | 6 | 7 ? "greater" : B extends 8 ? "equal" : "less" : A extends 9 ? B extends 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 ? "greater" : B extends 9 ? "equal" : "less" : A extends 10 ? B extends 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 ? "greater" : B extends 10 ? "equal" : "less" : "equal"; type CompareSameLength = CompareSameLengthWithDepth; type CompareSameLengthWithDepth = Depth["length"] extends 32 ? "equal" | "greater" | "less" : A extends `${infer A_first}${infer A_rest}` ? B extends `${infer B_first}${infer B_rest}` ? A_first extends B_first ? CompareSameLengthWithDepth : CompareDigit$1 : never : "equal"; //#endregion //#region src/numeric-literals/CSV.d.ts type Tighten = T extends ` ${infer Rest extends string}` ? T extends ` ${infer Double extends string}` ? Double : Rest : T; type Process$20 = Depth["length"] extends 64 ? readonly (string | number)[] : T extends `${infer Element},${infer Rest}` ? Process$20 extends NumberLike ? AsNumber> : Tighten], [unknown, ...Depth]> : [...Result, Tighten extends NumberLike ? AsNumber> : Tighten]; type ProcessJsonTuple = Depth["length"] extends 64 ? readonly unknown[] : T extends `${infer Element},${infer Rest}` ? ProcessJsonTuple extends NumberLike ? AsNumber> : If, "true">, true, If, "false">, false, Tighten<`"${Element}"`>>>], [unknown, ...Depth]> : [...Result, Tighten extends NumberLike ? AsNumber> : If, "true">, true, If, "false">, false, Tighten<`"${T}"`>>>]; type ProcessStr = Depth["length"] extends 64 ? readonly string[] : T extends `${infer Element},${infer Rest}` ? ProcessStr], [unknown, ...Depth]> : [...Result, Tighten]; type ProcessUnion$1 = Depth["length"] extends 64 ? Result | string | number : T extends `${infer Element},${infer Rest}` ? ProcessUnion$1 extends NumberLike ? Result | AsNumber> : Result | Tighten, [unknown, ...Depth]> : Tighten extends NumberLike ? Result | AsNumber> : Result | Tighten; type ProcessUnionStr = Depth["length"] extends 64 ? Result | string : T extends `${infer Element},${infer Rest}` ? ProcessUnionStr, [unknown, ...Depth]> : Result | Tighten; /** * **CsvToTuple**`` * * Converts a CSV string into a tuple with both numbers * and string literals extracted. * * **Related:** `CsvToTupleStr`, `CsvToUnion` */ type CsvToTuple = string extends T ? (string | number)[] : Process$20; /** * **CsvToTupleStr**`` * * Converts a CSV string into a tuple of string literals. * * **Related:** `CsvToTuple` */ type CsvToTupleStr = string extends T ? string[] : ProcessStr; /** * **CsvToUnion**`` * * Converts a CSV string into a union of string and/or numeric literals. * * **Related:** `CsvToTuple`, `CsvToStrUnion` */ type CsvToUnion = string extends T ? string | number : ProcessUnion$1; /** * **CsvToStrUnion**`` * * Converts a CSV string into a union of string literals. * * **Related:** `CsvToTuple`, `CsvToUnion` */ type CsvToStrUnion = ProcessUnionStr; /** * **CsvToTuple**`` * * Converts a CSV string into a tuple with both numbers * and string literals but for the string literals it ensures * -- just like you find with JSON strings -- that there are * explicit double quotes around the string. * * **Related:** `CsvToTuple`, `CsvToTupleStr`, `CsvToUnion` */ type CsvToJsonTuple = ProcessJsonTuple; //#endregion //#region src/numeric-literals/Decrement.d.ts type DecrementDigit$1 = T extends "0" ? { digit: "9"; borrow: true; } : T extends "1" ? { digit: "0"; borrow: false; } : T extends "2" ? { digit: "1"; borrow: false; } : T extends "3" ? { digit: "2"; borrow: false; } : T extends "4" ? { digit: "3"; borrow: false; } : T extends "5" ? { digit: "4"; borrow: false; } : T extends "6" ? { digit: "5"; borrow: false; } : T extends "7" ? { digit: "6"; borrow: false; } : T extends "8" ? { digit: "7"; borrow: false; } : T extends "9" ? { digit: "8"; borrow: false; } : never; type StripLeadingZeros = T extends "0" ? "0" : T extends `0${infer Rest}` ? StripLeadingZeros : T extends "" ? "0" : T; type DecrementString = Depth["length"] extends 32 ? `${number}` : T extends "0" | "" ? "0" : T extends `${infer Rest}${NumericChar}` ? T extends `${Rest}${infer Digit extends NumericChar}` ? DecrementDigit$1 extends { digit: infer Next extends string; borrow: infer Borrow extends boolean; } ? Borrow extends true ? Rest extends "" ? "0" : DecrementString : StripLeadingZeros<`${Rest}${Next}${Acc}`> : never : never : never; /** * **Decrement**`` * * Allows a number -- or a string literal of a number -- to be _decremented_ * by one. * * - Once reaching zero the Decrement utility will stay at 0 */ type Decrement = number extends T ? number : T extends number ? `${T}` extends `${string}.${string}` | `-${string}` ? number : AsNumber> : T extends `${number}` ? string extends T ? `${number}` : T extends `${string}.${string}` | `-${string}` ? `${number}` : DecrementString : never; //#endregion //#region src/numeric-literals/Delta.d.ts type Evaluate = If, If, Abs>, Subtract, Abs>, Subtract, Abs>>, Add, Abs>>; /** * **Delta**`` * * Provides the _delta_ between two numbers (including * between negative numbers). */ type Delta$1 = A extends number ? B extends number ? Evaluate<`${A}`, `${B}`> extends `${infer Num extends number}` ? Num : never : B extends `${number}` ? Evaluate<`${A}`, B> extends `${infer Num extends number}` ? Num : never : never : A extends `${number}` ? B extends `${number}` ? Evaluate : B extends number ? Evaluate : never : never; type AsLit = T extends `${number}` ? T : T extends number ? `${T}` : never; type ProcessNeg = Delta$1 extends `${infer Num extends number}` ? StartsWith extends true ? `${Num}` : `-${Num}` : never; type NegDelta = A extends number ? ParseInt, AsLit>> : ProcessNeg, AsLit>; type DeltaLight = Or<[IsWideType, IsWideType]> extends true ? number : Or<[IsNegativeNumber, IsNegativeNumber]> extends true ? Err<`invalid-type/negative`, `The DeltaLight utility does not work with negative numbers! Use Delta if you need that`, { a: A; b: B; }> : CompareNumbers extends infer Comparison ? Comparison extends "greater" ? Subtract : Comparison extends "less" ? Subtract : 0 : never; //#endregion //#region src/numeric-literals/Digit.d.ts /** * **Digit** * * A single numeric digit. * * **Related:** `NumericChar` */ type Digit$1 = typeof NUMERIC_DIGIT$1[number]; //#endregion //#region src/numeric-literals/Digitize.d.ts type Pos = ["+", T extends string ? Chars : ToNumericArray>]; type Neg = ["-", T extends string ? Chars : ToNumericArray>]; /** * **Digitize**`` * * Takes a literal value of a number -- either a numeric literal or a string literal * is accepted -- and converts into a tuple: `[ NumericSign, Digits[] ]` * ```ts * // ["+", readonly [1,2,3] ] * type N = Digitize<123>; * // ["-", readonly ["1","2","3"] ] * type S = Digitize<"-123">; * ``` */ type Digitize = Or<[IsEqual, IsEqual]> extends true ? [sign: NumericSign, digits: T extends string ? NumericChar[] : Digit$1[]] : `${T}` extends `-${infer Rest extends `${number}`}` ? Neg : `${T}` extends `${"+" | ""}${infer Rest extends `${number}`}` ? Pos : never; //#endregion //#region src/numeric-literals/DigitNonZero.d.ts /** * **DigitNonZero** * * A non-zero based digit (aka, 1-9). */ type DigitNonZero = Exclude; //#endregion //#region src/numeric-literals/Divide.d.ts type SmallInt$2 = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200; type Gte$1 = B extends [] ? true : Depth["length"] extends 128 ? boolean : A extends [] ? false : A extends [infer _, ...infer ATail] ? B extends [infer _, ...infer BTail] ? Gte$1 : never : never; type Sub$1 = B extends [] ? A : Depth["length"] extends 128 ? unknown[] : B extends [infer _, ...infer BTail] ? A extends [infer _, ...infer ATail] ? Sub$1 : never : never; type Div = Depth["length"] extends 128 ? unknown[] : Gte$1 extends true ? Div, B, [...Q, unknown], [unknown, ...Depth]> : Q; type Process$19 = FixedLengthArray> extends infer Dividend extends unknown[] ? FixedLengthArray> extends infer Divisor extends unknown[] ? Div : never : never; /** * **Divide** * * A type utility that will divide two integers. */ type Divide = number extends A ? number : number extends B ? number : And<[IsInteger, IsInteger]> extends true ? B extends 0 ? Err<"divide/division-by-zero", `The Divide<${A},${B}> type utility can not receive 0 as the divisor.`, { a: A; b: B; }> : Abs extends SmallInt$2 ? Abs extends SmallInt$2 ? Process$19, Abs> extends infer D extends readonly unknown[] ? Xor, IsNegativeNumber> extends true ? AsNegativeNumber : D["length"] : never : number : number : Err<`divide/non-integer`, `The Divide<${A},${B}> can only be used with integer values!`, { a: A; b: B; }>; //#endregion //#region src/numeric-literals/Even.d.ts /** * Even numbers to 100 */ type Even = 0 | 2 | 4 | 6 | 8 | 10 | 12 | 14 | 16 | 18 | 20 | 22 | 24 | 26 | 28 | 30 | 32 | 34 | 36 | 38 | 40 | 42 | 44 | 46 | 48 | 50 | 52 | 54 | 56 | 58 | 60 | 62 | 64 | 66 | 68 | 70 | 72 | 74 | 76 | 78 | 80 | 82 | 84 | 86 | 88 | 90 | 92 | 94 | 96 | 98 | 100; //#endregion //#region src/numeric-literals/GreaterThan.d.ts /** * **GreaterThan**`` * * Boolean operator which checks whether `A` is * _greater than_ `B`. * * **Related:** * - `IsGreaterThan` wraps this utility but allows `NumberLike` inputs * - `GreaterThanOrEqual`, `LessThan`, `LessThanOrEqual` */ type GreaterThan = number extends A ? boolean : number extends B ? boolean : [CompareNumbers] extends ["greater"] ? true : false; //#endregion //#region src/numeric-literals/GreaterThanOrEqual.d.ts /** * **GreaterThanOrEqual**`` * * Boolean operator which checks whether `A` is * _greater than_ or _equal to_ `B`. * * **Related:** * - `IsGreaterThanOrEqual` wraps this utility but allows `NumberLike` inputs * - `GreaterThanOrEqual`, `LessThan`, `LessThanOrEqual` */ type GreaterThanOrEqual = number extends A ? boolean : number extends B ? boolean : CompareNumbers extends "greater" ? true : A extends B ? true : false; //#endregion //#region src/numeric-literals/Increment.d.ts type IncrementDigit = T extends "0" ? { digit: "1"; carry: false; } : T extends "1" ? { digit: "2"; carry: false; } : T extends "2" ? { digit: "3"; carry: false; } : T extends "3" ? { digit: "4"; carry: false; } : T extends "4" ? { digit: "5"; carry: false; } : T extends "5" ? { digit: "6"; carry: false; } : T extends "6" ? { digit: "7"; carry: false; } : T extends "7" ? { digit: "8"; carry: false; } : T extends "8" ? { digit: "9"; carry: false; } : T extends "9" ? { digit: "0"; carry: true; } : never; type IncrementString = Depth["length"] extends 32 ? `${number}` : T extends `${infer Rest}${NumericChar}` ? T extends `${Rest}${infer Digit extends NumericChar}` ? IncrementDigit extends { digit: infer Next extends string; carry: infer Carry extends boolean; } ? Carry extends true ? IncrementString : `${Rest}${Next}${Acc}` : never : never : `1${Acc}`; /** * **Increment**`` * * Allows a number -- or a string literal of a number -- to be _incremented_ * by one. * ```ts * // 2 * type T = Increment<1>; * // "2" * type T = Increment<"1">; * ``` */ type Increment = number extends T ? number : T extends number ? `${T}` extends `${string}.${string}` | `-${string}` ? number : AsNumber> : T extends `${number}` ? string extends T ? `${number}` : T extends `${string}.${string}` | `-${string}` ? `${number}` : IncrementString : never; //#endregion //#region src/numeric-literals/Integer.d.ts interface IntegerBrand { __brand: "integer"; } /** * **Integer** * * Represents an integer in the type system while the poor * old runtime just sees a number. * * **Related:** `toInteger()`, `isInteger()` */ type Integer = number & IntegerBrand; //#endregion //#region src/numeric-literals/InvertNumericSign.d.ts /** * **InvertNumericSign**`` * * Inverts the numeric symbol of the value `T` passed in (aka, negative numbers become * positive and visa versa). */ type InvertNumericSign = IsNegativeNumber extends true ? Abs : AsNegativeNumber; //#endregion //#region src/numeric-literals/IsBetween.d.ts /** * **IsBetweenExclusively**`` * * Boolean operator which determines whether `TVal` is * * - greater than `TMin` * - and less than `TMax` * * **Related:** `IsBetweenInclusively` */ type IsBetweenExclusively = Or<[IsWideType, IsWideType, IsWideType]> extends true ? boolean : And<[IsGreaterThan, IsLessThan]>; /** * **IsBetweenInclusively**`` * * Boolean operator which determines whether `TVal` is * * - greater than _or equal to_ `TMin` * - and less than _or equal to_ `TMax` * * **Related:** `IsBetweenExclusively` */ type IsBetweenInclusively = string extends TVal ? boolean : string extends TMin ? boolean : string extends TMax ? boolean : number extends TVal ? boolean : number extends TMin ? boolean : number extends TMax ? boolean : IsGreaterThanOrEqual extends true ? IsLessThanOrEqual extends true ? true : false : false; //#endregion //#region src/numeric-literals/Length.d.ts /** * Utility type which returns the length of: * * - an _array_ (provides the number of elements) * - an _object_ (provides the number of keys) * - a _string_ (provides the number of chars) * - a _number_ (it will provide the number of digits, excluding `-` and/or `.` if present) * * ```ts * type Three = Length<[ "a", "b", "c" ]>; * type AlsoThree = Length<"abc">; * ``` * * #### Note: * * - any _wide type_ by default returns the wide `number` type * - if you'd prefer to an error returned, set `U` to true and * an error of the type/subtype `invalid-type/wide` */ type Length = [IsAny] extends [true] ? IsFalse extends true ? number : Err<`invalid-type/wide`> : number extends T ? IsFalse extends true ? number : Err<`invalid-type/wide`> : T extends number ? StripChars<`${T}`, "." | "-"> extends infer Numeric extends string ? Length : never : T extends string ? string extends T ? IsFalse extends true ? number : Err<`invalid-type/wide`> : StringLength : T extends readonly unknown[] ? number extends T["length"] ? IsFalse extends true ? number : Err<`invalid-type/wide`> : T["length"] extends number ? T["length"] : IsFalse extends true ? number : Err<`invalid-type/wide`> : never; type RequiredPrefixLength = T extends readonly [infer _First, ...infer Rest] ? RequiredPrefixLength : Count["length"]; /** * **MinLength**`` * * Determines what the _minimum_ length a given type has. * * ```ts * // 0 * type Zero = MinLength<[...readonly string[]]>; * // 1 * type One = MinLength<[string, ...readonly string[]]>; * ``` * * **Related:** `Length`, `MaxLength`, `TupleMeta` */ type MinLength = IsNumericLiteral> extends true ? As$1> extends true ? UnionToTuple> extends readonly number[] ? Min$1>> : never : Length, number> : As$1 : 0, number>; type MaxUnion = T extends readonly number[] ? Max$1 : never; /** * **MaxLength**`` * * Determines the _maximum_ length that a given tuple can be at runtime. * * - when the tuple has a _variatic_ type in the last position it's length is * not known and this utility will report `number` instead of a numeric literal * * ```ts * // 1 * type One = MaxLength<[string]>; * // 2 * type Two = MaxLength<[string, number?]>; * // number * type Infinite = MaxLength<[string, ...string[]]>; * ``` * * **Related:** `Length`, `MinLength`, `TupleMeta` */ type MaxLength = number extends T["length"] ? number : IsUnion extends true ? MaxUnion> : T["length"]; //#endregion //#region src/numeric-literals/LessThan.d.ts /** * **LessThan**`` * * Boolean operator which checks whether `A` is * _less than_ `B`. * * - Note: this solution is cheap and cheerful and doesn't * try to address negative numbers or other edge cases */ type LessThan = number extends A ? boolean : number extends B ? boolean : CompareNumbers extends "less" ? true : false; //#endregion //#region src/numeric-literals/LessThanOrEqual.d.ts /** * **LessThanOrEqual**`` * * Boolean operator which checks whether `A` is * _less than_ `B`. * * - Note: this solution is cheap and cheerful and doesn't * try to address negative numbers or other edge cases */ type LessThanOrEqual = number extends A ? boolean : number extends B ? boolean : CompareNumbers extends "less" ? true : CompareNumbers extends "equal" ? true : false; //#endregion //#region src/numeric-literals/Max.d.ts type Process$18 = T extends [infer Head extends number, ...infer Rest extends readonly number[]] ? M extends number ? IsGreaterThan extends true ? Process$18 : Process$18 : Process$18 : M extends number ? M : undefined; /** * **Max**`` * * Provides the _maximum_ value provided in a numeric tuple. */ type Max$1 = [T] extends [number] ? [IsUnion] extends [true] ? [UnionToTuple] extends [readonly number[]] ? Max$1> : never : T : T extends readonly number[] ? Process$18 : never; //#endregion //#region src/numeric-literals/MaxSafeInteger.d.ts /** * The largest safe integer value for Javascript's `number` type * (the `bigint` type can represent far larger numbers). */ type MaxSafeInteger = 9007199254740991; //#endregion //#region src/numeric-literals/Min.d.ts type Process$17 = T extends [infer Head extends number, ...infer Rest extends readonly number[]] ? M extends number ? IsLessThan extends true ? Process$17 : Process$17 : Process$17 : M extends number ? M : undefined; /** * **Min**`` * * Provides the _maximum_ value provided in a numeric array * or union. * * ```ts * // 1 * type Arr = Min<[1,2,3]>; * // 1 * type Arr = Min<1|2|3>; * ``` * * **Related:** `Max`, `Sum` */ type Min$1 = [T] extends [number] ? [IsUnion] extends [true] ? [UnionToTuple] extends [readonly number[]] ? Min$1> : never : T : T extends readonly number[] ? Process$17 : never; //#endregion //#region src/numeric-literals/Mod.d.ts type SmallInt$1 = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200; type Gte = B extends [] ? true : Depth["length"] extends 128 ? boolean : A extends [] ? false : A extends [infer _, ...infer ATail] ? B extends [infer _, ...infer BTail] ? Gte : never : never; type Sub = B extends [] ? A : Depth["length"] extends 128 ? unknown[] : B extends [infer _, ...infer BTail] ? A extends [infer _, ...infer ATail] ? Sub : never : never; type Modulus = Depth["length"] extends 128 ? unknown[] : Gte extends true ? Modulus, B, [unknown, ...Depth]> : A; type Process$16 = FixedLengthArray> extends infer Dividend extends unknown[] ? FixedLengthArray> extends infer Divisor extends unknown[] ? Modulus : never : never; /** * **Mod**`` * * A type utility which provides the _remainder_ (aka., **modulus**) of * a division of two integers. */ type Mod = A extends `${number}` ? Mod, AsNumber> : B extends `${number}` ? Mod> : number extends A ? number : number extends B ? number : And<[IsInteger, IsInteger]> extends true ? B extends 0 ? Err<"mod/division-by-zero", `The Mod<${A},${B}> type utility can not receive 0 as the divisor.`, { a: A; b: B; }> : Abs> extends SmallInt$1 ? Abs> extends SmallInt$1 ? Process$16>, Abs>> extends infer M extends unknown[] ? M["length"] : never : number : number : Err<`mod/non-integer`, `The Divide<${A},${B}> can only be used with integer values!`, { a: A; b: B; }>; //#endregion //#region src/numeric-literals/Multiply.d.ts type SmallInt = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200; type IsZero = AsNumber extends 0 ? true : false; type MultiplyTuples = R extends readonly [] ? S["length"] : Depth["length"] extends 64 ? number : R extends readonly [unknown, ...infer Rest extends readonly unknown[]] ? MultiplyTuples : number; type Process$15 = FixedLengthArray extends infer U extends readonly unknown[] ? FixedLengthArray extends infer R extends readonly unknown[] ? MultiplyTuples : never : never; /** * **Multiply**`` * * Multiplies two numbers together. Note, that these numbers must * be integers. */ type Multiply = Or<[IsZero, IsZero]> extends true ? 0 : number extends AsNumber ? number : number extends AsNumber ? number : AsNumber extends SmallInt ? AsNumber extends SmallInt ? Process$15, AsNumber> : number : number; //#endregion //#region src/numeric-literals/Negative.d.ts /** * **Negative**`` * * Ensures that the number represented by `T` is a _negative_ number. */ type Negative = T extends `${number}` ? T extends `-${string}` ? T : `-${T}` : T extends number ? `${T}` extends `-${string}` ? T : `-${T}` extends `${infer Neg extends number}` ? Neg : never : never; //#endregion //#region src/numeric-literals/NextDigit.d.ts /** * **NextDigit**`` * * Given a numeric digit, this utility provides the next numeric digit in sequence. * * - this includes the overflow condition of `9` -> `0` * - a string literal digit can be passed in as well and the next string literal * digit will be returned * ```ts * // 5 * type N = NextDigit<4>; * // "5" * type S = NextDigit<"4">; * ``` */ type NextDigit = T extends NumericChar ? T extends "0" ? "1" : T extends "1" ? "2" : T extends "2" ? "3" : T extends "3" ? "4" : T extends "4" ? "5" : T extends "5" ? "6" : T extends "6" ? "7" : T extends "7" ? "8" : T extends "8" ? "9" : T extends "9" ? "0" : never : T extends 0 ? 1 : T extends 1 ? 2 : T extends 2 ? 3 : T extends 3 ? 4 : T extends 4 ? 5 : T extends 5 ? 6 : T extends 6 ? 7 : T extends 7 ? 8 : T extends 8 ? 9 : T extends 9 ? 0 : never; //#endregion //#region src/numeric-literals/NumberLike.d.ts /** * **NumberLike** * * A type which represents a number whether it be a _number_ or * a string literal shaped as a number (aka, `${string}`). */ type NumberLike = number | `${number}`; //#endregion //#region src/numeric-literals/NumericRange.d.ts type Process$14 = C["length"] extends L ? R : Process$14; /** * **NumericRange**`` * * Creates a union type of numbers between `TLow` and `THigh` * * ```ts * // 2 | 3 | 4 | 5 | 6 | 7 * type Range = NumericRange<2,7>; * ``` */ type NumericRange = TLow | Exclude, Process$14>; //#endregion //#region src/numeric-literals/Precision.d.ts /** * Provides the number of digits _to the right of_ of the decimal * place. */ type Precision = number extends T ? number : Contains<`${T}`, "."> extends true ? StrLen> : 0; //#endregion //#region src/numeric-literals/PriorDigit.d.ts /** * **PriorDigit**`` * * Given a numeric digit, this utility provides the next numeric digit in sequence. * * - this includes the overflow condition of `0` -> `9` * - a string literal digit can be passed in as well and the next string literal * digit will be returned * ```ts * // 4 * type N = PriorDigit<5>; * // "4" * type S = PriorDigit<"5">; * ``` */ type PriorDigit = T extends NumericChar ? T extends "0" ? "9" : T extends "1" ? "0" : T extends "2" ? "1" : T extends "3" ? "2" : T extends "4" ? "3" : T extends "5" ? "4" : T extends "6" ? "5" : T extends "7" ? "6" : T extends "8" ? "7" : T extends "9" ? "8" : never : T extends 0 ? 9 : T extends 1 ? 0 : T extends 2 ? 1 : T extends 3 ? 2 : T extends 4 ? 3 : T extends 5 ? 4 : T extends 6 ? 5 : T extends 7 ? 6 : T extends 8 ? 7 : T extends 9 ? 8 : never; //#endregion //#region src/numeric-literals/ShiftDecimalPlace.d.ts type AppendZeros = N extends 0 ? "" : N extends 1 ? "0" : N extends 2 ? "00" : N extends 3 ? "000" : N extends 4 ? "0000" : N extends 5 ? "00000" : N extends 6 ? "000000" : N extends 7 ? "0000000" : N extends 8 ? "00000000" : string; type PrependZeros = N extends 0 ? "" : N extends 1 ? "0" : N extends 2 ? "00" : N extends 3 ? "000" : string; type MultiplyBy10Power = U extends 0 ? T : Contains extends true ? Split extends [infer Left extends string, infer Right extends string] ? `${Left}${Right}` : T : `${T}${AppendZeros}`; type DivideBy10Power = U extends 0 ? T : Contains extends true ? T : U extends 1 ? T extends `${infer First}${infer Rest}` ? Rest extends "" ? `0.${First}` : `${First}.${Rest}` : `0.${T}` : U extends 2 ? T extends `${infer A}${infer B}${infer Rest}` ? Rest extends "" ? `0.${A}${B}` : `${A}.${B}${Rest}` : T extends `${infer Single}` ? `0.0${Single}` : `0.0${T}` : U extends 3 ? T extends `${infer A}${infer B}${infer C}${infer Rest}` ? Rest extends "" ? `0.${A}${B}${C}` : `${A}.${B}${C}${Rest}` : `0.00${T}` : `0.${PrependZeros}${T}`; /** * **ShiftDecimalPlace**`` * * Shift a number's decimal place left or right based on the numeric * value of `U`. * * - a _positive_ value in `U` shifts the decimal place to the right * (in effect _multiplying_ by a factor of 10) * - a _negative_ value in `U` shifts the decimal place to the left * (in effect _dividing_ by a factor of 10) * * If `T` or `U` are a wide type then this utility will return the * appropriate wide response but when literals are passed in you * should always get a literal `NumberLike` value back. * * ```ts * // 12345 * type IntValue = ShiftDecimalPlace<"123.45", 2>; * ``` */ type ShiftDecimalPlace = number extends T ? number : `${number}` extends T ? `${number}` : U extends 0 ? T : T extends 0 ? T : number extends U ? `${number}` : IsNegativeNumber extends true ? T extends number ? `${T}` extends `${number}.${number}` ? number : IsNumericLiteral extends true ? AsNumber>> : number : DivideBy10Power, Abs> : T extends number ? `${T}` extends `${number}.${number}` ? number : IsNumericLiteral extends true ? AsNumber> : number : MultiplyBy10Power, U>; //#endregion //#region src/numeric-literals/Subtract.d.ts type DecrementDigit = digit extends "0" ? "9" : digit extends "1" ? "0" : digit extends "2" ? "1" : digit extends "3" ? "2" : digit extends "4" ? "3" : digit extends "5" ? "4" : digit extends "6" ? "5" : digit extends "7" ? "6" : digit extends "8" ? "7" : digit extends "9" ? "8" : never; interface SingleDigitSubResult { result: result; borrow: borrow; } type SubtractSingleDigits = borrowIn extends true ? left extends "0" ? SubtractSingleDigitsNoBorrow<"9", right> extends SingleDigitSubResult ? { result: R; borrow: true; } : never : SubtractSingleDigits, right, false> : right extends "0" ? { result: left; borrow: false; } : CompareDigit extends "less" ? SubtractWithBorrow : SubtractNoBorrow; type SubtractSingleDigitsNoBorrow = right extends "0" ? { result: left; borrow: false; } : CompareDigit extends "less" ? SubtractWithBorrow : SubtractNoBorrow; type CompareDigit = A extends "0" ? B extends "0" ? "equal" : "less" : A extends "1" ? B extends "0" ? "greater" : B extends "1" ? "equal" : "less" : A extends "2" ? B extends "0" | "1" ? "greater" : B extends "2" ? "equal" : "less" : A extends "3" ? B extends "0" | "1" | "2" ? "greater" : B extends "3" ? "equal" : "less" : A extends "4" ? B extends "0" | "1" | "2" | "3" ? "greater" : B extends "4" ? "equal" : "less" : A extends "5" ? B extends "0" | "1" | "2" | "3" | "4" ? "greater" : B extends "5" ? "equal" : "less" : A extends "6" ? B extends "0" | "1" | "2" | "3" | "4" | "5" ? "greater" : B extends "6" ? "equal" : "less" : A extends "7" ? B extends "0" | "1" | "2" | "3" | "4" | "5" | "6" ? "greater" : B extends "7" ? "equal" : "less" : A extends "8" ? B extends "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" ? "greater" : B extends "8" ? "equal" : "less" : A extends "9" ? B extends "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" ? "greater" : "equal" : never; type SubtractWithBorrow = left extends "0" ? right extends "1" ? { result: "9"; borrow: true; } : right extends "2" ? { result: "8"; borrow: true; } : right extends "3" ? { result: "7"; borrow: true; } : right extends "4" ? { result: "6"; borrow: true; } : right extends "5" ? { result: "5"; borrow: true; } : right extends "6" ? { result: "4"; borrow: true; } : right extends "7" ? { result: "3"; borrow: true; } : right extends "8" ? { result: "2"; borrow: true; } : right extends "9" ? { result: "1"; borrow: true; } : never : left extends "1" ? right extends "2" ? { result: "9"; borrow: true; } : right extends "3" ? { result: "8"; borrow: true; } : right extends "4" ? { result: "7"; borrow: true; } : right extends "5" ? { result: "6"; borrow: true; } : right extends "6" ? { result: "5"; borrow: true; } : right extends "7" ? { result: "4"; borrow: true; } : right extends "8" ? { result: "3"; borrow: true; } : right extends "9" ? { result: "2"; borrow: true; } : never : left extends "2" ? right extends "3" ? { result: "9"; borrow: true; } : right extends "4" ? { result: "8"; borrow: true; } : right extends "5" ? { result: "7"; borrow: true; } : right extends "6" ? { result: "6"; borrow: true; } : right extends "7" ? { result: "5"; borrow: true; } : right extends "8" ? { result: "4"; borrow: true; } : right extends "9" ? { result: "3"; borrow: true; } : never : left extends "3" ? right extends "4" ? { result: "9"; borrow: true; } : right extends "5" ? { result: "8"; borrow: true; } : right extends "6" ? { result: "7"; borrow: true; } : right extends "7" ? { result: "6"; borrow: true; } : right extends "8" ? { result: "5"; borrow: true; } : right extends "9" ? { result: "4"; borrow: true; } : never : left extends "4" ? right extends "5" ? { result: "9"; borrow: true; } : right extends "6" ? { result: "8"; borrow: true; } : right extends "7" ? { result: "7"; borrow: true; } : right extends "8" ? { result: "6"; borrow: true; } : right extends "9" ? { result: "5"; borrow: true; } : never : left extends "5" ? right extends "6" ? { result: "9"; borrow: true; } : right extends "7" ? { result: "8"; borrow: true; } : right extends "8" ? { result: "7"; borrow: true; } : right extends "9" ? { result: "6"; borrow: true; } : never : left extends "6" ? right extends "7" ? { result: "9"; borrow: true; } : right extends "8" ? { result: "8"; borrow: true; } : right extends "9" ? { result: "7"; borrow: true; } : never : left extends "7" ? right extends "8" ? { result: "9"; borrow: true; } : right extends "9" ? { result: "8"; borrow: true; } : never : left extends "8" ? right extends "9" ? { result: "9"; borrow: true; } : never : never; type SubtractNoBorrow = right extends "0" ? { result: left; borrow: false; } : left extends "1" ? right extends "1" ? { result: "0"; borrow: false; } : never : left extends "2" ? right extends "1" ? { result: "1"; borrow: false; } : right extends "2" ? { result: "0"; borrow: false; } : never : left extends "3" ? right extends "1" ? { result: "2"; borrow: false; } : right extends "2" ? { result: "1"; borrow: false; } : right extends "3" ? { result: "0"; borrow: false; } : never : left extends "4" ? right extends "1" ? { result: "3"; borrow: false; } : right extends "2" ? { result: "2"; borrow: false; } : right extends "3" ? { result: "1"; borrow: false; } : right extends "4" ? { result: "0"; borrow: false; } : never : left extends "5" ? right extends "1" ? { result: "4"; borrow: false; } : right extends "2" ? { result: "3"; borrow: false; } : right extends "3" ? { result: "2"; borrow: false; } : right extends "4" ? { result: "1"; borrow: false; } : right extends "5" ? { result: "0"; borrow: false; } : never : left extends "6" ? right extends "1" ? { result: "5"; borrow: false; } : right extends "2" ? { result: "4"; borrow: false; } : right extends "3" ? { result: "3"; borrow: false; } : right extends "4" ? { result: "2"; borrow: false; } : right extends "5" ? { result: "1"; borrow: false; } : right extends "6" ? { result: "0"; borrow: false; } : never : left extends "7" ? right extends "1" ? { result: "6"; borrow: false; } : right extends "2" ? { result: "5"; borrow: false; } : right extends "3" ? { result: "4"; borrow: false; } : right extends "4" ? { result: "3"; borrow: false; } : right extends "5" ? { result: "2"; borrow: false; } : right extends "6" ? { result: "1"; borrow: false; } : right extends "7" ? { result: "0"; borrow: false; } : never : left extends "8" ? right extends "1" ? { result: "7"; borrow: false; } : right extends "2" ? { result: "6"; borrow: false; } : right extends "3" ? { result: "5"; borrow: false; } : right extends "4" ? { result: "4"; borrow: false; } : right extends "5" ? { result: "3"; borrow: false; } : right extends "6" ? { result: "2"; borrow: false; } : right extends "7" ? { result: "1"; borrow: false; } : right extends "8" ? { result: "0"; borrow: false; } : never : left extends "9" ? right extends "1" ? { result: "8"; borrow: false; } : right extends "2" ? { result: "7"; borrow: false; } : right extends "3" ? { result: "6"; borrow: false; } : right extends "4" ? { result: "5"; borrow: false; } : right extends "5" ? { result: "4"; borrow: false; } : right extends "6" ? { result: "3"; borrow: false; } : right extends "7" ? { result: "2"; borrow: false; } : right extends "8" ? { result: "1"; borrow: false; } : right extends "9" ? { result: "0"; borrow: false; } : never : never; type RightMostDigit = s extends `${infer rest}${NumericChar}` ? s extends `${rest}${infer digit}` ? { rest: rest; digit: digit; } : never : never; type SubtractStrings = Depth["length"] extends 32 ? `${number}` : "" extends left ? "" extends right ? borrow extends true ? never : RemoveLeadingZeros : never : "" extends right ? RightMostDigit extends { rest: infer remainingLeft; digit: infer leftDigit; } ? leftDigit extends NumericChar ? SubtractSingleDigits extends SingleDigitSubResult ? SubtractStrings : never : never : never : RightMostDigit extends { rest: infer remainingLeft; digit: infer leftDigit; } ? RightMostDigit extends { rest: infer remainingRight; digit: infer rightDigit; } ? leftDigit extends NumericChar ? rightDigit extends NumericChar ? SubtractSingleDigits extends SingleDigitSubResult ? SubtractStrings : never : never : never : never : never; type RemoveLeadingZeros = s extends "0" ? "0" : s extends `0${infer rest}` ? RemoveLeadingZeros : s extends "" ? "0" : s; type Process$13 = A extends `-${infer AAbs extends `${number}`}` ? B extends `-${infer BAbs extends `${number}`}` ? CompareNumbers extends "less" ? SubtractStrings : SubtractStrings extends infer Result ? Result extends string ? Result extends "0" ? "0" : `-${Result}` : `${number}` : `${number}` : AddPositive extends infer Sum ? Sum extends number | `${number}` ? `-${Sum}` : `${number}` : `${number}` : B extends `-${infer BAbs extends `${number}`}` ? AddPositive extends infer Sum ? Sum extends number ? `${Sum}` : Sum extends `${number}` ? Sum : `${number}` : `${number}` : CompareNumbers extends "less" ? SubtractStrings extends infer Result ? Result extends string ? `-${Result}` : `${number}` : `${number}` : SubtractStrings; type CheckWide = IsWideType extends true ? true : IsWideType extends true ? true : false; type PreProcess$1 = CheckWide extends true ? IsString extends true ? `${number}` : IsString extends true ? `${number}` : number : A extends `${number}` ? B extends `${number}` ? Process$13 extends infer Result ? Result extends `${number}` ? Result : Result extends number ? `${Result}` : `${number}` : `${number}` : As$1}`>, `${number}`> : A extends number ? B extends number ? AsNumber> : AsNumber>> : never; /** * **Subtract**`` * * Subtracts the value of `B` _from_ `A`. * * Returns literal types when possible, handling both positive and negative results. * For mixed sign operations that would require addition, returns wide types. */ type Subtract = A extends number ? As$1, number> : A extends `${number}` ? As$1, `${number}`> : never; //#endregion //#region src/numeric-literals/Sum.d.ts type Count$1 = number extends T["length"] ? number : Depth["length"] extends 64 ? number : T extends readonly [] ? U : T extends readonly [infer Head extends NumberLike, ...(infer Rest extends NumberLike[])] ? IsNegativeNumber extends true ? Err<`invalid-number/negative`, `the Sum utility encountered a negative number; these are not support currently!`, { negative: Head; remaining: T; count: U; }> : Add extends infer Next extends NumberLike ? Count$1, [unknown, ...Depth]> : never : U; /** * **Sum**`` * * Sums a tuple of positive numbers * */ type Sum$1 = Count$1; //#endregion //#region src/numeric-literals/ToInteger.d.ts type ToIntegerOp = "truncate" | "round"; type Truncate$1 = T extends `${number}.${number}` ? T extends `${infer Q}.${number}` ? Q & `${number}` : never : T; type Round = T extends `${number}.${number}` ? T extends `${infer Q}.${infer D}${number}` ? If, Q & `${number}`, Increment> : never : T; type EnsureKind = TKind extends number ? ToNumber : TVal; /** * **ToInteger**`` * * Type utility which converts a _number_ (or numeric string * literal) to an _integer_ value. * * - the optional `TOp` generic provides methods for converting * a float to integer but the default is just to remove the * decimal value from the number (aka, "truncate"). */ type ToInteger = TOp extends "truncate" ? EnsureKind> : EnsureKind>; //#endregion //#region src/numeric-literals/ToNumericArray.d.ts type _Convert$1 = IsNonEmptyContainer extends true ? { [K in keyof TInput]: ToNumber } : number[]; /** * **ToNumericArray**`` * * Utility which accepts an array of numeric values _or_ a numeric * string literal and ensures that each element is made into a numeric value. * * - wide `number` types are fine and will be preserved as such * - numeric string literals will be converted to a narrow numeric type if * possible */ type ToNumericArray = IsReadonlyArray extends true ? Readonly<_Convert$1> : _Convert$1; //#endregion //#region src/numeric-literals/Zero.d.ts /** * **Zero** * * A representation of **zero**; either as the number zero or * the string literal equivalent. */ type Zero = 0 | `0`; //#endregion //#region src/datetime/AsRelativeDate.d.ts /** * Lookup the number of days in the year prior to a given month * * @param Y - The year (needed to determine if it's a leap year) */ type Lookup$4 = IsLeapYear<`${Y}`> extends true ? { 1: 0; 2: 31; 3: 60; 4: 91; 5: 121; 6: 152; 7: 182; 8: 213; 9: 244; 10: 274; 11: 305; 12: 335; } & Record : { 1: 0; 2: 31; 3: 59; 4: 90; 5: 120; 6: 151; 7: 181; 8: 212; 9: 243; 10: 273; 11: 304; 12: 334; } & Record; /** * Returns the components needed to calculate a relative time. * * - the year is multiplied by 1000 (using decimal shift for efficiency) * - the month is passed into a lookup to arrive at the number * of _days_ of the given year which have passed at the start * of that month * - the date is just an integer value of the number _days_ which * have expired on the current month * * ### Formula * * ```ts * Relative = (Year * 1000) + Lookup + Date * ``` */ type Days$1 = AddPositive[M], D> extends number ? Concat<[Y, AddPositive[M], D>]> extends NumberLike ? Concat<[Y, AddPositive[M], D>]> : never : never; type FromMeta = AsNumber extends infer Year extends number ? AsNumber extends infer Month extends number ? AsNumber extends infer Date extends number ? Days$1 : Days$1 : Days$1 : never; type ParseRelativeInput = T extends ParsedDate ? T : ParseDate extends infer P ? P extends ParsedDate ? P : Err<"invalid-date"> : never; /** * **AsRelativeDate**`` * * Reduces a Date to a number which can be used * as an informal means of comparing dates relatively */ type AsRelativeDate> = P extends ParsedDate ? AsDateMeta

extends infer M ? M extends DateMeta ? FromMeta : never : never : P extends TypedError ? P : Err<"invalid-date/missing", `The AsRelativeDate type requires a ParsedDate with year, month, and date components, but one or more are missing.`, { parsed: T; }>; //#endregion //#region src/datetime/AsTwoDigitMonth.d.ts type IsTwoDigitMonthText = T extends `0${"1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9"}` ? true : T extends `1${"0" | "1" | "2"}` ? true : false; type BrandMonth = [IsTrue] extends [true] ? TwoDigitMonth> : T; type IsNumericMonthIndex$1 = T extends number ? number extends T ? false : IsInteger extends true ? IsBetweenInclusively : false : false; type ExtractMonth = [IsNumericMonthIndex$1] extends [true] ? PadStart, "0", 2> extends infer M extends string ? IsTwoDigitMonthText extends true ? BrandMonth : Err<"invalid-month/number", `The generic T in AsTwoDigitMonth was a number but when an attempt was made to convert it to a TwoDigitMonth format something went wrong. This should not happen.`, { T: T; utility: "AsTwoDigitMonth"; }> : Err<"invalid-month/number", `The generic T in AsTwoDigitMonth was a number but when an attempt was made to convert it to a TwoDigitMonth format something went wrong. This should not happen.`, { T: T; utility: "AsTwoDigitMonth"; }> : [T] extends [DateLike] ? [T] extends [number] ? [IsNegativeNumber] extends [true] ? Err<`invalid-month/negative`, `The generic T passed to AsTwoDigitMonth was an integer number but it was negative!`, { T: T; utility: "AsTwoDigitMonth"; }> : [IsFloat] extends [true] ? Err<`invalid-month/float`> : [IsTrue] extends [true] ? TwoDigitMonth<"branded"> : TwoDigitMonth : [ParseDate] extends [infer P] ? P extends ParsedDate ? [P[1]] extends [infer Month extends TwoDigitMonth] ? [IsTrue] extends [true] ? Month : Unbrand : Err<`invalid-month/missing`, `The type passed in as T to AsTwoDigitMonth was parsed as a date but the date type is a IsoYearMonth or IsoYear type and therefore has no month information!`, { T: T; utility: "AsTwoDigitMonth"; }> : Err<`invalid-month/parse`, `While trying to produce a TwoDigitMonth, T was unable to be parsed as a date!`, { utility: "AsTwoDigitMonth"; T: T; }> : never : Err<"invalid-month/type", `The type T passed into AsTwoDigitMonth was not date like!`, { T: T; }>; /** * **AsTwoDigitMonth**`` * * Converts `T` -- _so long as it's addressable date representation with month information * present_ -- into the two digit month format that is used in ISO Date/Datetime strings. * * - if `T` is not parsable to provide **month** information an Error will be returned * - when successful: * - a normal string literal which _extends_ `TwoDigitMonth<'normal'>` will be returned * - this means that it is guaranteed to ba a valid ISO TwoDigitMonth but it is not in * it's "branded" form. * - if you prefer for it to come back in it's branded form switch `B` to `true` */ type AsTwoDigitMonth = [number] extends [T] ? [IsTrue] extends [true] ? TwoDigitMonth<"branded"> | Error : TwoDigitMonth | Error : [string] extends [T] ? [IsTrue] extends [true] ? TwoDigitMonth<"branded"> | Error : TwoDigitMonth | Error : [T] extends [TwoDigitMonth] ? IsTrue extends true ? [IsBranded] extends [true] ? T : TwoDigitMonth : Unbrand : As$1, B>, TwoDigitMonth | Error>; //#endregion //#region src/datetime/DateLike.d.ts /** * **DateLike** * * Represents structural patterns that look like a type that is a **date**. * * - a _number_ is assumed to be a Unix Epoch timestamp * - the string literal format is meant to match * the [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) spec * "YYYY-MM-DD" format. * - and then we have look for objects which _look like_: * - **MomentJS**'s DateTime object * - **DateFns**'s DateTime object * - **Luxon**'s DateTime object * - **Javascript**'s Date object */ type DateLike = number | IsoYear<"weak"> | IsoYearMonth<"weak"> | IsoDate$1 | IsoDateTime | object; //#endregion //#region src/datetime/DateMeta.d.ts /** * a property of `DateMeta` */ type DateType = typeof DATE_TYPE$1[number]; /** * NOTE: * - This was meant to be the DateMetaNoFunctions type but with the * addition of a number of handy and type strong functions attached * but that blew up typescript complexity so for now we're back in * design for that. */ interface DateMeta { dateType: DateType; hasTime: boolean; year: FourDigitYear<"branded"> | null; month: TwoDigitMonth<"branded"> | null; date: TwoDigitDate<"branded"> | null; hour: TwoDigitHour<"branded"> | null; minute: TwoDigitMinute<"branded"> | null; second: TwoDigitSecond<"branded"> | null; ms: ThreeDigitMillisecond<"branded"> | null; timezone: TimezoneOffset<"branded"> | null; } //#endregion //#region src/datetime/DatePlus.d.ts type DateSource = "date" | "temporal" | "luxon" | "date-fns" | "moment" | "epoch" | "epoch-milliseconds" | "day.js" | "iso-date" | "iso-year" | "iso-year-month" | "iso-year-independent" | "iso-datetime"; /** * The JS Date object with a bit more metadata. * * ### Ignorance is Bliss * * - **epoch** timestamps DO NOT have any conception of an _originating_ * timezone * - the ever present **Date** object in Javascript also has zero * concept of an _originating_ timezone (in fact it really just stores * an _epoch_ in milliseconds for it's state) * * For these libraries, if you pass in an ISO DateTime string with * explicit timezone offsetting, the DateTime will be immediately * converted to UTC time and the local timezone provided in _originating_ * source is lost. * * The `Date` object confusingly provides a `.getTimezoneOffset()` property * but this has **nothing** to the originating source and just reporting * the number of minutes of the timezone offset of the computer making the * call. * * ### Patience Rewards those who Wait * * The **Temporal** library, and 3rd party libraries like **Luxon** and * **Day.js** (with the timezone plugin) are aware. * * ### This Library * * This library provides a lot of support for various object based date * formats. The `asDateTime()` will standardize all of it's * supported types to a Javascript Date with the extra properties in * this interface. * * This interface, exists to try to preserve the originating source's * timezone information where it's available by adding a few additional * properties. */ interface DatePlus = null | TimezoneOffset<"branded">, TSourceIso = null | IsoDateTime> extends Date { /** * The originating timezone offset if the originating has a conception * of the originating timezone. * * - `null` will be stored when the source is not timezone aware * - `string` will represent the timezone offset in the same manner * as ISO's `+HH:MM`, `-HH:MM`, or `Z` for UTC. */ offset: TOffset; /** * If a IANA Timezone is available from the source this will * be provided here. * * **Note:** this isn't fancy enough to actually account for * daylight savings, etc. Use a full timezone date library if you * need that. */ tz: null | IanaZone; /** * the originating source representation structure */ source: TSource; /** * If the originating `offset` was able to be captured, we'll * also capture a full ISO `DateTime` representation. */ sourceIso: TSourceIso; } //#endregion //#region src/datetime/DaysInMonth.d.ts type CalcFeb = IsUndefined extends true ? 28 : AsFourDigitYear extends infer Year ? Year extends string ? IsLeapYear extends true ? IsDoubleLeap extends true ? 30 : 29 : 28 : ParseDate extends infer P ? P extends ParsedDate ? P[0] extends infer ParsedYear extends FourDigitYear ? IsLeapYear> extends true ? IsDoubleLeap> extends true ? 30 : 29 : 28 : Err<`invalid-year/missing`, `The utility DaysInMonth was passed a value for Y and though it was parsed as a date, the year information was invalid!`, { T: T; utility: "DaysInMonth"; }> : Err<`invalid-year/parse`, `The utility DaysInMonth was passed a value for Y but it was unable to be parsed into a valid year!`, { T: T; utility: "DaysInMonth"; }> : never : ParseDate extends infer P ? P extends ParsedDate ? P[0] extends infer ParsedYear extends FourDigitYear ? IsLeapYear> extends true ? IsDoubleLeap> extends true ? 30 : 29 : 28 : Err<`invalid-year/missing`, `The utility DaysInMonth was passed a value for Y and though it was parsed as a date, the year information was invalid!`, { T: T; utility: "DaysInMonth"; }> : Err<`invalid-year/parse`, `The utility DaysInMonth was passed a value for Y but it was unable to be parsed into a valid year!`, { T: T; utility: "DaysInMonth"; }> : never; type Days = Unbrand extends "02" | 2 ? CalcFeb : AsTwoDigitMonth extends IsoDate30 ? 30 : 31; type DaysForMonthNumber = M extends 2 ? CalcFeb : M extends 4 | 6 | 9 | 11 ? 30 : 31; type IsNumericMonthIndex = T extends number ? number extends T ? false : IsInteger extends true ? IsBetweenInclusively : false : false; type DaysFromParsedDate = P extends ParsedDate ? P[1] extends infer Month extends TwoDigitMonth ? P[0] extends infer Year extends FourDigitYear ? Days, Unbrand> : Unbrand extends NumberLike ? Days, Unbrand> : Days> : Err<`invalid-month/missing`> : P extends Error ? Err<`invalid-month/parsing`, `The generic T passed to DaysInMonth was date-like but when parsing produced the following error: ${P["message"]}`, { T: T; utility: "DaysInMonth"; }> : Err<`invalid-month/parsing`, `The generic T passed to DaysInMonth was date-like but when parsing it did not produce a ParsedDate or an Error (this should not happen)!`, { T: T; utility: "DaysInMonth"; }>; /** * **DaysInMonth**`` * * Converts the month represented by `T` into the number days in the month. * * - Month Representation * - You can pass in a `DateLike` value for `T` and as long as it has a * month representation it will be used to calculate the days of the month * - You can also pass in a month name (e.g., "January", "February", etc.) * - You can also pass in a month abbreviation (e.g., "Jan", "Feb", etc.) * - You can also pass in a two digit month number (e.g., 01, 02, etc.) * - You can also pass in a numeric value between 1 and 12 * * - Leap Year (and double leap) * - if `T` has month and _year_ info then leap years and double leap years * will be considered for February. * - if `T` is missing _year_ info but `Y` (as a valid year) is provided then * leap and double leap will be considered as well * - in other situations leap year can not be calculated and therefore * February will always return 28. */ type DaysInMonth = As$1 extends true ? DaysInMonth, Y> : Err<`a`> : string extends T ? 28 | 29 | 30 | 31 | Error : T extends TwoDigitMonth ? Unbrand extends NumberLike ? Days, Unbrand> : Days> : T extends DateLike ? ParseDate extends infer P extends ParsedDate | Error ? DaysFromParsedDate, P> : Err<`invalid-month/parsing`, `The generic T passed to DaysInMonth was date-like but when parsing it did not produce a ParsedDate or an Error (this should not happen)!`, { T: T; utility: "DaysInMonth"; }> : T extends MonthName ? GetMonthNumber extends infer M extends number ? IsUnion extends true ? 28 | 29 | 30 | 31 : [Y] extends [undefined] ? DaysForMonthNumber : DaysForMonthNumber> : Err<`invalid-month/name`, `The generic T passed to DaysInMonth extends MonthName but GetMonthNumber was unable to convert it to a number! This should not happen.`, { T: T; utility: "DaysInMonth"; }> : T extends MonthAbbrev ? GetMonthNumber extends infer M extends number ? IsUnion extends true ? 28 | 29 | 30 | 31 : [Y] extends [undefined] ? DaysForMonthNumber : DaysForMonthNumber> : Err<`invalid-month/abbrev`, `The generic T passed to DaysInMonth extends MonthAbbrev but GetMonthNumber was unable to convert it to a number! This should not happen.`, { T: T; utility: "DaysInMonth"; }> : Err<`invalid-month/type`, `The generic T passed to DaysInMonth was not a type in which a month could be extracted!`, { T: T; utility: "DaysInMonth"; }>, number | Error>; //#endregion //#region src/datetime/DoubleLeap.d.ts /** * Modern "Double Leap" years (1400-2300) * * **Related:** `IsoModernDoubleLeap` */ type ModernDoubleLeap = typeof DOUBLE_LEAP_MODERN$1[number]; /** * Modern "Double Leap" years (1400-2300) as ISO strings * * **Related:** `ModernDoubleLeap` */ type IsoModernDoubleLeap = `${ModernDoubleLeap}`; //#endregion //#region src/datetime/Epoch.d.ts declare const __epochinms: unique symbol; /** * An Epoch timestamp in milliseconds * * - assumes dates after July 14th, 1970 to avoid conflict with * timestamps in seconds * - or any date if not _auto detected_ * * **Related:** `isEpochInMilliseconds()`, `isEpoch()` */ type EpochInMs = number & { [__epochinms]: "EpochInMs"; }; declare const __epochinseconds: unique symbol; /** * An Epoch timestamp in seconds * * - assumes dates before Jan 1st, 2500 to avoid conflict with timestamps * in milliseconds * - or any date if not _auto detected_ * * **Related:** `isEpochInSeconds()`, `isEpoch()` */ type EpochInSeconds = number & { [__epochinseconds]: "EpochInSeconds"; }; //#endregion //#region src/datetime/general.d.ts type Digit$7 = "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9"; type ValidTwoDigitMonth$1 = `0${Exclude}` | `1${"0" | "1" | "2"}`; type ValidTwoDigitDate$1 = `0${Exclude}` | `1${Digit$7}` | `2${Digit$7}` | `3${"0" | "1"}`; type ValidFourDigitYear = `${Digit$7}${Digit$7}${Digit$7}${Digit$7}`; /** * common characters used to separate date representations */ type DateSeparator = "-" | "/" | "."; /** * Valid ISO Dates for months with 30 days */ type IsoDate30 = typeof ISO_DATE_30$1[number]; /** * Valid ISO Dates for months with 31 days */ type IsoDate31 = typeof ISO_DATE_31$1[number]; type TwoDigitHour = T extends "weak" ? `${number}` : T extends "normal" ? `0${number}` | `1${number}` | `2${0 | 1 | 2 | 3}` : T extends "strong" ? `0${0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9}` | `1${0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9}` | `2${0 | 1 | 2 | 3}` : T extends "branded" ? Brand<`${number}`, "TwoDigitHour"> : T extends `${number}` ? T extends TwoDigitHour<"strong"> ? Brand : never : never; type TwoDigitMinute = T extends "weak" ? `${number}` : T extends "normal" ? `${0 | 1 | 2 | 3 | 4 | 5}${number}` : T extends "strong" ? `0${0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9}` | `1${0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9}` | `2${0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9}` | `3${0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9}` | `4${0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9}` | `5${0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9}` : T extends "branded" ? Brand<`${number}`, "TwoDigitMinute"> : T extends `${number}` ? T extends TwoDigitMinute<"strong"> ? Brand : never : never; type TwoDigitSecond = T extends "branded" ? Brand<`${number}`, "TwoDigitSecond"> : T extends "normal" ? `${NumericChar__ZeroToFive}${number}` & `${number}` : T extends "strong" ? `${NumericChar__ZeroToFive}${NumericChar}` & `${number}` : T extends `${number}` ? T extends TwoDigitSecond<"strong"> ? Brand : Err<`invalid-type/second`, `The type passed into 'TwoDigitSecond<${T}>' is not a valid two digit month!`, { second: T; }> : never; /** * **ThreeDigitMillisecond**`` * * A three digit number prefixed by `.` as found in ISO DateTime string * * - `strong` variant is _self-validating_ but requires a large union type * to achieve this * - `normal` variant provides a bit of guard rails, only allowing two or * more numeric characters and union type is reasonably constrained * - `weak` is just any numeric literal and is for times when your type * budget is low * - `branded` variant is for when another utility has _validated_ this * numeric string to be valid */ type ThreeDigitMillisecond = T extends "weak" ? `${number}` : T extends "normal" ? `${NumericChar}${number}` : T extends "strong" ? `${NumericChar}${NumericChar}${NumericChar}` : T extends "branded" ? Brand<`${number}`, "ThreeDigitMillisecond"> : T extends `${number}` ? T extends ThreeDigitMillisecond<"strong"> ? Brand : Err<`invalid-type/ms`, `The type passed into 'ThreeDigitMillisecond<${T}>' is not valid!`, { ms: T; }> : never; /** * **TwoDigitMonth**`` * * - uses the `normal` variant by default which provides self-validating * type structure to the month * - if you need to preserve type strength you can opt for `weak` variant * - if you've validated the month with another utility you can move back * to a relatively weak "type" which is "branded" */ type TwoDigitMonth = T extends "normal" ? ValidTwoDigitMonth$1 & `${number}` : T extends "weak" ? `${"0" | "1"}${number}` & `${number}` : T extends "branded" ? Brand<`${number}` & ValidTwoDigitMonth$1, "TwoDigitMonth"> : T extends `${number}` ? T extends ValidTwoDigitMonth$1 ? Brand : Err<`invalid-type/month`, `The type passed into 'TwoDigitMonth<${T}>' is not a valid two digit month!`, { month: T; }> : never; /** * a union of valid month numbers */ type MonthNumber = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12; /** * **TwoDigitDate**`` * * Provides a type shape for a two digit date found in ISO Date and DateTime strings. * * - the `normal` variant provides strong type support but is not _self-validating_ * - the `weak` variant keeps some guard rails and is useful when you need to be * judicious with type strength * - the `branded` variant is to be used when you have validated through another utility * that this date is valid; this means: * - valid in isolation (aka, a potentially valid number) * - valid based on month (aka, fits into the max number of days in the month) * - valid based on whether it's a leap year or not * - Note: the _branded_ variant is intentionally not super strong on "type" because * it's brand ensures other utilities will know it's validated. */ type TwoDigitDate = T extends "normal" ? ValidTwoDigitDate$1 : T extends "weak" ? `0${number}` | `1${number}` | `2${number}` | `3${number}` : T extends "branded" ? Brand<`${number}` & ValidTwoDigitDate$1, "TwoDigitDate"> : T extends `${number}` ? T extends ValidTwoDigitDate$1 ? Brand : Err<`invalid-type/date`, `The type passed into TwoDigitDate<${T}> is not valid!`, { dte: T; }> : never; /** * **MinimalDigitDate** * * Digit combinations for representing a month's date's * but only allowing single digit representation for dates * like 1, 2, 3, etc. * * **Related:** `TwoDigitDate`, `MonthDateDigit` */ type MinimalDigitDate = T extends "normal" ? NumericChar__NonZero | `1${0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9}` | `2${0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9}` | `3${0 | 1}` : `0${number}` | `1${number}` | `2${number}` | `3${number}`; type StDays = "1" | "21" | "31"; type NdDays = "2" | "22"; type RdDays = "3" | "23"; type ThDays = Exclude, StDays | NdDays | RdDays>; type MinimalDigitDate__Suffixed = `${StDays}st` | `${NdDays}nd` | `${RdDays}rd` | `${ThDays}th`; /** * **MonthDateDigit** * * Union type of a both two digit and single digit * representations of a month's date. * * **Related:** `TwoDigitDate`, `MinimalDigitDate` */ type MonthDateDigit = TwoDigitDate | NumericChar__NonZero; /** * **FourDigitYear**`<["weak"|"NORMAL"|"strong"|"branded"]>` * * Represents a four digit year in the type system. * * - it is intended to be able to represent _any_ four digit year * - it more opinionated in the years 1000-2999 as that's typically * what we're working with * - this type _will_ allow false positives and you'll need to use * runtime validation to get the `IsoYear` type which is a branded * type that indicates it has been validated. * * **Note:** * - by default we use a moderate strength pattern (aka, "normal") but you * can set this to "strong" and it will be more opinionated but be sure the * union type it creates doesn't overwhelm Typescript. * - if you need to simplify further you can opt for "weak" * - you may also opt for `branded` which indicates that it has been * validated to be `FourDigitYear<"strong">` but the typescript type * is reduced to just `${number}` * - if you use a numeric value for `T` it will will intersect `T` * with the branded type. */ type FourDigitYear = T extends "strong" ? (`${"1" | "2"}${NumericChar}${NumericChar}${NumericChar}` | `${"0" | "3" | "4" | "5" | "6" | "7" | "8" | "9"}${number}`) & `${number}` : T extends "normal" ? (`${"1" | "2"}${NumericChar}${number}` | `${"0" | "3" | "4" | "5" | "6" | "7" | "8" | "9"}${number}`) & `${number}` : T extends "weak" ? `${NumericChar}${number}` & `${number}` : T extends "branded" ? Brand<`${number}`, "FourDigitYear"> : T extends `${number}` ? T extends ValidFourDigitYear ? Brand : Err<`invalid-type/four-digit-year`, `The type passed into 'FourDigitYear<${T}>' is not a valid four digit year so a Branded type can not be produced!`, { year: T; }> : never; type TimeZoneExplicit = `Z` | `${"+" | "-"}${TwoDigitHour}` | `${"+" | "-"}${TwoDigitHour}:${number}`; /** * **TimezoneOffset**`<[strong | NORMAL | explicit | implicit | branded ]`> * * - “Z” * - “±hh” * - “±hhmm” * - “±hh:mm” * * **Note:** * - by default we use a moderate strength pattern (aka, "normal") but you * can set this to "strong" and it will be more opinionated but be sure the * union type it creates doesn't overwhelm Typescript. * - when `T` is set to "strong" then it is _self-validating_ (aka, all * valid variants allowed and zero invalid variants allowed) * - if you know that when the _minutes_ are provided the "explicit" format with * the ":" will be use you can get self-validating from `explicit` with a smaller * union type * - similarly if you KNOW the `implicit` format with minutes will be used you * can use `implicit` * - if you have validate this string using another utility you can opt for `branded` * which is equivalent to the "normal" type structure but other utilities will * respect the branded type as validated. */ type TimezoneOffset = T extends "normal" ? `Z` | `${"+" | "-"}${number}` | `${"+" | "-"}${number}${number}` | `${"+" | "-"}${number}:${number}` : T extends "strong" ? `Z` | `${"+" | "-"}${TwoDigitHour}` | `${"+" | "-"}${TwoDigitHour}${TwoDigitMinute}` | `${"+" | "-"}${TwoDigitHour}:${TwoDigitMinute}` : T extends "explicit" ? `Z` | `${"+" | "-"}${TwoDigitHour}` | `${"+" | "-"}${TwoDigitHour}:${TwoDigitMinute}` : T extends "implicit" ? `Z` | `${"+" | "-"}${TwoDigitHour}` | `${"+" | "-"}${TwoDigitHour}${TwoDigitMinute}` : T extends "branded" ? Brand<(`Z` | `${"+" | "-"}${number}` | `${"+" | "-"}${number}${number}` | `${"+" | "-"}${number}:${number}`), "TimezoneOffset"> : T extends `${"Z" | "+" | "-"}${string}` ? T extends TimezoneOffset<"strong"> ? Brand : never : never; //#endregion //#region src/datetime/GetMonth.d.ts /** * **GetMonthAbbrev**`` * * Takes any `DateLike` value and convert it into: * * - if possible a specific `MonthAbbrev` * - if not possible then the union type `MonthAbbrev` */ type GetMonthAbbrev = IsWideType extends true ? MonthAbbrev : T extends string ? [IsIsoYear] extends [true] ? `Jan` : ParseDate extends ParsedDate ? ParseDate["1"] extends keyof typeof MONTH_ABBR$1 ? typeof MONTH_ABBR$1[ParseDate["1"]] : MonthAbbrev : MonthAbbrev : MonthAbbrev; /** * **GetMonthName**`` * * Takes any `DateLike` value and convert it into: * * - if possible a specific `MonthName` * - if not possible then the union type `MonthName` */ type GetMonthName = IsWideType extends true ? MonthName : T extends string ? [IsIsoYear] extends [true] ? `Jan` : ParseDate extends ParsedDate ? ParseDate["1"] extends keyof typeof MONTH_NAME$1 ? typeof MONTH_NAME$1[ParseDate["1"]] : MonthName : MonthName : MonthName; type MonthNameLookup = typeof MONTH_NAME_LOOKUP$1; type MonthAbbrevLookup = typeof MONTH_ABBREV_LOOKUP$1; /** * **GetMonthNumber** * * Takes any `DateLike` value or a `DateName` or `DateAbbrev` and converts it into: * * - if the month information can be parsed from `T` then: * - if possible a numeric literal * - if the precise literal is not known then all of the valid month numbers will be * returned as a union type * - if `T` is not parsable or the Date which was provided no date information (e.g., * an `IsoYear`) then an error will be returned */ type ExtractMonthFromIsoDate = T extends `${infer _Year}-${infer Month}-${infer _Rest}` ? Month extends `01` ? 1 : Month extends `02` ? 2 : Month extends `03` ? 3 : Month extends `04` ? 4 : Month extends `05` ? 5 : Month extends `06` ? 6 : Month extends `07` ? 7 : Month extends `08` ? 8 : Month extends `09` ? 9 : Month extends `10` ? 10 : Month extends `11` ? 11 : Month extends `12` ? 12 : never : never; type MonthNumberFromTwoDigit = T extends "01" ? 1 : T extends "02" ? 2 : T extends "03" ? 3 : T extends "04" ? 4 : T extends "05" ? 5 : T extends "06" ? 6 : T extends "07" ? 7 : T extends "08" ? 8 : T extends "09" ? 9 : T extends "10" ? 10 : T extends "11" ? 11 : T extends "12" ? 12 : never; type GetMonthNumberFromParsed

= P extends ParsedDate ? [P[1]] extends [null] ? Err<`month-number/missing`, `The type passed into GetMonthNumber was successfully parsed but there is no month information. This typically means that an IsoYear was passed in.`, { parse: ToStringLiteral__Array

; }> : P[1] extends infer Month extends string ? MonthNumberFromTwoDigit extends never ? MonthNumber : MonthNumberFromTwoDigit : MonthNumber : P extends Error ? ErrContext : never; type GetMonthNumber = [T] extends [object] ? MonthNumber : [T] extends [MonthName] ? MonthNameLookup[T]["num"] : [T] extends [MonthAbbrev] ? MonthAbbrevLookup[T]["num"] : [T] extends [string] ? string extends T ? boolean : ExtractMonthFromIsoDate extends never ? ParseDate extends infer P ? GetMonthNumberFromParsed

: never : ExtractMonthFromIsoDate : [T] extends [number] ? IsInteger extends true ? MonthNumber : Err<`month-number/parse`> : Err<`month-number/invalid-type`, `The type passed into GetMonthNumber is invalid!`, { parse: T; }>; //#endregion //#region src/datetime/GetSeason.d.ts type Lookup$3 = typeof MONTH_TO_SEASON_LOOKUP$1; type GetSeason = ParseDate extends ParsedDate ? GetMonthAbbrev extends keyof Lookup$3[H] ? Lookup$3[H][GetMonthAbbrev] : Season : Season; //#endregion //#region src/datetime/GetYear.d.ts /** * Takes any `DateLike` value and converts it into: * * - if possible a numeric literal value * - if not possible then it just converts it to a `number` */ type GetYear = IsWideType extends true ? number : T extends string ? IsIsoYear extends true ? AsNumber : ParseDate extends ParsedDate ? ParseDate[0] extends null ? number : AsNumber[0]> : number : number; //#endregion //#region src/datetime/iana.d.ts /** * The first _continent_-like component of an IANA Zone. */ type IanaZoneArea = `Africa` | `America` | `Antarctica` | `Asia` | `Europe` | `Pacific`; /** * **IanaZone**`<[normal|strong]>` * * An official IANA Timezone Marker * * **Related:** * - `IanaAmerica`, `IanaAsia`, `IanaAfrica`, `IanaEurope` * - `IanaAntarctica`, `IanaPacific` * - `IanaZoneArea` * * **Note:** * * - the default variant of this type includes all possible IANA variants * but with roughly 400-500 variants there is some Typescript cost associated * - if you prefer a type to just keep the "guardrails on" you can use the * "weak" variant which provides some structure but doesn't ensure a * valid IANA Zone (nor does it provide "autocomplete" when used as a * parameter to a function) * - finally, if you _know_ the broad region of a user and you want * precision you can opt for a region specific "zone area" with one of * the related types above */ type IanaZone = T extends "normal" ? typeof IANA_TIMEZONES$1[number] : T extends "weak" ? `${IanaZoneArea}/${string}` : never; /** * The official IANA Timezone markers from the Americas. */ type IanaAmerica = typeof IANA_TIMEZONES__AMERICA$1[number]; /** * The official IANA Timezone markers from the Asia. */ type IanaAsia = typeof IANA_TIMEZONES__ASIA$1[number]; /** * The official IANA Timezone markers from the Africa. */ type IanaAfrica = typeof IANA_TIMEZONES__AFRICA$1[number]; /** * The official IANA Timezone markers from Europe. */ type IanaEurope = typeof IANA_TIMEZONES__EUROPE$1[number]; /** * The official IANA Timezone markers from the Antarctica. */ type IanaAntarctica = typeof IANA_TIMEZONES__ANTARCTICA$1[number]; /** * The official IANA Timezone markers from the Pacific. */ type IanaPacific = typeof IANA_TIMEZONES__PACIFIC$1[number]; //#endregion //#region src/datetime/Iso.d.ts /** * **IsoYearLike** * * A year represented by the [**ISO8601**](https://en.wikipedia.org/wiki/ISO_8601) standard. * It is represented as either: * * 1. `YYYY` (the standard way) * 2. `+`/`-` followed by `YYYYY` for years beyond the range of 0000 and 9999 * * #### Variants * - the default is `normal` which provides decent type structure to help validate * but it is not "self-validating" as this would overwhelm the type system * - this will ensure that the year is at least three digits * - if you just want a nominal shape that is simple for Typescript to represent then choose `weak` * - if you have run this string through a validator of some type you can upgrade it to * the `branded` type which is quite weak from a Typescript standpoint but is respected * by all utilities in this library to be a validated type */ type IsoYear = T extends "normal" ? (`${NumericChar}${number}${NumericChar}` | `${"+" | "-"}${number}`) : T extends "weak" ? `${number}` | `${number}${"+" | "-"}${number}` : T extends "branded" ? `${number}` & { kind: "IsoYear"; } : never; /** * **IsoMonthDate**`` * * A type shape representing an ISO Date that represents a month * and date but is independent of year: * * - `--MM-DD` _or_ `--MMDD` * * #### Variants * * - by default the `normal` variant is used which provides strong type * support for the month but leaves the date as just a numeric literal * - choosing `explicit` or `implicit` provides the strongest type validation * for _one_ of the two structural variants above. * - `weak` ensures the prefix `--` exists and that there are numbers in the right place * - `branded` represents a string that _has been_ validated by a utility and though * the type is weak (to not overwhelm the type system) it will be seen as "valid" */ type IsoMonthDate = T extends "normal" ? `--${TwoDigitMonth}-${number}` | `--${TwoDigitMonth}${number}` : T extends "weak" ? `--${number}-${number}` | `--${number}` : T extends "branded" ? (`--${number}-${number}` | `--${number}`) & { kind: "IsoMonthDate"; } : T extends "explicit" ? `--${TwoDigitMonth}-${TwoDigitDate}` : T extends "implicit" ? `--${TwoDigitMonth}${TwoDigitDate}` : never; /** * **IsoYearMonth** * * A type shape representing an ISO Date that represents a year * and month but not an explicit date: * * - `-YYYY-MM` _or_ `-YYYYMM` * * #### Variants * * - the `normal` variant (used by default) forces the year * to be a numeric literal (weak) but provides strong support for the month * - where you need a weaker type variant the `weak` variant simply provides * structure but forces year and month to be any numeric literal * - the `explicit` and `implicit` types provide the strongest type protection * for one of the two structural variants above (note: these are complex unions * so be care with use) */ type IsoYearMonth = T extends "normal" ? `-${number}-${TwoDigitMonth}` | `-${number}${TwoDigitMonth}` : T extends "weak" ? `-${number}-${number}` | `-${number}` : T extends "explicit" ? `-${FourDigitYear<"strong">}-${TwoDigitDate}` : T extends "implicit" ? `-${FourDigitYear<"strong">}${TwoDigitDate}` : never; /** * Full ISO date format (no time info): * * - `YYYY-MM-DD`, _or_ * - `YYYYMMDD` * * **Related:** * - `IsoFullDateTime` * - `IsoDate`, `IsoMonthDateLike`, `IsoYearMonthLike` */ type IsoFullDate = T extends "normal" ? `${number}${TwoDigitMonth}${number}` | `${number}-${TwoDigitMonth}-${number}` : T extends "weak" ? `${number}${TwoDigitMonth<"weak">}` | `${number}-${TwoDigitMonth<"weak">}-${number}` : never; /** * Basic shape for an ISO DateTime string: * * - `YYYY-MM-DDT${time}`, _or_ * - `YYYYMMDDT${time}` * * **Related:** * - `IsoFullDate` * - `IsoDateTime`, `IsoMonthDateTimeLike`, `IsoYearMonthTimeLike` */ type IsoFullDateTimeLike = `${number}${TwoDigitMonth}${number}T${string}` | `${number}-${TwoDigitMonth}-${number}T${string}`; /** * [IsoDate](https://en.wikipedia.org/wiki/ISO_8601) * * Shows the basic shape for an ISO **Date** string: * * - `YYYY-MM-DD` _or_ `YYYYMMDD` - _for a full ISO Date_ * - `-YYYY-MM` _or_ `-YYYYMM` - _for date-independent year-month_ * - `--MM-DD` _or_ `--MMDD` - _for a year-independent month-date_ * * Please note: * - this type is not _self-validating_; it matches all valid variants * but there are many false-positives * - in order to have the `IsoDate` _branded type_ you should use * either: * - `isIsoDate()` type guard * - `IsIsoDate` type utility * * #### Variants * * - by default this type uses the `normal` variant which is good * for matching but not "validation" * - you can choose "full" if you only want to match for the full * year-month-date sort of date and there is more structure to the * type provided * - if you've validated with an external utility you can use * the `branded` variant which is a fairly broad "type" but will * be treated by other utilities as having been validated. */ type IsoDate$1 = T extends "branded" ? (IsoFullDate<"weak"> | IsoYearMonth<"weak"> | IsoMonthDate<"weak"> | IsoYear<"weak">) & { kind: "IsoDate"; } : T extends "normal" ? IsoFullDate<"weak"> | IsoYearMonth<"weak"> | IsoMonthDate<"weak"> | IsoYear<"weak"> : T extends "full" ? IsoFullDate<"normal"> : never; /** * [IsoDateTime](https://en.wikipedia.org/wiki/ISO_8601)`` * * Shows the basic shape for an ISO **DateTime** string. * * #### Variants * * - by default the `normal` variant is used which just captures * the basic shape * - however, if you've validated using some other utility then * you can use the `branded` type which has the same type but * will be treated as "validated" by other utilities */ type IsoDateTime = T extends "normal" ? `${number}-${number}-${number}T${number}:${number}${string}` : `${number}-${number}-${number}T${number}:${number}${string}` & { kind: "IsoDateTime"; }; /** * **[Iso8601TimeLike](https://en.wikipedia.org/wiki/ISO_8601)** * * Represents the general shape that **all** ISO Time strings * will fit into. * * This allows for the following structures: * * - `[hh]:[mm]` * - `[hh]:[mm]:[ss]` * - `[hh]:[mm]:[ss].[mmm]` * * All of these structures can also optionally have timezone information: * * - `Z` - _indicating UTC time_ * - `["+" | "-"][hh]` * - `["+" | "-"][hh][mm]` * - `["+" | "-"][hh]:[mm]` * * Please note: * * - this shape will allow _false positives_ and Typescript's type * system can not by itself fully represent a type that acts as not * only a _type_ but a _validator_. * - you can do runtime validation with `isIsoTime()`and if it passes * the validation the type will be "upgraded" to `IsoTime` which * convey's the same type constraint but is a _branded_ type indicating * that it has been validated. * * **Related:** * - `IsoTime`, `IsoDateTime`, `IsoDate` * - `IsoDateLike`, `IsoDateTimeLike` */ type IsoTimeLike = `${THour}:${TMin}${TZ}` | `${THour}:${TMin}:${number}${TZ}` | `${THour}:${TMin}:${number}.${number}${TZ}`; /** * **IsoTime**`<[TExplicit], [TZ]>` * * The [**ISO8601**](https://en.wikipedia.org/wiki/ISO_8601) * standard's representation of **time**. * * This allows for the following structures: * * - `[hh]:[mm]` * - `[hh]:[mm]:[ss]` * - `[hh]:[mm]:[ss].[mmm]` * * This type was validated from either: * - `isIsoTime()` - type guard * - `IsIsoTime` - type utility * * And is a branded type of `IsoTimeLike` */ type IsoTime = IsoTimeLike & { kind: "ISO Time"; }; //#endregion //#region src/datetime/Month.d.ts /** * **MonthName** * * The month of the year represented as a full string name. */ type MonthName = typeof MONTH_NAME$1[number]; /** * **MonthAbbr** * * The month of the year represented in an abbreviated string format. */ type MonthAbbrev = typeof MONTH_ABBR$1[number]; /** * **MonthNumeric** * * The month of the year represented in a numeric format. */ type MonthNumeric = "10" | "11" | "12" | `${"0" | ""}${NonZeroNumericChar}`; //#endregion //#region src/datetime/object-types/day-js.d.ts interface DayJsLike { isValid: () => boolean; /** converts a DayJS object to a Javascript Date */ toDate: () => Date; format: (formatStr?: string) => string; utc: () => DayJsLike; local: () => DayJsLike; add: (amount: number, unit: string) => DayJsLike; subtract: (amount: number, unit: string) => DayJsLike; [key: string]: any; } //#endregion //#region src/datetime/object-types/js-date.d.ts interface JsDateLike extends Date { getTime: () => number; toIsoString: () => string; getFullYear: () => number; setFullYear: (year: number, month?: number, date?: number) => number; getDate: () => number; /** Gets the day of the week, using local time. */ getDay: () => number; getHours: () => number; getMonth: () => number; getMinutes: () => number; [key: string | symbol]: any; } //#endregion //#region src/datetime/object-types/luxon.d.ts interface LuxonStaticDateTime { /** * Create a DateTime instance from a string and a format. * @param inp - The date/time string to parse. * @param format - The format string to interpret `inp`. * @param opts - Options to customize parsing, like `locale` or `zone`. */ fromFormat: (inp: string, format: string, opts?: object) => LuxonLikeDateTime; /** * Create a DateTime instance from an SQL date/time string. * @param inp - The SQL string to parse. * @param opts - Options to customize parsing, like `zone`. */ fromSQL: (inp: string, opts?: object) => LuxonLikeDateTime; /** * Create a DateTime instance in the local time zone. * Accepts optional values for date and time components. */ local: (year?: number, month?: number, day?: number, hour?: number, minute?: number, second?: number, millisecond?: number) => LuxonLikeDateTime; /** * Create a DateTime instance in the UTC time zone. * Accepts optional values for date and time components. */ utc: (year?: number, month?: number, day?: number, hour?: number, minute?: number, second?: number, millisecond?: number) => LuxonLikeDateTime; /** * Get the current date and time as a DateTime instance. * @param zone - Optional time zone for the instance. */ now: (zone?: string) => LuxonLikeDateTime; /** * Create a DateTime instance from an object specifying date and time components. * @param config - Object with properties like `year`, `month`, `day`, etc. */ fromObject: (config: { zone?: string; locale?: string; numberingSystem?: string; [key: string]: any; }) => LuxonLikeDateTime; /** * Create a DateTime instance from a JavaScript Date object. * @param date - The JavaScript Date object to convert. * @param opts - Options to customize conversion, like `zone`. */ fromJSDate: (date: Date, opts?: { zone?: string; locale?: string; }) => LuxonLikeDateTime; /** * Create a DateTime instance from a number of milliseconds since the epoch. * @param milliseconds - Milliseconds since January 1, 1970. * @param opts - Options like `zone` or `locale`. */ fromMillis: (milliseconds: number, opts?: { zone?: string; locale?: string; }) => LuxonLikeDateTime; /** * Create a DateTime instance from a number of seconds since the epoch. * @param seconds - Seconds since January 1, 1970. * @param opts - Options like `zone` or `locale`. */ fromSeconds: (seconds: number, opts?: { zone?: string; locale?: string; }) => LuxonLikeDateTime; } interface LuxonLikeDateTime { /** * Determine if the given input is a valid JavaScript Date object. * @param input - The value to check. * @returns True if `input` is a Date object, otherwise false. */ isDate: (input: unknown) => input is Date; isOffsetFixed: boolean; /** * Create an invalid DateTime instance. * @param reason - A string describing why the instance is invalid. */ invalid: (reason: string) => LuxonLikeDateTime; /** * Format the DateTime as a string using a specified format. * @param format - The format string. * @param opts - Options like `locale` for formatting. */ toFormat: (format: string, opts?: { locale?: string; }) => string; /** * Convert the DateTime to a SQL-compatible date/time string. * @param opts - Options to include the time zone or offset in the string. */ toSQL: (opts?: { includeZone?: boolean; includeOffset?: boolean; }) => string; /** * Convert the DateTime to an ISO 8601 string. * @param opts - Options to suppress milliseconds, seconds, or include the offset. */ toISO: (opts?: { suppressMilliseconds?: boolean; suppressSeconds?: boolean; includeOffset?: boolean; }) => string; /** * Convert the DateTime to an ISO 8601 date-only string. */ toISODate: () => string; /** * Convert the DateTime to an ISO 8601 time-only string. * @param opts - Options to suppress milliseconds, seconds, or include the offset. */ toISOTime: (opts?: { suppressMilliseconds?: boolean; suppressSeconds?: boolean; includeOffset?: boolean; }) => string; /** * Convert the DateTime to a JavaScript Date object. */ toJSDate: () => Date; /** * Convert the DateTime to a string representation. */ toString: () => string; /** * Get the number of milliseconds since the epoch for this DateTime. */ toMillis: () => number; /** * Get the number of seconds since the epoch for this DateTime. */ toSeconds: () => number; /** * Add a duration to this DateTime. * @param duration - An object specifying the amount to add, e.g., `{ days: 1 }`. */ plus: (duration: { years?: number; months?: number; days?: number; hours?: number; minutes?: number; seconds?: number; milliseconds?: number; }) => LuxonLikeDateTime; /** * Subtract a duration from this DateTime. * @param duration - An object specifying the amount to subtract, e.g., `{ days: 1 }`. */ minus: (duration: { years?: number; months?: number; days?: number; hours?: number; minutes?: number; seconds?: number; milliseconds?: number; }) => LuxonLikeDateTime; /** * Get the start of a specified time unit (e.g., start of the day). * @param unit - The unit, such as `"year"` or `"day"`. */ startOf: (unit: "year" | "month" | "week" | "day" | "hour" | "minute" | "second" | "millisecond") => LuxonLikeDateTime; /** * Get the end of a specified time unit (e.g., end of the day). * @param unit - The unit, such as `"year"` or `"day"`. */ endOf: (unit: "year" | "month" | "week" | "day" | "hour" | "minute" | "second" | "millisecond") => LuxonLikeDateTime; /** * Set specific components of the DateTime (e.g., change the year or month). * @param values - An object with the components to set. */ set: (values: { year?: number; month?: number; day?: number; hour?: number; minute?: number; second?: number; millisecond?: number; zone?: string; locale?: string; }) => LuxonLikeDateTime; /** * Change the locale, numbering system, or calendar system of the DateTime. * @param values - An object specifying the new configuration. */ reconfigure: (values: { locale?: string; numberingSystem?: string; outputCalendar?: string; }) => LuxonLikeDateTime; /** * Change the time zone of the DateTime. * @param zone - The new time zone. * @param opts - Options to keep the local time or calendar time. */ setZone: (zone: string, opts?: { keepLocalTime?: boolean; keepCalendarTime?: boolean; }) => LuxonLikeDateTime; /** * Get the specified unit of the DateTime (e.g., the year or month). * @param unit - The unit to retrieve. */ get: (unit: "year" | "month" | "day" | "hour" | "minute" | "second" | "millisecond") => number; /** * Calculate the difference between this DateTime and another. * @param other - The other DateTime to compare against. * @param unit - The units to calculate the difference in. * @param opts - Options like `conversionAccuracy`. */ diff: TypedFunction; diffNow: TypedFunction; hasSome: TypedFunction; getPossibleOffsets: TypedFunction; /** The year represented by this DateTime instance */ year: number; /** The month (1-12) represented by this DateTime instance */ month: number; /** The day of the month (1-31) represented by this DateTime instance */ day: number; /** The hour (0-23) represented by this DateTime instance */ hour: number; /** The minute (0-59) represented by this DateTime instance */ minute: number; /** The second (0-59) represented by this DateTime instance */ second: number; /** The millisecond (0-999) represented by this DateTime instance */ millisecond: number; /** The ISO week year represented by this DateTime instance */ weekYear: number; /** The ISO week number (1-53) represented by this DateTime instance */ weekNumber: number; /** The ISO weekday (1-7, where 1 is Monday) represented by this DateTime instance */ weekday: number; /** The ordinal day of the year (1-365 or 1-366 for leap years) */ ordinal: number; /** Indicates whether the DateTime instance is valid */ isValid: boolean; /** The reason the DateTime instance is invalid, if applicable */ invalidReason: string | null; /** Additional details about why the DateTime instance is invalid */ invalidExplanation: string | null; /** The name of the time zone for this DateTime instance */ zoneName: string; /** The locale used by this DateTime instance */ locale: string; } //#endregion //#region src/datetime/object-types/moment.d.ts interface MomentLike { _isAMomentObject: boolean; utc: () => MomentLike; local: () => MomentLike; add: (amount: number, unit: string) => MomentLike; subtract: (amount: number, unit: string) => MomentLike; /** * Formats a moment object into a calendar time string. * @param key - A string key specifying the calendar format. * @param m - A MomentJS object representing a comparison time. * @param now - A MomentJS object representing the reference time (default is now). */ longDateFormat: (key: any) => string; /** * Returns the string to use for invalid dates. */ invalidDate: () => string; /** * Formats an ordinal number (e.g., 1st, 2nd, 3rd). * @param n - The number to format. */ ordinal: (n: number) => string; /** * Prepares an input string for parsing (custom pre-parsing logic). * @param inp - The input string to preprocess. */ preparse: (inp: string) => string; /** * Formats an output string (custom post-formatting logic). * @param inp - The input string to postprocess. */ postformat: (inp: string) => string; /** * Formats relative time strings (e.g., "in 5 minutes", "5 minutes ago"). * @param n - The number to format (e.g., 5 for "5 minutes"). * @param withoutSuffix - Whether to exclude the suffix (e.g., "ago" or "in"). * @param key - The time unit (e.g., "s" for seconds, "m" for minutes). * @param isFuture - Whether the time is in the future. */ relativeTime: (n: number, withoutSuffix: boolean, key: any, isFuture: boolean) => string; /** * Formats relative time for past or future comparisons. * @param diff - The time difference in milliseconds. * @param absRelTime - The absolute relative time string. */ pastFuture: (diff: number, absRelTime: string) => string; /** * Sets specific configuration values for the moment object. * @param config - An object containing configuration keys and values. */ toISOString: () => IsoDateTime; /** * Converts the MomentJS object to a JavaScript Date object. */ toDate: () => Date; tz?: () => string; /** * Converts the MomentJS object to a Unix timestamp in seconds. */ unix: () => number; /** * Converts the MomentJS object to a JSON string. */ toJSON: () => string; /** * Formats the MomentJS object as a string using a specific format. * @param format - A string specifying the format to use. */ format: (format?: string) => string; /** * Clones the current MomentJS object. */ clone: () => MomentLike; /** * Checks if the MomentJS object is the same as another moment. * @param other - The moment to compare with. * @param granularity - The level of precision to compare at (e.g., "day", "hour"). */ isSame: (other: MomentLike, granularity?: string) => boolean; /** * Checks if the MomentJS object is before another moment. * @param other - The moment to compare with. * @param granularity - The level of precision to compare at (e.g., "day", "hour"). */ isBefore: (other: MomentLike, granularity?: string) => boolean; /** * Checks if the MomentJS object is after another moment. * @param other - The moment to compare with. * @param granularity - The level of precision to compare at (e.g., "day", "hour"). */ isAfter: (other: MomentLike, granularity?: string) => boolean; /** * Checks if the MomentJS object is valid. */ isValid: () => boolean; /** * Checks if the MomentJS object is between two other moments. * @param from - The starting moment. * @param to - The ending moment. * @param granularity - The level of precision to compare at (e.g., "day", "hour"). * @param inclusively - Controls whether the bounds are inclusive (`"[]"`) or exclusive (`"()"`). */ isBetween: (from: MomentLike, to: MomentLike, granularity?: string, inclusively?: string) => boolean; calendar: TypedFunction; [key: string]: any; } //#endregion //#region src/datetime/object-types/temporal.d.ts interface TemporalInstanceLike { equals: TypedFunction; add: TypedFunction; subtract: TypedFunction; until: TypedFunction; since: TypedFunction; round: TypedFunction; toZoneDateTimeISO: TypedFunction; toLocaleString: TypedFunction; toJSON: () => string; toString: TypedFunction; [key: string | symbol]: any; } interface TemporalZonedDateTimeLike { era: string | undefined; eraYear: number | undefined; year: number; month: number; monthCode: string; day: number; hour: number; minute: number; second: number; millisecond: number; microsecond: number; nanosecond: number; timeZoneId: string; calenderId: string; dayOfWeek: number; dayOfYear: number; hoursInDay: number; daysInWeek: number; isLeapYear: boolean; offset: string; epochMilliseconds: number; [key: string | symbol]: any; } type TemporalTimeZoneLike = string | TemporalZonedDateTimeLike; interface TemporalPlainDateTimeLike { era: string | undefined; eraYear: number | undefined; year: number; month: number; monthCode: string; day: number; hour: number; minute: number; second: number; millisecond: number; microsecond: number; nanosecond: number; calendar: any; equals: TypedFunction; with: TypedFunction; withPlainTime: TypedFunction; toZonedDateTime: (tzLike: TemporalTimeZoneLike, options?: any) => TemporalZonedDateTimeLike; add: TypedFunction; toPlainDate: TypedFunction; toPlainTime: TypedFunction; since: TypedFunction; toJSON: () => string; toString: TypedFunction; readonly [Symbol.toStringTag]: "Temporal.PlainDateTime"; [key: string | symbol]: any; } interface TemporalLike { toString: () => string; toJSON: () => string; toPlainDate?: () => object; toPlainTime?: () => object; toInstant?: () => { epochSeconds: number; }; [key: string | symbol]: any; } //#endregion //#region src/datetime/ParseDate.d.ts type ParsedDate = [year: FourDigitYear<"branded"> | null, month: TwoDigitMonth<"branded"> | null, date: TwoDigitDate<"branded"> | null, /** * When parsing for a Date we will also check if time * info is available. Possible outcomes * - no time info will result in no property * - valid time info will set this to `ParsedTime` * - invalid time info will result in an error */ time: ParsedTime | null]; type ParseMonthDate = string extends T ? ParsedDate | Error : TakeMonth extends { take: infer Month extends TwoDigitMonth<"branded">; rest: infer Rest extends string; } ? TakeDate extends { take: infer IsoDate extends TwoDigitDate<"branded">; rest: infer Rest extends string; } ? Rest extends "" ? As$1<[null, Month, IsoDate, null], ParsedDate> : Err<`parse-date/leftover`, `A string which appeared to be a IsoMonthDate string had trailing content which was unparsable [${Rest}]!`, { parse: T; month: Month; date: IsoDate; rest: Rest; }> : Err<`parse-date/date`, `Unable to parse the month of what appeared to be an IsoMonthDate string`, { parse: T; month: Month; rest: Rest; }> : Err<`parse-date/month`, `A string which appeared to be a IsoMonthDate string with leading '--' presented an invalid month`, { parse: T; }>; type ParseFullDate = TakeYear extends { take: infer Year extends FourDigitYear<"branded">; rest: infer Rest extends string; } ? TakeMonth extends { take: infer Month extends TwoDigitMonth<"branded">; rest: infer Rest extends string; } ? TakeDate extends { take: infer D extends TwoDigitDate<"branded">; rest: infer Rest extends string; } ? Rest extends "" ? As$1<[Year, Month, D, null], ParsedDate> : Err<`parse-date/leftover`, `While parsing what appeared to be an ISO Date, we found extra content at the end which is invalid: ${Rest}`, { year: Year; month: Month; date: D; rest: Rest; }> : ErrContext, Error>, { year: Year; month: Month; rest: Rest; }> : ErrContext, Error>, { year: Year; rest: Rest; }> : ErrContext, Error>, { parse: T; }>; type ParseYear = IsFourDigitYear extends true ? As$1<[FourDigitYear, null, null, null], ParsedDate> : Err<`parse-date/year`, `A string which looked like an ISO year string was unable to be parsed!`, { parse: T; }>; type ParseDateTime = T extends `${infer DatePart extends string}T${infer TimePart extends string}` ? ParseFullDate extends infer DateResult ? DateResult extends Error ? Err<`parse-date/datetime`, `The date component of a DateTime string was invalid: ${DateResult["message"]}`, { parse: T; date: DatePart; time: TimePart; }> : ParseTime extends infer TimeResult ? TimeResult extends Error ? Err<`parse-date/datetime`, `The time component of a DateTime string was invalid: ${TimeResult["message"]}`, { parse: T; date: DatePart; time: TimePart; }> : DateResult extends ParsedDate ? As$1<[DateResult[0], DateResult[1], DateResult[2], As$1], ParsedDate> : never : never : never : Err<`parse-date/datetime`, `Invalid structure`, { parse: T; }>; type ParseYearMonth = TakeYear extends { take: infer Year extends FourDigitYear<"branded">; rest: infer Rest extends string; } ? TakeMonth extends { take: infer Month extends TwoDigitMonth<"branded">; rest: infer Rest extends string; } ? Rest extends "" ? [Year, Month, null, null] : Err<`parse-date/leftover`, `The year and month were parsed and validated but there is remaining text which can't be parsed: ${Rest}`, { year: Year; minute: Month; rest: Rest; }> : Err<`parse-date/month`, `The month in what appeared to be a IsoYearMonth string was unable to be parsed`, { parse: T; year: Year; rest: Rest; }> : Err<`parse-date/year`, `The year in what started out as a IsoYearMonth string was unable to be parsed`, { parse: T; }>; /** * **ParseDate**`` * * Parses an ISO Date string to extract the core data. * * ISO Dates come in the following flavors: * * - `YYYY-MM-DD` _or_ `YYYYMMDD` * - `-YYYY-MM` _or_ `-YYYYMM` (_for year/month resolution and no date_) * - `--MM-DD` _or_ `--MMDD` (_for year independent dates_) * * Returns the type `ParsedDate` or `Error` if `T` couldn't be parsed as * a ISO date/datetime type. */ type ParseDate> = U extends string ? string extends U ? ParsedDate | Error : U extends `--${infer Rest extends string}` ? ParseMonthDate : U extends `-${infer Rest extends string}` ? ParseYearMonth : U extends `${string}T${string}` ? ParseDateTime : StrLen extends 4 ? ParseYear : ParseFullDate : Err<`parse-date/wrong-type`, `A non-string type was passed into ParseDate!`>; //#endregion //#region src/datetime/ParseTime.d.ts /** * **ParsedTime** * * a successfully parsed **ISO Time** string into a structured tuple. */ type ParsedTime = [hour: TwoDigitHour<"branded">, minute: TwoDigitMinute<"branded">, second: TwoDigitSecond<"branded"> | null, millisecond: ThreeDigitMillisecond<"branded"> | null, tz: TimezoneOffset<"branded"> | null]; type GetHoursMinutes = As$1 extends { take: infer Hour extends TwoDigitHour<"branded">; rest: infer Rest extends string; } ? TakeMinutes extends { take: infer Minute extends TwoDigitMinute<"branded">; rest: infer Rest extends string; } ? { hour: TwoDigitHour; minute: TwoDigitMinute; rest: Rest; } : Err<`parse-time/minute`, `could not parse out the minute component of this string: ${Rest}`, { parse: T; hour: Hour; rest: Rest; }> : Err<`parse-time/invalid`, `the passed in string could not be parsed as an ISO Time string`, { parse: T; }>, Error | { hour: TwoDigitHour<"branded">; minute: TwoDigitMinute<"branded">; rest: string; }>; /** a successful result from `GetHoursMinutes` */ interface HHMM { hour: TwoDigitHour<"branded">; minute: TwoDigitMinute<"branded">; rest: string; } /** * complete parsing of a time with Hour:Minute but not * seconds or milliseconds */ type ParseTimeWithMinutes, TMinutes extends TwoDigitMinute<"branded">, TRest extends string> = TRest extends "" ? As$1<[THours, TMinutes, null, null, null], ParsedTime> : TRest extends `:${infer Rest extends string}` ? ParseTimeWithSeconds : TakeTimezone extends { take: infer TZ extends TimezoneOffset<"branded">; rest: infer Rest extends string; } ? Rest extends "" ? [THours, TMinutes, null, null, TZ] : Err<`parse-time/leftover`, `Were able to parse out hours, minutes, and timezone but content still remains: ${Rest}`, { hours: THours; minute: TMinutes; tz: TZ; rest: Rest; }> : Err<`parse-time/tz`, `Could not parse remaining content as timezone: ${TRest}`, { hours: THours; minutes: TMinutes; rest: TRest; }>; type ParseTimeWithSeconds, TMinutes extends TwoDigitMinute<"branded">, TRest extends string> = TakeSeconds extends { take: infer Second extends TwoDigitSecond<"branded">; rest: infer Rest extends string; } ? Rest extends "" ? As$1<[THours, TMinutes, Second, null, null], ParsedTime> : Rest extends `.${infer MillisRest}` ? ParseTimeWithMilliseconds : TakeTimezone extends { take: infer TZ extends TimezoneOffset<"branded">; rest: infer TZRest extends string; } ? TZRest extends "" ? As$1<[THours, TMinutes, Second, null, TZ], ParsedTime> : Err<`parse-time/leftover`, `Was able to parse hours, minutes, seconds, and timezone but content still remains: ${TZRest}`, { hour: THours; minute: TMinutes; second: Second; tz: TZ; rest: TZRest; }> : Err<`parse-time/tz`, `Was able to parse hours, minutes, and seconds but failed to parse remaining as a timezone offset: ${Rest}`, { hour: THours; minute: TMinutes; second: Second; rest: Rest; }> : Err<`parse-time/sec`, `Invalid second in ISO Time string: ${TRest}`, { hour: THours; minute: TMinutes; rest: TRest; }>; type ParseTimeWithMilliseconds, TMinutes extends TwoDigitMinute<"branded">, TSeconds extends TwoDigitSecond<"branded">, TRest extends `${string}`> = TakeMilliseconds extends { take: infer MS extends ThreeDigitMillisecond<"branded">; rest: infer Rest extends `${string}`; } ? Rest extends "" ? As$1<[THours, TMinutes, TSeconds, MS, null], ParsedTime> : TakeTimezone extends { take: infer TZ extends TimezoneOffset<"branded">; rest: infer TZRest extends string; } ? TZRest extends "" ? As$1<[THours, TMinutes, TSeconds, MS, TZ], ParsedTime> : Err<"parse-time/leftover", `Parsed out hours, minutes, seconds, milliseconds, and timezone but content still remains: ${TZRest}`, { hour: THours; minute: TMinutes; second: TSeconds; ms: MS; tz: TZ; rest: TZRest; }> : Err<"parse-time/tz", `Parsed out hours, minutes, seconds, and milliseconds, but the Timezone was invalid: ${Rest}`, { hour: THours; minute: TMinutes; second: TSeconds; ms: MS; rest: Rest; }> : Err<`parse-time/ms`, `The string appeared to have milliseconds but upon validation it appears it is invalid: ${TRest}`, { hour: THours; minute: TMinutes; second: TSeconds; rest: TRest; }>; /** * **ParseTime**`` * * Tries to parse `T` as an ISO Time. If successful it will result in a * tuple of the form of: * * - `[ Hour, Minute, Second, Millisecond, TZ ]` * * - Values which are not represented are set to `undefined`. * - If it can't be parsed then an Error<"parse/time"> is returned. * * **Complexity Levels:** * - `"weak"`: Fast, less type-safe fallbacks * - `"normal"`: Balanced performance and safety (default) * - `"strong"`: Full type safety, slower compilation */ type ParseTime = string extends T ? ParsedTime | Error : GetHoursMinutes extends Error ? As$1, Error> : GetHoursMinutes extends HHMM ? ParseTimeWithMinutes["hour"], GetHoursMinutes["minute"], GetHoursMinutes["rest"]> : never; //#endregion //#region src/datetime/RenderTime.d.ts /** * **RenderTime**`` * * Renders an ISO time string based on generics passed in. * * **Performance Optimized:** Uses conditional assembly instead of * template literal distribution to avoid union explosion. * * **Complexity Levels:** * - `"weak"`: Fast, less type-safe fallbacks * - `"normal"`: Balanced performance and safety (default) * - `"strong"`: Full type safety, slower compilation * * **Original Issue:** The previous implementation used template literal * interpolation with the `N<>` helper which caused union explosion when * multiple large datetime unions were combined. * * **Solution:** Break down the template literal assembly into conditional * branches that avoid distributing large unions through template literals. */ type RenderTime | null = "00", TMin extends TwoDigitMinute<"weak" | "normal" | "strong"> | null = "00", TSec extends TwoDigitSecond<"normal" | "strong"> | null = null, TMs extends ThreeDigitMillisecond<"weak" | "normal" | "strong"> | null = null, TTz extends TimezoneOffset<"normal" | "strong"> | null = "Z", _TComplexity extends "weak" | "normal" | "strong" = "normal"> = THour extends null ? Err<`render-time/hour`, `To render a time you MUST have an hour!`> : TMin extends null ? Err<`render-time/min`, `To render a time you MUST have a minute!`> : TSec extends null ? TMs extends null ? TTz extends null ? `${THour}:${TMin}` : As$1<`${THour}:${TMin}${TTz}`, string> : TTz extends null ? As$1<`${THour}:${TMin}.${TMs}`, string> : As$1<`${THour}:${TMin}.${TMs}${TTz}`, string> : TMs extends null ? TTz extends null ? As$1<`${THour}:${TMin}:${TSec}`, string> : As$1<`${THour}:${TMin}:${TSec}${TTz}`, string> : TTz extends null ? As$1<`${THour}:${TMin}:${TSec}.${TMs}`, string> : As$1<`${THour}:${TMin}:${TSec}.${TMs}${TTz}`, string>; //#endregion //#region src/datetime/seasonality.d.ts /** * A season of the year */ type Season = typeof SEASONS$1[number]; /** * **MonthInSeason**`` * * Provides a union of the months in a given season. * * ```ts * // "Sep" | "Jul" | "Nov" * type Fall = MonthInSeason<"Fall">; * // "Mar" | "Apr" | "May" * type FallSouth = MonthInSeason<"Fall", "southern"> * ``` */ type MonthInSeason = typeof SEASON_TO_MONTH_LOOKUP$1[T][U]; //#endregion //#region src/boolean-logic/operators/datetime/IsDoubleLeap.d.ts type Digit$6 = "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9"; type ExtractYear = Unbrand extends `${infer A extends Digit$6}${infer B extends Digit$6}${infer C extends Digit$6}${infer D extends Digit$6}${string}` ? `${A}${B}${C}${D}` : never; type IsDoubleLeap = T extends object ? boolean : T extends string ? string extends T ? boolean : [ExtractYear] extends [never] ? false : ExtractYear extends IsoModernDoubleLeap ? true : false : T extends number ? number extends T ? boolean : [ExtractYear<`${T}`>] extends [never] ? false : ExtractYear<`${T}`> extends IsoModernDoubleLeap ? true : false : false; //#endregion //#region src/boolean-logic/operators/datetime/IsEpochInMilliseconds.d.ts /** the epoch timestamp (in milliseconds) for July 14th */ type Epoch_1979_07_14 = 16761600000; /** * **IsEpochInMilliseconds**`` * * Epoch timestamps represent times after January 1st, 1970 but up to July 14th, * 1970 there is no completely valid what of distinguishing an **epoch** based * on _seconds_ versus _milliseconds. After July 14th, no additional context/data * is necessary as long as we're willing to "cap" the **epoch** timestamps in seconds * to the year 2500. * * This boolean operator attempts to use the constraints above to test whether `T` * is an epoch timestamp measured in _milliseconds_. */ type IsEpochInMilliseconds = T extends number ? number extends T ? boolean : IsInteger extends true ? IsGreaterThanOrEqual : false : false; //#endregion //#region src/boolean-logic/operators/datetime/IsEpochInSeconds.d.ts /** the epoch timestamp (in seconds) for the date 2500-01-01 */ type Epoch_2500 = 16725225600; /** * **IsEpochInSeconds**`` * * Epoch timestamps represent times after January 1st, 1970 but up to July 14th, * 1970 there is no completely valid what of distinguishing an **epoch** based * on _seconds_ versus _milliseconds. After July 14th, no additional context/data * is necessary as long as we're willing to "cap" the **epoch** timestamps in seconds * to the year 2500. * * This boolean operator attempts to use the constraints above to test whether `T` * is an epoch timestamp measured in _seconds_. */ type IsEpochInSeconds = T extends number ? number extends T ? boolean : IsInteger extends true ? IsLessThanOrEqual extends true ? IsNegativeNumber extends true ? false : true : false : false : false; //#endregion //#region src/boolean-logic/operators/datetime/IsIsoDate.d.ts type Member = { [K in keyof T]: IsIsoDate }; /** * **IsIsoDate**`` * * Boolean operator which returns `true` when `T` is a valid ISO 8601 date string of the * format: * * - `YYYY-MM-DD`, * - `--MM-DD` or `--MMDD` - _for year-independent dates_ * - `-YYYY-DD` or `-YYYYDD` - _for year-month resolution with specific date_ * * **Note:** this _does not_ match on DateTime combinations; use `IsIsoDateTime` * for that. */ type IsIsoDate = [IsNever] extends [true] ? false : [IsAny] extends [true] ? boolean : [IsUnknown] extends [true] ? boolean : [IsNull] extends [true] ? false : [IsEqual] extends [true] ? false : [string] extends [T] ? boolean : [IsUnion] extends [true] ? [Every>, "equals", true>] extends [true] ? true : [Some>, "equals", true>] extends [true] ? boolean : false : [IsIsoFullDate] extends [true] ? true : [IsIsoYearMonth] extends [true] ? true : [IsIsoMonthDate] extends [true] ? true : [IsIsoYear] extends [true] ? true : false; //#endregion //#region src/boolean-logic/operators/datetime/IsIsoDateTime.d.ts type TupleMap = { [K in keyof T]: IsIsoDateTime }; type HandleUnionResult = T extends readonly [infer First, ...infer Rest] ? First extends true ? Rest extends readonly boolean[] ? HandleUnionResult extends true ? true : boolean : boolean : First extends false ? Rest extends readonly boolean[] ? HandleUnionResult extends false ? false : boolean : boolean : boolean : true; /** * **IsIsoDateTime**`` * * Boolean operator which test whether `T` is a valid ISO 8601 * DateTime string. * * **Note:** * - if a type passes this test then it guaranteed to be a valid * ISO DateTime string * - in the type system you can't upgrade it to the "blessed" * branded type of `IsoDateTime` but if your runtime uses the * `isIsoDateTime()` type guard it will pass and be upgraded. */ type IsIsoDateTime = IsNull extends true ? false : IsBoolean extends true ? false : IsUnion extends true ? HandleUnionResult>> : T extends string ? string extends T ? boolean : T extends IsoDateTime<"branded"> ? true : AsDateMeta extends Error ? false : AsDateMeta extends DateMeta ? AsDateMeta["dateType"] extends "datetime" ? true : false : false : false; //#endregion //#region src/boolean-logic/operators/datetime/IsIsoFullDate.d.ts interface DayToNumber { "01": 1; "02": 2; "03": 3; "04": 4; "05": 5; "06": 6; "07": 7; "08": 8; "09": 9; "10": 10; "11": 11; "12": 12; "13": 13; "14": 14; "15": 15; "16": 16; "17": 17; "18": 18; "19": 19; "20": 20; "21": 21; "22": 22; "23": 23; "24": 24; "25": 25; "26": 26; "27": 27; "28": 28; "29": 29; "30": 30; "31": 31; } type ValidMonth = "01" | "02" | "03" | "04" | "05" | "06" | "07" | "08" | "09" | "10" | "11" | "12"; type EndDiv4$1 = "00" | "04" | "08" | "12" | "16" | "20" | "24" | "28" | "32" | "36" | "40" | "44" | "48" | "52" | "56" | "60" | "64" | "68" | "72" | "76" | "80" | "84" | "88" | "92" | "96"; type IsLeapYearDecomposed = `${Y3}${Y4}` extends "00" ? `${Y1}${Y2}` extends EndDiv4$1 ? true : false : `${Y3}${Y4}` extends EndDiv4$1 ? true : false; type IsValidDate = Unbrand extends "02" ? TDate extends 29 ? IsLeapYearDecomposed extends true ? true : false : TDate extends 30 | 31 ? false : true : Unbrand extends IsoDate30 ? TDate extends 31 ? false : true : true; type IsFourDigitString = T extends `${NumericChar}${NumericChar}${NumericChar}${NumericChar}` ? true : false; type ParseIsoFullDate = T extends `${infer Y1}${infer Y2}${infer Y3}${infer Y4}-${infer M1}${infer M2}-${infer D1}${infer D2}` ? `${D1}${D2}` extends keyof DayToNumber ? `${M1}${M2}` extends ValidMonth ? IsFourDigitString<`${Y1}${Y2}${Y3}${Y4}`> extends true ? IsValidDate : false : false : false : T extends `${infer Y1}${infer Y2}${infer Y3}${infer Y4}${infer M1}${infer M2}${infer D1}${infer D2}` ? `${D1}${D2}` extends keyof DayToNumber ? `${M1}${M2}` extends ValidMonth ? IsFourDigitString<`${Y1}${Y2}${Y3}${Y4}`> extends true ? IsValidDate : false : false : false : false; /** * **IsIsoFullDate**`` * * Tests whether `T` is an ISO 8601 Date (not DateTime) which is * of the format: * * - `YYYY-MM-DD`, _or_ * - `YYYYMMDD` * * **Note:** * - if a type passes this test then it guaranteed to be a valid * ISO Date string * - in the type system you can't upgrade it to the "blessed" * branded type of `IsoDate` but if your runtime uses the * `isIsoDate()` type guard it will pass and be upgraded. */ type IsIsoFullDate = [IsAny] extends [true] ? boolean : [IsNever] extends [true] ? false : [IsUnknown] extends [true] ? boolean : T extends string ? string extends T ? boolean : ParseIsoFullDate : false; //#endregion //#region src/boolean-logic/operators/datetime/IsIsoFullDateTime.d.ts /** * **IsIsoFullDateTime**`` * * Tests whether `T` is an ISO 8601 DateTime (not just Date) which is * of the format: * * - `YYYY-MM-DDT${time}`, _or_ * - `YYYYMMDDT${time}` * * **Note:** * - if a type passes this test then it guaranteed to be a valid * ISO DateTime string * - in the type system you can't upgrade it to the "blessed" * branded type of `IsoDateTime` but if your runtime uses the * `isIsoDateTime()` it will pass. */ type IsIsoFullDateTime = T extends IsoFullDateTimeLike ? ParseDate extends ParsedDate ? ParseDate extends [FourDigitYear<"strong">, TwoDigitMonth, TwoDigitDate, ParsedTime] ? true : false : false : false; //#endregion //#region src/boolean-logic/operators/datetime/IsIsoMonthDate.d.ts /** * Tests whether `T` is a valid **ISO Date** which captures month * and date but not year: * * - `--MM-DD` _or_ `--MMDD` * * **Related:** * - `IsIsoYearMonth` * * **Note:** * - if a type passes this test then it guaranteed to be a valid * ISO Date string * - in the type system you can't upgrade it to the "blessed" * branded type of `IsoDate` but if your runtime uses the * `isIsoDate()` it will pass. */ type IsIsoMonthDate = [T] extends [IsoMonthDate] ? [string] extends [T] ? boolean : [ParseDate] extends [ParsedDate] ? [ParseDate] extends [[null, TwoDigitDate, TwoDigitDate, null]] ? true : false : false : false; //#endregion //#region src/boolean-logic/operators/datetime/IsIsoTime.d.ts /** * **IsIsoTime**`` * * Boolean operator which returns `true` when `T` is a valid * [ISO 8601 time](https://en.wikipedia.org/wiki/ISO_8601#Times) * string of the format: * * - `HH:MM:SS`, `HH:MM:SS.ms`, `HH:MM:SSZ`, etc. */ type IsIsoTime = T extends IsoTimeLike ? ParseTime extends Error ? false : true : false; //#endregion //#region src/boolean-logic/operators/datetime/IsIsoYear.d.ts /** * - if all elements in the tuple are valid ISO year's then returns `true`, * - if some of the elements in the tuple are valid ISO year's then returns `boolean` * - otherwise return false. */ type CheckUnion = T extends readonly string[] ? And<{ [K in keyof T]: T[K] extends `${number}` ? FourDigitYear extends Error ? false : true : false }> extends true ? true : Or<{ [K in keyof T]: T[K] extends `${number}` ? FourDigitYear extends Error ? false : true : false }> extends true ? boolean : false : false; /** * **IsIsoYear**`` * * Boolean operator which tests whether `T` is a ISO Year ( * a four digit year) */ type IsIsoYear = [IsAny] extends [true] ? false : [IsNever] extends [true] ? false : IsObject extends true ? false : string extends T ? boolean : [IsUnion] extends [true] ? CheckUnion> : T extends `${number}` ? FourDigitYear extends Error ? false : true : false; //#endregion //#region src/boolean-logic/operators/datetime/IsIsoYearMonth.d.ts /** * Tests whether `T` is a valid ISO Date which captures year * and month but not date: * * - `-YYYY-MM` _or_ `-YYYYMM` * * **Related:** `IsIsoYearMonthTime`, `IsIsoDate` * * **Note:** * - if a type passes this test then it guaranteed to be a valid * ISO Date string * - in the type system you can't upgrade it to the "blessed" * branded type of `IsoDate` but if your runtime uses the * `isIsoDate()` type guard it will pass and be upgraded. */ type IsIsoYearMonth = T extends string ? string extends T ? boolean : AsDateMeta extends Error ? false : AsDateMeta extends DateMeta ? AsDateMeta["dateType"] extends "year-month" ? true : false : false : false; //#endregion //#region src/boolean-logic/operators/datetime/IsJsDate.d.ts interface Shape$3 { getDate: AnyFunction; getMonth: AnyFunction; getMilliseconds: AnyFunction; getTimezoneOffset: AnyFunction; getUTCDate: AnyFunction; getUTCDay: AnyFunction; getUTCFullYear: AnyFunction; } /** * **IsJsDate**`` * * Boolean utility to test whether `T` is a Javascript Date object. */ type IsJsDate = [IsAny] extends [true] ? false : [IsNever] extends [true] ? false : [IsUnknown] extends [true] ? boolean : [IsUnion] extends [true] ? [UnionMemberExtends] extends [true] ? T extends Date ? true : boolean : false : [Extends] extends [true] ? true : IsDictionary extends true ? T extends Shape$3 ? true : false : false; //#endregion //#region src/boolean-logic/operators/datetime/IsLeapYear.d.ts type Digit$5 = "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9"; type EndDiv4 = "00" | "04" | "08" | "12" | "16" | "20" | "24" | "28" | "32" | "36" | "40" | "44" | "48" | "52" | "56" | "60" | "64" | "68" | "72" | "76" | "80" | "84" | "88" | "92" | "96"; /** * **Detect** whether a numeric year string represents a leap year. * * Directly infers the last two digits (and, for century years, the first two) * instead of distributing over large template-literal unions. This avoids the * deep type-instantiation chain that caused the previous `Or`/`And`/`Not` * formulation to run out of memory on literal inputs. */ type Detect = Y extends `${infer First extends Digit$5}${infer Second extends Digit$5}${infer Third extends Digit$5}${infer Fourth extends Digit$5}${string}` ? `${Third}${Fourth}` extends "00" ? `${First}${Second}` extends EndDiv4 ? true : false : `${Third}${Fourth}` extends EndDiv4 ? true : false : false; /** * **IsLeapYear**`` * * A boolean operator which tests whether the year component of `T` represents a _leap year_ * or not. * * - attempts to resolve this to `true`/`false` at design time * - however, many of the object-based representations of date/datetime can * only be resolved at runtime so it will return `boolean` in these situations. */ type IsLeapYear = T extends number ? number extends T ? boolean : AsFourDigitYear extends infer Y ? Y extends string ? Detect : Y : never : [Unbrand] extends [DateLike] ? string extends Unbrand ? boolean : Unbrand extends `${infer A extends Digit$5}${infer B extends Digit$5}${infer C extends Digit$5}${infer D extends Digit$5}${string}` ? Detect<`${A}${B}${C}${D}`> : Unbrand extends string ? ParseDate> extends infer P ? P extends Error ? P : P extends ParsedDate ? P[0] extends `${number}` ? Detect : false : boolean : boolean : boolean : Err<`parse-date/invalid-type`, `The value passed into IsLeapYear does not extend DateLike!`, { val: Unbrand; }>; //#endregion //#region src/boolean-logic/operators/datetime/IsLuxonDateTime.d.ts interface Shape$2 { isValid: boolean; toISO: AnyFunction; toFormat: AnyFunction; year: number; zoneName: string; } /** * **IsLuxonDateTime`` * * A boolean operator which returns `true` when `T` appears to be a Luxon DateTime instance. */ type IsLuxonDateTime = [IsAny] extends [true] ? false : [IsNever] extends [true] ? false : [IsUnknown] extends [true] ? boolean : [IsUnion] extends [true] ? UnionMemberExtends extends true ? T extends Shape$2 ? true : boolean : false : IsDictionary extends true ? T extends Shape$2 ? true : false : false; //#endregion //#region src/boolean-logic/operators/datetime/IsMoment.d.ts interface Shape$1 { isValid: AnyFunction; toDate: AnyFunction; format: AnyFunction; isDST: AnyFunction; add: AnyFunction; subtract: AnyFunction; calendar: AnyFunction; fromNow: AnyFunction; creationData: AnyFunction; } /** * **IsMoment`` * * a boolean operator which returns `true` when `T` appears to be a Moment.js instance. */ type IsMoment = [IsAny] extends [true] ? false : [IsNever] extends [true] ? false : [IsUnknown] extends [true] ? boolean : [IsUnion] extends true ? UnionMemberExtends extends true ? boolean : false : T extends Shape$1 ? true : false; //#endregion //#region src/boolean-logic/operators/datetime/IsSameDay.d.ts type IsWide$1 = string extends A ? true : string extends B ? true : number extends A ? true : number extends B ? true : false; type BothNumeric = A extends number ? B extends number ? true : false : false; type EitherAreDateObject$2 = IsJsDate extends true ? true : IsJsDate extends true ? true : IsMoment extends true ? true : IsMoment extends true ? true : IsDayJs extends true ? true : IsDayJs extends true ? true : IsLuxonDateTime extends true ? true : IsLuxonDateTime extends true ? true : false; type GetDatePart$2 = T extends `${infer D}T${string}` ? D : T; type IsLikelyDate = T extends `${number}-${number}-${number}` ? true : T extends `${number}${number}${number}${number}${number}${number}${number}${number}` ? true : false; type IsFourDigitYearString = T extends `${number}` ? T extends `${infer _1}${infer _2}${infer _3}${infer _4}${infer Rest}` ? Rest extends "" ? true : false : false : false; /** * **IsSameDay**`` * * Boolean operator which indicates whether `A` and `B` represent * the same calendar day. */ type IsSameDay = IsWide$1 extends true ? boolean : BothNumeric extends true ? IsFloat extends true ? Err<`invalid-date/float`> : IsFloat extends true ? Err<`invalid-date/float`> : IsNegativeNumber extends true ? Err<`invalid-date/negative`> : IsNegativeNumber extends true ? Err<`invalid-date/negative`> : IsEqual extends true ? true : boolean : A extends string ? B extends string ? IsEqual, GetDatePart$2> extends true ? IsIsoFullDate> extends true ? true : Err<`invalid-date`> : IsLikelyDate> extends true ? IsLikelyDate> extends true ? false : IsFourDigitYearString extends true ? false : Err<`invalid-date`> : IsFourDigitYearString extends true ? IsFourDigitYearString extends true ? IsEqual extends true ? true : false : Err<`invalid-date`> : Err<`invalid-date`> : Err<`invalid-date`> : EitherAreDateObject$2 extends true ? boolean : Err<`invalid-date`>; //#endregion //#region src/boolean-logic/operators/datetime/IsSameMonth.d.ts type GetDatePart$1 = T extends `${infer D}T${string}` ? D : T; type StripLeadingHyphen = T extends `-${infer R}` ? R : T; type GetMonthFromDate = StripLeadingHyphen extends infer Clean extends string ? Clean extends `${string}-${infer M}-${string}` ? M : Clean extends `${string}-${infer M}` ? M : never : never; type IsWide = string extends A ? true : string extends B ? true : number extends A ? true : number extends B ? true : false; type EitherAreDateObject$1 = IsJsDate extends true ? true : IsJsDate extends true ? true : IsMoment extends true ? true : IsMoment extends true ? true : IsDayJs extends true ? true : IsDayJs extends true ? true : IsLuxonDateTime extends true ? true : IsLuxonDateTime extends true ? true : false; /** * **IsSameMonth**`` * * Boolean operator which indicates whether `A` and `B` represent * the same month (regardless/independently of year). */ type IsSameMonth = IsWide extends true ? boolean : A extends string ? B extends string ? IsEqual>, GetMonthFromDate>> extends true ? true : false : EitherAreDateObject$1 extends true ? boolean : Err<`invalid-date/type`> : A extends number ? B extends number ? number extends A ? IsTrue> extends true ? boolean : Err<`invalid-date/numeric`> : number extends B ? boolean : IsEqual extends true ? true : boolean : EitherAreDateObject$1 extends true ? boolean : Err<`invalid-date/type`> : EitherAreDateObject$1 extends true ? boolean : Err<`invalid-date/type`>; //#endregion //#region src/boolean-logic/operators/datetime/IsSameMonthYear.d.ts type GetDatePart = T extends `${infer D}T${string}` ? D : T; type GetYearMonthFromDate = T extends `-${infer Rest}` ? GetYearMonthFromDate : T extends `${infer Y}-${infer M}-${string}` ? `${Y}-${M}` : T extends `${infer Y}-${infer M}` ? `${Y}-${M}` : never; type EitherAreDateObject = IsJsDate extends true ? true : IsJsDate extends true ? true : IsMoment extends true ? true : IsMoment extends true ? true : IsDayJs extends true ? true : IsDayJs extends true ? true : IsLuxonDateTime extends true ? true : IsLuxonDateTime extends true ? true : false; type SameStringMonthYear = string extends A ? boolean : string extends B ? boolean : IsEqual>, GetYearMonthFromDate>> extends true ? true : false; type SameNumericMonthYear = IsInteger extends false ? Err<`invalid-date`, `The numeric values passed into IsSameMonth were not integers which makes them unable to be treated as a date!`, { a: A; b: B; }> : IsInteger extends false ? Err<`invalid-date`, `The numeric values passed into IsSameMonth were not integers which makes them unable to be treated as a date!`, { a: A; b: B; }> : IsEqual extends true ? true : IsEpochInMilliseconds extends true ? IsEpochInMilliseconds extends true ? boolean : boolean : IsEpochInSeconds extends true ? IsEpochInSeconds extends true ? boolean : boolean : boolean; /** * **IsSameMonthYear**`` * * Boolean operator which indicates whether `A` and `B` represent * the same month and year. */ type IsSameMonthYear = [A] extends [string] ? [B] extends [string] ? SameStringMonthYear : boolean : [A] extends [number] ? number extends A ? boolean : [B] extends [number] ? number extends B ? boolean : SameNumericMonthYear : boolean : [B] extends [number] ? boolean : EitherAreDateObject extends true ? boolean : boolean; //#endregion //#region src/boolean-logic/operators/datetime/IsSameYear.d.ts type CompareDateMeta = AM extends Error ? Err<"invalid-date", `The string passed into the first parameter of IsSameYear -- ${As$1} -- is not a valid ISO date! ${AM["message"]}`, { a: A; b: B; }> : BM extends Error ? Err<"invalid-date", `The string passed into the second parameter of IsSameYear -- ${As$1} -- is not a valid ISO date!`, { a: A; b: B; }> : AM extends DateMeta ? BM extends DateMeta ? IsNull extends true ? false : AM["year"] extends BM["year"] ? true : false : boolean : boolean; /** * **IsSameYear**`` * * Boolean operator which indicates whether `A` and `B` represent * the same year. A literal true/false is returned where that is * possible other wise you'll just `boolean` for things which * can only be validated at runtime. * * **Note:** literal types are available at design time when: * - ISO Date/DateTime string are used * - returns `true` when epoch timestamps are the same * - returns `false` when epoch timestamps are more than a year * different * - otherwise we fallback to `boolean` for valid `DateLike` types * * **Related:** * - `IsSameMonthYear`, `IsSameDay`, `IsSameMonth`, * - `isSameMonthYear()`, `isSameYear()`, `isSameMonth()` */ type IsSameYear = number extends A ? boolean : number extends B ? boolean : string extends A ? boolean : string extends B ? boolean : IsFloat extends true ? Err<"invalid-date/float", `A in IsSameYear was a floating point number!`, { A: A; B: B; }> : IsFloat extends true ? Err<"invalid-date/float", `B in IsSameYear was a floating point number!`, { A: A; B: B; }> : IsNegativeNumber extends true ? Err<"invalid-date/negative", `A in IsSameYear was a negative number!`, { A: A; B: B; }> : IsNegativeNumber extends true ? Err<"invalid-date/negative", `B in IsSameYear was a negative number!`, { A: A; B: B; }> : And<[IsNumber, IsNumber]> extends true ? IsEqual extends true ? true : boolean : AsDateMeta extends infer AM ? AsDateMeta extends infer BM ? CompareDateMeta : never : never; //#endregion //#region src/boolean-logic/operators/datetime/validators/IsFourDigitYear.d.ts type Digit$4 = "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9"; /** * Boolean operator which validates that `T` is a * `FourDigitYear` found in ISO strings. */ type IsFourDigitYear = T extends string ? string extends T ? boolean : T extends `${Digit$4}${Digit$4}${Digit$4}${Digit$4}` ? true : false : false; //#endregion //#region src/boolean-logic/operators/datetime/validators/IsTwoDigitDate.d.ts type Digit$3 = "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9"; type ValidTwoDigitDate = `0${Exclude}` | `1${Digit$3}` | `2${Digit$3}` | `3${"0" | "1"}`; type MonthWith30Days = "04" | "06" | "09" | "11"; type DateThrough28 = Exclude; type DateThrough29 = Exclude; type DateThrough30 = Exclude; type TestFeb = TYear extends null ? T extends DateThrough29 ? true : false : IsLeapYear extends true ? IsDoubleLeap extends true ? T extends DateThrough30 ? true : false : T extends DateThrough29 ? true : false : T extends DateThrough28 ? true : false; /** * validates that `T` is a **valid** ISO date string for the * given month and year. * * - if _year_ is not provided for any month other than February * this can also validate but due to leap year you will need * to pass in a year for February dates. * - this will consider both normal leap years and the occasional * "double leap" */ type IsTwoDigitDate = T extends string ? string extends T ? boolean : TMonth extends "02" ? TestFeb : TMonth extends null | undefined ? T extends ValidTwoDigitDate ? true : false : TMonth extends MonthWith30Days ? T extends DateThrough30 ? true : false : T extends ValidTwoDigitDate ? true : false : false; //#endregion //#region src/boolean-logic/operators/datetime/validators/IsTwoDigitMonth.d.ts type Digit$2 = "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9"; type ValidTwoDigitMonth = `0${Exclude}` | `1${"0" | "1" | "2"}`; /** * Boolean operator which tests whether `T` is a valid * ISO month representation. * * - if it is then it can be badged `TwoDigitMonth<"branded">` */ type IsTwoDigitMonth = T extends string ? string extends T ? boolean : T extends ValidTwoDigitMonth ? true : false : false; //#endregion //#region src/boolean-logic/operators/dictionary/HasIndexKeys.d.ts type HasTemplateLiteralKey = Keys extends readonly [infer Head, ...infer Rest] ? IsTemplateLiteral extends true ? true : HasTemplateLiteralKey : false; /** * **HasIndexKeys**`` * * Tests whether the dictionary `T` has _index_ keys. * * ```ts * // true * type T1 = HasIndexKeys<{foo: 1; [key: symbol]: number } * type T2 = HasIndexKeys>; * // false * type F1 = HasIndexKeys<{foo: 1; bar: 2 } * ``` * * **Related:** `HasFixedKeys` */ type HasIndexKeys = string extends keyof T ? true : number extends keyof T ? true : symbol extends keyof T ? true : HasTemplateLiteralKey> extends true ? true : false; //#endregion //#region src/boolean-logic/operators/errors/IsErrMsg.d.ts type IsErrMsg = T extends U & { kind: "ErrMsg"; } ? true : false; //#endregion //#region src/boolean-logic/operators/errors/IsError.d.ts /** * **IsError**`` * * Boolean operator which validates that `T` _extends_ the `Error` type. */ type IsError = [T] extends [null] ? false : [T] extends [Error] ? true : false; //#endregion //#region src/boolean-logic/operators/functions/HasEscapeFunction.d.ts /** * **HasEscapeFunction**`` * * Checks whether the API surface passed in has an escape function defined. */ type HasEscapeFunction = IsAny extends true ? false : IsNever extends true ? false : GetEscapeFunction extends Error ? false : true; //#endregion //#region src/boolean-logic/operators/functions/HasNoParameters.d.ts /** * **HasNoParameters**`` * * Type utility which detects if `T` is both a function and has _no_ parameters in * it's signature. * * ```ts * const fn = (foo: string) => `${foo}bar`; * // true * type P = HasParameters; * ``` */ type HasNoParameters = [IsAny] extends [true] ? false : [IsNever] extends [true] ? false : T extends TypedFunction ? IsEqual>, 0> extends true ? true : false : false; //#endregion //#region src/boolean-logic/operators/functions/HasOneParameter.d.ts type HasOneParameter = IsFunction extends true ? Parameters> : false; //#endregion //#region src/boolean-logic/operators/functions/HasParameters.d.ts /** * **HasParameters**`` * * Type utility which detects if `T` is both a function and whether that * function has _at least_ one type parameter. * ```ts * const fn = (foo: string) => `${foo}bar`; * // true * type P = HasParameters; * ``` */ type HasParameters = [IsAny] extends [true] ? false : [IsNever] extends [true] ? false : T extends TypedFunction ? IsEqual>, 0> extends true ? false : true : false; //#endregion //#region src/boolean-logic/operators/functions/HasVariadicParameters.d.ts type VariadicParameterModifiers = DefineModifiers<["match-variadic-tail", "match-variadic-head", "match-variadic-interior"]>; /** * **HasVariadicParameters**`` * * Tests wether `T` is: * * - a function * - has parameters which are variadic and **not** a wide array type * * You can optionally use any of the following three modifiers for `U`: * * - `match-variadic-tail`, * - `match-variadic-head` * - `match-variadic-interior` * * You can include one or more and these modifiers determine which _kinds_ of * variadic patterns you want to match on. */ type HasVariadicParameters = [IsNever] extends [true] ? false : [IsAny] extends [true] ? boolean : [IsUnknown] extends [true] ? boolean : T extends AnyFunction ? T extends TypedFunction ? Parameters extends infer Params extends readonly unknown[] ? IsVariadicArray extends true ? IsNull extends true ? true : And<[HasModifier<"match-variadic-tail", U, VariadicParameterModifiers>, HasVariadicTail>]> extends true ? true : And<[HasModifier<"match-variadic-head", U, VariadicParameterModifiers>, HasVariadicHead>]> extends true ? true : And<[HasModifier<"match-variadic-interior", U, VariadicParameterModifiers>, HasVariadicInterior>]> extends true ? true : false : false : false : false : false; //#endregion //#region src/boolean-logic/operators/functions/IsEscapeFunction.d.ts /** * **IsEscapeFunction** * * Boolean operator that validates that `T` extends `EscapeFunction` */ type IsEscapeFunction = [IsAny] extends [true] ? false : [IsNever] extends [true] ? false : T extends EscapeFunction ? FnKeyValue extends { escape: true; } ? true : false : false; //#endregion //#region src/boolean-logic/operators/functions/IsFnWithDictionary.d.ts /** * **IsFnWithDictionary**`` * * Checks whether `T` is a function which also includes * key/value dictionary sitting alongside the function. */ type IsFnWithDictionary = [IsAny] extends [true] ? false : [IsNever] extends [true] ? false : [IsUnknown] extends [true] ? boolean : T extends AnyFunction ? T extends TypedFunction ? FnMeta["hasProps"] : boolean : false; //#endregion //#region src/boolean-logic/operators/functions/IsFunction.d.ts /** * **IsFunction**`` * * Checks whether `T` is a function of _any_ kind and that includes * functions with dictionary props sitting alongside the function. * * **Related:** * - `IsNarrowingFn`, `IsStaticFn` * - `IsLiteralFunction`, `IsLiteralLikeFunction`, `IsWideFn` */ type IsFunction = [IsAny] extends [true] ? false : [IsNever] extends [true] ? false : T extends undefined ? false : [T] extends [AnyFunction] ? true : false; //#endregion //#region src/boolean-logic/operators/functions/IsLiteralFn.d.ts type LiteralFnModifiers = DefineModifiers<["allow-variadic-tail"]>; /** * **IsLiteralFn**`` * * A boolean operator which checks that `T` is a function with: * * - a fixed length of parameters * - you can optionally allow a variadic tail to the parameters * by setting `allow-variadic-tail` * - if you do this then there must be at least one static parameter * which is not variadic (aka, it can not be a wide array) * - parameter types can be any type _except for_ `any`, `unknown`, or `never` * - return type can be any type _except for_ `any`, `unknown`, or `never` * * **Related:** * - `IsFunction`, `IsWideFn` * - `IsStaticFn`, `IsNarrowingFn` */ type IsLiteralFn = [IsAny] extends [true] ? false : [IsNever] extends [true] ? false : [IsUnknown] extends [true] ? boolean : T extends TypedFunction ? Not>> extends true ? HasModifier<"allow-variadic-tail", U, LiteralFnModifiers> extends true ? HasVariadicTail> extends true ? true : false : false : IsUnknown> extends true ? false : IsAny> extends true ? false : IsNever> extends true ? false : true : false; //#endregion //#region src/boolean-logic/operators/functions/IsNarrowingFn.d.ts /** * **IsNarrowingFn**`` * * A boolean operator which checks whether `TFn` uses generics * to narrow the input parameters. This is in contrast to a function * which takes literal types rather than _extending_ them. * * **Related:** * - `IsStaticFn` * - `NarrowingFn`, `StaticFn` */ type IsNarrowingFn = [IsAny] extends [true] ? boolean : TFn extends AnyFunction ? TFn extends TypedFunction ? Not> extends true ? FnMeta["params"]["length"] extends 0 ? false : true : false : Not> extends true ? true : false : false; //#endregion //#region src/boolean-logic/operators/functions/IsStaticFn.d.ts /** * Reconstructs a _non-generic_ function from `Fn`'s parameters and return type. * * The return type is normalized: when `ReturnType` collapses to `any` — which * TypeScript does for generic functions whose constraint is a **union** and whose * return weaves the type parameter into a template literal (e.g. * `(name: T) => `hi ${T}``) — we substitute `unknown`. * Leaving `any` in place would let the reconstruction compare _equal_ to the * original generic signature (an `any` return is bilaterally assignable), which * would misclassify a narrowing function as static. */ type RegularFn$1 = Fn extends ((...args: any[]) => any) ? (...args: Parameters) => ([IsAny>] extends [true] ? unknown : ReturnType) : false; type HasExtraProperties$1 = T extends ((...args: any[]) => any) ? keyof T extends never ? false : true : false; type ExtractProps = T extends ((...args: any[]) => any) ? Omit any)> : never; type IsStaticCheck = [IsEqual, T>] extends [true] ? true : HasExtraProperties$1 extends false ? false : [IsEqual & ExtractProps, T>] extends [true] ? true : false; /** * **IsStaticFn**`` * * A boolean operator which checks that `TFn`: * * - is a function * - _does not_ use generics to narrow input parameters * * **Related:** `LiteralFn`, `IsNarrowFn` */ type IsStaticFn = [IsAny] extends [true] ? boolean : [IsNever] extends [true] ? false : [IsUnknown] extends [true] ? boolean : T extends AnyFunction ? T extends TypedFunction ? IsStaticCheck extends true ? FnMeta["params"]["length"] extends 0 ? false : true : false : IsStaticCheck extends true ? true : false : false; //#endregion //#region src/boolean-logic/operators/functions/IsThenable.d.ts /** * Boolean operator which tests whether `T` is a * `Thenable` variable (aka, promise-like). */ type IsThenable = [IsAny] extends [true] ? false : [IsNever] extends [true] ? false : [IsUnknown] extends [true] ? boolean : T extends Thenable ? true : false; type IsStrictPromise = [IsAny] extends [true] ? false : [IsNever] extends [true] ? false : [IsUnknown] extends [true] ? boolean : T extends { then: (onfulfilled?: (value: any) => any, onrejected?: (reason: any) => any) => any; finally?: (onfinally?: () => void) => any; } ? true : false; //#endregion //#region src/boolean-logic/operators/functions/Returns.d.ts /** * **Returns**`` * * Boolean type utility which detects whether `TFn` is a function * and _extends_ `TExpected` in it's return type. */ type Returns = [IsAny] extends [true] ? false : [IsNever] extends [true] ? false : [IsUnknown] extends [true] ? boolean : T extends TypedFunction ? ReturnType extends TExpected ? true : false : false; //#endregion //#region src/boolean-logic/operators/functions/ReturnsBoolean.d.ts /** * **ReturnsBoolean**`` * * Type utility which indicates whether the _return value_ of `T` is * a `false` value. Possible values are `true`, `false`, or `boolean`. * * Note: any non-functions passed in as `T` are always a **false** value */ type ReturnsBoolean = [IsAny] extends [true] ? false : [IsNever] extends [true] ? false : [IsUnknown] extends [true] ? boolean : T extends TypedFunction ? IsBoolean> : false; //#endregion //#region src/boolean-logic/operators/functions/ReturnsFalse.d.ts /** * **ReturnsTrue**`` * * Type utility which indicates whether the _return value_ of `T` is * a `false` value. Possible values are `true`, `false`, or `boolean`. * * Note: any non-functions passed in as `T` are removed from the result set */ type ReturnsFalse = [IsAny] extends [true] ? false : [IsNever] extends [true] ? false : [IsUnknown] extends [true] ? boolean : T extends TypedFunction ? ReturnType extends false ? true : IsEqual, boolean> extends true ? boolean : false : false; //#endregion //#region src/boolean-logic/operators/functions/ReturnsTrue.d.ts /** * **ReturnsTrue**`` * * Type utility which indicates whether the _return value_ of `T` is * a `true` value. Return value are always either `true` or `false`. * * Note: any non-functions passed in as `T` are always a **false** value * and so is a `boolean` value */ type ReturnsTrue = T extends TypedFunction ? ReturnType extends true ? true : false : false; //#endregion //#region src/boolean-logic/operators/lists/IsNumericArray.d.ts type IsNumericArray = T extends number[] ? true : false; //#endregion //#region src/boolean-logic/operators/literal/HasIndexSignature.d.ts /** * **HasIndexSignature**`` * * Tests whether a container `T` has an _index signature_ as part of * it's type definition. */ type HasIndexSignature = [IsAny] extends [true] ? false : [IsNever] extends [true] ? false : string extends keyof T ? true : number extends keyof T ? true : symbol extends keyof T ? true : false; //#endregion //#region src/boolean-logic/operators/literal/HasWideValues.d.ts type Validate$9 = [] extends T ? false : IsWideType> extends true ? true : Validate$9>; /** * **HasWideValues**`` * * Tests whether any values in the tuple are _wide_ (aka, not a literal) value. */ type HasWideValues = Validate$9; //#endregion //#region src/boolean-logic/operators/literal/IsAlphanumeric.d.ts type Combine = IsNull extends true ? T : T | U; type TestAlphanumeric = T extends `${infer Head extends string}${infer Rest}` ? Head extends Combine ? TestAlphanumeric : false : true; /** * **IsAlphanumeric**`` * * Boolean operator which tests that all characters in `T` are alpha-numeric. * * - if you want to add some additional characters which pass validation you can add * a string or _string union_ type as `U`. * * **Related:** * - `AlphaNumericChar` * - `ValidateAlphanumeric` */ type IsAlphanumeric = string extends T ? boolean : string extends U ? IsAlphanumeric extends true ? true : boolean : TestAlphanumeric; //#endregion //#region src/boolean-logic/operators/literal/IsAny.d.ts /** * **IsAny**`` * * Tests whether a given `T` is of the **any** type. */ type IsAny = [IsNever] extends [true] ? false : 1 extends T & 0 ? true : false; //#endregion //#region src/boolean-logic/operators/literal/IsBooleanLiteral.d.ts /** * **IsBooleanLiteral**`` * * Boolean type utility which detects whether `T` * is a boolean literal (aka, is `true` or `false`) * * **Related:** `IsBoolean`, `IsBooleanExactly` */ type IsBooleanLiteral = [IsAny] extends [true] ? false : [IsNever] extends [true] ? false : [IsTrue] extends [true] ? true : [IsFalse] extends [true] ? true : false; //#endregion //#region src/boolean-logic/operators/literal/IsLiteral.d.ts type LiteralModifiers = DefineModifiers<["include-boundary", "include-any", "include-never"]>; type IsLiteral = [IsAny] extends [true] ? If, HasModifier<"include-boundary", U, LiteralModifiers>]>, true, false> : [IsNever] extends [true] ? If, HasModifier<"include-boundary", U, LiteralModifiers>]>, true, false> : [T] extends [readonly unknown[]] ? IsLiteralTuple : [T] extends [object] ? IsLiteralObject : IsLiteralScalar; //#endregion //#region src/boolean-logic/operators/literal/IsLiteralContainer.d.ts /** * **IsLiteralContainer**`` * * Tests `T` to see if it's a literal container (object or array). */ type IsLiteralContainer = [IsAny] extends [true] ? false : [IsNever] extends [true] ? false : T extends Container ? T extends any[] ? IsLiteralTuple : T extends object ? IsLiteralObject : never : false; //#endregion //#region src/boolean-logic/operators/literal/IsLiteralLike.d.ts /** * the _modifiers_ which `IsLiteralLike` utility exposes */ type LiteralLikeModifiers = DefineModifiers<["allow-variadic-tail", "exclude-unions", "allow-mixed-unions"]>; /** * **IsLiteralLike**`` * * Boolean utility which returns `true` when `T` is _literal like_. This means `true` is returned * any time `T` is: * * - any type which passed the `IsLiteral` test * - any _object_ where the **shape** is literal-like (known keys, literal-like values) * - any _tuple_ where the **shape** is literal-like * - any _union type_ where all members are literal types (unless excluded) * * In essence, the **main** differences between a `Literal` type and a `LiteralLike` type are: * * 1. that _container_ types provide a literal _shape_ even if their type values are not always literal types. * 2. unions which have only literal elements are also allowed in unless explicitly disqualified: * * - using `exclude-unions` makes it so no matching on union types is done * - using `allow-mixed-unions` increases the matches on union types to include not only _literal unions_ * but _mixed unions_ which are unions that include some literal elements but also some wide elements * * 3. The boundary literals `any` and `never` are NEVER considered a _literal like_ type * * **Related:** * - `IsLiteral`, `IsWideType` * - `IsLiteralLikeTuple`, `IsLiteralLikeObject` * - `IsLiteralUnion`, `IsWideUnion`, `IsMixedUnion` */ type IsLiteralLike = [IsAny] extends [true] ? false : [IsNever] extends [true] ? false : [EmptyObject] extends [T] ? number extends As$1, readonly unknown[]>["length"] ? [IsEqual] extends [true] ? true : false : true : [string] extends [T] ? false : [number] extends [T] ? false : [bigint] extends [T] ? false : [symbol] extends [T] ? false : [T] extends [string] ? true : [T] extends [number] ? true : [T] extends [bigint] ? true : [IsBoolean] extends [true] ? true : [T] extends [symbol] ? true : [T] extends [null | undefined] ? true : [IsUnion] extends [true] ? [HasModifier<"exclude-unions", U, LiteralLikeModifiers>] extends [true] ? false : [HasModifier<"allow-mixed-unions", U, LiteralLikeModifiers>] extends [true] ? IsLiteralUnion extends true ? true : IsMixedUnion extends true ? true : false : IsLiteralUnion : [T] extends [readonly unknown[]] ? IsLiteralTuple : [object] extends [T] ? false : [string] extends [keyof T] ? false : [T] extends [object] ? IsLiteralLikeObject : false; //#endregion //#region src/boolean-logic/operators/literal/IsLiteralLikeArray.d.ts /** * **IsLiteralLikeArray**`` * * Tests whether the _shape_ of the array has at least one fixed type * (aka, non-variadic). * * ```ts * // true * type T1 = IsLiteralLikeArray<[...string[], number]>; * type T2 = IsLiteralLikeArray<[string, number, ...boolean[]]>; * // false * type F1 = IsLiteralLikeArray<(string | number)[]>; * ``` * * **Related:** `IsLiteralLikeTuple` */ type IsLiteralLikeArray = [IsAny] extends [true] ? false : [IsNever] extends [true] ? false : [T] extends [readonly unknown[]] ? [IsVariadicArray] extends [true] ? number extends DropVariadic["length"] ? false : true : [number] extends [T["length"]] ? false : true : false; //#endregion //#region src/boolean-logic/operators/literal/IsLiteralLikeObject.d.ts type _Keys$1 = UnionToTuple>; type CheckIt = IsNever extends true ? false : IsEqual<_Keys$1, []> extends true ? false : true; /** * **IsLiteralLikeObject**`` * * Tests whether an object is a literal. An object literal is any of the following: * * - any KV-like type which has an **explicit** number of keys * - if `Keys["length"]` translates to `number` than this is **not** a literal. */ type IsLiteralLikeObject = [IsAny] extends [true] ? false : [IsNever] extends [true] ? false : [IsUnknown] extends [true] ? boolean : [T] extends [readonly any[]] ? false : T extends Dictionary ? IsEqual extends true ? true : CheckIt : false; //#endregion //#region src/boolean-logic/operators/literal/IsLiteralLikeTuple.d.ts /** * **IsLiteralLikeTuple**`` * * Tests whether the _shape_ of the tuple is literal. * * - to be a literal-like tuple it must have a fixed number of keys * - the _types_ at each key position can be wide or literal and still make a match * * ```ts * // true * type T1 = IsLiteralLikeTuple<[1, 2, 3]>; * type T2 = IsLiteralLikeTuple<[string, number, string]>; * // false * type F1 = IsLiteralLikeTuple; * type F2 = IsLiteralLikeTuple; * ``` * * **Related:** `IsLiteralLikeArray` */ type IsLiteralLikeTuple = [IsAny] extends [true] ? false : [IsNever] extends [true] ? false : [T] extends [readonly unknown[]] ? [number] extends [T["length"]] ? false : IsUnion extends true ? false : true : false; //#endregion //#region src/boolean-logic/operators/literal/IsLiteralNumber.d.ts type LiteralNumberModifiers = DefineModifiers<["allow-union"]>; type IsEveryUnionMemberLiteralNumber = T extends number ? number extends T ? false : true : false; /** * **IsLiteralNumber**`` * * Boolean operator which validates that `T` is a **literal** `number` type. * * - if you add the `"allow-union"` modifier to `U` * - it will match on unions where every element of the union is a number literal * - by default no union types will match */ type IsLiteralNumber = [IsAny] extends [true] ? false : [IsNever] extends [true] ? false : [IsUnion] extends [true] ? [HasModifier<"allow-union", U, LiteralNumberModifiers>] extends [true] ? IsEveryUnionMemberLiteralNumber : false : T extends number ? number extends T ? false : true : false; //#endregion //#region src/boolean-logic/operators/literal/IsLiteralObject.d.ts type AllValuesAreLiteral = And<{ [K in keyof T]: T[K] extends Scalar ? IsLiteralScalar : T[K] extends Container ? IsLiteralContainer : T[K] extends AnyFunction ? T[K] extends TypedFunction ? true : false : never }>; type LiteralObjectModifiers = DefineModifiers<["allow-wide-values"]>; /** * **IsLiteralObject**`` * * Boolean operator which tests whether `T` is a literal object. To * be a literal object `T` must: * * - have 1 or more known keys * - the known key's _values_ are literal types * - can not be a union of literal objects * * If you want to allow for _wide_ value types, you can set `U` to `accept-wide-values` and this * will ensure the object's shape (as defined by it's keys) is a literal but allows more flexibility * for the key values. * ***Related:** `IsLiteralLikeObject`, `IsWideObject` */ type IsLiteralObject = [IsAny] extends [true] ? false : [IsNever] extends [true] ? false : [IsTuple] extends [true] ? false : [T] extends [readonly unknown[]] ? false : [T] extends [(...args: any[]) => any] ? false : [T] extends [object] ? [number] extends [keyof T] ? false : [keyof T] extends [never] ? false : [string] extends [keyof T] ? false : [keyof T] extends [never] ? false : number extends keyof T ? false : HasModifier<"allow-wide-values", U, LiteralObjectModifiers> extends true ? true : AllValuesAreLiteral>, readonly unknown[]>> : false; //#endregion //#region src/boolean-logic/operators/literal/IsLiteralScalar.d.ts type IsLiteralScalar = [IsAny] extends [true] ? false : [IsNever] extends [true] ? false : string extends T ? false : number extends T ? false : bigint extends T ? false : boolean extends T ? false : symbol extends T ? false : T extends string | number | bigint | boolean | symbol | null | undefined ? true : false; //#endregion //#region src/boolean-logic/operators/literal/IsLiteralString.d.ts type LiteralStringModifiers = DefineModifiers<["allow-union"]>; type IsEveryUnionMemberLiteralString = T extends string ? string extends T ? false : true : false; /** * **IsLiteralString**`` * * Boolean operator which validates that `T` is a string literal type. * * - if you add the `"allow-union"` modifier to `U` * - it will match on unions where every element of the union is a string literal * - by default no union types will match */ type IsLiteralString = [IsAny] extends [true] ? false : [IsNever] extends [true] ? false : [IsUnion] extends [true] ? [HasModifier<"allow-union", U, LiteralStringModifiers>] extends [true] ? IsEveryUnionMemberLiteralString : false : T extends string ? string extends T ? false : true : false; //#endregion //#region src/boolean-logic/operators/literal/IsLiteralTuple.d.ts type IsLiteralScalar$1 = T extends string | number | bigint | boolean | symbol | null | undefined ? string | number | bigint | boolean | symbol extends T ? false : true : false; type IsLiteralObject$1 = T extends object ? [IsAny] extends [true] ? false : [IsNever] extends [true] ? false : T extends readonly unknown[] ? false : T extends ((...args: any[]) => any) ? false : number extends keyof T ? false : true : false; type IsLiteralValue = [IsAny] extends [true] ? false : [IsNever] extends [true] ? false : T extends readonly unknown[] ? IsLiteralTuple : T extends object ? IsLiteralObject$1 : IsLiteralScalar$1; /** * **IsLiteralTuple**`` * * Boolean operator which tests whether `T` is a literal tuple where ALL elements are literal types. * A literal tuple must be literal in both shape (fixed-length array) and type (all elements are literals). */ type IsLiteralTuple = [IsAny] extends [true] ? false : [IsNever] extends [true] ? false : T extends readonly unknown[] ? [IsTuple] extends [true] ? T extends readonly [] ? true : T extends readonly [infer First, ...infer Rest] ? [IsLiteralValue] extends [true] ? IsLiteralTuple : false : false : false : false; //#endregion //#region src/boolean-logic/operators/literal/IsNarrower.d.ts /** * **IsNarrower**`` * * tests whether `T` forms a _proper_ subtype of `TWide`? */ type IsNarrower = [T] extends [TWide] ? ([TWide] extends [T] ? false : true) : false; //#endregion //#region src/boolean-logic/operators/literal/IsNever.d.ts /** * **IsNever**`` * * Boolean type utility which check whether `T` is of type _never_. */ type IsNever = [T] extends [never] ? true : false; //#endregion //#region src/boolean-logic/operators/literal/IsNumericLiteral.d.ts /** * **IsNumericLiteral**`` * * Type utility which detects if the type `T` is a * numeric literal. */ type IsNumericLiteral = IfNever extends true ? IfEqual : false>; //#endregion //#region src/boolean-logic/operators/literal/IsStrictlyEmptyObject.d.ts /** Exclude `{}` and `object` from counting as empty */ type IsStrictEmptyObject = IsEmptyObject extends true ? (unknown extends T ? false : true) : false; //#endregion //#region src/boolean-logic/operators/literal/IsStringLiteral.d.ts /** * **IsStringLiteral**`` * * Boolean type utility which detects whether `T` is * a string literal. */ type IsStringLiteral$1 = IsNever extends true ? false : T extends string ? IsEqual extends true ? false : true : false; //#endregion //#region src/boolean-logic/operators/literal/IsTuple.d.ts /** * **IsTuple**`` * * A boolean operator which validates that `T` is a `Tuple`: * * - must extends `readonly any[]`, * - must have a _known_ number of elements */ type IsTuple = [IsAny] extends [true] ? false : [IsNever] extends [true] ? false : [IsUnknown] extends [true] ? boolean : [T] extends [readonly any[]] ? [number] extends [T["length"]] ? false : true : false; //#endregion //#region src/boolean-logic/operators/literal/IsUnitPrimitive.d.ts /** * **IsUnitPrimitive**`` * * Boolean operator which tests that `T` is a singleton primitive type: * * - null, undefined * - literal string (not union) * - literal number (not union) * - literal bigint (not union) * - true, false (not boolean) * - unique symbols (not regular symbols) * * **Related:** `IsNarrower`, `IsLiteral`, `IsLiteralLike`, `IsLiteralUnion` */ type IsUnitPrimitive = [IsAny] extends [true] ? false : [IsNever] extends [true] ? false : [IsUnion] extends [true] ? false : [T] extends [null | undefined] ? true : IsNarrower extends true ? true : IsNarrower extends true ? true : IsNarrower extends true ? true : IsNarrower extends true ? true : IsNarrower extends true ? true : false; //#endregion //#region src/boolean-logic/operators/literal/IsWideArray.d.ts /** * **IsWideArray**`` * * Boolean operator which returns `true` when `T` is a wide array type. * A wide array is one where the length is not fixed (e.g., * `string[]`, `number[]`, `(string | number)[]`). * * - `any` and `never` types return `false` * - `unknown` returns `boolean` */ type IsWideArray = [IsAny] extends [true] ? false : [IsNever] extends [true] ? false : T extends readonly unknown[] ? IsEqual extends true ? number extends DropVariadic["length"] ? true : false : false : false; //#endregion //#region src/boolean-logic/operators/literal/IsWideBoolean.d.ts /** * **IsWideBoolean**`` * * Boolean operator which returns `true` when `T` is the wide `boolean` type. * Returns `false` for literal boolean values like `true` or `false`. */ type IsWideBoolean = IsEqual; //#endregion //#region src/boolean-logic/operators/literal/IsWideContainer.d.ts /** * **IsWideContainer**`` * * Boolean operator which checks if `T` is a **wide** variant of a `Container` type. */ type IsWideContainer = IsEqual extends true ? boolean : T extends Container ? T extends readonly unknown[] ? IsWideArray : T extends object ? IsWideObject : T extends TypedFunction ? TypedFunction extends T ? true : AnyFunction extends T ? true : false : false : false; //#endregion //#region src/boolean-logic/operators/literal/IsWideNumber.d.ts /** * **IsWideNumber**`` * * Boolean operator which returns `true` when a _wide_ number * is passed in as `T`. It reports `false` on all other values * including _numeric literals_. */ type IsWideNumber = IsEqual; //#endregion //#region src/boolean-logic/operators/literal/IsWideObject.d.ts /** * **IsWideObject**`` * * Tests whether `T` is a _wide_ variant of an object. Wide variants * include: * * - `Record`, `Map`, and `WeakMap` are considered **wide** in cases * where the _keys_ of the type have mono-variant * - Set is considered wide when the type it's holding is wide */ type IsWideObject = [IsAny] extends [true] ? false : [IsNever] extends [true] ? false : [T] extends [AnyFunction] ? false : [T] extends [Dictionary] ? [number] extends [Keys$1["length"]] ? true : number extends TupleMeta>["nonVariadicLength"] ? true : HasNonTemplateLiteral> extends true ? false : Keys$1["length"] extends 0 ? false : true : [T] extends [object] ? [IsEqual] extends [true] ? true : [T] extends [Map] ? IsLiteralLike extends true ? false : true : [T] extends [WeakMap] ? IsLiteralLike extends true ? false : true : [T] extends [Set] ? IsLiteralLike extends true ? false : true : [IsLiteralLikeObject] extends [true] ? false : [IsUnion] extends [true] ? false : [keyof T] extends [never] ? false : true : false; //#endregion //#region src/boolean-logic/operators/literal/IsWideScalar.d.ts type WideScalarModifiers = DefineModifiers<["allow-null", "allow-undefined"]>; /** * **IsWideScalar**`` * * Boolean operator which validates whether or not `T` * is considered a "wide type" _and_ extends `Scalar`. * * - by default `undefined` and `null` will always return `false` * as they are considered _literal_ types * - however because they are non-variant literals there are times where * it can be useful to group them together with wide strings, numbers, and * boolean types. * - set `U` to `allow-null` to match against _null_ types * - set `U` to `allow-undefined` to match against _undefined_ types * - set `U` to `["allow-null", "allow-undefined"]` to match on both * _null_ and _undefined_ */ type IsWideScalar = [IsAny] extends [true] ? false : [IsNever] extends [true] ? false : [T] extends [Scalar] ? [IsNull] extends [true] ? [HasModifier<"allow-null", U, WideScalarModifiers>] extends [true] ? true : false : [IsUndefined] extends [true] ? [HasModifier<"allow-undefined", U, WideScalarModifiers>] extends [true] ? true : false : [string] extends [T] ? true : [number] extends [T] ? true : [IsWideSymbol] extends [true] ? true : [IsWideBoolean] extends [true] ? true : false : false; //#endregion //#region src/boolean-logic/operators/literal/IsWideString.d.ts /** * **IsWideString**`` * * Boolean operator which returns `true` when a _wide_ string * is passed in as `T`. It reports `false` on all other values * including _literal strings_. */ type IsWideString = IsEqual; //#endregion //#region src/boolean-logic/operators/literal/IsWideType.d.ts /** * **IsWideType**`` * * Identifies types which are "wide" (and have a narrow variant): * * - string, number, and boolean types * - `string[]`, `number[]` array types * - wide union types like `string | number` * * **Note:** * - types such as `null` and `undefined` **are** considered wide. * - If the `T` passed in is _never_ the result of this operation is * ErrorCondition<"invalid-never"> but this can be made into whatever * you like by setting the `TNever` generic. * - If an ErrorCondition is in `T` then it will be bubbled up */ type IsWideType = [IsAny] extends [true] ? false : [IsNever] extends [true] ? false : [IsWideBoolean] extends [true] ? true : [IsUnknown] extends [true] ? boolean : [IsUnion] extends [true] ? IsWideUnion : [IsLiteralLike] extends [true] ? false : true; //#endregion //#region src/boolean-logic/operators/scalar/boolean/IsBoolean.d.ts /** * **IsBoolean** * * Boolean type utility which detects literal or wide boolean type. */ type IsBoolean = [IsUnion] extends [true] ? [WidenUnion] extends [boolean] ? true : [string] extends [WidenUnion] ? boolean : false : [T] extends [boolean] ? true : false; //#endregion //#region src/boolean-logic/operators/scalar/boolean/IsBooleanLike.d.ts /** * **IsBooleanLike**`` * * Boolean operator which checks whether `T` is a string literal of * either "boolean", "true", or "false". */ type IsBooleanLike = [IsNever] extends [true] ? false : [IsAny] extends [true] ? boolean : [IsUnknown] extends [true] ? boolean : T extends string ? string extends T ? boolean : T extends "boolean" | "true" | "false" ? true : false : false; //#endregion //#region src/boolean-logic/operators/scalar/boolean/IsFalse.d.ts /** * **IsFalse**`` * * Type utility which checks for the narrow type of `false` * ```ts * // true * type T = IsFalse; * // false * type F1 = IsFalse; * type F2 = IsFalse<"foobar">; * ``` */ type IsFalse = [IsNever] extends [true] ? false : [T] extends [null] ? false : [IsBoolean] extends [true] ? [T] extends [false] ? true : false : false; //#endregion //#region src/boolean-logic/operators/scalar/boolean/IsFalsy.d.ts /** * **IsFalsy**`` * * Boolean operator which tests whether `T` is _falsy_. */ type IsFalsy = [T] extends [null] ? true : [T] extends [undefined] ? true : Not>; //#endregion //#region src/boolean-logic/operators/scalar/boolean/IsTrue.d.ts type Process$12 = [IsNever] extends [true] ? TNever : [IsEqual] extends [true] ? true : false; /** * **IsTrue**`` * * Type utility which checks for the narrow type of `true` * ```ts * // true * type T = IsTrue; * // false * type U = IsTrue; * // false * type F2 = IsTrue<"foobar">; * ``` */ type IsTrue = Process$12; //#endregion //#region src/boolean-logic/operators/scalar/boolean/IsTruthy.d.ts /** * **IsTruthy**`` * * A type utility which evaluates `T` for _[truthiness](https://frontend.turing.edu/lessons/module-1/js-truthy-falsy-expressions.html)_ and returns `true` or `false` * where the state can be detected at design time; otherwise returns `boolean`. * * **See Also:** `IfTruthy`, `IfSomeTruthy`, `IfAllTruthy`, and `TruthyReturns` */ type IsTruthy = [T] extends [null | undefined | false | 0 | -0 | ""] ? false : [T] extends [true] ? true : [T] extends [string] ? IsStringLiteral$1 extends true ? true : boolean : [T] extends [number] ? IsNumericLiteral extends true ? [T] extends [0 | -0] ? false : true : boolean : [T] extends [boolean] ? IsFalse extends true ? false : IsTrue extends true ? true : boolean : IsArray extends true ? true : IsDictionary extends true ? true : never; //#endregion //#region src/boolean-logic/operators/scalar/IsNull.d.ts /** * **IsNull**`` * * Type utility which returns a boolean flag based on whether the given * type is **null**. */ type IsNull = IsNever extends true ? false : [IsAny] extends [true] ? false : [T] extends [null] ? true : [Extract] extends [never] ? false : boolean; //#endregion //#region src/boolean-logic/operators/scalar/IsScalar.d.ts /** * **IsScalar**`` * * Type utility which checks if a value is a _scalar_ value (aka, it is * an atomic value and doesn't _contain_ other types). In practical terms this just * means if it's a string, number, boolean, null, or symbol then it is * a **scalar**. Arrays and records of any type are _not_ scalars. * * - Typically this resolves at design-time to true/false, however, in some * cases a union type can not resolve until runtime and a `boolean` value will * be returned. * * **Related:** `IsOptionalScalar` */ type IsScalar = [IsNever] extends [true] ? false : [IsUnion] extends [true] ? [Every, "extends", [Scalar]>] extends [true] ? true : [Some, "extends", [Scalar]>] extends [true] ? boolean : false : [T] extends [Scalar] ? true : false; //#endregion //#region src/boolean-logic/operators/scalar/IsSymbol.d.ts /** * **IsSymbol**`` * * Type utility which returns a boolean flag based on whether the given * type is a **Symbol**. */ type IsSymbol = T extends symbol ? true : false; //#endregion //#region src/boolean-logic/operators/scalar/IsUndefined.d.ts /** * **IsUndefined** * * Boolean type utility returns `true` if `T` is undefined; `false` otherwise */ type IsUndefined = [IsNever] extends [true] ? false : [IsAny] extends [true] ? boolean : [T] extends [undefined] ? true : [Extract] extends [never] ? false : boolean; //#endregion //#region src/boolean-logic/operators/scalar/numeric/AllNumericLiterals.d.ts /** * **AllNumericLiterals**`` * * Boolean operator which checks whether **all** of the * passed in elements are _numeric literals_. */ type AllNumericLiterals = And<{ [K in keyof T]: IsNumericLiteral }>; //#endregion //#region src/boolean-logic/operators/scalar/numeric/HaveSameNumericSign.d.ts /** * **HaveSameNumericSign**`` * * Validates that `A` _and_ `B` are both negative number or both * positive numbers. */ type HaveSameNumericSign = If, IsPositiveNumber extends true ? true : false, IsNegativeNumber extends true ? true : false>; //#endregion //#region src/boolean-logic/operators/scalar/numeric/IsFloat.d.ts /** * **IsFloat**`` * * Boolean operator which tests whether `T` is a **float** representation of * a `NumberLike` type `T`. * * **Warning:** when using numeric values like `1.0` the `.0` portion is lost before * making the comparison so it is not possible to mark this as a float value. * However, the string literal version of `"1.0"` **is** marked as a float. */ type IsFloat = [IsNever] extends [true] ? false : [T] extends [NumberLike] ? [IsStringLiteral$1<`${T}`>] extends [true] ? [HasCharacters<`${T}`, ".">] extends [true] ? true : false : boolean : false; //#endregion //#region src/boolean-logic/operators/scalar/numeric/IsGreaterThan.d.ts type IsWideNumberLike$1 = number extends T ? true : `${number}` extends T ? true : false; /** * **IsGreaterThan**`` * * Boolean type operator which determines whether `A` * is _greater than_ `B`. * * **Related:** * - wraps `GreaterThan` and allows both _numbers_ and numeric string literals * - `IsGreaterThanOrEqual`, `IsLessThan`, `IsLessThanOrEqual` */ type IsGreaterThan = IsWideNumberLike$1 extends true ? boolean : IsWideNumberLike$1 extends true ? boolean : [CompareNumbers] extends ["greater"] ? true : false; /** * **IsGreaterThanOrEqual**`` * * Test whether `A` is _greater than_ or _equal_ to `B`. */ type IsGreaterThanOrEqual = IsWideNumberLike$1 extends true ? boolean : IsWideNumberLike$1 extends true ? boolean : [CompareNumbers] extends ["greater" | "equal"] ? true : false; //#endregion //#region src/boolean-logic/operators/scalar/numeric/IsInteger.d.ts /** * **IsInteger**`` * * Boolean operator which tests whether `T` is a **integer** representation of * a `NumberLike` type `T`. */ type IsInteger = [IsNever] extends [true] ? false : [T] extends [NumberLike] ? [IsStringLiteral$1<`${T}`>] extends [true] ? [HasCharacters<`${T}`, ".">] extends [true] ? false : true : boolean : false; //#endregion //#region src/boolean-logic/operators/scalar/numeric/IsLessThan.d.ts type IsWideNumberLike = number extends T ? true : `${number}` extends T ? true : false; /** * **IsLessThan**`` * * Boolean type operator which determines whether `A` * is _less than_ `B`. * * - this wraps the `LessThan` utility and provides * the ability to pass in numbers _or_ numeric * string literals * - if you KNOW you'll be using numbers using `LessThan` * reduces type complexity a little bit. */ type IsLessThan = IsWideNumberLike extends true ? boolean : IsWideNumberLike extends true ? boolean : [CompareNumbers] extends ["less"] ? true : false; /** * **IsLessThanOrEqual**`` * * Test whether `A` is _less than_ or _equal_ to `B`. * * **Related:** * - wraps `LessThanOrEqual` and allows not only numbers but numeric * string literals to be passed in. */ type IsLessThanOrEqual = IsWideNumberLike extends true ? boolean : IsWideNumberLike extends true ? boolean : [CompareNumbers] extends ["less" | "equal"] ? true : false; //#endregion //#region src/boolean-logic/operators/scalar/numeric/IsNegativeNumber.d.ts /** * **IsNegativeNumber**`` * * A boolean utility which returns true when `T` is a numerically * negative value. This includes string literal representations of * a number. */ type IsNegativeNumber = T extends NumberLike ? IsWideType extends true ? boolean : T extends number ? AsString extends `-${number}` ? true : false : T extends string ? T extends `-${number}` ? true : false : false : false; //#endregion //#region src/boolean-logic/operators/scalar/numeric/IsNumber.d.ts /** * **IsNumber**`` * * Boolean type utility testing whether `T` is a numeric type. */ type IsNumber = [IsUnion] extends [true] ? WidenUnion extends number ? true : number extends WidenUnion ? boolean : false : [T] extends [number] ? true : false; //#endregion //#region src/boolean-logic/operators/scalar/numeric/IsNumberLike.d.ts /** * **IsNumberLike**`` * * Boolean operator which validates that `T` is a number or `${number}` */ type IsNumberLike = IsNever extends true ? false : IsNumber extends true ? true : DoesExtend extends true ? true : false; //#endregion //#region src/boolean-logic/operators/scalar/numeric/IsPositiveNumber.d.ts /** * **IsPositiveNumber**`` * * Boolean operator which checks whether the value `T` is a _positive_ number. * * **Related:** `IsNegativeNumber`, `Abs`, `InvertNumericSign` */ type IsPositiveNumber = IsNegativeNumber extends true ? false : true; //#endregion //#region src/boolean-logic/operators/scalar/string/EndsWith.d.ts type CheckOne = TComparator extends string ? TComparator extends "" ? false : TValue extends `${string}${TComparator}` ? true : false : false; type Check$2 = true extends CheckOne ? true : false; /** * **EndsWith** * * A type utility which checks whether `TValue` _ends with_ the * value of `TComparator`. * * - numeric values for `TValue` will be converted into string literals * prior to comparison * - a tuple value in `TComparator` is allowed and will test whether * _at least one_ type Ends the sequence for TValue */ type EndsWith = [IsAny] extends [true] ? false : [IsNever] extends [true] ? false : [IsUnknown] extends [true] ? boolean : string extends TValue ? boolean : number extends TValue ? boolean : number extends TComparator ? boolean : string extends TComparator ? boolean : Check$2<`${TValue}`, TComparator extends readonly (string | number)[] ? ToStringArray : TComparator extends (string | number) ? [`${TComparator}`] : never>; //#endregion //#region src/boolean-logic/operators/scalar/string/EndsWithNumber.d.ts /** * **EndsWithNumber**`` * * Boolean operator which tests whether `T` is a string and _ends with_ * a numeric character. */ type EndsWithNumber = T extends string ? string extends T ? boolean : T extends "" ? false : LastChar extends NumericChar ? true : false : false; //#endregion //#region src/boolean-logic/operators/scalar/string/HasCharacters.d.ts type Process$11 = TStr extends `${string}${TChars}${string}` ? true : false; type ProcessTuple = TOp extends "any" ? Or<{ [K in keyof TChars]: TStr extends `${string}${TChars[K]}${string}` ? true : false }> : And<{ [K in keyof TChars]: TStr extends `${string}${TChars[K]}${string}` ? true : false }>; type PreProcess$3 = IsUnion extends true ? UnionToTuple extends readonly string[] ? ProcessTuple, TOp> : never : Process$11; /** * **HasCharacters**`` * * Boolean type utility which tests whether `TStr` has _any_ of the * characters in `TChars`. * * - If you would prefer to test for ALL characters matching then * you can change `TOp` to "all". * * **Related:** `NotCharacters` */ type HasCharacters = IsStringLiteral$1 extends true ? TChars extends string ? IsStringLiteral$1 extends true ? PreProcess$3 : boolean : TChars extends readonly string[] ? AllStringLiterals extends true ? ProcessTuple : boolean : boolean : boolean; //#endregion //#region src/boolean-logic/operators/scalar/string/IsAllCaps.d.ts /** * **IsAllCaps**` * * Boolean operator which returns _true_ when `T` consists of ALL capital letters. * * - Note: non-alphabetic characters are ignored by this utility * * ```ts * // true * type T = AllCaps<"FOOBAR">; * type T2 = AllCaps<"FOOBAR2">; * // false * type T = AllCaps<"FooBar">; * // boolean * type T = AllCaps; * ``` * * **Related:** `IsAllLowercase` */ type IsAllCaps = string extends T ? boolean : T extends Uppercase ? true : false; //#endregion //#region src/boolean-logic/operators/scalar/string/IsAllLowercase.d.ts /** * **IsAllLowercase**`` * * Boolean operator which indicates whether `T` has _all_ lowercase characters in it. * Valid values are: * * - note: any non-alphabetic characters are ignored in the evaluation * * ```ts * // true * type T = AllCaps<"foobar">; * // false * type T = AllCaps<"FooBar">; * // boolean * type T = AllCaps; * ``` */ type IsAllLowercase = string extends T ? boolean : If, true, false>; //#endregion //#region src/boolean-logic/operators/scalar/string/IsCssHexadecimal.d.ts /** * **IsHexadecimal**`` * * Ensures that `T` is a valid hexadecimal and converts to **never** * otherwise. */ type IsCssHexadecimal = T extends string ? IsStringLiteral$1 extends true ? T extends `#${infer Rest}` ? IsHexadecimal : false : boolean : false; //#endregion //#region src/boolean-logic/operators/scalar/string/IsCsv.d.ts type Validate$8 = { [K in keyof T]: Trim extends "" ? false : Kind extends Unset ? true : Trim extends Kind ? true : false }; /** * **IsCsv**`` * * Tests that the string `T` is a valid CSV; which means: * * - must have at least one `,` * - once whitespace is trimmed away, each element must contain something other * than an empty string. * - if `K` is set then it will also ensure that trimmed values _extend_ `K` * * **Note:** _a trailing comma **is** allowed._ */ type IsCsv = [IsAny] extends [true] ? false : [IsNever] extends [true] ? false : [IsUnknown] extends [true] ? boolean : HasCharacters extends true ? Contains extends true ? false : And, K>> : false; //#endregion //#region src/boolean-logic/operators/scalar/string/IsDotPath.d.ts type CheckForInvalid = HasCharacters extends true ? true : StartsWith extends true ? true : EndsWith extends true ? true : Contains extends true ? true : false; /** * **IsDotPath**`` * * Boolean operator which detects whether a given `T` should be considered a * "dot path". Results based on `T` are: * * - `false` - any non-string type or any string literal in which `DotPath` resolves * to false (including _never_ value). * - `boolean` - a wide string type * - `true` - a string literal value where `DotPath` does not resolve to _never_. * * Note: this utility does not validate that `T` is a _valid_ dot path for a particular * container; only that it is a valid looking dotpath. If you want this validation use * `IsValidDotPath` instead. */ type IsDotPath = [IsNever] extends [true] ? false : T extends string ? [IsEqual] extends [true] ? true : IsStringLiteral$1 extends true ? CheckForInvalid extends true ? TElse : TIf : TMaybe : false; //#endregion //#region src/boolean-logic/operators/scalar/string/IsEmptyString.d.ts /** * **IsEmptyString**`` * * Returns: * - `true` when string T is a literal _and_ equal to "" * - `boolean` when string T is wide * - `false` for all other conditions */ type IsEmptyString = T extends string ? IsStringLiteral$1 extends true ? IsEqual extends true ? true : false : boolean : false; //#endregion //#region src/boolean-logic/operators/scalar/string/IsSingleChar.d.ts /** * **IsSingleChar**`` * * Boolean operator which returns true/false/boolean based on whether `T` is a */ type IsSingleChar = T extends string ? Length extends 1 ? true : If, false, boolean> : false; //#endregion //#region src/boolean-logic/operators/scalar/string/IsSingularNoun.d.ts /** * **IsSingularNoun**`` * * Boolean operator which returns: * * - `true` - if `T` is a string literal with only `Alpha` chars and ending in * character defined by `SingularNounEnding`. * - `boolean` - if `T` is a wide string type * - `false` - all other conditions */ type IsSingularNoun = T extends string ? If, IfNever, false, true>, boolean> : false; //#endregion //#region src/boolean-logic/operators/scalar/string/IsString.d.ts /** * **IsString** * * Type utility which returns true/false based on whether `T` is a * string (wide or narrow). */ type IsString = [IsUnion] extends [true] ? WidenUnion extends string ? true : string extends WidenUnion ? boolean : false : [T] extends [string] ? true : false; //#endregion //#region src/boolean-logic/operators/scalar/string/IsSubstring.d.ts /** * **IsSubstring**`` * * type operator which validates if `TFind` is a string subset of * `TContent`. */ type IsSubstring = As$1; //#endregion //#region src/boolean-logic/operators/scalar/string/IsUrl.d.ts type HasUrlPath = And<[Not>>, Or<[Extends, "">, Extends, `/${string}`>, string extends GetUrlPath ? true : false]>]>; type HasUrlSource = Not>>; type HasNetworkProtocolReference = Extends}${string}`>; /** * **IsUrl**`` * * Boolean operator which tests whether the passed in `TTest` * is a valid URL. * * **Note:** by default it will only check the `https` protocol * but you can choose any set `TProtocol` with anything from `NetworkProtocol` * if you like. * * **Note:** you can add **optional** as a part of the protocol union * type and it will then accept the protocols you've selected or a URL * without a protocol. */ type IsUrl = TTest extends string ? IsStringLiteral$1 extends true ? And<[Or<[HasNetworkProtocolReference, Extends<"optional", TProtocol>]>, HasUrlPath, HasUrlSource]> : boolean : false; //#endregion //#region src/boolean-logic/operators/scalar/string/IsValidDotPath.d.ts /** * **IsValidDotPath**`` * * - if `TContainer` is a literal value than it will validate against * the _actual_ dot paths which are valid for the container. * - if `TContainer` is a wide container type then it will generically validate * whether the dot path _could_ be a valid path. * - if `TContainer` isn't a container at all then the only valid dot path is * an empty string * - a DotPath of either "" or null is _always_ valid because these are _identity_ * paths that simply return the container. */ type IsValidDotPath = IsEqual extends true ? true : IsLiteralLikeObject extends true ? IsTuple extends true ? Contains, TDotPath> : IsContainer extends true ? IsDotPath : IsEqual extends true ? true : false : IsContainer extends true ? IsDotPath : IsEqual extends true ? true : false; //#endregion //#region src/boolean-logic/operators/scalar/string/IsWhitespace.d.ts type IsWhitespace = T extends string ? IsWideString extends true ? boolean : StripChars extends "" ? true : false : false; //#endregion //#region src/boolean-logic/operators/scalar/string/Network-operators.d.ts /** * **IsIp4Octet**`` * * Checks whether `T` is a valid IPv4Octet. */ type IsIp4Octet = T extends number ? IsIp4Octet<`${T}`> : T extends string ? IsStringLiteral$1 extends true ? T extends Ip4Octet ? true : false : boolean : false; /** * **IsHexadecimal**`` * * Boolean operator which tests the string `T` to ensure * all characters are valid hexadecimal digits/chars. */ type IsHexadecimal = T extends string ? IsStringLiteral$1 extends true ? HasOtherCharacters, NumericChar | "a" | "b" | "c" | "d" | "e" | "f"> extends true ? false : true : boolean : false; /** * **IsIp6HexGroup**`` * * Tests whether `T` is a valid hexadecimal group for an IP6 * Group. To be valid means: * * - each digit must be a hexadecimal digit * - There will be between 1 and 4 digits */ type IsIp6HexGroup = T extends string ? IsStringLiteral$1 extends true ? IsLessThan, 5> extends true ? IsGreaterThan, 0> extends true ? IsHexadecimal : false : false : boolean : false; type DeepOctetCheck = [] extends T ? true : IsIp4Octet> extends true ? DeepOctetCheck> : false; /** * **IsIp4Address**`` * * Validates that `T` is a _valid_ IPv4 address by: * * - making sure the basic `${number}.${number}.${number}.${number}` * - and then that each octet is a valid number between 0 and 255 */ type IsIp4Address = T extends string ? IsStringLiteral$1 extends true ? T extends Ip4AddressLike ? Split["length"] extends 4 ? DeepOctetCheck> : false : false : boolean : never; type _EachGroup = { [K in keyof T]: IsIp6HexGroup }; type IsIp6Address = T extends string ? IsStringLiteral$1 extends true ? T extends Ip6AddressFull ? And<_EachGroup>> : Ip6GroupExpansion extends Ip6AddressFull ? And<_EachGroup, ":">>> : false : boolean : false; /** * **IsIpAddress**`` * * A boolean operator which validates that `T` is either a V4 or V6 IP * Address. */ type IsIpAddress = T extends string ? IsStringLiteral$1 extends true ? IsIp4Address extends true ? true : IsIp6Address extends true ? true : false : boolean : false; /** * **HasIpAddress**`` * * a boolean operator which tests whether a string literal `T` has an IP address * in it. */ type HasIpAddress = T extends string ? IsStringLiteral$1 extends true ? T extends `${string}${infer IpAddress extends Ip4AddressLike | Ip6Address | Ip6Subnet}${string}` ? IsIp4Address : false : boolean : never; type _TLD = Lowercase extends `${LowerAlphaChar}${LowerAlphaChar}${infer Rest}` ? HasOtherCharacters extends true ? false : true : false; type _DomainLabel = T extends "" ? false : HasOtherCharacters, LowerAlphaChar | NumericChar | "-" | "_"> extends true ? false : true; type _DomainName = T extends `${infer Label}.${infer Rest}` ? _DomainLabel

]> extends true ? GetUrlQueryParams extends `${string}${P}=${string}` ? true : false : boolean; //#endregion //#region src/boolean-logic/operators/scalar/string/PhoneOperators.d.ts /** * **IsPhoneNumber**`` * * Boolean operator which tests whether `T` has a * type that supports it being a phone number. * * **Note:** * * - this utility relies on the using the `PhoneNumber` validation * technique to determine that whether it is a phone number but whereas * this utility returns `T` _or_ and `ErrorCode` this produces a boolean * outcome. * * **Related:** `PhoneNumber`, `HasPhoneCountryCode` */ type IsPhoneNumber = IsError> extends true ? false : UnionMemberExtends extends true ? boolean : true; /** * **HasPhoneCountryCode**`` * * Boolean operator which validates whether the passed in `T` has a country code leading it (ignoring any leading * whitespace): * * - by default, the country code is not only parsed out of the phone number but also validated against an world * wide index of valid country codes * - if you want to just validate that user _attempted_ to express a country code then you can change the check by * setting `TExplicit` to **false**. * * **Related:** `IsPhoneNumber`, `PhoneNumber` */ type HasPhoneCountryCode = TPhone extends string ? IsStringLiteral$1 extends true ? IsTrue extends true ? GetPhoneCountryCode extends PhoneCountryCode ? true : false : GetPhoneCountryCode extends "" ? false : true : boolean : false; //#endregion //#region src/boolean-logic/operators/scalar/string/StartsWith.d.ts type Check$1 = Or<{ [K in keyof TComparator]: TValue extends `${TComparator[K]}${string}` ? IsEqual extends true ? false : true : false }>; /** * **StartsWith** * * A type utility which checks whether `TValue` _starts with_ the * value of `TComparator`. * * - numeric values for `TValue` will be converted into string literals * prior to comparison * - a tuple value in `TComparator` is allowed and will test whether * _any_ of the patterns start `TValue` * - a union type for `TComparator` is allowed so long as it's only for a single character * - this can be much more type efficient for unions with lots of characters * - if you need larger pattern matches then use a Tuple for `TComparator` * */ type StartsWith = [IsUnion] extends [true] ? FirstChar<`${TValue}`> extends TComparator ? true : false : [IsAny] extends [true] ? false : [IsNever] extends [true] ? false : [IsUnknown] extends [true] ? boolean : string extends TValue ? boolean : number extends TValue ? boolean : number extends TComparator ? boolean : string extends TComparator ? boolean : Check$1<`${TValue}`, TComparator extends readonly (string | number)[] ? ToStringArray : TComparator extends (string | number) ? [`${TComparator}`] : never>; //#endregion //#region src/boolean-logic/operators/scalar/string/StartsWithNumber.d.ts /** * **StartsWithNumber**`` * * Boolean operator which tests whether `T` is a string and _starts with_ * a numeric character. */ type StartsWithNumber = T extends string ? string extends T ? boolean : T extends "" ? false : FirstChar extends NumericChar ? true : false : false; //#endregion //#region src/boolean-logic/operators/scalar/string/YouTube-operators.d.ts type VideoUrlKind = "single-video" | "video-in-playlist" | "both"; /** * **IsYouTubeUrl**`` * * Boolean operator which returns _true_ when the string is a * possible YouTube URL. */ type IsYouTubeUrl = [T] extends [string] ? [IsStringLiteral$1] extends [true] ? [T] extends [YouTubeUrl] ? true : false : boolean : false; type _VideoKind = TQueryParams extends `${string}list=${string}` ? TKind extends "single-video" ? false : true : TKind extends "video-in-playlist" ? false : true; /** * **IsYouTubeVideoUrl**`` * * Boolean operator which returns _true_ when the string is a * possible YouTube URL which is for playing a video. * * **Note:** by default any URL which plays a video is allowed but * you can change `TKind` to "single-video" or "video-in-playlist" * to isolate to just one of the play styles. * * **Related:** `IsYouTubeUrl`, `YouTubeVideoUrl` */ type IsYouTubeVideoUrl = [TTest] extends [string] ? [IsStringLiteral$1] extends [true] ? [TTest] extends [YouTubeVideoUrl] ? _VideoKind, TKind> : false : boolean : false; /** * **IsYouTubeUrl**`` * * Boolean operator which returns _true_ when the string is a * possible YouTube URL. */ type IsYouTubePlaylist = [T] extends [string] ? [IsStringLiteral$1] extends [true] ? [T] extends [YouTubePlaylistUrl] ? true : false : boolean : false; //#endregion //#region src/boolean-logic/operators/scalar/symbol/IsUniqueSymbol.d.ts /** * **IsUniqueSymbol**`` * * Boolean operator which is true if T is a **unique symbol** type: * * - it extends `symbol` * - it's not the wide `symbol` itself * - it's not a union (so e.g., `A | B` where A,B are distinct unique symbols is false) * - excludes `any` / `never` * * **Related:** `IsWideSymbol` */ type IsUniqueSymbol = IsAny extends true ? false : IsNever extends true ? false : [T] extends [symbol] ? IsEqual extends true ? false : IsUnion extends true ? false : true : false; //#endregion //#region src/boolean-logic/operators/scalar/symbol/IsWideSymbol.d.ts /** * **IsWideSymbol**`` * * Boolean operator which is true if T is a **wide** symbol type: * * - it extends `symbol` * - it's not the wide `symbol` itself * - it's not a union (so e.g., `A | B` where A,B are unique symbols is false) * - note that any unique symbol in a union with the wide symbol type widens the * type immediately to a wide symbol * - excludes `any` / `never` * * **Related:** `IsUniqueSymbol` */ type IsWideSymbol = [IsAny] extends [true] ? false : [IsNever] extends [true] ? false : [T] extends [symbol] ? [IsEqual] extends [true] ? [IsUnion] extends [true] ? false : true : false : false; //#endregion //#region src/boolean-logic/operators/sets/Contains.d.ts type StringLiteralType = string | number | boolean; type Cmp = TContent extends [infer Head, ...infer Rest] ? [TOp] extends ["equals"] ? [IsEqual] extends [true] ? true : [IsWideType] extends [true] ? Cmp : [IsUnion] extends [true] ? [TComparator] extends [Head] ? [Head] extends [TComparator] ? Cmp : true : Cmp : [TComparator] extends [Head] ? [Head] extends [TComparator] ? true : Cmp : Cmp : [TOp] extends ["extends"] ? [DoesExtend] extends [true] ? true : Cmp : [TOp] extends ["auto"] ? [IsNull] extends [true] ? [IsNull] extends [true] ? true : Cmp : [IsUndefined] extends [true] ? IsUndefined extends true ? true : Cmp : [DoesExtend] extends [true] ? true : Cmp : never : false; /** * **Contains**`` * * Checks whether `TContent` _extends_ (or _equals_) the type of `TComparator`: * * - when `TContent` is an array/tuple * - each item is compared to `TComparator` * - by default the comparison operator will "extends" except for `null` and `undefined` * which we will use "equals" so that these two similar variants can be kept separate * - if you would like to modify the comparison operator you can set `TOp`, values are: * - `auto` (_the default_) - primarily uses an _extends_ comparison but with * `null` and `undefined` it will use strict equality. * - `extends` - uses _extends_ including with "null" and "undefined" * - `equals` - uses the _equals_ operator for all comparisons * - if `TContent` is a string or numeric type then it will report on whether `TComparator` * has been found as a string subset * * **Related:** * - `NarrowlyContains`, * - `ContainsSome`, `ContainsAll` */ type Contains = [string] extends [TContent] ? boolean : [number] extends [TContent] ? boolean : [TContent] extends [string | number] ? [IsWideType] extends [true] ? boolean : IsSubstring<`${TContent}`, AsString>> : [TContent] extends [readonly unknown[]] ? Cmp : never; //#endregion //#region src/boolean-logic/operators/sets/ContainsAll.d.ts /** * **ContainsAll**`` * * Type utility which provides a boolean response based on * whether _all_ of the values in `THasAll` are _contained_ by `TContent`. * * - `TContent` can be either a tuple value or a string/numeric value * - for _string_ content all of the substrings found in `THasAll` * must be found in that string * - all numeric content is first converted to a string literal before * making any comparisons. * * **Related:** `Contains`, `NarrowlyContains` */ type ContainsAll = IsWideContainer extends true ? boolean : And<{ [K in keyof THasAll]: TContent extends number ? Contains, THasAll[K]> : Contains }>; //#endregion //#region src/boolean-logic/operators/sets/ContainsSome.d.ts /** * **ContainsSome**`` * * Type utility which provides a boolean response based on * whether the list `TList` contains _some_ of the values passed * in for `TFind`. * * **Related:** `DoesExtend`, `Contains` * * @deprecated use `Contains` instead */ type ContainsSome = Or<{ [K in keyof TFind]: Contains }>; //#endregion //#region src/boolean-logic/operators/sets/HasAny.d.ts type TestArray$1 = T extends (infer _U)[] ? any[] extends T ? boolean : T extends readonly [] ? false : T extends readonly [infer First, ...infer Rest] ? IsAny extends true ? true : Rest extends readonly unknown[] ? TestArray$1 : false : false : T extends readonly [] ? false : T extends readonly [infer First, ...infer Rest] ? IsAny extends true ? true : Rest extends readonly unknown[] ? TestArray$1 : false : false; type Validate$7 = IsAny extends true ? Err<`invalid/has-any`, `The type passed into 'HasAny' was 'any'! This utility requires that T be a container type.`> : IsNever extends true ? Err<`invalid/has-any`, `The type passed into 'HasAny' was 'never'! This utility requires that T be a container type.`> : T; /** * **HasAny**`` * * Test whether the container `T` has any values which are the `any` type. * * - if `T` is a wide type then this utility will always return `boolean` */ type HasAny = Validate$7 extends Error ? Validate$7 : IsWideContainer extends true ? boolean : T extends readonly unknown[] ? TestArray$1 : T extends Dictionary ? IsWideObject extends true ? boolean : Values extends readonly unknown[] ? TestArray$1> : never : false; //#endregion //#region src/boolean-logic/operators/sets/HasFalse.d.ts type Test$7 = T extends readonly [infer Head, ...infer Rest] ? IsFalse extends true ? true : Test$7 : false; type Validate$6 = [IsAny] extends [true] ? Err<`invalid/has-false`, `The type passed into 'HasFalse' was 'any'! This utility requires that T be a container type.`> : [IsNever] extends [true] ? Err<`invalid/has-false`, `The type passed into 'HasFalse' was 'never'! This utility requires that T be a container type.`> : T extends Container ? T : Err<`invalid/has-false`, `The type passed into HasFalse was not a container!`, { value: T; }>; /** * **HasFalse**`` * * Test whether the container `T` has any _values_ which are equal to `false`. * * - if `T` is a wide type then this utility will always return `boolean` */ type HasFalse = [Validate$6] extends [Error] ? Validate$6 : [Values] extends [readonly unknown[]] ? [number] extends [Values["length"]] ? boolean : Test$7> : never; //#endregion //#region src/boolean-logic/operators/sets/HasNever.d.ts type TestArray = T extends readonly [] ? false : T extends readonly [infer First, ...infer Rest] ? [IsNever] extends [true] ? true : Rest extends readonly unknown[] ? TestArray : false : false; type Validate$5 = [IsAny] extends [true] ? Err<`invalid/has-never`, `The type passed into 'HasNever' was 'any'! This utility requires that T be a container type.`> : [IsNever] extends [true] ? Err<`invalid/has-never`, `The type passed into 'HasNever' was 'never'! This utility requires that T be a container type.`> : T; /** * **HasNever**`` * * Test whether the container `T` has any _values_ which are the `never` type. * * - if `T` is a wide type then this utility will always return `boolean` */ type HasNever = [Validate$5] extends [Error] ? Validate$5 : [IsWideArray] extends [true] ? boolean : [T] extends [readonly any[]] ? [IsWideArray] extends [true] ? boolean : TestArray : [IsWideObject] extends [true] ? boolean : IsDictionary extends true ? TestArray> : false; //#endregion //#region src/boolean-logic/operators/sets/HasNonTemplateLiteral.d.ts type Test$6 = T extends [infer Head, ...infer Rest] ? IsTemplateLiteral extends false ? true : Test$6 : false; type Validate$4 = [IsAny] extends [true] ? Err<`invalid/has-template-literal`, `The type passed into 'HasNonTemplateLiteral' was 'any'! This utility requires that T be a container type.`> : [IsNever] extends [true] ? Err<`invalid/has-template-literal`, `The type passed into 'HasNonTemplateLiteral' was 'never'! This utility requires that T be a container type.`> : T extends Container ? T : Err<`invalid/has-template-literal`, `The type passed into HasNonTemplateLiteral was not a container!`, { value: T; }>; /** * **HasNonTemplateLiteral**`` * * Test whether the container `T` has any _values types_ which are do not have a template literal ( * aka, have blocks like `${string}` or `${number}`) as part of their type. * * - if `T` is a wide type then this utility will always return `boolean` * - if `T` is an _optional_ type it is treated the same as if it were a required type */ type HasNonTemplateLiteral> = [Validate$4] extends [Error] ? Validate$4 : [Values] extends [readonly unknown[]] ? [number] extends [Values["length"]] ? boolean : Test$6> : never; //#endregion //#region src/boolean-logic/operators/sets/HasOptionalElements.d.ts /** * Helper type that checks if Required structurally differs from T * by using the readonly modifier trick to avoid deep instantiation. */ type RequiredDiffersFromOriginal = [Required] extends [T] ? [T] extends [Required] ? false : true : true; type HasOptionalElements__Tuple = RequiredDiffersFromOriginal; /** * **HasOptionalElements**`` * * Boolean operator which detects whether the container `T` has any * elements/keys which are considered "optional". */ type HasOptionalElements = [T] extends [readonly unknown[]] ? RequiredDiffersFromOriginal : T extends Dictionary ? [keyof T] extends [RequiredKeys] ? [RequiredKeys] extends [keyof T] ? false : true : true : never; //#endregion //#region src/boolean-logic/operators/sets/HasRequiredElements.d.ts /** * **HasRequiredElements**`` * * Boolean operator which detects whether the container `T` has any * elements/keys which are considered "required". */ type HasRequiredElements = IsEqual extends true ? false : IsWideContainer extends true ? boolean : T extends readonly unknown[] ? GetRequiredElementCount extends 0 ? false : true : T extends Dictionary ? RequiredKeysTuple["length"] extends 0 ? false : true : never; //#endregion //#region src/boolean-logic/operators/sets/HasTemplateLiteral.d.ts type Test$5 = T extends [infer Head, ...infer Rest] ? IsTemplateLiteral extends true ? true : Test$5 : false; type Validate$3 = [IsAny] extends [true] ? Err<`invalid/has-template-literal`, `The type passed into 'HasTemplateLiteral' was 'any'! This utility requires that T be a container type.`> : [IsNever] extends [true] ? Err<`invalid/has-template-literal`, `The type passed into 'HasTemplateLiteral' was 'never'! This utility requires that T be a container type.`> : T extends Container ? T : Err<`invalid/has-template-literal`, `The type passed into HasTemplateLiteral was not a container!`, { value: T; }>; /** * **HasTemplateLiteral**`` * * Test whether the container `T` has any _values types_ which are equal template literals ( * aka, have blocks like `${string}` or `${number}`). * * - if `T` is a wide type then this utility will always return `boolean` * - if `T` is an _optional_ type it is treated the same as if it were a required type */ type HasTemplateLiteral> = [Validate$3] extends [Error] ? Validate$3 : [Values] extends [readonly unknown[]] ? [number] extends [Values["length"]] ? boolean : Test$5> : never; //#endregion //#region src/boolean-logic/operators/sets/HasTrue.d.ts type Test$4 = T extends [infer Head, ...infer Rest] ? IsTrue extends true ? true : Test$4 : false; type Validate$2 = [IsAny] extends [true] ? Err<`invalid/has-true`, `The type passed into 'HasTrue' was 'any'! This utility requires that T be a container type.`> : [IsNever] extends [true] ? Err<`invalid/has-true`, `The type passed into 'HasTrue' was 'never'! This utility requires that T be a container type.`> : T extends Container ? T : Err<`invalid/has-true`, `The type passed into HasTrue was not a container!`, { value: T; }>; /** * **HasTrue**`` * * Test whether the container `T` has any _value types_ which are equal to `true`. * * - if `T` is a wide type then this utility will always return `boolean` */ type HasTrue = [Validate$2] extends [Error] ? Validate$2 : [Values] extends [readonly unknown[]] ? [number] extends [Values["length"]] ? boolean : Test$4> : never; //#endregion //#region src/boolean-logic/operators/sets/HasWideBoolean.d.ts type Test$3 = T extends readonly [infer Head, ...infer Rest] ? IsWideBoolean extends true ? true : Test$3 : false; type Validate$1 = [IsAny] extends [true] ? Err<`invalid/has-wide-boolean`, `The type passed into 'HasWideBoolean' was 'any'! This utility requires that T be a container type.`> : [IsNever] extends [true] ? Err<`invalid/has-wide-boolean`, `The type passed into 'HasWideBoolean' was 'never'! This utility requires that T be a container type.`> : T; /** * **HasNever**`` * * Test whether the container `T` has any _values_ which are the wide `boolean` type. * * - if `T` is a wide type then this utility will always return `boolean` */ type HasWideBoolean = [Validate$1] extends [Error] ? Validate$1 : [T] extends [readonly any[]] ? [number] extends [Keys$1["length"]] ? boolean : Test$3 : [IsDictionary] extends [true] ? [number] extends [Keys$1["length"]] ? boolean : Test$3> : false; //#endregion //#region src/boolean-logic/operators/tuples/AllLengthOf.d.ts /** * **AllLengthOf**`` * * Tests that a tuple of strings are all of a designated length. */ type AllLengthOf = And<{ [K in keyof TList]: [StrLen] extends [TLen] ? true : false }>; //#endregion //#region src/boolean-logic/operators/unions/HasUnionType.d.ts type _HasUnion = TList extends [infer Head, ...infer Rest] ? IsUnion extends true ? true : _HasUnion : false; /** * **HasUnionType**`` * * Checks whether any item within a _list_ is a **union** type. * * **Related:** * - `UnionIncludes`, `UnionHasArray`, * - `IsLiteralUnion`, `IsMixedUnion`, `IsNonLiteralUnion` * * ```ts * // true * type T = HasUnionType<["foo" | "bar", 42]>; * // false * type F = HasUnionType<["foo", "bar"]>; * ``` */ type HasUnionType = _HasUnion; //#endregion //#region src/boolean-logic/operators/unions/IsLiteralUnion.d.ts type AllElementsAreLiteral = T extends [infer Head, ...infer Rest] ? [IsLiteralLike] extends [true] ? AllElementsAreLiteral : [IsLiteralLike] extends [false] ? false : AllElementsAreLiteral : IsTrue extends true ? boolean : true; /** * **IsLiteralUnion**`` * * Boolean operator which returns true when `T`: * * - is a union type, AND * - all elements of the union are `LiteralLike` */ type IsLiteralUnion = As$1<[IsUnion] extends [true] ? AllElementsAreLiteral> : false, boolean>; //#endregion //#region src/boolean-logic/operators/unions/IsMixedUnion.d.ts /** * **IsMixedUnion**`` * * Test that `T` is: * * - a union type, AND * - some of the elements of the union are literal-like types * - some of the elements of the union are wide types * * Both `any` and `never` passed in as `T` result in a return of `false` * whereas a type of `unknown` will return `boolean`. * * **Related:** `IsLiteralUnion`, `IsNonLiteralUnion`, `IsWideUnion` */ type IsMixedUnion = [IsAny] extends [true] ? false : [IsNever] extends [true] ? false : [IsUnknown] extends [true] ? boolean : IsUnion extends true ? IsLiteralUnion extends false ? IsWideUnion extends false ? true : false : false : false; //#endregion //#region src/boolean-logic/operators/unions/IsNonLiteralUnion.d.ts type Process$10 = UnionToTuple extends readonly unknown[] ? RetainLiterals>["length"] extends UnionToTuple["length"] ? false : true : never; /** * **IsNonLiteralUnion**`` * * Boolean utility which checks whether `T` is both a _union type_ * and that none of it's elements are considered _literal types_. * * **Related:** `IsLiteralUnion`, `IsWideUnion` */ type IsNonLiteralUnion = If, Process$10, false>; //#endregion //#region src/boolean-logic/operators/unions/IsUnion.d.ts type IsUnionImpl = (T extends infer TItem ? C extends TItem ? true : unknown : never) extends true ? false : true; /** * **IsUnion**`` * * Type utility which returns a boolean flag indicating whether the * given `T` is typed as a _union_ type. * * Note: `boolean` is treated as a union (`true | false`) and returns `true`. */ type IsUnion = IsUnionImpl; //#endregion //#region src/boolean-logic/operators/unions/IsUnionArray.d.ts /** * **IsUnionArray**`` * * Boolean operator which tests whether `T` is an array of * a _union type_. */ type IsUnionArray = T extends readonly any[] ? IsEqual extends true ? IsUnion> extends true ? true : false : false : false; //#endregion //#region src/boolean-logic/operators/unions/IsWideUnion.d.ts type Check = And<{ [K in keyof T]: IsWideType }>; /** * **IsWideUnion**`` * * Checks whether `T` is a union whose elements are all considered "wide" types. * * **Related:** `IsLiteralUnion`, `IsMixedUnion` */ type IsWideUnion = IsUnion extends true ? Check> : false; //#endregion //#region src/boolean-logic/operators/unions/UnionExtends.d.ts /** * **UnionExtends**`` * * Boolean operator which tests whether `T` is a union type which * _extends_ `U` as a member of the union. * * - the comparison uses a _extends_ matching criteria * - use `UnionIncludes` instead if you prefer a stricter matching * criteria * - if `T` is **any** or **never** this will always return `false` * - if `T` isn't a union type then this will always return `false` * * **Related:** `UnionIncludes`, `HasUnionType` */ type UnionExtends = [IsNever] extends [true] ? false : [IsAny] extends [true] ? false : [IsUnion] extends [true] ? UnionToTuple__PreserveBoolean extends infer Tuple extends readonly unknown[] ? Contains : never : false; //#endregion //#region src/boolean-logic/operators/unions/UnionHasArray.d.ts type Process$9 = HasArray extends true ? true : false; /** * **UnionHasArray**`` * * A boolean operator which tests whether T is: * * - indeed a _union_ type * - and that one of the elements of the union is an array * of some sort. */ type UnionHasArray = IsUnion extends true ? Process$9> : false; //#endregion //#region src/boolean-logic/operators/unions/UnionIncludes.d.ts /** * **UnionIncludes**`` * * Boolean operator which tests whether `T` is a union type which * _includes_ `U` as a member of the union. * * - the comparison uses a _strict equality_ match * - use `UnionExtends` instead if you prefer a looser matching * criteria * - if `T` is **any** or **never** this will always return `false` * - if `T` isn't a union type then this will always return `false` * * **Related:** `UnionExtends`, `HasUnionType` */ type UnionIncludes = [IsNever] extends [true] ? false : [IsAny] extends [true] ? false : [IsUnion] extends [true] ? UnionToTuple__PreserveBoolean extends infer Tuple extends readonly unknown[] ? Contains : never : false; //#endregion //#region src/boolean-logic/operators/unions/UnionMemberEquals.d.ts type Process$8 = T extends [infer First, ...infer Rest] ? Some extends true ? true : Process$8 : false; /** * **UnionMemberEquals**`` * * Boolean operator which tests whether any of the union elements in `T` equal * the type `U`. * * - always returns `false` if `T` is _not_ a union type * * **Related:** * - `UnionMemberExtends`, `UnionFilter`, `IsUnion`, `IsUnionArray` * - `UnionIncludes`, `UnionExtends` */ type UnionMemberEquals = [IsAny] extends [true] ? false : [IsAny] extends [true] ? true : [IsEqual] extends [true] ? false : [IsNever] extends [true] ? false : [IsNever] extends [true] ? false : [IsUnknown] extends [true] ? boolean : [IsUnknown] extends [true] ? boolean : [IsUnion] extends [true] ? UnionToTuple extends readonly unknown[] ? Process$8, IsUndefined extends true ? [undefined] : AsArray> : false : false; //#endregion //#region src/boolean-logic/operators/unions/UnionMemberExtends.d.ts /** * **UnionMemberExtends**`` * * Boolean operator which tests whether any of the union elements in `T` extend * the type `U`. * * - always returns `false` if `T` is _not_ a union type * - if `U` is a tuple of types then they will be made into a union type for the * comparison * * **Related:** `UnionMemberEquals`, `UnionFilter`, `IsUnion`, `IsUnionArray` */ type UnionMemberExtends = [IsAny] extends [true] ? false : [IsNever] extends [true] ? false : [IsUnknown] extends [true] ? boolean : IsUnion extends true ? [T, U] extends [string[] | number, Array] ? true : [T, U] extends [{ foo: string; } | { bar: number; }, Array] ? false : Some, "extends", [U]> : false; //#endregion //#region src/brands/EvenNumber.d.ts type EvenNumber = number & { brand: "EvenNumber"; }; //#endregion //#region src/brands/OddNumber.d.ts type OddNumber = number & { brand: "OddNumber"; }; //#endregion //#region src/classes/Constructor.d.ts /** * Define a class constructor; allowing strong typing for constructor's parameters * and the returned class structure. */ type Constructor = new (...props: Ctor) => Klass; //#endregion //#region src/classes/KlassMeta.d.ts /** * **KlassMeta**`` * * Given a class constructor `CTor`, this will return a tuple: * * ```ts * { * args: ConstructorParams, * instance: InstanceType, * class_decorators: ClassDecoratorContext, * field_decorators: ClassFieldDecoratorContext * } * ``` */ type KlassMeta any> = CTor extends (abstract new (...args: infer P) => infer R) ? { params: P; instance: R; class_decorators: ClassDecoratorContext; field_decorators: ClassFieldDecoratorContext; } : never; //#endregion //#region src/constants/NoMatch.d.ts /** * A type used in **take** functions and lexers to indicate that _what_ * the take function is configured to look for in the HEAD of the string * being parsed _was not_ found. */ type NoMatch = "NO MATCH"; //#endregion //#region src/containers/IsEmptyContainer.d.ts /** * **EmptyContainer**`` * * Boolean utility which tests whether a container is "empty" * (meaning it has no keys). * * **Related:** `NonEmptyContainer` */ type IsEmptyContainer = T extends Dictionary ? T extends ExplicitlyEmptyObject ? true : Keys$1["length"] extends 0 ? true : false : Keys$1["length"] extends 0 ? true : false; //#endregion //#region src/containers/IsNonEmptyContainer.d.ts /** * **NonEmptyContainer**`` * * Boolean utility which tests whether a container has keys * (aka, is not "empty") * * **Related:** `EmptyContainer` */ type IsNonEmptyContainer = IsEmptyContainer extends true ? false : true; //#endregion //#region src/containers/OnlyOptional.d.ts /** * **OnlyOptional**`` * * Takes a container as `T` and returns only those elements in the * container which are marked as "optional". * * ```ts * // { bar?: 2; baz? number } * type Obj = OnlyOptional<{foo: 1; bar?:2; baz?: number }>; * // [3?] * type Arr = OnlyOptional<[1,2,3?]> * ``` * * **Related:** `OnlyRequired` */ type OnlyOptional = [IsWideContainer] extends [true] ? T : [T] extends [readonly unknown[]] ? [HasOptionalElements] extends [false] ? [] : HasVariadicTail extends false ? GetOptionalElementCount extends number ? SliceArray>> : never : GetOptionalElementCount extends infer Count extends number ? SliceArray> : never : T extends Dictionary ? HasOptionalElements extends false ? EmptyObject : WithKeys> : never; //#endregion //#region src/containers/RemoveBoolean.d.ts type Tuple$2 = T extends [infer Head, ...infer Rest] ? Tuple$2 extends true ? R : [...R, Head]> : R; type ProcessDict, readonly (PropertyKey & keyof T)[]>, R extends Dictionary = EmptyObject> = K extends [infer Head extends PropertyKey & keyof T, ...infer Rest extends readonly (PropertyKey & keyof T)[]] ? ProcessDict extends true ? R : R & Record> : ExpandDictionary; /** * **RemoveBoolean**`` * * Removes boolean _values_ from an array or a dictionary object. * * - the `O` generic determines how we should treat _optional_ values: * - when **true** (_the default_) any boolean value including an * optional one is removed * - when **false** any optional properties are just * left "as is" but the required ones are removed * - any value of `boolean`, `true`, or `false` will be removed * - for dictionaries when the _value_ is a boolean value the key/value * pair is removed * - for arrays this just acts as a filter which removes all boolean types */ type RemoveBoolean = T extends readonly unknown[] ? IsWideArray extends true ? IsEqual extends true ? [] : T : HasOptionalElements extends true ? TakeOptionalElements extends infer Opt extends readonly unknown[] ? TakeRequiredElements extends infer Req extends readonly unknown[] ? [IsTrue] extends [true] ? [...Tuple$2, ...Partial>>] : [...Tuple$2, ...Partial] : never : never : Tuple$2<[...T]> : T extends Dictionary ? HasOptionalElements extends true ? IsTrue extends true ? ProcessDict> extends infer Dict extends Dictionary ? MakeKeysOptional> : never : ExpandDictionary> & ProcessDict>>> : ProcessDict : never; //#endregion //#region src/containers/RemoveEmpty.d.ts type IsEmpty$1 = Or<[IsNull, T extends Container ? IsEmptyContainer : false, IsEmptyString, IsUndefined, IsNever]> extends true ? true : false; type ProcessTup = [] extends T ? Result : ProcessTup, [...Result, IsEmpty$1> extends true ? Marked$2 : First$1]>; type ProcessObj = [] extends TKeys ? TResult : ProcessObj, IsEmpty$1> extends true ? TResult & Record, TObj[First$1]> : TResult>; /** * **RemoveEmpty** * * A _container_ utility looks at all immediate keys of the * container and removes all which are "empty". Being empty means: * * - is either `null`, `undefined`, or `never` * - has an _empty string literal_ of `""` * - is an empty container * * For any value `T` which is not a container nor a union type, the value * is just passed through. */ type RemoveEmpty = T extends Tuple$1 ? As$1>, readonly unknown[]> : T extends Dictionary ? As$1>>, Dictionary> : T; //#endregion //#region src/containers/RemoveMarked.d.ts type Marked$3 = typeof MARKED$1; /** * Efficiently filters tuples by removing never values using direct tail recursion */ type FilterTuple$1 = T extends readonly [infer Head, ...infer Tail] ? [Head] extends [Marked$3] ? FilterTuple$1 : FilterTuple$1 : Result; /** * Efficiently filters objects by removing never values using mapped types */ type FilterObject$1 = { [K in keyof T as [T[K]] extends [Marked$3] ? never : K]: T[K] }; /** * **RemoveMarked**`` * * Removes all values in `T` which extends `Constant<"Marked">` */ type RemoveMarked = T extends readonly unknown[] ? FilterTuple$1 : T extends Dictionary ? FilterObject$1 : never; //#endregion //#region src/containers/RemoveNever.d.ts /** * Efficiently filters tuples by removing never values using direct tail recursion */ type FilterTuple = T extends readonly [infer Head, ...infer Tail] ? [Head] extends [never] ? FilterTuple : FilterTuple : Result; /** * Efficiently filters objects by removing never values using mapped types */ type FilterObject = { [K in keyof T as [Required[K]] extends [never] ? never : K]: T[K] extends Dictionary ? ProcessObject : T[K] }; type ProcessObject = IsWideObject extends true ? Dictionary : FilterObject; /** * **RemoveNever**`` * * Removes all of the elements from `T` which are typed as _never_. * * Optimized implementation that avoids expensive UnionToTuple and NumericKeys operations. */ type RemoveNever = T extends readonly unknown[] ? FilterTuple : T extends Dictionary ? ProcessObject : never; //#endregion //#region src/containers/RemoveUndefined.d.ts type _Keys = UnionToTuple> extends readonly ObjectKey[] ? UnionToTuple> : never; type Process$7 = TKeys extends [infer Head extends PropertyKey, ...infer Rest extends readonly PropertyKey[]] ? Head extends keyof T ? IsUndefined extends true ? Process$7 : Process$7 : never : never> : never : TResults; /** * **RemoveUndefined**`` * * Removes all the elements from `T` which are typed as _undefined_. */ type RemoveUndefined = Process$7 : _Keys>; //#endregion //#region src/containers/SetKey.d.ts /** * Sets a Key on a container. * * - can add new properties * - can also update existing */ type SetIndex = Expand & Record>; //#endregion //#region src/crdt/json-joy.d.ts type JsonRxProtocol = `rx` | `json2`; type JsonRxMessageEncoding = `compact` | `binary` | `verbose`; type JsonRxPayloadEncoding = `json` | `cbor` | `msgpack` | `ubjson`; /** * JSON-Rx Encoding Specifier * * [Docs](https://jsonjoy.com/specs/json-rx/encoding-specifier) */ type JsonRxEncodingSpecifier = `rpc.${JsonRxProtocol}.${JsonRxMessageEncoding}.${JsonRxPayloadEncoding}`; //#endregion //#region src/domains/color/ApplyCssHexShorthand.d.ts type WrongType = Err<`invalid-type/hexadecimal`, `The value passed into ApplyCssHexShorthand -- ${AsString} -- was not able to be treated as a hexadecimal color value!`, { hex: T; }>; type NonHexString = Err<`invalid-type/hexadecimal`, `The string passed into ApplyCssHexShorthand -- ${T} -- was not able to be treated as a hexadecimal color value!`, { hex: T; }>; type WrongLength = Err<`invalid-type/hexadecimal`, `The hexadecimal number component of a CSS color must be either 3 or 6 characters long but was ${Length}!`>; type Apply> = string extends T ? string | Error : IsHexadecimal extends true ? Length extends 3 ? Join<{ [K in keyof C]: `${C[K]}${C[K]}` }> : Length extends 6 ? T : WrongLength : NonHexString; /** * **ApplyCssHexShorthand**`` * * Allows conversion of a 3 digit hexadecimal value to be * converted to a full 6 digit hexadecimal value for RGB color * purposes. * * - you can keep or remove the leading `#` and this utility * will still work. * - strings _without_ a leading `#` will be returned _without_ * a leading `#` * - hexadecimal values with 6 characters will be _passed through_ * with no change to type * - hexadecimal values with 3 characters will "double" each character * (e.g., `fa9` -> `ffaa99`); this is consistent with CSS shorthand rules * - any non-hex value or hex-value of the wrong length will return * a `invalid-type/hexadecimal` error. */ type ApplyCssHexShorthand = T extends string ? T extends `#${infer Rest}` ? Concat<["#", Apply]> : Apply : WrongType; //#endregion //#region src/domains/color/IsRgbObject.d.ts type ValidValue = IsGreaterThanOrEqual extends true ? IsLessThanOrEqual extends true ? IsInteger : false : false; /** * **IsRgbObject**`` * * Boolean operator which tests whether `T` is a valid RGB object. * * - not only tests for object shape and that `r`, `g`, and `b` are numbers * - but also validate that those numbers are between 0-255 and integers * - rejects objects with extra properties (like `a` for alpha, which would make it RGBA) */ type IsRgbObject = T extends { r: number; g: number; b: number; } ? HasSameKeys extends true ? ValidValue extends true ? ValidValue extends true ? ValidValue extends true ? true : false : false : false : false : false; //#endregion //#region src/domains/color/RGB.d.ts /** * **RGB** * * An object representation of an RGB value. */ interface RGB { /** red */ r: number; /** green */ g: number; /** blue */ b: number; } //#endregion //#region src/domains/color/RGBA.d.ts /** * **RGBA** * * An object representation of an RGB value with * an alpha channel. */ interface RGBA { /** red */ r: number; /** green */ g: number; /** blue */ b: number; /** alpha value; should have value between 0 and 1 */ a: Percentage; } //#endregion //#region src/domains/color/AsRgbaObject.d.ts type ParseCssRgb$1 : T)> = Split extends readonly [infer R extends string, infer G extends string, infer B extends string] ? { r: AsNumber>; g: AsNumber>; b: AsNumber>; } : Err<"invalid-value/rgb", `Failed to parse a CssRgb string -- ${T} -- into a valid RGB object`, { input: T; raw: Raw; utility: "AsRgb"; library: "inferred-types"; }>; type Lookup$2 = typeof CSS_COLOR_LOOKUP$1; /** * **AsRgbaObject**`` * * Attempts to map various kinds of color information and convert * it to an `RGBA` object. Can convert: * * - CSS RGB color string (aka, `CssRgbColor`) and sets alpha to 1 * - CSS RGBA color string (aka, `CssRgbaColor`) * - A hex color string (e.g., `#ffee00`) and sets alpha to 1 * - an RGB object (extracts r, g, b) and sets alpha to 1 * - an RGBA-like object with extra properties (extracts r, g, b) * - and will proxy through a pure RGBA object "as is" * * **Related:** `AsRgbObject` */ type AsRgbaObject = T extends RGBA ? IsRgbaObject extends true ? T : Err<`invalid-type/rgb`, `An RGBA like object was passed into AsRgb but it's numeric values were not valid: { r: ${T["r"]}, g: ${T["g"]}, b: ${T["b"]} }`, { input: T; utility: "AsRgb"; library: "inferred-types"; }> : T extends RGB ? IsRgbObject extends true ? ExpandDictionary> : Err<`invalid-type/rgb`, `An RGB like object was passed into AsRgb but it's numeric values were not valid: { r: ${T["r"]}, g: ${T["g"]}, b: ${T["b"]} }`, { input: T; utility: "AsRgb"; library: "inferred-types"; }> : T extends CssRgb ? ParseCssRgb$1 extends RGB ? IsRgbObject> extends true ? ParseCssRgb$1 : Err<`invalid-type/rgb`, `A CSS RGB color string was parsed but the RGB values didn't pass as valid: { r: ${ParseCssRgb$1["r"]}, g: ${ParseCssRgb$1["g"]}, b: ${ParseCssRgb$1["b"]} }`, { input: T; utility: "AsRgb"; library: "inferred-types"; }> : ParseCssRgb$1 extends Error ? ParseCssRgb$1 : never : T extends CssNamedColor ? AsRgbObject> : T extends HexColor ? HexColorToRgbObject extends Error ? Err<`invalid-type/rgb`, `A CSS Hex color string was parsed but the RGB values didn't pass as valid: { r: ${T}`, { input: T; utility: "AsRgb"; library: "inferred-types"; }> : HexColorToRgbObject extends RGB ? HexColorToRgbObject : never : Err<`invalid-type/rgb`, `A value which doesn't extend RGB, RGBA, HexColor, CssRgb, or CssRgba was passed in!`>; //#endregion //#region src/domains/color/AsRgbObject.d.ts type ParseCssRgb : T)> = Split extends readonly [infer R extends string, infer G extends string, infer B extends string] ? { r: AsNumber>; g: AsNumber>; b: AsNumber>; } : Err<"invalid-value/rgb", `Failed to parse a CssRgb string -- ${T} -- into a valid RGB object`, { input: T; raw: Raw; utility: "AsRgb"; library: "inferred-types"; }>; type Lookup$1 = typeof CSS_COLOR_LOOKUP$1; type ExtractRgb = T extends { r: infer R extends number; g: infer G extends number; b: infer B extends number; } ? { r: R; g: G; b: B; } : never; /** * **AsRgbObject**`` * * Attempts to map various kinds of color information and convert * it to an `RGB` object. Can convert: * * - CSS RGB color string (aka, `CssRgbColor`) * - CSS RGBA color string (aka, `CssRgbaColor`) * - A hex color string (e.g., `#ffee00`) * - an RGBA object (extracts r, g, b) * - an RGB-like object with extra properties (extracts r, g, b) * - and will proxy through a pure RGB object */ type AsRgbObject = T extends RGBA ? IsRgbObject> extends true ? ExtractRgb : Err<`invalid-type/rgb`, `An RGBA like object was passed into AsRgb but it's numeric values were not valid: { r: ${T["r"]}, g: ${T["g"]}, b: ${T["b"]} }`, { input: T; utility: "AsRgb"; library: "inferred-types"; }> : T extends RGB ? IsRgbObject> extends true ? ExtractRgb : Err<`invalid-type/rgb`, `An RGB like object was passed into AsRgb but it's numeric values were not valid: { r: ${T["r"]}, g: ${T["g"]}, b: ${T["b"]} }`, { input: T; utility: "AsRgb"; library: "inferred-types"; }> : T extends CssRgb ? ParseCssRgb extends RGB ? IsRgbObject> extends true ? ParseCssRgb : Err<`invalid-type/rgb`, `A CSS RGB color string was parsed but the RGB values didn't pass as valid: { r: ${ParseCssRgb["r"]}, g: ${ParseCssRgb["g"]}, b: ${ParseCssRgb["b"]} }`, { input: T; utility: "AsRgb"; library: "inferred-types"; }> : ParseCssRgb extends Error ? ParseCssRgb : never : T extends CssNamedColor ? AsRgbObject> : T extends HexColor ? HexColorToRgbObject extends Error ? Err<`invalid-type/rgb`, `A CSS Hex color string was parsed but the RGB values didn't pass as valid: { r: ${T}`, { input: T; utility: "AsRgb"; library: "inferred-types"; }> : HexColorToRgbObject extends RGB ? HexColorToRgbObject : never : Err<`invalid-type/rgb`, `A value which doesn't extend RGB, RGBA, HexColor, CssRgb, or CssRgba was passed in!`>; //#endregion //#region src/domains/color/AsRgbTuple.d.ts /** * **AsRgbTuple**`` * * Attempts to map various kinds of color information and convert * it to aa tuple of the form of `[ red, green, blue ]`. Can convert: * * - CSS RGB color string (aka, `CssRgbColor`) * - CSS RGBA color string (aka, `CssRgbaColor`) * - A hex color string (e.g., `#ffee00`) * - an RGBA object * - and a RGB object */ type AsRgbTuple = AsRgbObject extends Error ? AsRgbObject : AsRgbObject extends infer O extends RGB ? [red: O["r"], green: O["g"], blue: O["b"]] : never; //#endregion //#region src/domains/color/HexColorToRgbObject.d.ts type Process$6 = HexToDecimal extends [infer R extends number, infer G extends number, infer B extends number] ? { r: R; g: G; b: B; } : HexToDecimal extends Error ? T : Err<`invalid-type/hex-color`, `The Hex color passed into HexColorToRgb could not be parsed into an RGB object`, { input: T; utility: "HexColorToRgbObject"; library: "inferred-types"; }>; /** * **HexColorToRgbObject**`` * * Converts a hex color string to a `RGB` object. * * **Related:** * - `HexColorToRgbTuple` * - `AsRgb`, `IsRGB`, `RGB`, `RGBA`, `CssRgbColor` * - `cssColor()`, `twColor()`, `isRgbObject()`, `isCssRgbString()` */ type HexColorToRgbObject = T extends `#${infer Rest}` ? Length extends 3 ? Process$6, string>> : Length extends 6 ? Process$6 : Err<`invalid-type/hex-color`, `The Hex color passed into HexColorToRgbObject must have 3 or 6 hexadecimal digits`, { input: T; length: Length; utility: "HexColorToRgbObject"; }> : Err<`invalid-type/hexadecimal`, `A hexadecimal color must be a string and start with '#' symbol!`, { input: T; utility: "HexColorToRgbObject"; }>; //#endregion //#region src/domains/color/HexColorToRgbTuple.d.ts /** * **HexColorToRgbTuple**`` * * Converts a hex color string to a `RgbTuple`. * * **Related:** * - `HexColorToRgbTuple` * - `AsRgb`, `IsRGB`, `RGB`, `RGBA`, `CssRgbColor` * - `cssColor()`, `twColor()`, `isRgbObject()`, `isCssRgbString()` */ type HexColorToRgbTuple = HexColorToRgbObject extends infer O extends RGB ? [red: O["r"], green: O["g"], blue: O["b"]] : HexColorToRgbObject extends Error ? HexColorToRgbObject : never; //#endregion //#region src/domains/color/IsCssRgbString.d.ts /** * **IsCssRgbString**`` * * Boolean operator which tests whether `T` is a string literal which * accurately represents a RGB string in CSS syntax (e.g., `rgb(1,1,1)`) */ type IsCssRgbString = T extends string ? string extends T ? boolean : T extends `rgb(${infer Inner})` ? Split extends infer S extends readonly string[] ? Length extends 3 ? Every, "extends", `${number}`> extends true ? IsRgbTuple>> : false : false : false : false : false; //#endregion //#region src/domains/color/IsHexColor.d.ts /** * **IsHexColor**`` * * Boolean operator which tests whether `T` is a valid hex color string. * * - string must start with `#` * - remaining characters must be valid hexadecimal characters * - must be either 3 or 6 hexadecimal digits * - if only 3 digits are present then it is assumed this * represents the CSS shorthand rule of converting each * digit into two digits (e.g., `#FA9` to `#FFAA99`) */ type IsHexColor = T extends `#${infer Rest}` ? Trim extends "" ? false : Chars extends infer C extends readonly string[] ? Every extends true ? Length extends 3 ? true : Length extends 6 ? true : false : false : false : false; //#endregion //#region src/domains/color/IsRgbaObject.d.ts type ValidColorValue = IsGreaterThanOrEqual extends true ? IsLessThanOrEqual extends true ? IsInteger : false : false; /** * **IsRgbaObject**`` * * Boolean operator which tests whether `T` is a valid RGBA object. * * - not only tests for object shape and that `r`, `g`, `b`, and `a` are numbers * - but also validate that those numbers are: * - between 0-255 and integers for color values * - alpha value between 0 and 1 (or between `0%` and `100%`) * - rejects objects with extra properties (like `a` for alpha, which would make it RGBA) */ type IsRgbaObject = T extends { r: infer Red extends number; g: infer Green extends number; b: infer Blue extends number; a: infer Alpha extends number | Percentage; } ? HasSameKeys extends true ? ValidColorValue extends true ? ValidColorValue extends true ? ValidColorValue extends true ? IsPercentage extends true ? true : false : false : false : false : false : false; //#endregion //#region src/domains/color/IsRgbTuple.d.ts /** * **IsRgbTuple**`` * * Boolean operator which tests whether `T` is a valid `RgbTuple`: * * - must have three numeric parameters * - all parameters must be between 0 and 255 */ type IsRgbTuple = T extends readonly number[] ? Length extends 3 ? Every extends true ? Every extends true ? true : false : false : false : false; //#endregion //#region src/domains/color/RgbDecimal.d.ts /** * **RgbDecimalString** * * A string literal which represents the decimal numbers 0-255. */ type RgbDecimalString = `25${NumericChar__OneToFive}` | `2${NumericChar__ZeroToFour}${NumericChar}` | `1${NumericChar}${NumericChar}` | `${NumericChar}${NumericChar}`; //#endregion //#region src/domains/color/RgbTuple.d.ts type RgbTuple = [red: number, green: number, blue: number]; //#endregion //#region src/domains/lexer.d.ts /** * **LexerState** * * The _state_ for a Lexer. * * - the `parse` property carries the string component which still needs * parsing * - the `tokens` is a tuple of Lexer token's which have already been parsed * out of the origin string. * * A successful parse will see the lexer's state starts with a parse string and * no tokens and concludes when the parse string has been reduced to an empty string. * * If during parsing, the parse string is still not empty and none of the configured * take functions are able to parse any further then we reach an error state for the * parser. */ interface LexerState { parse: T; tokens: U; } /** * When a take function matches the HEAD of the the parse string, * it returns: * * - the _sub-string_ which it will be taking off the parse * string * - the Lexer token which has been created * * The wrapping take builder will convert this delta into the next * `LexerState` so that parsing can continue. */ type LexerDelta = [T, U]; //#endregion //#region src/domains/nesting/exceptions/exception-rules.d.ts interface ExitExceptionRules { /** * will **ignore** the `exit` token when * the character or characters which defined are * found in the character _following_ the current * character being evaluated. */ ignoreFollowedBy: Char$1 | readonly Char$1[]; /** * will **ignore** the `exit` token when * the character or characters which defined are * found in the character _preceding_ the current * character being evaluated. */ ignorePrecededBy: Char$1 | readonly Char$1[]; } interface EntryExceptionRules { /** * will **ignore** the `entry` token when * the character or characters which defined are * found in the character _following_ the current * character being evaluated. */ ignoreFollowedBy: Char$1 | readonly Char$1[]; /** * will **ignore** the `entry` token when * the character or characters which defined are * found in the character _preceding_ the current * character being evaluated. */ ignorePrecededBy: Char$1 | readonly Char$1[]; } /** * **NestedException** * * A structure which allows **exceptions** to be defined for * nesting configurations. * * **Related:** `NestingKeyValue`, `NestingTuple` */ interface NestedException { /** define exceptions for the `exit` token */ exit?: ExitExceptionRules; /** define exceptions for the `entry` token */ entry?: EntryExceptionRules; } //#endregion //#region src/domains/nesting/helpers/NormalizeNestingEntry.d.ts type NormalizeNestingEntry = TEntry extends readonly [infer Exit extends string, infer Children extends Nesting] ? { exit: Exit; children: Children; } : TEntry extends NestingKeyValueConfig & { exit: infer Exit extends string; children?: infer Children; } ? { exit: Exit; children: Children extends Nesting ? Children : TFallback; } : TEntry extends string ? { exit: TEntry; children: TFallback; } : never; //#endregion //#region src/domains/nesting/helpers/GetExitToken.d.ts type _GetExitToken = [TNesting] extends [NestingKeyValue] ? TEntry extends keyof TNesting ? NormalizeNestingEntry["exit"] : Err<`invalid-lookup`, `GetNestingEnd got a start/entering character '${TEntry}' which is NOT defined in the configuration (a NestingKeyValue config)!`, { config: TNesting; }> : [TNesting] extends [readonly [infer StartingChars extends readonly string[], infer EndingChars extends readonly string[], ...infer _Rest]] ? TEntry extends StartingChars[number] ? EndingChars extends readonly string[] ? EndingChars[number] : never : Err<"invalid-lookup", `GetNestingEnd got a start/entering character '${TEntry}' which is NOT defined in the configuration (a NestingTuple config)!`, { config: TNesting; }> : [TNesting] extends [readonly [infer StartingChars extends readonly string[], infer _EndingConfig extends { exit?: infer Exit extends readonly string[]; }]] ? TEntry extends StartingChars[number] ? Exit[number] : Err<"invalid-lookup", `GetNestingEnd got a start/entering character '${TEntry}' which is NOT defined in the configuration (a NestingTuple config)!`, { config: TNesting; }> : [TNesting] extends [readonly [infer StartingChars extends readonly string[], infer EndingChars extends readonly string[]]] ? TEntry extends StartingChars[number] ? EndingChars extends readonly string[] ? EndingChars[number] : never : Err<"invalid-lookup", `GetNestingEnd got a start/entering character '${TEntry}' which is NOT defined in the configuration (a NestingTuple config)!`, { config: TNesting; }> : never; /** * **GetExitToken**`` * * Provides the END/EXIT character(s) which the passed in `TStartChar` character * along with the configuration of `TNesting` match up to. * * - if no match is found a `Err<'invalid-lookup'>` will be returned. * - when using a `NestingTuple` config, the return value will typically be a _union_ of exit characters * - in contrast, a `NestingKeyValue` config will typically just return a single character variant to * match with. */ type GetExitToken = [IsNull] extends [true] ? null : [string] extends [TEntry] ? string | Err<`invalid-lookup`> : _GetExitToken, TNesting>; //#endregion //#region src/domains/nesting/helpers/GetNextLevelConfig.d.ts /** * **GetNextLevelConfig**`` * * Extracts the nesting configuration to use inside a nesting level that * starts with `TEntry`. * * - For **simple configs** (string values): Returns the same config (no hierarchy) * - For **hierarchical key-value** configs: Extracts `nextLevel` from `[exit, nextLevel]` tuple * - For **hierarchical tuple** configs: Extracts the third element if present * - If character is not in config: Returns the same config * * **Examples:** * * ```ts * // Simple config - returns same * type A = GetNextLevelConfig<"(", { "(": ")" }>; // { "(": ")" } * * // Hierarchical - extract empty config * type B = GetNextLevelConfig<'"', { '"': ['"', {}] }>; // {} * * // Hierarchical - extract nested config * type C = GetNextLevelConfig<"(", { "(": [")", { "[": "]" }] }>; // { "[": "]" } * ``` */ type GetNextLevelConfig = As$1<[TNesting] extends [NestingKeyValue] ? TEntry extends keyof TNesting ? NormalizeNestingEntry["children"] : TNesting : [TNesting] extends [readonly [infer _Start extends readonly string[], infer End, infer NextLevel extends Nesting]] ? End extends readonly string[] | undefined ? NextLevel : End extends { children?: infer Children extends Nesting; } ? Children : NextLevel : [TNesting] extends [readonly [infer _Start extends readonly string[], infer End]] ? End extends { children?: infer Children extends Nesting; } ? Children : TNesting : TNesting, Nesting>; //#endregion //#region src/domains/nesting/helpers/GetParentConfig.d.ts /** * Helper to rebuild config by applying GetNextLevelConfig for each element except the last */ type _GetParentConfigRecursive = TStack extends readonly [infer First extends string, infer Second extends string, ...infer Rest extends string[]] ? Rest["length"] extends 0 ? GetNextLevelConfig : _GetParentConfigRecursive<[Second, ...Rest], TRootNesting, GetNextLevelConfig> : TCurrentConfig; /** * **GetParentConfig**`` * * Reconstructs the nesting config that was active when the last entry character (top of stack) was seen. * * This is needed for `IsNestingMatchEnd` to look up the correct exit token in hierarchical configs. * * **Logic:** * - If stack has ≤1 element: parent is root level * - Otherwise: apply `GetNextLevelConfig` for each level except the last * * **Examples:** * ```ts * // Stack ["["], root { "[": "]" } -> parent is root * type A = GetParentConfig<["["], { "[": "]" }>; // { "[": "]" } * * // Stack ["{", "["], root { "{": ["}", { "[": "]" }] } * // Parent config at level 1 where "[" was seen * type B = GetParentConfig<["{", "["], { "{": ["}", { "[": "]" }] }>; // { "[": "]" } * ``` */ type GetParentConfig = TStack["length"] extends 0 | 1 ? TRootNesting : _GetParentConfigRecursive; //#endregion //#region src/domains/nesting/helpers/IsEntryToken.d.ts /** * Tests the character `T` to see if it is a * starting character in the Nesting configuration. */ type IsEntryToken = [string] extends [TChar] ? boolean : TNesting extends string ? false : [TNesting] extends [Record] ? false : [keyof TNesting] extends [never] ? false : [TNesting] extends [NestingKeyValue] ? [TChar] extends [Extract] ? true : false : [TNesting] extends [NestingTuple] ? TNesting[0] extends readonly string[] ? TChar extends TNesting[0][number] ? true : false : never : never; //#endregion //#region src/domains/nesting/helpers/ExtractExitTokens.d.ts type ExtractExitTokens = NormalizeNestingEntry["exit"]; //#endregion //#region src/domains/nesting/helpers/IsExitToken.d.ts /** * Tests the character `T` to see if it is a * terminal character in the Nesting configuration. */ type IsExitToken = [string] extends [TChar] ? boolean : [TNesting] extends [NestingKeyValue] ? [TChar] extends [ExtractExitTokens[number], TNesting>] ? true : false : [TNesting] extends [NestingTuple] ? [TNesting[1]] extends [readonly string[]] ? [TChar] extends [TNesting[1][number]] ? true : false : [TNesting[1]] extends [{ exit?: infer Exit extends readonly string[]; }] ? [TChar] extends [Exit[number]] ? true : false : [TNesting[1]] extends [undefined] ? [TChar] extends [TNesting[0][number]] ? false : true : never : never; //#endregion //#region src/domains/nesting/helpers/IsNestingConfig.d.ts /** * boolean operator which tests whether `T` is a valid nesting configuration. */ type IsNestingConfig = IsNestingKeyValue extends true ? true : IsNestingTuple extends true ? true : false; //#endregion //#region src/domains/nesting/helpers/IsNestingKeyValue.d.ts /** * Returns `true` if `T` is a valid `NestingKeyValue` otherwise returns a `invalid-nesting` * Error * * **NEW**: Now supports both: * - Simple form: `{ "(": ")" }` (values are strings) * - Hierarchical form: `{ "(": [")", {}] }` (values are [exit, nextLevel] tuples) * - Mixed form: `{ "(": [")", {}], "[": "]" }` (some values strings, some tuples) */ type IsNestingKeyValue = T extends Record ? AllLengthOf, 1> extends true ? V extends string ? AllLengthOf, readonly string[]>, 1> extends true ? true : Err<`invalid-nesting/key-value`, `Some of the values in this key-value were not a single character in length!`, { values: ToStringLiteral>; }> : V extends [infer Exit extends string, infer NextLevel] ? Exit extends string ? Exit["length"] extends 1 ? IsNestingConfig extends true ? true : Err<`invalid-nesting/key-value`, `The nextLevel configuration in the hierarchical tuple must be a valid Nesting config`, { nextLevel: ToStringLiteral; }> : Err<`invalid-nesting/key-value`, `The exit token (first element of hierarchical tuple) must be a single character`, { exit: ToStringLiteral; }> : Err<`invalid-nesting/key-value`, `The exit token must be a string`, { exit: ToStringLiteral; }> : V extends readonly [infer Exit extends string, infer NextLevel] ? Exit extends string ? Exit["length"] extends 1 ? IsNestingConfig extends true ? true : Err<`invalid-nesting/key-value`, `The nextLevel configuration in the hierarchical tuple must be a valid Nesting config`, { nextLevel: ToStringLiteral; }> : Err<`invalid-nesting/key-value`, `The exit token (first element of hierarchical tuple) must be a single character`, { exit: ToStringLiteral; }> : Err<`invalid-nesting/key-value`, `The exit token must be a string`, { exit: ToStringLiteral; }> : V extends string | readonly [string, Nesting] | [string, Nesting] ? true : Err<`invalid-nesting/key-value`, `Values must be either strings or [exit, nextLevel] tuples`, { values: ToStringLiteral; }> : Err<`invalid-nesting/key-value`, `Some of the keys in this key-value were not a single character in length!`, { keys: ToStringLiteral>; }> : Err<`invalid-nesting/key-value`, `Not a key-value type!`, { type: ToStringLiteral; }>; //#endregion //#region src/domains/nesting/helpers/IsNestingMatchEnd.d.ts /** * **IsNestingMatchEnd**`` * * Tests the `TChar` to see if it is not only a valid * _ending_ token but that it is _right_ ending token * based on what's on the stack. * * **NEW**: Now properly handles hierarchical configs by extracting exit tokens * from [exit, nextLevel] tuples */ type IsNestingMatchEnd = [IsExitToken] extends [true] ? [TNesting] extends [NestingKeyValue] ? [Last$1] extends [string] ? Last$1 extends keyof TNesting ? TNesting[Last$1] extends infer Value ? [TChar] extends [ExtractExitTokens] ? true : false : never : false : never : true : false; //#endregion //#region src/domains/nesting/helpers/IsNestingTuple.d.ts /** * IsNestingTuple * * A boolean-ish operator which returns `true` when `T` is a valid `NestingTuple` * * - if `Start` or `End` tuple elements are still a union type then this * return `boolean` * - when used in the runtime, however, it should resolve the union to a literal * - instead of returning `false` this utility returns an error which will help * debug the problem. * - **NEW**: Now supports optional third element for hierarchical nesting * * **Related:** * - `IsNestingKeyValue` * - `isNestingTuple(val)`, `isNestingKeyValue(val)` */ type IsNestingTuple = T extends [infer Start extends readonly string[], infer End extends readonly string[] | undefined | NestingTupleConfig, ...infer Rest] ? [AllStringLiterals] extends [true] ? [AllLengthOf] extends [true] ? [End] extends [readonly string[]] ? [AllStringLiterals] extends [true] ? [AllLengthOf] extends [true] ? Rest extends [] ? true : Rest extends [infer NextLevel] ? IsNestingConfig extends true ? true : Err<`invalid-nesting/tuple`, `The optional 3rd element (nextLevel) must be a valid Nesting configuration`, { nextLevel: ToStringLiteral; }> : Err<`invalid-nesting/tuple`, `NestingTuple can have at most 3 elements: [start, end, nextLevel?]`, { tuple: ToStringLiteral; }> : Err<`invalid-nesting/tuple`, `the tuple being tested had END tokens which were longer than a single character!`, { end: ToStringLiteral; }> : boolean : [End] extends [undefined] ? Rest extends [] ? true : Rest extends [infer NextLevel] ? IsNestingConfig extends true ? true : Err<`invalid-nesting/tuple`, `The optional 3rd element (nextLevel) must be a valid Nesting configuration`, { nextLevel: ToStringLiteral; }> : Err<`invalid-nesting/tuple`, `NestingTuple can have at most 3 elements: [start, end, nextLevel?]`, { tuple: ToStringLiteral; }> : [End] extends [NestingTupleConfig] ? true : Err<`invalid-nesting/tuple`, `The END segment (aka, 2nd element) of the tuple should be either undefined or a 'readonly string[]'. It was neither!`, { end: ToStringLiteral; tuple: ToStringLiteral; }> : Err<`invalid-nesting/tuple`, `The START segment (aka, 1st element) had character strings which were longer than a single character! This is not allowed.`, { start: ToStringLiteral; tuple: ToStringLiteral; }> : false : false; //#endregion //#region src/domains/nesting/helpers/NestedString.d.ts /** * **NestedString** * * A hierarchical representation of a string which uses * a `Nesting` configuration to determine when to move up * and down the hierarchy. * * - a root node will be level 0 * - root nodes will always have `null` for both _enter_ and _exit_ * characters * - only the origin node in a `NestedString` will be at level 0 * - child nodes which have an `enter` character but no `exit` * character are considered "unbalanced" * - you can test if a node or any of their children are _unbalanced_ * with the `IsBalanced` utility. */ interface NestedString { content: string; enterChar: string | null; exitChar: string | null; children: NestedString[]; level: number; } //#endregion //#region src/domains/nesting/named/recursive.d.ts /** * **DefaultNesting** * * Includes all of the standard start/stop tokens * for brackets as a key-value pairing to be used * with utilities that deal with `Nesting`. */ type DefaultNesting = typeof BRACKET_NESTING$1; /** * nesting configuration which has matching opening and closing * brackets based on bracketing characters. */ type BracketNesting = typeof BRACKET_NESTING$1; /** * nesting configuration which treats all quote characters as * opening and closing characters. * * - if you start with `"` you end with `"`; * - if you start with `'`, you end with `'`. * - if you start with \`, you end with \`. */ type QuoteNesting = typeof QUOTE_NESTING$1; /** * **BracketAndQuoteNesting** * * Mixes the `QuoteNesting` and `BracketNesting` strategies together to * form a paired nesting strategy which includes all bracket characters * and quotation characters. */ type BracketAndQuoteNesting = typeof BRACKET_AND_QUOTE_NESTING$1; //#endregion //#region src/domains/nesting/named/shallow.d.ts /** * **ShallowBracketNesting** * * Hierarchical nesting configuration where bracket characters are recognized * at level 0, but inside brackets no further nesting is recognized. * * Useful for utilities that only care about root-level bracketing without * nested complexity. */ type ShallowBracketNesting = typeof SHALLOW_BRACKET_NESTING$1; /** * **ShallowQuoteNesting** * * Hierarchical nesting configuration where quote characters are recognized * at level 0, but inside quotes no further nesting is recognized. * * This treats quoted content as literals, perfect for split operations * that should ignore delimiters inside quotes. */ type ShallowQuoteNesting = typeof SHALLOW_QUOTE_NESTING$1; /** * **ShallowBracketAndQuoteNesting** * * Combines shallow bracket and quote nesting. Both brackets and quotes * are recognized at level 0, but inside either, no further nesting occurs. */ type ShallowBracketAndQuoteNesting = typeof SHALLOW_BRACKET_AND_QUOTE_NESTING$1; //#endregion //#region src/domains/nesting/named/mapping.d.ts /** * **KnownNestingConfig** * * the list of the known _named_ nesting configurations defined in this repo. */ type KnownNestingConfig = typeof KNOWN_NESTING_CONFIGURATIONS$1[number]; /** * **AsNestingConfig**`` * * convert a "named" nesting configuration to the actual shape * of that named configuration points to. */ type AsNestingConfig = As$1<[T] extends [string] ? T extends "brackets" ? BracketNesting : T extends "quotes" ? QuoteNesting : T extends "brackets-and-quotes" ? BracketAndQuoteNesting : T extends "shallow-brackets" ? ShallowBracketNesting : T extends "shallow-quotes" ? ShallowQuoteNesting : T extends "shallow-brackets-and-quotes" ? ShallowBracketAndQuoteNesting : Err<`invalid-nesting-config/name`, `The nesting config "${T}" is not a known named configuration!`, { config: T; }> : [T] extends [NestingKeyValue] ? T : [T] extends [NestingTuple] ? T : Err<`invalid-nesting-config/structured`, `The nesting configuration passed in was invalid! You must use either a known "named configuration" like "quotes" or "brackets" or `>, Error | NestingKeyValue | NestingTuple>; //#endregion //#region src/domains/nesting/primitives/Nesting.d.ts /** * **Nesting** * * A _nesting_ rule configuration. Can take one of three forms: * * 1. `NestingKeyValue` - matching START and END tokens * 2. `NestingTuple` - unmatched START and END tokens * 3. `NestingConfig__Named` - a set of pre-configured rules which * are seen to have high reuse potential. */ type Nesting = NestingKeyValue | NestingTuple | KnownNestingConfig; //#endregion //#region src/domains/nesting/primitives/NestingApi.d.ts /** * **NestingApi** * * An API surface which gives you direct access to all runtime utilities * which are _nesting aware_. This surface is the direct result of calling the * `nesting(config)` utility. */ interface NestingApi { config: T; /** * **retainUntil**`(content, find, [include])` * * Trims off content after `find` is found in `content`. But * works in a _nested_ manner so the character match must * happen at the root level. */ retainUntil: (str: TStr, find: TFind, incl?: TInclude) => RetainUntil__Nested extends infer Find extends readonly string[] ? As$1 : never, { config: As$1; include: As$1; }>; /** * **split**`(content, splitOn, [policy])` * * Splits the content provided using `splitOn` as the delimiter. * * - you may optionally provide a "policy"; by default this policy * is "omit". */ split: (content: TContent, split: TSplit, policy?: TPolicy | undefined) => NestedSplit; } /** * used to convert a valid nesting configuration into the `NestingApi` */ type AsNestingApi = [T] extends [Error] ? T : [AsNestingConfig] extends [Error] ? AsNestingConfig : [AsNestingConfig] extends [Nesting] ? NestingApi : never; //#endregion //#region src/domains/nesting/primitives/NestingKeyValue.d.ts interface NestingKeyValueConfig { /** the exit token */ exit: Char$1; /** * optionally specify a new nesting configuration for child nodes */ children?: Nesting; /** * optionally add exceptions to _entry_ or _exit_ tokens. */ exception?: NestedException; } type NestingKeyValueEntry = Char$1 | readonly [exit: Char$1, children: Nesting] | NestingKeyValueConfig; /** * **NestingKeyValue** * * Used to define _entry_ tokens which have a **discrete** set of _exit_ tokens associated * to each entry token. * * - the _keys_ of this type represent the _entry tokens_ that this rule will define * - the _values_ of this type define the _exit token(s)_ associated to their _key_. The * _values_ can be expressed in one of two ways: * * 1. **Simple:** * ```ts * type Example = { * '(': ')' * } * ``` * - the _simple_ format is compact and very readable but does not offer advanced features * * 2. **Detailed:** * * ```ts * type Example = { * '(': { * exit: ')'; * children: DifferentRule; * exception: { * entry: { * ignorePrecededBy: "=" * } * } * } * } * ``` * * - the _detailed_ format opens up the ability to configure a different rule for _children_ * as well as define _exceptions_ for this level and below. * * **Related:** `NestingTuple`, `Nesting` */ type NestingKeyValue = Partial>; //#endregion //#region src/domains/nesting/primitives/NestingTuple.d.ts interface NestingTupleConfig { /** the exit token */ exit?: Char$1[]; /** * optionally specify a new nesting configuration for child nodes */ children?: Nesting; /** * optionally add exceptions to _entry_ or _exit_ tokens. */ exception?: NestedException; } /** * **NestingTuple** * * A tuple which represents a nesting configuration: * * - **Simple**: `[start, end]` * - `start` is a tuple of strings representing all characters allowed to start the nesting * - `end` is either a tuple of characters which terminate the nesting, or if `end` is _undefined_ * then the nesting terminates when the characters in `start` end. * * - **Detailed**: `[start, { exit: [ a,b,c ]; children: {}, ... } ]` - `start` * - `config` - `exit`, `children` and/or `exception` props * * **Examples:** * * ```ts * // Simple Recursive Ruleset * type Simple = [ * [ "(", "[" ], // entry * [ ")", "]"] // exit * ] * * // Detailed Config * type Multi = [ * ["(", "["], // entry * { exit: "]", ")", children: {}, exclude: { exit: { ignoreFollowedBy: "!" } } } * ] */ type NestingTuple = [entry: readonly Char$1[], exit: undefined | readonly string[] | NestingTupleConfig, children?: Nesting]; //#endregion //#region src/domains/geo/locale.d.ts type LOOKUP = typeof LOCALES$1; type ISO639 = GetEach; /** * **ISO639_2** * * The [ISO 639 standard](https://en.wikipedia.org/wiki/List_of_ISO_639_language_codes) * is broken up into different sets but the most commonly used is referred to * "set 1" and set 1 provides each language a two letter abbreviation. * * Alias: `Locale` */ type ISO639_2 = ISO639[number]; /** * **ISO639_3** * * The [ISO 639 standard](https://en.wikipedia.org/wiki/List_of_ISO_639_language_codes) * is broken up into different _sets_ where the most commonly used is "set 1" which uses * a two letter abbreviation but this type represents "set 2" which uses three letters * to represent each language. * * See Also: `ISO639_2`, `Locale`, `LocaleWithSubTag` */ type ISO639_3 = GetEach[number]; /** * **Locale**(ISO639_2) * * The [ISO 639 standard](https://en.wikipedia.org/wiki/List_of_ISO_639_language_codes) * is broken up into different sets but the most commonly used is referred to * "set 1" and set 1 provides each language a two letter abbreviation. * * Alias: `ISO639_2` * See Also: `LocaleWithSubTag`, `ISO639_3` */ type Locale = ISO639_2; type WithSuffix = { [K in keyof T]: `${T[K]}${"" | `-${string}`}` }; /** * **LocaleWithSubTag** * * This type provides valid primary language tags and an * optional `-${string}` type for when you want to specify * a sub-tag as part of [RFC 5646](https://www.rfc-editor.org/rfc/rfc5646.html). */ type LocaleWithSubTag = WithSuffix; //#endregion //#region src/each/Each.d.ts type EachOperation = "returnType" | "get" | "isLiteral" | "isLiteralLike" | "isWide" | "append" | "prepend"; type FirstParam = T extends "returnType" ? null : T extends "get" ? string | null : T extends "offset" ? PropertyKey | null : T extends "isLiteral" ? null : T extends "isWide" ? null : T extends "append" ? string | number : T extends "prepend" ? string | number : null; /** * **Each**`` * * Iterates over a tuple `T` and performs one of the following operations: * * - `get` - combined with a parameter -- which can be a _dot-path_ -- this * operation will retrieve nested properties in each element * - `returnType` - expects elements to functions and converts these functions into * their appropriate return type. * - `isLiteral` - returns `true` if all elements are literal values * - `isWide` - returns `true` if all elements are wide values */ type Each | null = null> = TOp extends "isLiteral" ? And<{ [K in keyof T]: IsLiteral }> : TOp extends "isLiteralLike" ? And<{ [K in keyof T]: IsLiteralLike }> : TOp extends "isWide" ? And<{ [K in keyof T]: IsWideType }> : { [K in keyof T]: TOp extends "returnType" ? T[K] extends TypedFunction ? ReturnType : Err<`not-function/return-type`, `The Each operation 'returnType' expected to see a functions in T but item was '${GetTypeOf}' instead!`, { element: T[K]; }> : TOp extends "get" ? TParam extends string ? Get : Err<`no-index/get`, `The Each operation 'get' requires that a parameter representing a 'DotPath' be present but no such parameter was found!`, { element: T[K]; param: TParam; }> : TOp extends "append" ? TParam extends string | number ? T[K] extends string ? `${T[K]}${TParam}` : T[K] extends number ? `${T[K]}${TParam}` extends `${number}` ? AsNumber<`${T[K]}${TParam}`> : `${T[K]}${TParam}` : T[K] : Err<`invalid-param/append`, `The parameter for 'append' must be a string (or number)!`, { param: TParam; }> : TOp extends "prepend" ? TParam extends string | number ? T[K] extends string ? `${TParam}${T[K]}` : T[K] extends number ? `${TParam}${T[K]}` extends `${number}` ? AsNumber<`${TParam}${T[K]}`> : `${TParam}${T[K]}` : T[K] : Err<`invalid-param/prepend`, `The parameter for 'prepend' must be a string (or number)!`, { param: TParam; }> : never }; //#endregion //#region src/functional/Left.d.ts /** * **Left** * * Extracts the **left** value from a `LeftRight`. */ type Left$1 = T[1]; //#endregion //#region src/functional/Right.d.ts /** * **Right** * * Extracts the **right** value from a `LeftRight`. */ type Right$1 = T[2]; //#endregion //#region src/functions/ArgUnion.d.ts /** * **ArgUnion**`` * * Converts the first */ type ArgUnion> = { [K in keyof P]: P[K] & string }; //#endregion //#region src/functions/AsFnMeta.d.ts /** * **AsFnMeta**`` * * Converts any function into `FnMeta` format. */ type AsFnMeta = TFn extends TypedFunction ? [IsNonEmptyObject>] extends [true] ? FnMeta : FnMeta : FnMeta; //#endregion //#region src/functions/AsyncFunction.d.ts /** * **AsyncFunction**`<[TParams], [TReturns]>` * * By default, represents the type of _any_ Asynchronous function * which returns a Promise (or _promise-like_) API surface. * * Provides generics to narrow the scope of the type if desired. * * **Related:** `Awaited`, `IsThenable` */ type AsyncFunction = (...params: TParams) => IsThenable extends true ? TReturns : Promise; //#endregion //#region src/functions/ExplicitFunction.d.ts /** * **ExplicitFunction** * * A function which provides _type_ information to the runtime * system about it's name, parameters, and what it returns. */ type ExplicitFunction = TypedFunction & { name: string; parameters: readonly TypedParameter[]; returns: unknown; }; //#endregion //#region src/functions/FnFrom.d.ts /** * **FnFrom**`` * * Type utility to build a type from it's constituent parts. */ type FnFrom = EmptyObject extends TProps ? TParams["length"] extends 0 ? () => TReturn : AsNarrowingFn : TParams["length"] extends 0 ? (() => TReturn) & ExpandRecursively : AsNarrowingFn; //#endregion //#region src/functions/FnKeyValue.d.ts /** * Built-in function property keys which should NOT be treated as user props. */ type BuiltinFnKeys = "arguments" | "caller" | "length" | "prototype" | "apply" | "call" | "bind" | "toString"; type Process$5 = Omit>, BuiltinFnKeys>; /** * **FnKeyValue**`` * * Return a dictionary of key/value pairs from a function. If no key/value * pairs are assigned to the function base then an empty object is returned. */ type FnKeyValue = Expand>>; //#endregion //#region src/functions/FnMeta.d.ts /** * **FnMeta** * * The meta-information around a given function. * * ```ts * // { * // fn: () => "hi"; * // params: []; * // returns: "hi"; * // hasParams: false; * // hasProps: false; * // kind: "identity"; * // } * type Test = FnMeta<() => "hi">; * ``` */ interface FnMeta { /** the function itself */ fn: TFn; /** the parameters of the function */ params: Parameters; /** the return type of the function */ returns: FnReturn; props: FnKeyValue; hasProps: [IsNonEmptyObject>] extends [true] ? true : false; hasParams: Parameters["length"] extends 0 ? false : true; kind: IsNarrowingFn extends true ? "narrowing" : Parameters["length"] extends 0 ? "identity" : "static"; } interface FnMetaShape { fn: TypedFunction; params: readonly unknown[]; returns: unknown; props: Dictionary; hasProps: boolean; hasParams: boolean; kind: "narrowing" | "identity" | "static"; } //#endregion //#region src/functions/FnReturn.d.ts /** * Enhanced template hole filler that handles multiple template literal patterns */ type FillAllTemplateHoles = TParams extends readonly [infer First, ...infer Rest] ? First extends string ? FillAllTemplateHoles, Rest> : First extends number ? FillAllTemplateHoles, Rest> : FillAllTemplateHoles : ReplaceAll, "{{number}}", "${number}">; /** * **FnReturn**`` * * Determines the return type of a function. * * - If the function has a concrete return type, returns it directly * - If ReturnType resolves to `any` (often with generic functions), attempts to infer * a more useful return type based on template literal patterns * - For template literals with generics, converts them to their base template form * (e.g., `${T}` becomes `${string}` where T extends string) * * ```ts * // `Hi Bob` | `Hi Mary` * type LiteralUnion = FnReturn<(name: "Bob" | "Mary") => `Hi ${name}`> * // `${string} is ${number} years old` * type Template = FnReturn<(name: string, age: number) => `${name} is ${age} years old`> * ``` */ type FnReturn | null = null> = [IsAny>] extends [true] ? string : ReturnType extends string ? IsTemplateLiteral> extends true ? Parameters["length"] extends 1 ? Parameters[0] extends string ? ReturnType extends `hi ${string}` ? `hi ${Parameters[0]}` : FillAllTemplateHoles>, string>, Parameters> : FillAllTemplateHoles>, string>, Parameters> : ReturnType : ReturnType : ReturnType; //#endregion //#region src/functions/FnWithDescription.d.ts type FnDefn = [fn: AnyFunction] | [fn: AnyFunction, desc: string] | [fn: AnyFunction, props: Record]; /** * **Fn**`` */ type FnWithDescription = TFn extends [fn: AnyFunction] ? TFn[0] : TFn extends [fn: AnyFunction, desc: string] ? TFn[0] & { desc: TFn[1]; } : TFn extends [fn: AnyFunction, props: Record] ? TFn[0] & TFn[1] : never; //#endregion //#region src/functions/FnWithProps.d.ts /** * **FnWithProps**`` * * Produces a function which is intersected with a dictionary of KV's. * * **Related**: `SimpleFn`, `NarrowableFn`, `AnyFunction`, `IsFunctionWithDict` */ type RebaseFn = (...args: Parameters) => FnReturn>; type UnderlyingFn = T extends infer F & Record ? F extends ((...args: any[]) => any) ? F : T extends ((...args: any[]) => any) ? T : never : T extends ((...args: any[]) => any) ? T : never; type FnWithProps = IsNonEmptyObject> extends true ? RebaseFn & Readonly, Extract> & TProps>> : TFn & ExpandRecursively; //#endregion //#region src/functions/HandleDoneFn.d.ts /** * **HandleDoneFn**`` * * A type utility which looks for a `done` property on `T` and * if it's a function it will convert the type to the _return type_ * of the `done()` function. */ type HandleDoneFn = T extends { done: TypedFunction; } ? ReturnType : T extends TypedFunction ? Parameters["length"] extends 0 ? ReturnType : T : T; //#endregion //#region src/functions/IdentityFn.d.ts /** * **IdentityFn**`` * * A function which returns the value of `T`. */ type IdentityFn = [TNarrow] extends [true] ? [IsLiteralLike] extends [true] ? [IsUnion] extends [true] ? (v: T) => T : Err<"invalid-literal", `A narrowing identity function must be based off a wide type or a union of literals!`, { value: TValue; }> : (v: T) => T : () => TValue; //#endregion //#region src/functions/LogicFunction.d.ts /** * **LogicFunction** * * A function which returns a boolean value. */ type LogicFunction = (...args: any[]) => boolean; //#endregion //#region src/functions/NarrowingFn.d.ts /** * **NarrowingFn**`` * * Produces a function which helps to narrow down to the type passed in * by assigning generics to all input parameters. * * ```ts * // (name: string) => string * type Fn1 = NarrowingFn<(name: string) => string>; * // (v: T) => T * type Fn2 = NarrowingFn; * // (v: T) => T * type Fn2 = NarrowingFn<42>; * ``` * * **Related:** `LiteralFn`, `IsNarrowingFn` */ type NarrowingFn = IsEqual, []> extends true ? TFn : IsNarrowingFn extends true ? TFn : (]>(...args: T) => ReturnType); /** * **AsNarrowingFn**`` * * Constructs a `NarrowingFn` from component aspects of * a function. * * **Related:** `LiteralFn`, `NarrowingFn`, `AsStaticFn` */ type AsNarrowingFn = TParams extends TypedFunction ? NarrowingFn : TParams extends readonly unknown[] ? EmptyObject extends TProps ? TParams["length"] extends 0 ? () => TReturn : (...args: T) => TReturn : [IsEqual] extends [true] ? (() => TReturn) & ExpandRecursively : ((...args: T) => TReturn) & TProps : never; //#endregion //#region src/functions/OnlyFn.d.ts type HasExtraProperties = T extends ((...args: any[]) => any) ? keyof T extends never ? false : true : false; /** * **OnlyFn**`` * * Takes a function `T` and strips away any key/value pair that may * be tied to it, leaving only the function. * * This utility extracts just the function signature, removing any * intersection properties while preserving: * - Parameter names and types (including optional/rest parameters) * - Return type * - Generic type parameters (for generic functions) */ type OnlyFn = HasExtraProperties extends true ? T extends TypedFunction ? (...args: FnMeta["params"]) => FnMeta["returns"] : T extends ((...args: infer P) => infer R) ? CallableFunction extends T ? T : (...args: P) => R : AnyFunction : T; //#endregion //#region src/functions/OnlyFnProps.d.ts /** * **OnlyFnProps**`` * * Takes a function `T` and strips the function away leaving only * any key/values that were stored alongside it. */ type OnlyFnProps = T extends TypedFunction ? FnMeta["props"] : EmptyObject; //#endregion //#region src/functions/PromiseAll.d.ts /** * **PromiseAll** * * */ interface PromiseAll { >>(...promises: T): { [K in keyof T]: Awaited }; } //#endregion //#region src/functions/Promisify.d.ts type Result$1 = Parameters["length"] extends 2 ? Parameters[1] : void; /** * **Promisify**`` * * A better typed **Promisify** type utility. * * - converts a `NodeCallback` into a promise based async function */ type Promisify = T extends ((...args: [...infer Args, infer Cb extends NodeCallback]) => void) ? (...args: Args) => Promise> : never; //#endregion //#region src/functions/RemoveFnProps.d.ts /** * **RemoveFnProps**`` * * Takes a function `T` and returns the function unchanged but without any * key/value pairs that may have been added to the function's definition. */ type RemoveFnProps = (...args: AsFnMeta["params"]) => AsFnMeta["returns"]; //#endregion //#region src/functions/StaticFn.d.ts /** * **StaticFn**`` * * Receives any function `TFn` and makes sure that it is not using * generics to narrow the inputs coming into the function. * * Converts generic/narrowing functions to their static equivalents: * - `(x: T) => T` becomes `(x: string) => string` * - Preserves intersection properties if present * * **Related:** `IsStaticFn`, `NarrowingFn` */ type StaticFn = TFn extends ((...args: infer P) => infer R) ? P["length"] extends 0 ? () => R : (...args: P) => R : never; /** * **AsStaticFn**`` * * Constructs a `StaticFn` from component aspects of * a function. * * **Related:** `LiteralFn`, `NarrowingFn`, `AsNarrowingFn` */ type AsStaticFn = TParams extends TypedFunction ? StaticFn : TParams extends readonly any[] ? IsNonEmptyObject extends true ? TParams["length"] extends 0 ? (() => TReturn) & TProps : ((...args: TParams) => TReturn) & TProps : TParams["length"] extends 0 ? () => TReturn : (...args: TParams) => TReturn : never; //#endregion //#region src/functions/SyncFunction.d.ts /** * **SyncFunction**`<[TParams], [TReturns]>` * * By default, represents the type of _any_ Asynchronous function * which returns a Promise (or _promise-like_) API surface. * * Provides generics to narrow the scope of the type if desired. * * **Related:** * - `AsyncFunction` * - `Awaited`, `IsThenable` */ type SyncFunction = IsThenable extends true ? never : (...params: TParams) => TReturns; //#endregion //#region src/functions/ToFn.d.ts /** * **ToFn**`` * * Ensures that resultant type is a function, where the mapping is: * * - `AnyFunction` - function signature maintained * - `FnMeta` - is converted to a precise function type * - `never` _or_ `ErrorCondition` - returned "as is" * * All other values will return a function of the form `() => T` * * **Related:** `AsFn` */ type ToFn = T extends AnyFunction ? T : () => T; //#endregion //#region src/functions/TypedParameter.d.ts /** * A way to express the full type of a function's parameter */ interface TypedParameter { name: string; type: any; } //#endregion //#region src/functions/TypeGuard.d.ts /** * **TypeGuard** * * a typing for a **TS** type-guard which evaluates an _unknown_ input * and determines if it is of type `T`. */ type TypeGuard = (value: UU) => value is T & UU; //#endregion //#region src/functions/WrapperFn.d.ts /** * **WrapperFn**`` * * A function which consumes a known function `TFn` and exposes the * same parameters externally while allowing it to _transform_ the * original functions return value before completing. * * Optionally, you can express some amount of _state_ which will be available * to the `TTransform` function to do it's work. * * ```ts * type Fn = (name: string) => `Hello ${string}`; * // (name: string) => `Hello ${name}!`; * type Wrapped = WrapperFn `${v}!`> * ``` */ type WrapperFn>(rtn: TRtn) => unknown, TState extends Container | Unset = Unset> = If, FnFrom, ReturnType>>, (state: T) => FnFrom, ReturnType>>>; //#endregion //#region src/runtime-types/SimpleToken.d.ts /** * the _optional_ variants of the `SimpleScalarToken` type */ type OptionalSimpleScalarTokens = typeof SIMPLE_OPT_SCALAR_TOKENS$1[number]; /** * the _required_ variants of the `SimpleScalarToken` type */ type RequiredSimpleScalarTokens = typeof SIMPLE_SCALAR_TOKENS$1[number]; /** * **SimpleUnionToken** * * A subset of `SimpleToken` which represents union types. */ type SimpleUnionToken = typeof SIMPLE_UNION_TOKENS$1[number]; /** * a subset of `SimpleContainerToken` */ type SimpleDictToken = typeof SIMPLE_DICT_TOKENS$1[number]; /** * a subset of `SimpleContainerToken` */ type SimpleArrayToken = typeof SIMPLE_ARRAY_TOKENS$1[number]; /** * a subset of `SimpleContainerToken` */ type SimpleMapToken = typeof SIMPLE_MAP_TOKENS$1[number]; /** * a subset of `SimpleContainerToken` */ type SimpleSetToken = typeof SIMPLE_SET_TOKENS$1[number]; /** * **SimpleContainerToken** * * A subset of `SimpleToken` which provides shortcut's for expressing * _container_ types via a simple token. */ type SimpleContainerToken = SimpleDictToken | SimpleArrayToken | SimpleMapToken | SimpleArrayToken; /** * **SimpleScalarToken** * * A subset of the `SimpleToken` which may be more useful for building * simple string literal values. * * **Note:** this includes both `RequiredSimpleScalarTokens` and `OptionalSimpleScalarTokens`. */ type SimpleScalarToken = RequiredSimpleScalarTokens | OptionalSimpleScalarTokens; /** * **SimpleToken** * * An enumeration of string values which point to _types_ in the * the type system. * * **Related:** * - `SimpleScalarToken`, `SimpleContainerToken`, `SimpleUnionToken`, * - `FromSimpleToken`, `FromDefn` * - `TypeToken` */ type SimpleToken = SimpleScalarToken | SimpleArrayToken | SimpleDictToken | SimpleMapToken | SimpleSetToken | SimpleUnionToken; //#endregion //#region src/runtime-types/SimpleType.d.ts type SetTypes = typeof SIMPLE_SET_TYPES$1[number]; type MapKeys$1 = typeof SIMPLE_MAP_KEYS$1[number]; type MapValues = typeof SIMPLE_MAP_VALUES$1[number]; type DictValues = typeof SIMPLE_DICT_VALUES$1[number]; /** * **SimpleTypeScalar**`` * * Converts a `SimpleScalarToken` into the _type_ it represents. */ type SimpleTypeScalar = T extends "string" ? string : T extends `string(${infer Literal})` ? Literal extends `${string},${string}` ? CsvToStrUnion : Literal : T extends "number" ? number : T extends `number(${infer Literal})` ? Literal extends `${string},${string}` ? CsvToUnion : AsNumber : T extends "boolean" ? boolean : T extends "true" ? true : T extends "false" ? false : T extends "null" ? null : T extends "any" ? any : T extends "undefined" ? undefined : T extends "unknown" ? unknown : T extends `Opt<${infer Underlying extends SimpleScalarToken}>` ? undefined | SimpleTypeScalar : never; /** * **SimpleTypeUnion**`` * * Converts a `SimpleUnionToken` into the _type_ it represents. */ type SimpleTypeUnion = T extends "opt(string)" ? string | undefined : T extends "opt(number)" ? number | undefined : T extends "opt(boolean)" ? boolean | undefined : T extends "opt(unknown)" ? unknown | undefined : T extends `opt(${infer Literal extends string})` ? Literal extends `${string},${string}` ? TupleToUnion> | undefined : UnderlyingType | undefined : T extends `Union(${infer Literal})` ? Literal extends `${string},${string}` ? CsvToTuple : Literal : never; type SimpleTypeDict = T extends `Dict` ? Dictionary : T extends `Dict` ? Dictionary> : T extends `Dict<{${infer K}: ${infer V}, ${infer K2}: ${infer V2}}>` ? V extends SimpleScalarToken ? V2 extends SimpleScalarToken ? ExpandDictionary> & Record> & Dictionary> : ExpandDictionary> & Dictionary> : V2 extends SimpleScalarToken ? ExpandDictionary> & Dictionary> : never : T extends `Dict<{${infer Key}: ${infer Value}}>` ? Value extends SimpleScalarToken ? ExpandDictionary> & Dictionary> : never : never; type SimpleTypeArray = T extends "Array" ? any[] : T extends "Array" ? string[] : T extends `Array` ? Array> : T extends "Array" ? number[] : T extends `Array` ? Array> : T extends "Array" ? boolean[] : T extends "Array" ? unknown[] : never; type SimpleTypeMap = T extends "Map" ? Map : T extends `Map<${infer Key extends MapKeys$1}, ${infer Value extends MapValues}>` ? Map, SimpleType> : never; type SimpleTypeSet = T extends "Set" ? Set : T extends `Set<${infer Type extends SetTypes}>` ? Set> : never; /** * **SimpleType**`` * * A type utility which takes a `SimpleToken` and converts it to * it's _type_ in the type system. * * **Related:** `ToShapeToken`, `StructuredStringType` */ type SimpleType = T extends SimpleScalarToken ? SimpleTypeScalar : T extends SimpleDictToken ? SimpleTypeDict : T extends SimpleArrayToken ? SimpleTypeArray : T extends SimpleMapToken ? SimpleTypeMap : T extends SimpleSetToken ? SimpleTypeSet : T extends SimpleUnionToken ? SimpleTypeUnion : never; type StructuredStringType = any; //#endregion //#region src/runtime-types/AsSimpleType.d.ts type ProcessSimple = T extends SimpleToken ? SimpleType : never; type Iterate$1 = [] extends T ? TResult : Iterate$1, TResult & (First$1 extends SimpleScalarToken ? SimpleTypeScalar> : First$1 extends SimpleDictToken ? SimpleTypeDict> : First$1 extends SimpleMapToken ? SimpleTypeMap> : First$1 extends SimpleSetToken ? SimpleTypeSet> : First$1 extends SimpleArrayToken ? SimpleTypeArray> : First$1 extends SimpleUnionToken ? SimpleTypeUnion> : never)>; /** * **AsSimpleType**`` * * converts either a `SimpleToken` or a `TypeToken` into the * _type_ it represents. * * NOTE: only implemented for `SimpleToken` at the moment. */ type AsSimpleType = T extends readonly SimpleToken[] ? Iterate$1 : T extends SimpleToken ? ProcessSimple : never; //#endregion //#region src/runtime-types/comparison/FilterFn.d.ts /** * **FilterFn**`` * * A type realized when partially applying the runtime's `filter()` * utility. This partially-applied type can be reused as a comparator * function which */ type FilterFn> = []>(list: TList) => Filter; //#endregion //#region src/runtime-types/comparison/FindFunction.d.ts /** * **FindFunction**`` * * A partially applied type resulting from a call to the * runtime's `find()` utility. This function has a fully * configured `Comparator` (aka, an comparison _operation_ * and one or more parameters to allow valid comparisons * to be made). */ type FindFunction> = []>(list: TList) => Find$1; //#endregion //#region src/runtime-types/FromLiteralTokens.d.ts type _Tokenize$1 = If, StripLeading, T extends "" ? `${string}` : T extends "" ? `${number}` : T extends "" ? `${boolean}` : T extends "" ? `${AlphaChar}` : T extends "" ? `${LowerAlphaChar}` : T extends "" ? `${UpperAlphaChar}` : T extends "" ? `${Digit$1}` : T extends "" ? `${Bracket}` : T extends "" ? `${OpeningBracket}` : T extends "" ? `${ClosingBracket}` : never>; type _Convert = [] extends T ? Type : _Convert, _Tokenize$1> extends string ? `${Type}${_Tokenize$1>}` extends StringLiteralToken ? `${Type}${_Tokenize$1>}` : never : never>; /** * **FromLiteralTokens**`` * * Type utility which converts an array of `StringLiteralToken`'s * into a literal type. */ type FromLiteralTokens = _Convert; //#endregion //#region src/runtime-types/RuntimeTakeFunction.d.ts /** * **RuntimeTakeFunction**`` * * A `take` function which tries to take the _head_ of the string * for the token/thing it wants to extract. It returns either: * * - `Unset` * - returns an `Unset` type when this take function didn't find * anything to work with at the HEAD of the parse string. * * - `[T, string]` * - a tuple is returned when the take function finds and extracts * the token/thing it was looking for * * - `Error` | `E` * - an error is returned when the take function finds * the _block_ it is looking for but that block is malformed * in some manner * - it is encouraged that you use the runtime utilities for * creating the take functions because that allows setting * the allowed error types for the take function. */ type RuntimeTakeFunction = (input: TParseStr) => Unset | [T, string] | E; //#endregion //#region src/runtime-types/Shape.d.ts type Narrow$1 = Exclude; /** * **Shape** * * This is a union type that captures all signatures of **shapes** which * are produced as the runtime representation of a type by utilities * like the `ShapeApi` and the `shape()` runtime function. */ type Shape = `<<${T}${string}>>`; type ShapeSuggest = Suggest<`<<${TypeTokenKind}>>`>; /** * **ShapeAddOrDone**`` * * The structure of endpoints on the `ShapeApi` which return * a tuple or union. */ interface ShapeTupleOrUnion { add: (a: TAdd) => ShapeTupleOrUnion<[...TTuple, TAdd], TMakeUnion>; done: () => If, TupleToUnion, TTuple>; } type WideTypeName = "string" | "number" | "boolean" | "null" | "undefined" | "unknown" | "object"; interface StringTokenUtilities { /** * **startsWith** * * Fix a string literal for the beginning of the string and allow * anything else afterward */ startsWith: (startsWith: T) => `${T}${string}`; /** * **endsWith** * * Fix a string literal for the ending of the string and allow * anything else before it */ endsWith: (endsWith: T) => `${string}${T}`; /** * **numericString** * * A string type which holds numeric content (e.g., \`${number}\`) */ numericString: () => `${number}`; /** * traditional 5 digit zip code (e.g., 90210) */ zip: () => Zip5; /** * A 5 digit code, a dash, and then a 4 digit code used for greater * geographic specificity. You can use the [melissa](https://lookups.melissa.com/home/zip4/zip4/) * API to see what 4 digit codes are available for a known base zip code. */ zipPlus4: () => ZipPlus4; /** * **zipCode** * * A union type including both `zip` and `zipPlus4` patterns. */ zipCode: () => ZipCode; /** * **ipv4Address** * * A simple representation of a IPv4 address. */ ipv4Address: () => Ip4AddressLike; /** * **ipv6Address** * * A simple representation of a fully qualified Ip6Address. */ ipv6Address: () => Ip6Address; /** * **regex** * * A regular expression which can act as a type validator during * runtime, along with a type pattern/representation that doesn't * overburden the type system while keeping the guard rails on. */ regex: (re: TExp, ...representation: TRep) => unknown; done: () => T; } type ShapeApi__Scalars = Omit<{ /** * **string**(_literals_) * * When called with: * * - **no parameters** sets the type to `string` * - you may also choose other well known string literal patterns off an extended API * when you initially call with no params * - **one parameter** makes it a _string literal_ * - **more than one** parameter results in a _union type_ of string literals. */ string: ((...literals: T) => T["length"] extends 0 ? StringTokenUtilities : T["length"] extends 1 ? T[0] : TupleToUnion); /** * **number**(_literals_) * * When called with: * * - **no parameters** sets the type to `number` * - **one parameter** makes it a _numeric literal_ * - **more than one** parameter results in a _union type_ of numeric literals. */ number: (...literals: T) => T["length"] extends 0 ? number : T["length"] extends 1 ? T[0] : TupleToUnion; /** * **boolean**(_literal_) * * When called with _no_ parameters it results in a `boolean` type; however * you may add `true` or `false` into the call signature to make it a literal. */ boolean: (v?: L) => If, true, If, false, boolean>>; /** * **null**() * * Set as a `null` value. */ null: () => If, null, null | TUnion>; /** * **undefined**() * * Set as a `undefined` value. */ undefined: () => If, undefined, undefined | TUnion>; /** * **unknown**() * * Set as an `unknown` value. */ unknown: () => If, unknown, unknown | TUnion>; }, TExclude>; type UnionElDefn = ShapeCallback | Tuple$1; interface ShapeApi__Union { union: (...elements: U) => AsUnionToken; } type DictionaryTypeDefn = Record; /** * **FnArgsDefn** * * The definition of a function's argument */ type FnArgsDefn = ShapeCallback | WideContainerNames; /** * **FnReturnTypeDefn** * * The definition of _return type_ of a function */ type FnReturnTypeDefn = WideTokenNames | ShapeCallback; /** * **FnPropertiesDefn** * * The definition of the _optional_ properties associated with a function. */ type FnPropertiesDefn = DictionaryTypeDefn; interface ShapeApi__Functions { fn: (...args: TArgs) => ({ returns: (rtn: TReturn) => ({ addProperties: (kv: TProps) => any; done: () => any; }); done: () => any; }); } /** used in Shape callbacks */ type RecordKeyWideTokens = "string" | "symbol" | "string | symbol"; type FromSimpleRecordKey = T extends "string" ? string : T extends "symbol" ? symbol : T extends "string | symbol" ? string | symbol : never; type RecordKeyDefn = RecordKeyWideTokens | ShapeCallback; type FromRecordKeyDefn = T extends ShapeCallback ? FromShapeCallback extends ObjectKey ? FromShapeCallback : never : T extends "string" ? string : T extends "symbol" ? symbol : T extends "string | symbol" ? string | symbol : never; /** * An input type for defining an object's "key". * * Note: use of `FromDefn` will translate this into the actual key value. */ type ObjKeyDefn = RecordKeyWideTokens | ShapeCallback; type FromObjKeyDefn = T extends ShapeCallback ? FromShapeCallback extends ObjectKey ? FromShapeCallback : never : FromRecordKeyDefn; type ArrayTypeDefn = "Array" | "Array" | "Array" | "Array" | ShapeCallback; type RecordValueTypeDefn = ShapeCallback | WideTokenNames; type MapKeyDefn = ShapeCallback | WideTokenNames; type MapValueDefn = ShapeCallback | WideTokenNames; type WeakMapKeyDefn = WideContainerNames | ShapeCallback; type WeakMapValueDefn = ShapeCallback | WideTokenNames; interface ShapeApi__WideContainers { record: (key?: TKey, value?: TValue) => TKey extends string | symbol ? Record, FromDefn> : never; array: (type?: T) => AsArray>; set: (type?: T) => T extends ShapeCallback ? Set>> : T extends WideTokenNames ? Set> : Set; map: (key?: TKey, value?: TValue) => Map, FromDefn>; weakMap: (key?: TKey, value?: TValue) => WeakMap, Container>, FromDefn>; } type TupleDefn = WideTokenNames | ShapeCallback; interface ShapeApi__LiteralContainers { dictionary: (obj: T) => FromDefn; /** * **tuple**(el, el, ...) * * Allows the definition of a **tuple** by expressing each of the elements * in the tuple using the built-in "wide types" or with any type you need * using the callback api. * * ```ts * // [string, number, 42 | 56] * const tuple = 📦.tuple("string", "number", s => s.number(42,56)) * ``` */ tuple: (...elements: T) => FromDefn; } /** * The `ShapeApi` is an API surface for defining types which have a runtime aspect * to them as well. * * This is precisely what the `shape()` runtime utility exposes * but any function can add this -- typically by associating a property on a function * -- with the `ShapeCallback` type which simply gives this API to the caller of * the function. */ type ShapeApi = { kind: "shape"; } & ShapeApi__Scalars & ShapeApi__Union & ShapeApi__Functions & ShapeApi__WideContainers & ShapeApi__LiteralContainers; /** * **ShapeCallback** * * This is a function signature for a property which you want to use * the `SharpApi` with to define types. */ type ShapeCallback = (api: T) => unknown>(cb: TCb) => ReturnType; type ScalarCallback = (api: ShapeApi__Scalars & ShapeApi__Union) => unknown; //#endregion //#region src/runtime-types/StringLiteralToken.d.ts type OptModifier = `|opt`; /** * **BespokeLiteral** * * A string literal token which has a discrete literal value */ type BespokeLiteral = `literal:${string}`; /** * **BespokeUnion** * * A string literal token which represents a discrete set of * values who's union represents the string literal value. * * Note: if you need a comma literal in your union type then it * must be serialized to `Constant<"comma">`. */ type BespokeUnion = `union:[${CSV}`; type OptionalOptModifier = OptModifier | ""; /** * **StringLiteralToken** * * Tokens are broken up into three types: * * 1. **bespoke** literal values can also be specified by prefixing with * `literal:` and then the literal value. * 2. **union** literal values can be expressed as `union:[CSV]` * 3. **known** literals are surrounded by `<` and `>` characters and * represent a known type definition which is valid for a string * literal. * * - within known literals there are three char "scopes": * - `` effectively allows any number and type of chars * - `` and `` allow for as many characters as is required for completing the type * - all others -- like ``, ``, etc. -- are just a single character * - known literals can add the `| opt` modifier to become intersected with `| ""` which makes them an optional condition. Note that only `` does _not_ allow this as this optionality provides no additional optionality. */ type StringLiteralToken = BespokeLiteral | "" | `` | `` | `` | `` | `` | `` | `` | `` | `` | ``; //#endregion //#region src/runtime-types/TokenizeStringLiteral.d.ts type _Tokenize = [] extends T ? Results : First$1 extends StringLiteralToken ? _Tokenize, [...Results, First$1]> : If]>, _Tokenize, [...Results, `literal:${AsString>}`]>, _Tokenize, [...Results, Passthrough extends string ? true : false, "", If>, "", "">>, StringLiteralToken, never>]>>; /** * **TokenizeStringLiteral**`` * * Type utility which receives a list of _tokens_ which are intended * to represent the underlying type of a string literal. This utility * will ensure that known tokens -- those delimited by `<` and `>` symbols * are maintained but that any _string literals_ are prefixed with "literal:". * * - a wide _number_ or _boolean_ type will be converted to `${number}` and `${boolean}` * - literal values for number and boolean will be converted to a string using `ToString` * * **Related:** `ToStringLiteral` */ type TokenizeStringLiteral = _Tokenize; //#endregion //#region src/runtime-types/tokens/Grammar.d.ts type AddGrammarMethod<_S extends TokenSyntax, T extends Token$1> = Record T["type"] : T extends DynamicToken ?

>(...params: P) => unknown : never>; /** * Provides a list of `Token` names from a tuple of `Token[]`'s */ type GetTokenNames = { [K in keyof T]: T[K]["name"] extends TokenName ? T[K]["name"] : never }; type GrammarTypeDefinition = [] extends T ? Expand : GrammarTypeDefinition, R & AddGrammarMethod>>; interface Grammar = TokenSyntax, TTokens extends readonly Token$1[] = readonly Token$1[], TShape extends [number] & TokenName) | undefined = undefined>(token?: TName) => TName extends undefined ? `${TSyntax["start"]}${TTokens[number]["name"]}${TSyntax["end"]}` : `${TSyntax["start"]}${TName}${TSyntax["end"]}` = any> { kind: "Grammar"; /** * the _syntax_ which regulates the structure of the tokens * in this grammar */ syntax: TSyntax; /** * The formal definitions of the token's in this grammar */ tokenDefinitions: TTokens; /** * The _names_ of all the tokens in this grammar */ tokenNames: GetTokenNames; /** * **tokenShape**`(token?: string)` * * A function which can take the name of a valid token in the grammar. * - if no token name is provided then a union type which represents all * possible tokens will be returned. * in the grammar. * - if a token _is_ provided then the type which encapsulates all * variants of that particular token is returned */ tokenShape: TShape; typeDefinition: GrammarTypeDefinition; } //#endregion //#region src/runtime-types/tokens/OutputToken.d.ts type IT_TupleToOutputToken = [] extends T ? Surround>"> : IT_TupleToOutputToken, R extends "" ? `"${SafeEncode>}"` : `${R}, "${SafeEncode>}"`>; /** * **OutputToken** * * An _output token_ is a variant of an _input token_ which is always a string * based value which represents a "type" in full fidelity. * * - this is a _branded_ type and to validate that a value is of this * type you should use the `isOutputToken()` type guard. */ type OutputToken = `<<${string}>>` & { brand: "OutputToken"; }; /** * **TypeToken** * * An type token is just a _valid_ string-based `InputToken` * wrapped in delimiters. * * **Related:** `isTypeToken()`, `asTypeToken()`, `ToTypeToken` */ type AsOutputToken = T extends string ? `<<"${SafeEncode}">>` : T extends DefineObject ? ToJsonObject> extends infer J extends string ? `<<${J}>>` : never : T extends readonly InputTokenSuggestions[] ? IT_TupleToOutputToken : never; //#endregion //#region src/runtime-types/tokens/Token.d.ts type TokenName = `${AlphaChar}${string}`; /** * How this token uses -- or doesn't use -- parameters to create * variants. The parameters, if they exist, represent the args * which the */ type TokenParamsConstraint = "none" | readonly unknown[]; type TokenType = "static" | "dynamic"; type TokenIsStatic = T extends "none" ? true : false; type ResolvedTokenType = [type: T, tg: TG]; /** * A **TokenResolver** is a higher order function. * * - the first call is made by a _syntax_ to provides it's context. * - the second call provides the **parameters** which allow a dynamic token * to isolate to a discrete variant state. * * This second call is responsible for returning the `type` and `typeGuard` * function which validates this variant state. */ type TokenResolver = (syntax: TSyntax) => (...params: TParams) => { type: unknown; typeGuard: (val: unknown) => boolean; }; /** * **Tokenizer** * * A tokenizer provides an API surface to setting type variants which * the given token can represent. * * - A tokenizer always returns an array of strings which will represent * the token's eventual parameters for this variant */ type Tokenizer = (...args: readonly any[]) => readonly string[]; interface DynamicToken { kind: "DynamicToken"; /** * boolean flag indicating whether the token is static or is _dynamic_ * (which multiple variants possible). */ isStatic: false; /** the name of the token */ name: TToken; resolver: TResolver; tokenizer: TTokenizer; } interface StaticToken boolean = (val: unknown) => boolean> { kind: "StaticToken"; /** * boolean flag indicating whether the token is static or is _dynamic_ * (which multiple variants possible). */ isStatic: true; name: TToken; type: TType; typeGuard: TG; } type Token$1 = T1 extends TypedFunction ? DynamicToken : StaticToken; //#endregion //#region src/runtime-types/tokens/token-api.d.ts type StaticTokenApi = boolean>(type: TType, typeGuard: TGuard) => StaticToken, TGuard>; /** * The remaining configuration required to create a Dynamic Token. */ type DynamicTokenApi = (resolver: TResolve, tokenizer: TTokenize) => DynamicToken; /** * An API surface for completing the creation process for a Token. * It distinguishes between "static" and "dynamic" tokens in what is * required for configuration. */ type DefineTokenDetail = TKind extends "static" ? StaticTokenApi : DynamicTokenApi; //#endregion //#region src/runtime-types/tokens/TokenSyntax.d.ts /** * **TokenSyntax**`` * * Provides the shape of the token as well as an * encoder/decoder to ensure parameter values of * tokens will not interfere with string pattern * matching. */ interface TokenSyntax { kind: "TokenSyntax"; /** the name of the Token Syntax */ name: TName; /** the initial starting character's of a token */ start: string; /** a token's */ end: string; /** the initial starting character's of a token */ sep: string; /** * the encode/decode definition */ encodingDefinition: Dictionary; /** * An encoder for parameter values to ensure parsing * mistakes on the token are avoided. */ encode: TEnc; /** * A decoder for parameter values to allow * decoding of the _encoded_ safe type. */ decode: TDec; } //#endregion //#region src/runtime-types/Type.d.ts interface TypeOptions = TypeDefaultValue, TValidations extends readonly unknown[] | "no-validations" = readonly unknown[] | "no-validations"> { isRequired?: TRequired; validations?: TValidations; defaultValue?: TDefaultValue; description?: TDesc; } type TypeKindLiteral = TupleToUnion; type TypeKindWide = TupleToUnion; type TypeKindFalsy = TupleToUnion; type TypeKindContainerNarrow = TupleToUnion; type TypeKindContainerWide = TupleToUnion; type TypeKindContainer = TypeKindContainerNarrow | TypeKindContainerWide; /** * A union of all the _types_ of types we have within the `Type` namespace. */ type TypeKind = TypeKindLiteral | TypeKindWide | TypeKindFalsy | TypeKindContainer; type TypeIsRequired = "required" | "not-required"; /** * **IsLiteralKind**`` * * Type utility which checks whether a given `TypeKind` maps to * a narrow / literal type. */ type IsLiteralKind = If, true, false>, If, true, false>]>, true, false>; type IfLiteralKind = IsLiteralKind extends true ? IF : ELSE; /** * **ToType** * * A type utility which takes a runtime type's "kind", whether it's * required or not, and any _underlying_ values and produces the * Typescript type. * * Note: because `Type` and `TypeDefn` have slightly different representations * of TRequired and TUnderlying, we will accept either and convert. */ type ToType$1 = If, Extends]>, ToBaseType | undefined, ToBaseType>; type ToBaseType = TKind extends "string" ? string : TKind extends "number" ? number : TKind extends "boolean" ? boolean : TKind extends "null" ? null : TKind extends "undefined" ? undefined : TKind extends "stringLiteral" ? TupleToUnion : TKind extends "numericLiteral" ? TupleToUnion : TKind extends "true" ? true : TKind extends "false" ? false : TKind extends "anyArray" ? unknown[] : TKind extends "unknownObject" ? Record : TKind extends "unknownObject" ? Record : TKind extends "unknownFunction" ? AnyFunction : TKind extends "unknownObject" ? Record : TKind extends "fnWithDict" ? TUnderlying extends readonly [{ kind: "fnType"; type: unknown; [key: string]: unknown; }, { kind: "object"; type: unknown; [key: string]: unknown; }] ? TUnderlying[0]["type"] & TUnderlying[1]["type"] : never : TKind extends "tuple" ? TUnderlying extends readonly unknown[] ? TupleToUnion : never : TKind extends "union" ? TUnderlying extends readonly unknown[] ? TupleToUnion : never : TKind extends "intersection" ? TUnderlying extends readonly unknown[] ? UnionToIntersection> : never : unknown; /** * **TypeUnderlying** * * Used in both `Type` and `TypeDefn` structures, it's value is one of * two types: * * - `no-underlying` is used when no _underlying_ types are needed to * specify the type * - `readonly unknown[]` is used to host unknown set of values which _combine_ * in some way to determine the **type** of the property * * Note: the property `underlying_ */ type TypeUnderlying = readonly unknown[] | "no-underlying"; type TypeDefnValidations = readonly unknown[] | "no-validations"; /** * **TypeDefaultValue** * * The resultant _value_ of the `defaultValue` prop in a `Type` structure * and one of the generic's used to hold specifics for a `TypeDefn` struct. * * - either a Box where T extends the type of the property * - or, the constant `NoDefaultValue` indicating no default was set * * Note: the _generic_ `TWithDefault` in a `Type` is defined as `TypeHasDefaultValue` * which is used to preserve type info but provide developers a "summarized status." */ type TypeDefaultValue = Box> | NoDefaultValue$1; /** * **TypeDefn**`` * * Represents a minimal `Type` definition. * * Note: this type is typically then converted to a `Type<...>` type. */ interface TypeDefn = TypeDefaultValue, TValidations extends TypeDefnValidations = TypeDefnValidations> { readonly kind: TKind; readonly isRequired?: TRequired; readonly underlying?: TUnderlying; readonly description?: TDesc; readonly defaultValue?: TDefaultVal; readonly validations?: TValidations; } /** * **FromTypeDefn**`` * * Type utility which converts from the minimalist `TypeDefn` to a full * fledged `Type` definition. */ type FromTypeDefn

= TD extends TypeDefn ? Type$1 extends true ? "required" : IsFalse extends true ? "not-required" : "required", IsStringLiteral$1 extends true ? Desc : "", IsArray extends true ? Exclude : "no-underlying", As$1, IsUnion]>, "no-default-value", "with-default-value">, TypeHasDefaultValue>, As$1, IsUnion]>, "no-validations", "with-validations">, TypeHasValidations>> : never; type TypeHasDefaultValue = "no-default-value" | "with-default-value"; type TypeHasValidations = "no-validations" | "with-validations"; type TypeHasUnderlying = "no-underlying" | "literals" | "children"; /** * A function which is provided a value `T` and must either return * `true` or an `ErrorCondition` which describes the issue. */ type ValidationFunction = (value: T) => true | Err; /** * A type definition which retains valuable runtime characteristics */ interface Type$1 { _type: "Type"; /** * **kind** * * The _type_ / _category_ of the type (e.g., string, stringLiteral, number, etc). */ kind: TKind; /** * **type** * * The fully expressed _type definition_. * * **Note:** do not use this for anything in the runtime environment */ type: ToType$1; /** * **isRequired** * * Whether or not this type is _required_ to exist or if it's type * should be a union with `undefined`; will default to `required` */ isRequired: TRequired extends "not-required" ? false : true; /** * Whether the given runtime type is a narrow literal type */ isLiteral: TKind extends TypeKindLiteral ? true : false; /** * This can be an array of _type literals_ or a container * type (e.g., object, union, intersection, tuple, etc.). * * In all cases, the _underlying_ types represent the type * definition using the _logical operand_ of the `underlying_operand` * property. */ underlying: TUnderlying; /** * **underlying_operand** * * In cases where a runtime type has _underlying_ types, this property * expresses how they should be merged together into a type. In most cases * this is an `OR` operand but not all. */ underlying_operand: TUnderlying extends "no-underlying" ? "NA" : TKind extends "intersection" ? "AND" : "OR"; /** * **defaultValue** * * A default value to set this variable to at runtime; * defaults to not being set but when it is said then * certain additional runtime operations are possible. */ defaultValue: TWithDefault extends "no-default-value" ? NoDefaultValue$1 : Box>; /** * **isUnion** * * Whether or not the type represents a _union_ type. This can be true in * obvious cases like a `union` _type_ but **any** type which is not required * is also in effect a union type too. */ isUnion: boolean; /** * **is**`(input: unknown): input is T` * * a **type guard** function which helps users to ensures type safety * for the given type. */ is: TypeGuard>; /** * **validate**`(val) => boolean` * * Runs any runtime configurations which were provided to the runtime type. */ validate: >(val: V) => boolean; /** * **validations** * * An optional array of runtime validations which can be performed on the * runtime type. When the `validate()` function is called these functions * along with any _underlying_ types which have validators will be run to ensure * the validity at all levels of the type. */ validations: TWithValidations extends "no-validations" ? readonly [] : readonly ValidationFunction[]; identity: ToType$1 | NotApplicable$1<"some types do not have an identity value for concat/sum">; /** Description of the type */ description: TDesc; } //#endregion //#region src/runtime-types/type-defn/DefineObjectWith.d.ts type Convert$2, TMap extends TokenMapper, TKeys extends readonly string[] = StringKeys, TResult extends Record = EmptyObject> = TKeys extends [infer Head extends string & keyof TDefn, ...infer Rest extends readonly string[]] ? TDefn[Head] extends keyof TMap ? Convert$2> : Err<`invalid-key/define-object-with`, `The TokenMapper provided to DefineObjectWith was unable to map the token type '${Head}'`> : ExpandRecursively; /** * **DefineObjectWith**`` * * * **Related:** `DefineObject`, `TokenMapper` */ interface DefineObjectWith, TMap extends TokenMapper, TKeys extends readonly string[] = StringKeys> { /** a object created with the `DefineObjectWith` utility */ kind: "define-object-with"; /** the token based definition of the type */ defn: TDefn; /** the type which the tokens represent */ type: Convert$2; } //#endregion //#region src/runtime-types/type-defn/FromDefn.d.ts type ProcessUnion = T extends Tuple$1 ? TupleToUnion : T extends ShapeCallback ? HandleDoneFn> : never; type IterateUnion = { [K in keyof T]: ProcessUnion }; /** * **AsUnion** * * Receives a `UnionTokenSet`, a `ShapeCallback` or just a tuple of values * and makes this into _union type_. */ type AsUnionToken = T extends UnionElDefn[] ? TupleToUnion> : T extends UnionElDefn ? ProcessUnion : never; type IsDictionaryDefinition = T extends Dictionary ? Contains, readonly unknown[]>, ShapeCallback> : false; /** * converts non-tuple definition types to actual type */ type ToType = T extends ShapeCallback ? FromShapeCallback : T extends SimpleToken ? FromSimpleToken : T extends RecordKeyWideTokens ? FromSimpleRecordKey : T extends WideTokenNames | WideContainerNames ? FromWideTokens : T extends RecordKeyWideTokens ? FromSimpleRecordKey : TElse; /** * iterates over tuple definition types to convert into real types */ type IterateOverDefinitions = { [K in keyof T]: ToType }; type TypeDefinition = NarrowableScalar | ShapeCallback; /** * converts a `ShapeCallback` into the _type_ which it is defining */ type FromShapeCallback = TAsToken extends false ? ReturnType> : string; /** * converts a `SimpleToken` into the _type_ which it is defining */ type FromSimpleToken = SimpleType; /** * **FromDefn**`` * * Takes either a singular `T` or a tuple of values for `T` and * looks for any cases where a `ShapeCallback` is found: * * - where it is found, it will resolve the type * - if the type is a `SimpleToken` then this too is resolved * - in other cases it simply proxies the values through * - if `TElse` is set you can redirect values which don't use * the ShapeCallback API to a specific type. * * Note: when dictionary objects are found the _values_ will be * interrogated for ShapeCallback's. */ type FromDefn = T extends DefineObject ? FromDefineObject : T extends SimpleToken ? SimpleType : T extends readonly unknown[] ? IterateOverDefinitions : IsUnset extends true ? T : ToType; //#endregion //#region src/runtime-types/type-defn/input-tokens/AsInputToken.d.ts type AsUnion$1 = Join<{ [K in keyof T]: AsInputToken }, " | ">; /** * **AsInputToken**`` * * Converts any type `T` into the _string based_ `InputToken` representing that type. */ type AsInputToken = [IsAny] extends [true] ? "any" : [IsNever] extends [true] ? "never" : [T] extends [string] ? [string] extends [T] ? "string" : [IsUnion] extends [true] ? AsUnion$1> : `'${AsStaticTemplate}'` : [T] extends [number] ? [number] extends [T] ? "number" : [IsUnion] extends [true] ? AsUnion$1> : `${T}` : [T] extends [boolean] ? [IsTrue] extends [true] ? "true" : [IsFalse] extends [true] ? "false" : "boolean" : [IsNull] extends [true] ? "null" : [IsUndefined] extends [true] ? "undefined" : [T] extends [void] ? "void" : [IsEqual] extends [true] ? "unknown" : [IsLiteralLikeArray] extends [true] ? [IsVariadicArray>] extends [true] ? "variadic" : ToStringLiteral : [T] extends [(infer Type)[]] ? [IsUnion] extends [true] ? AsUnion$1> extends infer U extends string ? `(${U})[]` : never : AsInputToken extends string ? `${AsInputToken}[]` : never : "xxx"; //#endregion //#region src/runtime-types/type-defn/input-tokens/DefineObject.d.ts /** * **DefineObject** * * A dictionary which defines the _type_ of a dictionary. * * - values can be: * - a string based `InputToken` * - another `DefineObject` definition * - a tuple of * * **Example:** * ```ts * const myObject: DefineObject = { * foo: "string", * bar: "Opt", * baz: p => p.string().zipCode() * } * ``` * * - typically used `FromDefn` or `FromDefineObject` utilities */ interface DefineObject { [key: string]: InputToken; } /** * **DefineObjectApi** * * Provides a function which takes a `DefineObject` and converts it to the * type that it defines. * * **Example:** * ```ts * const api: DefineObjectApi = ...; * // { foo: string; bar: string | undefined; baz: ZipCode } * const myObject = api({ * foo: "string", * bar: "Opt", * baz: p => p.string().zipCode() * }); * ``` */ type DefineObjectApi = (defn: T) => FromDefn; //#endregion //#region src/runtime-types/type-defn/input-tokens/DefineTuple.d.ts /** * A tuple who's elements are all `InputToken`'s * * - this type is meant to be used with utilities like * `FromDefineTuple`, `FromInputToken`, etc. */ type DefineTuple = readonly InputToken[]; //#endregion //#region src/runtime-types/type-defn/input-tokens/FromDefineObject.d.ts /** * **FromDefineObject**`` * * Converts a `DefineObject` _definition_ into the **type** which it * it defines. * * **Note:** * - this is just an alias of `FromInputToken__Object` but with a * cooler name */ type FromDefineObject = FromInputToken__Object; //#endregion //#region src/runtime-types/type-defn/input-tokens/FromDefineTuple.d.ts type FromDefineTuple = { [K in keyof T]: T[K] extends string ? FromInputToken__String : T[K] extends DefineObject ? FromInputToken__Object : T[K] extends DefineTuple ? FromInputToken__Tuple : never }; //#endregion //#region src/runtime-types/type-defn/input-tokens/FromInputToken.d.ts /** * **FromInputToken**`` * * Converts an input token to a type, or produces an error with type * of `invalid-token` and a "subType" of whichever type structure caught * the error. * * InputToken's consist primarily as _string_ tokens of one of the following * variants: * * - an _atomic_ token (e.g., true, null, undefined, boolean, etc.) * - a _literal_ token (e.g., String(v), Number(v), Boolean(v), Record(k,v)) * - an _object_ token (e.g., `{ ... }`) * - a _tuple_ token (e.g., `[ ... ]`) * - a _function_ token (e.g., `fn(...) => token` _or_ `async fn() => token ) * - a _generator_ token (e.g., `gen(...) => token`) * * **Related:** `FromStringInputToken` */ type FromInputToken = T extends string ? FromInputToken__String : T extends readonly InputToken[] ? FromInputToken__Tuple : T extends DefineObject ? FromInputToken__Object : never; /** * **FromInputToken__String**`` * * A type utility responsible for _receiving_ string-based input tokens and * converting them into the _type_ which the token represents. * * **Related:** * - `FromInputToken` * - `FromInputToken__Tuple`, `FromInputToken__Object`, `FromInputToken__Tuple` * - `GetInputToken`, */ type FromInputToken__String = GetInputToken extends Error ? GetInputToken : GetInputToken extends infer Success extends IT_Token ? Success["type"] : never; /** * Takes a tuple of `InputTokens` to create a **Tuple** type. */ type FromInputToken__Tuple = { [K in keyof T]: T[K] extends InputTokenSuggestions ? FromInputToken__String : T[K] extends DefineObject ? FromDefineObject : T[K] extends DefineTuple ? FromDefineTuple : never }; type _FromInputToken__Object_Props = { [K in keyof T]: T[K] extends string ? FromInputToken__String : T[K] extends DefineObject ? FromDefineObject : T[K] extends DefineTuple ? FromDefineTuple : never }; type _HasErrorProp = { [K in keyof T]: T[K] extends Error ? K : never }[keyof T]; type _ExtractErrorFromProps = _HasErrorProp extends never ? T : _HasErrorProp extends infer PropKey extends keyof T ? T[PropKey] extends infer OrigErr extends Error ? OrigErr extends { type: infer EType extends string; subType?: infer ESubType; } ? ESubType extends string ? Err<`${EType}/${ESubType}`, `Property "${PropKey & string}" has a malformed token`, { property: PropKey; token: TOriginal; originalError: OrigErr; }> : Err : OrigErr : T[PropKey] : never; type _FromInputToken__Object = _ExtractErrorFromProps<_FromInputToken__Object_Props, T>; /** * Takes a tuple of `InputTokens` to create a **Tuple** type. */ type FromInputToken__Object = _FromInputToken__Object> extends infer Result ? Result extends Error ? Result : Result extends Dictionary ? Mutable> extends readonly ObjectKey[] ? UnionToTuple> : never>> : never : never; //#endregion //#region src/runtime-types/type-defn/input-tokens/GetInputToken.d.ts /** * Narrows the return type to: * * - `Err<"malformed-token">` if handler tried to parse but hit an error while parsing * - note: if the value is `never` it will also convert this to a `Err<"malformed-error">` * because while this is NOT expected it does represent an unexpected failure of the take function * - `IT_Token` if handler was successful at parsing the head of the string * - `null` if a `wrong-handler` error was found */ type Process$4 = IsNever extends true ? Err<"unexpected-error/never", `A take function returned 'never'; this should not happen!`> : T extends IT_TakeOutcome ? IsInputTokenSuccess extends true ? T extends infer Token extends IT_Token ? Token : IT_Token : T extends Error ? ErrType extends "malformed-token" ? T : null : null : Err<"unexpected-error", `A take function returned an unexpected type!`, { type: T; }>; type TryTake = TProcessed extends infer R ? R extends Error ? R : R extends infer Success extends IT_Token ? Iterate : TFallback : never; /** * **Iterate**`` * * Iterates over all of the known _take_ functions for InputToken's * and parses to as much as possible. * * - if `TToken` is able to be reduced to "" then the job is considered * to be complete and the results will be passed to `Finalize` * - if `TToken` still has content in it after all take functions have * had a chance to reduce it, then one of two errors will result: * * - `incomplete-parse` is returned when at least _some_ of the original * token string has been parsed * - the `parsedType` property will provide the _type_ up to the point * of reaching this incomplete state * - the `rest` property exposes what is left _unparsed_ * * - `unparsed` is returned when no parsing was possible */ type Iterate> = TRemaining extends "" ? TToken extends IT_Token ? TToken : Err<"empty-parse", `The token string was an empty string so there is nothing to parse!`> : TryTake>, "atomic", TryTake>, "literal", TryTake>, "literal", TryTake>, "kv", TryTake>, "array", TryTake>, "promise", TryTake>, "set", TryTake>, "generator", TryTake>, "function", TryTake>, "literal-array", TryTake>, "object-literal", TryTake>, "group", TryTake>, "union", TryTake>, "intersection", TToken extends IT_Token ? Err<"incomplete-parse", `The token string was not fully parsed; the text '${TRemaining}' remains unparsed`, { underlying: readonly [TToken]; parsedType: As$1["type"]; rest: TRemaining; combinator: "none"; }> : Err<"unparsed", `The token string -- ${TRemaining} -- was unable to be parsed!`>>>>>>>>>>>>>>>; /** * **GetInputToken**`` * * Passing in a valid string `InputToken`, this utility will provide * you back an `IT_Token` which provides meta data about the token * including the _type_ which this token represents. * * - if all you want back is the _type_ then you're better off using * the `FromInputToken` or `FromInputToken__String` utilities. * * Possible error variants from this utility include: * * 1. `unparsed` - unable to parse the token string at all! * 2. `incomplete-parse` - part of the token _was_ parsed but there * is remaining text which can not be parsed. * 3. `invalid-union` - when the parser has detected the _combinator_ * to be a union type, then the number of underlying types must be at * least two * 4. `invalid-intersection` - when the parser has detected the _combinator_ * to be an intersection type, then the number of underlying types must * be at least two * * However, the most common Error type is `malformed-token` which will * be returned anytime the parsing process is mid-stream in parsing a * known type and some portion of that token is invalid. These errors * should have lots of contextual properties to help the caller understand * where the error is occurring. */ type GetInputToken = string extends T ? IT_Token | Error : Iterate; //#endregion //#region src/runtime-types/type-defn/input-tokens/InputToken.d.ts /** * **InputToken** * * The set of valid inputs which can be converted from a "token" to an inferred _type_ * at runtime with utilities like `GetInputToken`, `FromInputToken`, etc. * * **Note:** * - the possible set of variants of input tokens is _unbounded_ so this type will * allow in some _false positives_ but you can explicitly check whether a given value is * an `InputToken` with the `IsInputToken` boolean operator. * * - the `InputTokenSuggestions` type represents a suggested set of _string_ tokens that * are known to be valid and are helpful to developers by giving some guidance on valid * shape patterns without limiting the choice of strings not on the suggested list. * * - beyond the "pure" string based input tokens, however, this type allows -- _for convenience_ * -- using dictionary or tuple structures to define a type too: * * ```ts * { foo: "number"; bar: "string" } // Dictionary example * [ "string", "string", "boolean" ] // Tuple example * ``` * * - the dictionary based variant of an `InputToken` is the defined by the type `DefineObject` * - the tuple based variant of an `InputToken` is the defined by the type `DefineTuple` * - both of these types have corresponding _runtime_ builders: `defineObject()`, `defineTuple()` * * ### Related Utilities * * - `FromToken` / `FromInputToken` / `FromInputToken__String` * * - converts a "token" to the _tokens_ **type** it represents * - if `T` is not a valid type then an Error of the type `invalid-token` will * be returned * * - `AsType` * * - same as the `From...` utilities except that if `T` isn't a token then * it will _proxy_ through **T**'s existing type "as is" * * - `AsString` / `ToStringInputToken` * - `AsString` is a general purpose utility for ensuring that types passed in are * converted to an "appropriate" string type * - for _string-based_ input tokens this utility will simply proxy the type through * "as is" * - for dictionary or tuples which are valid input tokens, it will convert this to the * string-based equivalent `InputToken` * - any dictionaries or tuples which are not valid input tokens, their types will be taken * at face value and converted to a string representation: * * ```ts * // "{ foo: number; bar: string }" * type Token = AsString<{ foo: "number", bar: "string" }>; * // "{ foo: number; bar: string }" * type NotToken = AsString<{ foo: number, bar: string }>; * ``` * - `ToStringInputToken` is a targeted utility for ensuring that `T`, if a valid input token, * is a _string_ representation of an input token. * * - `IT_Token` * - typically used in the token parsing process * - this type represents a token's meta characteristics including: * - the string `token` * - the `type` the token represents * - any remaining text still left to be parsed after this token (`rest`) * - depending the type, there may be other characteristics too * * - `GetInputToken` * - this is the core _lookup_ utility which other utilities use to convert a "token" to * meta information (aka, a derivative of `IT_Token`) * - this utility, unlike most others, only takes _string-based_ input tokens * - if you need to convert a dictionary or tuple based token to string you can do so * with the `AsStringInputToken` utility */ type InputToken = InputTokenSuggestions | Record> | readonly (InputTokenSuggestions | Record | readonly InputTokenSuggestions[])[]; //#endregion //#region src/runtime-types/type-defn/input-tokens/InputTokenSuggestions.d.ts type BaseSuggest = `${IT_AtomicToken}` | `string | undefined` | `number | undefined` | `boolean | undefined` | `string | number` | `string | boolean` | `string | undefined` | `string | number | undefined`; type LiteralSuggest = `String(foo)` | `String(bar)` | `Number(1)` | `Number(42)` | `Boolean(true)` | `Boolean(false)` | `"foo" | "bar"`; /** * A set of fairly simple `InputTokens` which can be used as a type * or a suggested type. */ type InputToken__SimpleTokens = BaseSuggest | `Array` | `Array` | `Array` | `Array` | `Array` | `Array` | `Array` | `Array` | `Array boolean>` | `string[]` | `string[][]` | `number[]` | `boolean[]` | `(string | number)[]`; /** * The actual variants for a string based input token are _unbounded_ but * in order to help people understand acceptable syntax and patterns this * list of suggestions will provide autocomplete for */ type InputTokenSuggestions = Suggest` | `Map<${BaseSuggest}, ${BaseSuggest}>` | `WeakMap` | `Set<${BaseSuggest}>` | `Record` | `Record`>; //#endregion //#region src/runtime-types/type-defn/input-tokens/IsInputToken.d.ts /** * **IsInputToken**`` * * Tests whether `T` is a valid `InputToken` (string or otherwise) */ type IsInputToken = T extends InputToken ? T extends string ? GetInputToken extends Error ? false : true : T extends readonly string[] ? Every<{ [K in keyof T]: IsInputToken }, "true", []> : T extends Dictionary ? IsWideObject extends true ? boolean : Values extends infer ObjValues extends readonly string[] ? Every<{ [K in keyof ObjValues]: IsInputToken }, "true", []> : false : false : false; //#endregion //#region src/runtime-types/type-defn/input-tokens/IT_Base.d.ts type IT_TakeKind = "atomic" | "array" | "literal" | "kv" | "set" | "group" | "union" | "intersection" | "function" | "generator" | "promise" | "literal-array" | "object-literal"; type IT_Combinators = "union" | "intersection" | "none"; type IT_KvType = "Record" | "Map" | "WeakMap"; interface IT_Generics { generics: GenericParam[]; rest: string; } interface IT_Parameter { /** the _name_ of the parameter */ name: string; /** * a _string-based_ token for the parameter's **type** which is * either: * - an `InputToken` * - a `GenericParam` */ token: string; /** * **fromGeneric** * * returns `false` if the _type_ of this variable is NOT derived from a generic, * returns a string value mapping to the `name` of the generic involved. */ fromGeneric: false | string; /** * the _type_ this parameter **extends** (if derived from a generic) or * the _type_ it **is** otherwise. */ type: unknown; } interface IT_ParameterResults { parameters: readonly IT_Parameter[]; generics: readonly GenericParam[]; rest: string; } interface IT_Token_Base { __kind: "IT_Token"; /** * The category/kind of token this is (atomic, kv, literal, etc.). * * - Depending on the _kind_ additional properties may be exposed */ kind: T; /** * the string token _representing_ the type */ token: string; /** * the _type_ which the **token** represents */ type: any; /** * the _remaining_ text string to be parsed */ rest: string; } interface IT_Token_Atomic extends IT_Token_Base<"atomic"> {} interface IT_Token_Promise extends IT_Token_Base<"promise"> {} interface IT_Token_Set extends IT_Token_Base<"set"> {} interface IT_Token_Group extends IT_Token_Base<"group"> { underlying: IT_Token; } interface IT_Token_Literal extends IT_Token_Base<"literal"> {} interface IT_Token_Array extends IT_Token_Base<"array"> {} interface IT_Token_Literal_Array extends IT_Token_Base<"literal-array"> {} interface IT_Token_Object_Literal extends IT_Token_Base<"object-literal"> { /** * A tuple of `KeyValue` elements which define the object literal. */ keyValues: readonly KeyValue[]; } interface IT_Token_Union extends IT_Token_Base<"union"> { /** all members of the union type */ members: readonly unknown[]; } interface IT_Token_Intersection extends IT_Token_Base<"intersection"> { /** all members of the intersection type */ members: readonly unknown[]; } interface IT_Token_Kv extends IT_Token_Base<"kv"> { /** the KV container type */ container: IT_KvType; /** the token for a KV container's "key" */ keyToken: unknown; /** the token for a KV container's "value" */ valueToken: unknown; } interface IT_Token_Function extends IT_Token_Base<"function"> { /** the name of the function; `null` if anonymous */ name: string | null; /** the generics used for the parameters of the function */ generics: readonly GenericParam[]; /** a tuple representing the parameters in the function */ parameters: readonly IT_Parameter[]; /** * whether the function is shaped as a _narrowing_ function * with generics (`true`) or a _static_ function (`false`). */ narrowing: boolean; /** the tokenized representation of the return */ returnToken: string; /** * the _return type_ of the function */ returnType: unknown; /** * whether or not the function is asynchronous */ isAsync: boolean; } interface IT_Token_Generator extends IT_Token_Base<"generator"> { /** the name of the generator; `null` if anonymous */ name: string | null; /** the generics used for the parameters of the generator */ generics: readonly GenericParam[]; /** a tuple representing the parameters in the generator function */ parameters: readonly IT_Parameter[]; /** * whether the generator is shaped as a _narrowing_ function * with generics (`true`) or a _static_ generator (`false`). */ narrowing: boolean; /** the tokenized representation of the return */ returnToken: string; /** * the return type of the generator function (i.e., the Generator/AsyncGenerator type) */ returnType: unknown; /** whether or not the generator is asynchronous */ isAsync: boolean; } /** * **IT_Token**`` * * When a take utility for input tokens attempts to parse the token string * it can result in one of two conditions: * * 1. utility can not _take_ from the head of the token string and returns * an Error * 2. utility returns a `IT_Token` dictionary * * The generic `T` represents the _kind_ of token that was parsed and depending * on what it's set to, certain properties particular to that _kind_ will be * exposed. */ type IT_Token = IsUnion extends true ? IT_Token_Base : T extends "atomic" ? IT_Token_Atomic : T extends "literal" ? IT_Token_Literal : T extends "set" ? IT_Token_Set : T extends "kv" ? IT_Token_Kv : T extends "group" ? IT_Token_Group : T extends "literal-array" ? IT_Token_Literal_Array : T extends "object-literal" ? IT_Token_Object_Literal : T extends "array" ? IT_Token_Array : T extends "union" ? IT_Token_Union : T extends "function" ? IT_Token_Function : T extends "generator" ? IT_Token_Generator : T extends "promise" ? IT_Token_Promise : T extends "intersection" ? IT_Token_Intersection : never; /** * a validation utility to make sure `T` is of the type `IT_TakeSuccess` */ type IsInputTokenSuccess = IsDictionary extends true ? "kind" extends keyof T ? T["kind"] extends IT_TakeKind ? "rest" extends keyof T ? T["rest"] extends string ? true : false : false : false : false : false; /** * the error _types_ associated with trying to parse input tokens */ type IT_Failure = "invalid-token" | "malformed-token" | "wrong-handler" | "unparsed"; /** * a string literal (aka, `foo`, `bar`, etc.) */ type IT_StringLiteralToken = `String(${string})` | `"${string}"` | `'${string}'` | `\`${string}\``; /** * a numeric literal (aka, `1`, `42`, `99`, etc.) */ type IT_NumericLiteralToken = `Number(${number})` | `${number}`; /** * a literal value of `true` or `false` */ type IT_BooleanLiteralToken = `Boolean(${"true" | "false"})` | "true" | "false"; type IT_TakeOutcome = IT_Token | (Error & { type: IT_Failure; }); //#endregion //#region src/runtime-types/type-defn/input-tokens/IT_TakeArray.d.ts /** * matches on tokens like `string[]`, `number[]`, etc. */ type IT_TakeArray_Postfix = T extends `${infer Block extends string}[][]${infer Rest extends string}` ? ErrType> extends "malformed-token" ? Err<`malformed-token/array`, `the token has the shape of a two-dimensional array of '${Block}' but the type of array could not be parsed into a type!`, { token: T; block: Block; rest: Rest; }> : GetInputToken extends infer Token extends IT_Token ? { __kind: "IT_Token"; kind: "array"; token: `${Token["token"]}[][]`; type: (Token["type"])[][]; rest: Rest; } : never : T extends `${infer Block extends string}[]${infer Rest extends string}` ? ErrType> extends "malformed-token" ? Err<`malformed-token/array`, `the token has the shape of an array of type '${Block}' but the type of array could not be parsed into a type!`, { token: T; block: Block; rest: Rest; }> : GetInputToken extends infer Token extends IT_Token ? { __kind: "IT_Token"; kind: "array"; token: `${Token["token"]}[]`; type: (Token["type"])[]; rest: Rest; } : Err<"wrong-handler/array"> : Err<"wrong-handler/array">; /** * matches on tokens like `(string)[]`, `(string | number)[]`, etc. */ type IT_TakeArray_Postfix_Grouped = T extends `(${infer Rest}` ? NestedSplit"; "(": ")"; "=": ">"; }> extends [infer Block extends string, ...infer Rest extends [string, ...string[]]] ? GetInputToken> extends infer Token extends IT_Token ? { __kind: "IT_Token"; kind: "array"; token: `(${Token["token"]})[][]`; type: (Token["type"])[][]; rest: Trim>; } : Err<"malformed-token/array", `The token '${T}' appeared to be a grouped two-dimensional array but the interior block '${Block}' could not be parsed as a valid type!`, { token: T; block: Block; rest: Rest; }> : NestedSplit"; "(": ")"; "=": ">"; }> extends [infer Block extends string, ...infer Rest extends readonly [string, ...string[]]] ? GetInputToken extends infer Token extends IT_Token ? { __kind: "IT_Token"; kind: "array"; token: `(${Token["token"]})[]`; type: (Token["type"])[]; rest: Trim>; } : Err<"malformed-token/array", `The token '${T}' appeared to be a grouped array but the interior block '${Block}' could not be parsed as a valid type!`, { token: T; block: Block; rest: Rest; }> : Err<"wrong-handler/array", `The grouped function matcher could not parse the string token.`, { token: T; rest: Rest; }> : Err<"wrong-handler/array">; /** * matches on tokens like `Array`, etc. */ type IT_TakeArray_Bracket = T extends `Array<${infer Rest extends string}` ? NestedSplit", { "{": "}"; "[": "]"; "<": ">"; "(": ")"; "=": ">"; }> extends [infer Block extends string, ...infer Rest extends readonly string[]] ? Rest extends [] ? Err<"malformed-token/array", `The Array< signature indicates a bracketed array syntax but no terminating '>' character was found!`, { token: T; block: Block; rest: Rest; }> : GetInputToken extends infer Token extends IT_Token ? { __kind: "IT_Token"; kind: "array"; token: `Array<${Token["token"]}>`; type: Array; rest: Trim">>; } : Err<"malformed-token/array", `The token '${T}' appeared to be a bracketed array (e.g., Array<...>) but the interior block '${Block}' could not be parsed as a valid type!`, { token: T; block: Block; rest: Rest; }> : Err<"malformed-token/array", `The token '${T}' appears to be a bracketed array type (e.g., Array<...>) but the terminal '>' character was not found!`, { token: T; rest: T; }> : Err<"wrong-handler/array", `The string token does not start with 'Array<' so the bracketed array take function is not the right handler for this token`, { token: T; }>; type Select$3 = T extends [infer Head, ...infer Rest extends readonly unknown[]] ? Head extends infer Success extends IT_Token<"array"> ? Success : Head extends infer Fail extends Err<"malformed-token"> ? Fail : Select$3 : Err<"wrong-handler", `The IT_TakeArray handler is unable to parse the head of: '${TToken}'`, { token: TToken; }>; /** * **IT_TakeArray**`` * * Tries to take wide array signatures off the head of the string token. * * - **PostFix**: `string[]`, `string[][]`, `number[]`, etc. * - **PostFix Grouped**: `(string | number)[]`, `(number | boolean)[][]` * - **Bracketed**: `Array`, `Array` */ type IT_TakeArray = Select$3<[IT_TakeArray_Postfix_Grouped, IT_TakeArray_Postfix, IT_TakeArray_Bracket], T>; //#endregion //#region src/runtime-types/type-defn/input-tokens/IT_TakeArrayLiteral.d.ts type GetElementTypes = { [K in keyof T]: T[K] extends `${infer ReqToken}?` ? FromInputToken__String : FromInputToken__String }; /** * attempts to take any array with at least one fixed type */ type IT_TakeLiteralArray = T extends `[${infer Rest extends string}` ? NestedSplit extends [infer Block extends string, ...infer Rest extends string[]] ? NestedSplit extends infer Elements extends readonly string[] ? TrimEach extends infer Elements extends readonly string[] ? Elements["length"] extends 0 ? { __kind: "IT_Token"; kind: "array-literal"; elements: []; token: "[]"; type: []; rest: Trim>; } : { __kind: "IT_Token"; kind: "literal-array"; token: `[ ${Join} ]`; type: GetElementTypes; rest: Trim>; } : never : Err<`malformed-token`> : Err<"wrong-handler/array-literal"> : Err<"wrong-handler/array-literal">; //#endregion //#region src/runtime-types/type-defn/input-tokens/IT_TakeAtomic.d.ts /** * token to type mapping for atomics */ interface AtomicMap { string: string; number: number; bigint: bigint; boolean: boolean; true: true; false: false; null: null; undefined: undefined; void: void; unknown: unknown; any: any; object: object; Object: object; } /** * **IT_AtomicToken** * * The input tokens categorized as "atomic" based on their only having one state with * no variants. */ type IT_AtomicToken = StringKeys[number]; /** * **IT_TakeAtomic**`` * * Tries to locate atomic tokens at the _head_ of the token string * and extract them. */ type IT_TakeAtomic> = As$1<[RetainUntil, RetainAfter] extends [infer Atom extends string, infer Rest extends string] ? Atom extends keyof AtomicMap ? As$1<{ __kind: "IT_Token"; kind: "atomic"; token: Trim; type: AtomicMap[Atom]; rest: Trim; }, IT_Token<"atomic">> : Err<`wrong-handler/atomic`, `The candidate token '${Atom}' is not an atomic token.`> : Err<`wrong-handler/atomic`>, IT_TakeOutcome<"atomic">>; //#endregion //#region src/runtime-types/type-defn/input-tokens/IT_TakeFunction.d.ts /** * **GetReturnType**`` * * Determines the return type for a given function by matching the `TToken` on (in order): * * 1. Generic Name * 2. String Literal with reference to `TToken` * 3. parse as a normal InputToken */ type StripSurroundingQuotes$1 = T extends `"${infer R}"` ? R : T extends `'${infer R}'` ? R : T extends `\`${infer R}\`` ? R : T; type GetReturnType = Trim extends `Promise<${infer Inner extends string}>` ? Promise, TGenerics>> : Find$1]> extends infer Generic extends GenericParam ? Generic["type"] : IsStaticTemplate, TemplateMap__Generics> extends true ? AsLiteralTemplate, TemplateMap__Generics>, TemplateMap__Generics> : Contains, "\${"> extends true ? AsLiteralTemplate, TemplateMap__Generics>, TemplateMap__Generics> : FromInputToken__String; type NamedSyncFunction = Trim extends `function ${infer AfterFunction extends string}` ? Trim extends `${infer Leading extends string}(${infer AfterParen extends string}` ? Leading extends `${infer Name extends string}<${infer GenericsBlock extends string}` ? Trim extends "" ? Err<"wrong-handler", `The function did not appear to have a name and therefore is not a named function.`, { token: T; }> : IT_TakeParameters<`<${GenericsBlock}(${AfterParen}`> extends { parameters: infer Parameters extends readonly IT_Parameter[]; generics: infer Generics extends readonly GenericParam[] | []; rest: infer AfterParams extends string; } ? Trim extends `:${infer ReturnToken extends string}` ? FnFrom, GetReturnType, Generics>, { name: Trim; }> extends infer FnType extends TypedFunction ? { __kind: "IT_Token"; kind: "function"; name: Trim; generics: Generics; parameters: Parameters; narrowing: true; returnToken: AsStaticTemplate, TemplateMap__Generics>; returnType: GetReturnType, Generics>; token: Trim; type: FnType; isAsync: Extends, Generics>, Promise>; rest: ""; } : never : Err<"malformed-token", `After successfully parsing the parameters of a named function, the return type was unable to be parsed because we couldn't find the expected ':' character used to separate the parameters from the return type`, { token: T; rest: Trim; parameter: Parameters; generics: Generics; }> : Err<"malformed-token", `Failed to parse the parameters of what appeared to be a named function!`, { token: T; rest: `<${GenericsBlock}(${AfterParen}`; attempt: IT_TakeParameters<`<${GenericsBlock}(${AfterParen}`>; }> : Trim extends infer Name extends string ? Trim extends "" ? Err<"wrong-handler", `The function did not appear to have a name and therefore is not a named function.`, { token: T; }> : IT_TakeParameters<`(${AfterParen}`> extends { parameters: infer Parameters extends readonly IT_Parameter[]; generics: infer Generics extends readonly GenericParam[] | []; rest: infer AfterParams extends string; } ? Trim extends `:${infer ReturnTok}` ? AsStaticTemplate, TemplateMap__Generics> extends infer ReturnToken extends string ? FnFrom, GetReturnType, Generics>, EmptyObject> extends infer FnType extends TypedFunction ? { __kind: "IT_Token"; kind: "function"; name: Trim; generics: Generics; parameters: Parameters; returnToken: ReturnToken; returnType: GetReturnType, Generics>; narrowing: false; token: Trim; type: FnType & { name: Trim; }; isAsync: Extends>, Promise>; rest: ""; } : never : never : Err<"malformed-token", `After successfully parsing the parameters of a named function, the return type was unable to be parsed because we couldn't find the expected ':' character used to separate the parameters from the return type`, { token: T; rest: Trim; parameter: Parameters; generics: Generics; }> : Err<"malformed-token", `Failed to parse the parameters of what appeared to be a named function!`, { token: T; rest: `(${AfterParen}`; attempt: IT_TakeParameters<`(${AfterParen}`>; }> : never : Err<"wrong-handler"> : Err<"wrong-handler">; type NamedAsyncFunction = T extends `async ${infer Rest}` ? NamedSyncFunction> extends Err<"malformed-token"> ? NamedSyncFunction> : NamedSyncFunction> extends infer Token extends IT_Token<"function"> ? IsTrue extends true ? Token : Err<"malformed-token"> : Err<"wrong-handler"> : Err<`wrong-handler`, `The NamedAsyncFunction can not parse the token '${T}'`>; type AnonSyncFunction = Trim extends `function ${infer Rest}` ? IT_TakeParameters> extends infer P extends IT_ParameterResults ? P extends { parameters: infer Parameters extends readonly IT_Parameter[]; generics: infer Generics extends readonly GenericParam[] | []; rest: infer Rest extends string; } ? Rest extends `:${infer ReturnToken extends string}` ? GetReturnType, Generics> extends Error ? Err<`malformed-token`, `The arrow function -- '${Trim}' -- has a return type '${Trim}' which could not be parsed to a type!`, { generics: Generics; parameters: Parameters; returnToken: AsStaticTemplate, TemplateMap__Generics>; }> : FnFrom, GetReturnType, Generics>, EmptyObject> extends infer FnType extends TypedFunction ? { __kind: "IT_Token"; kind: "function"; name: null; generics: Generics; parameters: Parameters; narrowing: Generics extends [] ? false : true; returnToken: AsStaticTemplate, TemplateMap__Generics>; returnType: GetReturnType, Generics>; token: Trim; type: FnType; isAsync: Extends, Generics>, Promise>; rest: ""; } : never : Err<"malformed-token", `Expected return type after ':' in an anonymous function`> : never : Err<"wrong-handler", `Unable to parse parameters for async anonymous function: '${T}'`> : Err<"wrong-handler", `Not a valid async anonymous function: '${T}'`>; type AnonAsyncFunction = T extends `async ${infer Rest extends string}` ? AnonSyncFunction> extends Error ? AnonSyncFunction> : AnonSyncFunction> extends infer Token extends IT_Token<"function"> ? IsTrue extends true ? Token : Err<"malformed-token", `An asynchronous function MUST return a Promise!`, { token: Trim; returnType: Token["returnType"]; }> : never : Err<"wrong-handler">; type CalcParams = { [K in keyof T]: T[K]["type"] }; type ArrowSyncFunction = IT_TakeParameters extends infer P extends IT_ParameterResults ? P extends { parameters: infer Parameters extends readonly IT_Parameter[]; generics: infer Generics extends readonly GenericParam[] | []; rest: infer Rest extends string; } ? Trim extends `=>${infer ReturnToken extends string}` ? GetReturnType, Generics> extends Error ? Err<`malformed-token`, `The arrow function -- '${Trim}' -- has a return type '${Trim}' which could not be parsed to a type!`, { generics: Generics; parameters: Parameters; returnToken: AsStaticTemplate, TemplateMap__Generics>; }> : FnFrom, GetReturnType, Generics>, EmptyObject> extends infer FnType extends TypedFunction ? { __kind: "IT_Token"; kind: "function"; name: null; generics: Generics; parameters: Parameters; narrowing: Generics extends [] ? false : true; isAsync: GetReturnType, Generics> extends Promise ? true : false; returnToken: AsStaticTemplate, TemplateMap__Generics>; returnType: GetReturnType, Generics>; token: T; type: FnType; rest: ""; } : never : Err<"malformed-token", `An arrow function requires the '=>' operator but it was not found, got: '${Rest}'`> : never : Err<"wrong-handler", `The token passed in can not be parsed as a synchronous Arrow function: '${Trim}'`>; type ArrowAsyncFunction = T extends `async ${infer Rest extends string}` ? ArrowSyncFunction> extends Error ? ArrowSyncFunction> : ArrowSyncFunction> extends infer Token extends IT_Token<"function"> ? IsTrue extends true ? Omit & Record<"token", Trim> : Err<`malformed-token`, `An async function must always return a promise!`, { token: T; }> : never : Err<"wrong-handler", `The token passed in can not be parsed as an asynchronous Arrow function: '${Trim}'`>; type OptGenerics = `<${string}>` | ""; /** * iterates over the various function signatures and returns when: * * 1. a variant returns an Error of the type "malformed-token" * 2. a variant returns a successful outcome which _extends_ `IT_Token<"fn">` */ type Select$2 = T extends [infer Head, ...infer Rest extends readonly unknown[]] ? Head extends Err<"malformed-token"> ? Head : Head extends Error ? Select$2 : Head : Err<"wrong-handler", `None of the variants for functions was able to parse the token: '${TToken}'`, { token: TToken; utility: "IT_TakeFunction"; variants: TVariants; }>; type InvalidNamedFunction = Err<`malformed-token/named-function`, `The token started with the text '${A}function' and thereby clearly indicated a function definition but the remaining text -- ${T} -- was not parsable! Remember that when using the 'function' keyword the return type is delimited by a ':' character and NOT an arrow. You CAN use an arrow function but that should NOT include the 'function' keyword.`, { token: `${A}function ${T}`; }>; /** * **IT_TakeFunction**`` * * Attempts to find a function (note: not a _generator_ function) at the head of a token string. * Will find the following variants: * * - **named** _synchronous_ and _asynchronous_ functions * - **anonymous** _synchronous_ and _asynchronous_ functions * - **arrow** _synchronous_ and _asynchronous_ functions * * **Note:** _all variants also account for the possible use of **generics**_ * * For **Generator** functions use `IT_TakeGeneratorFunction`. */ type IT_TakeFunction = Select$2<[T extends `function ${string}(${string}):${string}` ? NamedSyncFunction : Error, T extends `async function ${string}(${string}):${string}` ? NamedAsyncFunction : Error, T extends `function ${OptGenerics}(${string}):${string}` ? AnonSyncFunction : Error, T extends `async function ${OptGenerics}(${string}):${string}` ? AnonAsyncFunction : Error, T extends `${OptGenerics}(${string}) => ${string}` ? ArrowSyncFunction : Error, T extends `async ${OptGenerics}(${string}) => ${string}` ? ArrowAsyncFunction : Error, T extends `function ${infer Rest extends string}` ? InvalidNamedFunction : Error, T extends `async function ${infer Rest extends string}` ? InvalidNamedFunction : Error], T>; //#endregion //#region src/runtime-types/type-defn/input-tokens/IT_TakeGenerator.d.ts type StripSurroundingQuotes = T extends `"${infer R}"` ? R : T extends `'${infer R}'` ? R : T extends `\`${infer R}\`` ? R : T; /** * Resolve a return token to its type with support for generics and * static template interpolation. */ type ResolveToken = Find$1]> extends infer Generic extends GenericParam ? Generic["type"] : IsStaticTemplate, TemplateMap__Generics> extends true ? AsLiteralTemplate, TemplateMap__Generics>, TemplateMap__Generics> : Contains, "\${"> extends true ? AsLiteralTemplate, TemplateMap__Generics>, TemplateMap__Generics> : FromInputToken__String; type ResolveGeneratorReturn = Trim extends `Generator<${infer Rest extends string}` ? NestedSplit"> extends [infer Block extends string, ...infer _R extends readonly string[]] ? TrimEach, readonly string[]>> extends infer Params extends readonly string[] ? Params["length"] extends 1 ? Generator, any, unknown> : Params["length"] extends 2 ? Generator, ResolveToken, unknown> : Generator, ResolveToken, ResolveToken> : Err<"malformed-token", `Failed to parse the payload Generator interior: '${Block}'.`, { token: TToken; block: Block; }> : Err<"malformed-token", `The Generator<...> token '${TToken}' is missing a terminating '>' character!`> : Trim extends `Iterator<${infer Rest extends string}` ? NestedSplit"> extends [infer Block extends string, ...infer _R extends readonly string[]] ? Iterator, TGenerics>> : Err<"malformed-token", `The Iterator<...> token '${TToken}' is missing a terminating '>' character!`> : Trim extends `IterableIterator<${infer Rest extends string}` ? NestedSplit"> extends [infer Block extends string, ...infer _R extends readonly string[]] ? IterableIterator, TGenerics>> : Err<"malformed-token", `The IterableIterator<...> token '${TToken}' is missing a terminating '>' character!`> : Trim extends `AsyncGenerator<${infer Rest extends string}` ? NestedSplit"> extends [infer Block extends string, ...infer _R extends readonly string[]] ? TrimEach, readonly string[]>> extends infer Params extends readonly string[] ? Params["length"] extends 1 ? AsyncGenerator, any, unknown> : Params["length"] extends 2 ? AsyncGenerator, ResolveToken, unknown> : AsyncGenerator, ResolveToken, ResolveToken> : Err<"malformed-token", `Failed to parse the payload AsyncGenerator interior: '${Block}'.`, { token: TToken; block: Block; }> : Err<"malformed-token", `The AsyncGenerator<...> token '${TToken}' is missing a terminating '>' character!`> : Trim extends `AsyncIterableIterator<${infer Rest extends string}` ? NestedSplit"> extends [infer Block extends string, ...infer _R extends readonly string[]] ? AsyncIterableIterator, TGenerics>> : Err<"malformed-token", `The AsyncIterableIterator<...> token '${TToken}' is missing a terminating '>' character!`> : Err<"malformed-token", `A generator function's return type must be a Generator/Iterator or AsyncGenerator/AsyncIterableIterator type!`, { token: TToken; }>; type NamedSyncGenerator = Trim extends `function* ${infer AfterFunction extends string}` ? Trim extends `${infer Leading extends string}(${infer AfterParen extends string}` ? Leading extends `${infer Name extends string}<${infer GenericsBlock extends string}` ? Trim extends "" ? Err<"wrong-handler", `The generator did not appear to have a name and therefore is not a named generator.`, { token: T; }> : IT_TakeParameters<`<${GenericsBlock}(${AfterParen}`> extends { parameters: infer Parameters extends readonly IT_Parameter[]; generics: infer Generics extends readonly GenericParam[] | []; rest: infer AfterParams extends string; } ? Trim extends `:${infer ReturnToken extends string}` ? ResolveGeneratorReturn, Generics> extends infer RT ? Extends | IterableIterator | Iterator> extends true ? { __kind: "IT_Token"; kind: "generator"; name: Trim; generics: Generics; parameters: Parameters; narrowing: Generics extends [] ? false : true; returnToken: AsStaticTemplate, TemplateMap__Generics>; returnType: RT; token: Trim; type: RT; isAsync: false; rest: ""; } : Err<"malformed-token", `A synchronous generator must return a Generator/Iterator type!`, { token: Trim; returnToken: Trim; resolved: RT; }> : never : Err<"malformed-token", `After successfully parsing the parameters of a named generator, the return type was unable to be parsed because we couldn't find the expected ':' character used to separate the parameters from the return type`, { token: T; rest: Trim; parameters: Parameters; generics: Generics; }> : Err<"malformed-token", `Failed to parse the parameters of what appeared to be a named generator!`, { token: T; rest: `<${GenericsBlock}(${AfterParen}`; attempt: IT_TakeParameters<`<${GenericsBlock}(${AfterParen}`>; }> : Trim extends infer Name extends string ? Trim extends "" ? Err<"wrong-handler", `The generator did not appear to have a name and therefore is not a named generator.`, { token: T; }> : IT_TakeParameters<`(${AfterParen}`> extends { parameters: infer Parameters extends readonly IT_Parameter[]; generics: infer Generics extends readonly GenericParam[] | []; rest: infer AfterParams extends string; } ? Trim extends `:${infer ReturnToken extends string}` ? ResolveGeneratorReturn, Generics> extends infer RT ? Extends | IterableIterator | Iterator> extends true ? { __kind: "IT_Token"; kind: "generator"; name: Trim; generics: Generics; parameters: Parameters; narrowing: Generics extends [] ? false : true; returnToken: AsStaticTemplate, TemplateMap__Generics>; returnType: RT; token: Trim; type: RT; isAsync: false; rest: ""; } : Err<"malformed-token", `A synchronous generator must return a Generator/Iterator type!`, { token: Trim; returnToken: Trim; resolved: RT; }> : never : Err<"malformed-token", `Expected return type after ':' in a named generator`> : Err<"malformed-token", `Failed to parse the parameters of what appeared to be a named generator!`, { token: T; rest: `(${AfterParen}`; attempt: IT_TakeParameters<`(${AfterParen}`>; }> : never : Err<"wrong-handler"> : Err<"wrong-handler">; type NamedAsyncGenerator = Trim extends `async function* ${infer AfterFunction extends string}` ? Trim extends `${infer Leading extends string}(${infer AfterParen extends string}` ? Leading extends `${infer Name extends string}<${infer GenericsBlock extends string}` ? Trim extends "" ? Err<"wrong-handler", `The generator did not appear to have a name and therefore is not a named generator.`, { token: T; }> : IT_TakeParameters<`<${GenericsBlock}(${AfterParen}`> extends { parameters: infer Parameters extends readonly IT_Parameter[]; generics: infer Generics extends readonly GenericParam[] | []; rest: infer AfterParams extends string; } ? Trim extends `:${infer ReturnToken extends string}` ? ResolveGeneratorReturn, Generics> extends infer RT ? Extends | AsyncIterableIterator> extends true ? { __kind: "IT_Token"; kind: "generator"; name: Trim; generics: Generics; parameters: Parameters; narrowing: Generics extends [] ? false : true; returnToken: AsStaticTemplate, TemplateMap__Generics>; returnType: RT; token: Trim; type: RT; isAsync: true; rest: ""; } : Err<"malformed-token", `An asynchronous generator MUST return an AsyncGenerator/AsyncIterableIterator!`, { token: Trim; returnToken: Trim; resolved: RT; }> : never : Err<"malformed-token", `After successfully parsing the parameters of a named generator, the return type was unable to be parsed because we couldn't find the expected ':' character used to separate the parameters from the return type`, { token: T; rest: Trim; parameters: Parameters; generics: Generics; }> : Err<"malformed-token", `Failed to parse the parameters of what appeared to be a named generator!`, { token: T; rest: `<${GenericsBlock}(${AfterParen}`; attempt: IT_TakeParameters<`<${GenericsBlock}(${AfterParen}`>; }> : Trim extends infer Name extends string ? Trim extends "" ? Err<"wrong-handler", `The generator did not appear to have a name and therefore is not a named generator.`, { token: T; }> : IT_TakeParameters<`(${AfterParen}`> extends { parameters: infer Parameters extends readonly IT_Parameter[]; generics: infer Generics extends readonly GenericParam[] | []; rest: infer AfterParams extends string; } ? Trim extends `:${infer ReturnToken extends string}` ? ResolveGeneratorReturn, Generics> extends infer RT ? Extends | AsyncIterableIterator> extends true ? { __kind: "IT_Token"; kind: "generator"; name: Trim; generics: Generics; parameters: Parameters; narrowing: Generics extends [] ? false : true; returnToken: AsStaticTemplate, TemplateMap__Generics>; returnType: RT; token: Trim; type: RT; isAsync: true; rest: ""; } : Err<"malformed-token", `An asynchronous generator MUST return an AsyncGenerator/AsyncIterableIterator!`, { token: Trim; returnToken: Trim; resolved: RT; }> : never : Err<"malformed-token", `Expected return type after ':' in a named generator`> : Err<"malformed-token", `Failed to parse the parameters of what appeared to be a named generator!`, { token: T; rest: `(${AfterParen}`; attempt: IT_TakeParameters<`(${AfterParen}`>; }> : never : Err<"wrong-handler"> : Err<"wrong-handler">; type AnonSyncGenerator = Trim extends `function* ${infer Rest}` ? IT_TakeParameters> extends infer P extends IT_ParameterResults ? P extends { parameters: infer Parameters extends readonly IT_Parameter[]; generics: infer Generics extends readonly GenericParam[] | []; rest: infer AfterParams extends string; } ? Trim extends `:${infer ReturnToken extends string}` ? ResolveGeneratorReturn, Generics> extends infer RT ? Extends | IterableIterator | Iterator> extends true ? { __kind: "IT_Token"; kind: "generator"; name: null; generics: Generics; parameters: Parameters; narrowing: Generics extends [] ? false : true; returnToken: AsStaticTemplate, TemplateMap__Generics>; returnType: RT; token: Trim; type: RT; isAsync: false; rest: ""; } : Err<"malformed-token", `A synchronous generator must return a Generator/Iterator type!`, { token: Trim; returnToken: Trim; resolved: RT; }> : never : Err<"malformed-token", `Expected return type after ':' in an anonymous generator`> : never : Err<"wrong-handler", `Unable to parse parameters for anonymous generator: '${T}'`> : Err<"wrong-handler", `Not a valid anonymous generator: '${T}'`>; type AnonAsyncGenerator = Trim extends `async function* ${infer Rest extends string}` ? IT_TakeParameters> extends infer P extends IT_ParameterResults ? P extends { parameters: infer Parameters extends readonly IT_Parameter[]; generics: infer Generics extends readonly GenericParam[] | []; rest: infer AfterParams extends string; } ? Trim extends `:${infer ReturnToken extends string}` ? ResolveGeneratorReturn, Generics> extends infer RT ? Extends | AsyncIterableIterator> extends true ? { __kind: "IT_Token"; kind: "generator"; name: null; generics: Generics; parameters: Parameters; narrowing: Generics extends [] ? false : true; returnToken: AsStaticTemplate, TemplateMap__Generics>; returnType: RT; token: Trim; type: RT; isAsync: true; rest: ""; } : Err<"malformed-token", `An asynchronous generator MUST return an AsyncGenerator/AsyncIterableIterator!`, { token: Trim; returnToken: Trim; resolved: RT; }> : never : Err<"malformed-token", `Expected return type after ':' in an anonymous generator`> : never : Err<"wrong-handler", `Unable to parse parameters for anonymous generator: '${T}'`> : Err<"wrong-handler", `Not a valid anonymous generator: '${T}'`>; /** * iterates over the various generator signatures and returns when: * 1. a variant returns an Error of the type "malformed-token" * 2. a variant returns a successful outcome which extends `IT_Token<"generator">` */ type Select$1 = T extends [infer Head, ...infer Rest extends readonly unknown[]] ? Head extends Err<"malformed-token"> ? Head : Head extends Error ? Select$1 : Head : Err<"wrong-handler", `None of the variants for generators was able to parse the token: '${TToken}'`, { token: TToken; utility: "IT_TakeGenerator"; variants: TVariants; }>; type InvalidNamedGenerator = Err<`malformed-token/named-generator`, `The token started with the text '${A}function*' and thereby clearly indicated a generator function definition but the remaining text -- ${T} -- was not parsable! Remember that when using the 'function*' keyword the return type is delimited by a ':' character and MUST be a Generator/Iterator type.`, { token: `${A}function* ${T}`; }>; /** * IT_TakeGenerator * * Attempts to find a generator function at the head of a token string. * Will find the following variants: * - named synchronous and asynchronous generators * - anonymous synchronous and asynchronous generators * - Note: arrow generators are not valid and thus not supported. * * All variants also account for possible use of generics for parameters. */ type IT_TakeGenerator = Select$1<[T extends `function* ${string}(${string}):${string}` ? NamedSyncGenerator : Error, T extends `async function* ${string}(${string}):${string}` ? NamedAsyncGenerator : Error, T extends `function* (${string}):${string}` | `function* <${string}>(${string}):${string}` ? AnonSyncGenerator : Error, T extends `async function* (${string}):${string}` | `async function* <${string}>(${string}):${string}` ? AnonAsyncGenerator : Error, T extends `function* ${infer Rest extends string}` ? InvalidNamedGenerator : Error, T extends `async function* ${infer Rest extends string}` ? InvalidNamedGenerator : Error], T>; //#endregion //#region src/runtime-types/type-defn/input-tokens/IT_TakeGroup.d.ts /** * **IT_TakeGroup**`` * * Attempts to parse a _group_ at the head of the parse string `T`. * * - a group starts with `(` character and is terminated with a `)` * which resides at the "root" level */ type IT_TakeGroup = As$1 extends infer Parts extends readonly string[] ? Parts["length"] extends 1 ? Err<`malformed-token/group`, `The IT_TakeGroup failed to find the terminating ')' character in: '${Trim}'`, { token: T; }> : Parts extends [infer Block extends string, ...infer Rest extends readonly string[]] ? GetInputToken> extends Error ? Err<`malformed-token/group`, [IsNever>>] extends [true] ? `The group's interior token -- ${Trim} -- returned the 'never' type when trying to resolve This shouldn't happen and indicates an error in one of the Take utilities!` : `The IT_TakeGroup failed while trying to parse the group's interior: '${Trim}'. The underlying error was: ${GetInputToken>["message"]}`, { group: Trim; rest: Join; underlying: GetInputToken>; }> : GetInputToken> extends infer IT extends IT_Token ? As$1<{ __kind: "IT_Token"; kind: "group"; token: `(${Trim})`; underlying: IT; type: (IT["type"]); rest: Trim>; }, IT_Token<"group">> : never : Err<`wrong-handler/group`> : Err<`wrong-handler/group`> : Err<`wrong-handler/group`>, IT_TakeOutcome<"group">>; //#endregion //#region src/runtime-types/type-defn/input-tokens/IT_TakeIntersection.d.ts /** * **IT_TakeIntersection**`` * * Takes the _prior token_ (which has already been parsed) and the * remaining parse string and converts it into an intersection type. */ type IT_TakeIntersection = undefined extends T ? Err<`malformed-token/intersection`, `The intersection character '&' was found at the start of a parse string. This is invalid as the '&' operator must be inline with types on both sides!`, { parseString: P; }> : As$1

extends infer Tokens extends readonly string[] ? TrimEach extends infer SplitTokens extends readonly string[] ? { [K in keyof SplitTokens]: GetInputToken } extends infer SplitTokens extends readonly unknown[] ? HasErrors extends true ? IsolateErrors extends infer Outcome extends IsolatedResults ? Err<`malformed-token/intersection`, `Error occurred trying to parse the elements [${Increment>}] of an intersection type. The text prior to the first '&' character was valid but ${Outcome["errors"]["length"]} of the remaining ${Length} were in an error state.`, { token: P; splitTokens: TrimEach; firstError: First$1; underlying: [T, ...SplitTokens]; }> : Err<"shit"> : { __kind: "IT_Token"; kind: "intersection"; token: `${As$1["token"]}&${Rest}`; type: TupleToIntersection<[As$1["type"], ...As$1, readonly unknown[]>]>; members: [As$1["type"], ...As$1, readonly unknown[]>]; rest: ""; } : Err<"malformed-token/intersection", `An intersection type was detected and parsed into elements but at least one of these elements was unable to be parsed as an InputToken!`, { tokens: SplitTokens; }> : Err<"malformed-token/intersection"> : Err<`malformed-handler/intersection`, `The token string contained a '&' character indicating that this is an intersection type but `> : Err<"wrong-handler/intersection">, IT_TakeOutcome<"intersection">>; //#endregion //#region src/runtime-types/type-defn/input-tokens/IT_TakeKvObjects.d.ts type ParseRecord = NestedSplit", { "{": "}"; "[": "]"; "<": ">"; "(": ")"; "=": ">"; }> extends [infer Block extends string, ...infer Rest extends readonly string[]] ? NestedSplit, ",", { "{": "}"; "[": "]"; "<": ">"; "(": ")"; "=": ">"; }> extends [infer Key extends string, infer Value extends string] ? FromInputToken__String> extends Error ? Err<`malformed-token/record`, `while parsing a Record, the key token '${Trim}' was not parsable to a type!`> : FromInputToken__String> extends Error ? Err<`malformed-token/record`, `while parsing a Record, the value token '${Trim}' was not parsable to a type!`> : [GetInputToken>, GetInputToken>] extends [infer ParsedKey extends IT_Token, infer ParsedValue extends IT_Token] ? ParsedKey["type"] extends string ? { __kind: "IT_Token"; kind: "kv"; token: `Record<${Block}>`; type: Record; container: "Record"; keyToken: Trim; valueToken: Trim; rest: Trim">>; } : Err<`malformed-token/record`, `The key and value tokens for the record 'Record<${Block}>' were parsed to types but the key's type did not extend string!`> : never : Err<`malformed-token/record`, `The terminating '>' character was not found while parsing the record: 'Record<${T}>'`> : Err<"wrong-handler/record">; type ParseMap = NestedSplit", { "{": "}"; "[": "]"; "<": ">"; "(": ")"; "=": ">"; }> extends [infer Block extends string, ...infer Rest extends readonly string[]] ? NestedSplit, ",", { "{": "}"; "[": "]"; "<": ">"; "(": ")"; "=": ">"; }> extends [infer Key extends string, infer Value extends string] ? FromInputToken__String> extends Error ? Err<`malformed-token/map`, `while parsing a Map, the key token '${Trim}' was not parsable to a type!`> : FromInputToken__String> extends Error ? Err<`malformed-token/map`, `while parsing a Map, the value token '${Trim}' was not parsable to a type!`> : { __kind: "IT_Token"; kind: "kv"; token: `Map<${Block}>`; type: Map>, FromInputToken__String>>; container: "Map"; keyToken: Trim; valueToken: Trim; rest: Trim">>; } : Err<`malformed-token/map`, `The terminating '>' character was not found while parsing: 'Map<${T}'`> : Err<"wrong-handler/map">; type ParseWeakMap = NestedSplit", { "{": "}"; "[": "]"; "<": ">"; "(": ")"; "=": ">"; }> extends [infer Block extends string, ...infer Rest extends readonly string[]] ? NestedSplit, ",", { "{": "}"; "[": "]"; "<": ">"; "(": ")"; "=": ">"; }> extends [infer Key extends string, infer Value extends string] ? FromInputToken__String> extends Error ? Err<`malformed-token/weakmap`, `while parsing a WeakMap, the key token '${Trim}' was not parsable to a type!`> : FromInputToken__String> extends Error ? Err<`malformed-token/weakmap`, `while parsing a WeakMap, the value token '${Trim}' was not parsable to a type!`> : [GetInputToken>, GetInputToken>] extends [infer ParsedKey extends IT_Token, infer ParsedValue extends IT_Token] ? ParsedKey["type"] extends object ? { __kind: "IT_Token"; kind: "kv"; token: `WeakMap<${Block}>`; type: WeakMap; container: "WeakMap"; keyToken: Trim; valueToken: Trim; rest: Trim">>; } : Err<`malformed-token/weakmap`, `The key and value tokens for 'WeakMap<${Block}>' were parsed to the key's type did not extend object (which is required for a WeakMap)!`> : never : Err<`malformed-token/weakmap`, `The terminating '>' character was not found while parsing: 'WeakMap<${T}'`> : Err<"wrong-handler/weakmap">; type Select = T extends [infer Head, ...infer Rest extends readonly unknown[]] ? Head extends Err<"malformed-token"> ? Head : Head extends Error ? Select : Head : Err<"wrong-handler/kv", `None of the variants of KV containers matched on: '${TToken}'`, { token: TToken; utility: "IT_TakeKvObjects"; variants: TVariants; }>; /** * **IT_TakeKvObjects**`` * * Is intended for types like `Record`, `Map` and `WeakMap`, it will * take the _key_ and _value_ types as well as capture the container type. * * **Note:** the "object literal" type is taken separately from these more basic KV * forms. Use `IT_TakeObjectLiteral` for taking object literals. */ type IT_TakeKvObjects = Select<[T extends `Record<${infer Rest extends string}` ? ParseRecord : Error, T extends `Map<${infer Rest extends string}` ? ParseMap : Error, T extends `WeakMap<${infer Rest extends string}` ? ParseWeakMap : Error], T>; //#endregion //#region src/runtime-types/type-defn/input-tokens/IT_TakeNumericLiteral.d.ts type Break$2 = Whitespace | "|" | "&"; type TakeNumber = T extends `${infer Head}${infer Rest}` ? Head extends Break$2 ? R : TakeNumber : R; type Bare = StartsWith extends true ? TakeNumber extends `${number}` ? { __kind: "IT_Token"; kind: "literal"; token: `${TakeNumber}`; type: AsNumber>; rest: Trim>>; } : Err<`malformed-token/numeric-literal`, `A bare number was detected but the resultant token of '${TakeNumber}' can not be converted to a number!`, { parse: T; token: TakeNumber; }> : Err<`wrong-handler/numeric-literal`, `A bare number representing a numeric literal requires that the string passed in starts with a numeric literal.`, { token: T; }>; type NumberConstructor = T extends `Number(${infer Num extends number})${infer Rest extends string}` ? { __kind: "IT_Token"; kind: "literal"; token: `${Num}`; type: Num; rest: Trim; } : T extends `Number(${infer Rest extends string}` ? Contains extends true ? Err<`malformed-token/numeric-literal`, `A numeric literal with the 'Number(defn)' syntax provided an invalid numeric value of '${RetainUntil}'!`, { token: T; }> : Err<`malformed-token/numeric-literal`, `A numeric literal definition was detected by the 'Numeric(' but no terminating ')' character found!`, { token: T; }> : Err<"wrong-handler/numeric-literal">; /** * **IT_TakeNumericLiteral**`` * * Attempts to parse a numeric literal from the head of the parse string. */ type IT_TakeNumericLiteral = As$1 extends IT_Token<"literal"> ? Bare : NumberConstructor extends IT_Token<"literal"> ? NumberConstructor : Bare extends Err<"malformed-token"> ? Bare : NumberConstructor extends Err<"malformed-token"> ? NumberConstructor : Err<"wrong-handler/numeric-literal">, IT_TakeOutcome<"literal">>; //#endregion //#region src/runtime-types/type-defn/input-tokens/IT_TakeObjectLiteral.d.ts type DetermineKeyType = T extends "string" ? string : StripTrailing extends "symbol" ? symbol : T extends string ? StripTrailing : Err<"malformed-token/object-literal", `A key '${T}' can not be converted to a type!`>; type GetKv> = [StripTrailing, Trim] extends [infer KeyToken extends string, infer ValueToken extends string] ? DetermineKeyType extends Error ? DetermineKeyType : GetInputToken extends Error ? Err<`malformed-token/object-literal`, `The value '${ValueToken}' in the key value pair '${TKey}: ${ValueToken}' could not be parsed into a type!`, { keyToken: KeyToken; valueToken: ValueToken; underlying: GetInputToken; }> : GetInputToken extends IT_Token ? { key: DetermineKeyType; value: GetInputToken["type"]; required: Not; } : Err<`malformed-token/object-literal`> : never; type ParseKv = IsolateErrors<{ [K in keyof T]: NestedSplit extends [infer KeyToken extends string, infer ValueToken extends string] ? GetKv, Trim> : never }>; /** * **ParseObjectLiteral**`` * * Tries to parse the head of the parse string for a string based object literal definition. * * - any parse string which _starts with_ `{${string}` will be assumed to be an attempt * to define an object literal */ type ParseObjectLiteral = NestedSplit extends infer Parts extends readonly string[] ? Parts["length"] extends 1 ? Err<"malformed-token/object-literal", `The terminating '}' character was not found in the token's object literal definition!`, { token: `{ ${T}`; }> : Parts extends [infer Block extends string, ...infer Rest extends readonly string[]] ? NestedSplit, [",", ";"]> extends infer KvPairs extends readonly string[] ? TrimEach extends infer KVs extends readonly string[] ? ParseKv extends infer Outcome extends IsolatedResults ? Length extends 0 ? Outcome["successes"] extends infer Success extends readonly KeyValue[] ? { __kind: "IT_Token"; kind: "object-literal"; token: `{ ${Trim} }`; type: FromKv; rest: Trim>; keyValues: Success; } : Err<"malformed-token/object-literal", `There were no errors detected in the key/value pairs but result type did not extends IT_Token: ${Block}`, { block: Block; split: NestedSplit, [",", ";"]>; }> : Err<"malformed-token/object-literal", `Error(s) occurred in parsing the key/value pairs of an object literal. The following errors were found: ${Join, "\n\t">}`, { token: `{ ${Trim} }`; block: Trim; split: NestedSplit, [",", ";"]>; errors: GetEach; }> : Err<`malformed-token/object-literal`, `Failed to parse the key values found in the object literal: '${T}'`, { token: T; block: Block; }> : Err<"malformed-token/object-literal", `The parsing of an object literal was started due to the presence of the '{' character but no matching '}' was detected: ${Block}`> : Err<"malformed-token/object-literal", `The terminating '}' character was not found in the token's object literal definition!`, { token: T; }> : Err<"oops"> : never; /** * **IT_TakeObjectLiteral**`` * * Parses object literal definitions at the head of the parse string. * * - Strings starting with `{` indicate the beginning of an object literal definition */ type IT_TakeObjectLiteral = As$1> : Err<`wrong-handler/object-literal"`, `The token ${T} did not start with '{' so this is not an object literal`>, IT_TakeOutcome<"object-literal">>; //#endregion //#region src/runtime-types/type-defn/input-tokens/IT_TakeParameters.d.ts type DetermineType< /** the string token for the parameter type */T extends string, U extends readonly GenericParam[]> = Find$1 extends infer Generic extends GenericParam ? { token: Generic["token"]; type: Generic["type"]; fromGeneric: Generic["name"]; } : Trim extends `Array<${infer Inner extends string}>` ? DetermineType, U> extends infer InnerInfo extends { type: unknown; } ? { token: Trim; type: Array; fromGeneric: false; } : Err<`malformed-token`, `While parsing an Array parameter, the interior token '${Trim}' was not parsable to a type!`, { parameter: Trim; generics: U; }> : Trim extends `${infer InnerA extends string}[][]` ? DetermineType, U> extends infer AInfo extends { type: unknown; } ? { token: Trim; type: AInfo["type"][][]; fromGeneric: false; } : Err<`malformed-token`, `While parsing a two-dimensional array parameter, the interior token '${Trim}' was not parsable to a type!`, { parameter: Trim; generics: U; }> : Trim extends `${infer InnerB extends string}[]` ? DetermineType, U> extends infer BInfo extends { type: unknown; } ? { token: Trim; type: BInfo["type"][]; fromGeneric: false; } : Err<`malformed-token`, `While parsing an array parameter, the interior token '${Trim}' was not parsable to a type!`, { parameter: Trim; generics: U; }> : Trim extends `Set<${infer InnerS extends string}` ? NestedSplit"> extends [infer Block extends string, ...infer _R extends readonly string[]] ? DetermineType, U> extends infer SInfo extends { type: unknown; } ? { token: `Set<${Trim}>`; type: Set; fromGeneric: false; } : Err<`malformed-token`, `While parsing a Set parameter, the interior token '${Trim}' was not parsable to a type!`, { parameter: Trim; generics: U; }> : Err<`malformed-token`, `The Set<...> token '${Trim}' is missing a terminating '>' character!`, { parameter: Trim; generics: U; }> : Trim extends `Promise<${infer InnerP extends string}` ? NestedSplit"> extends [infer Block extends string, ...infer _R extends readonly string[]] ? DetermineType, U> extends infer PInfo extends { type: unknown; } ? { token: `Promise<${Trim}>`; type: Promise; fromGeneric: false; } : Err<`malformed-token`, `While parsing a Promise parameter, the interior token '${Trim}' was not parsable to a type!`, { parameter: Trim; generics: U; }> : Err<`malformed-token`, `The Promise<...> token '${Trim}' is missing a terminating '>' character!`, { parameter: Trim; generics: U; }> : Trim extends `Map<${infer RestM extends string}` ? NestedSplit"> extends [infer Block extends string, ...infer _R extends readonly string[]] ? TrimEach, readonly string[]>> extends [infer KTok extends string, infer VTok extends string, ...infer _Extra extends readonly string[]] ? DetermineType extends infer KInfo extends { type: unknown; } ? DetermineType extends infer VInfo extends { type: unknown; } ? { token: `Map<${KTok}, ${VTok}>`; type: Map; fromGeneric: false; } : Err<`malformed-token`, `While parsing a Map parameter, the value token '${VTok}' was not parsable to a type!`, { parameter: Trim; generics: U; }> : Err<`malformed-token`, `While parsing a Map parameter, the key token '${KTok}' was not parsable to a type!`, { parameter: Trim; generics: U; }> : Err<`malformed-token`, `The Map<...> parameter interior '${Block}' did not contain a valid 'key, value' pair!`, { parameter: Trim; generics: U; }> : Err<`malformed-token`, `The Map<...> token '${Trim}' is missing a terminating '>' character!`, { parameter: Trim; generics: U; }> : Trim extends `WeakMap<${infer RestW extends string}` ? NestedSplit"> extends [infer Block extends string, ...infer _R extends readonly string[]] ? TrimEach, readonly string[]>> extends [infer KTok extends string, infer VTok extends string, ...infer _Extra extends readonly string[]] ? DetermineType extends infer KInfo extends { type: unknown; } ? DetermineType extends infer VInfo extends { type: unknown; } ? { token: `WeakMap<${KTok}, ${VTok}>`; type: WeakMap, VInfo["type"]>; fromGeneric: false; } : Err<`malformed-token`, `While parsing a WeakMap parameter, the value token '${VTok}' was not parsable to a type!`, { parameter: Trim; generics: U; }> : Err<`malformed-token`, `While parsing a WeakMap parameter, the key token '${KTok}' was not parsable to a type!`, { parameter: Trim; generics: U; }> : Err<`malformed-token`, `The WeakMap<...> parameter interior '${Block}' did not contain a valid 'key, value' pair!`, { parameter: Trim; generics: U; }> : Err<`malformed-token`, `The WeakMap<...> token '${Trim}' is missing a terminating '>' character!`, { parameter: Trim; generics: U; }> : Trim extends `Record<${infer RestR extends string}` ? NestedSplit"> extends [infer Block extends string, ...infer _R extends readonly string[]] ? TrimEach, readonly string[]>> extends [infer KTok extends string, infer VTok extends string, ...infer _Extra extends readonly string[]] ? DetermineType extends infer KInfo extends { type: unknown; } ? DetermineType extends infer VInfo extends { type: unknown; } ? { token: `Record<${KTok}, ${VTok}>`; type: Record, VInfo["type"]>; fromGeneric: false; } : Err<`malformed-token`, `While parsing a Record parameter, the value token '${VTok}' was not parsable to a type!`, { parameter: Trim; generics: U; }> : Err<`malformed-token`, `While parsing a Record parameter, the key token '${KTok}' was not parsable to a type!`, { parameter: Trim; generics: U; }> : Err<`malformed-token`, `The Record<...> parameter interior '${Block}' did not contain a valid 'key, value' pair!`, { parameter: Trim; generics: U; }> : Err<`malformed-token`, `The Record<...> token '${Trim}' is missing a terminating '>' character!`, { parameter: Trim; generics: U; }> : FromInputToken__String> extends Error ? Err<`malformed-token`, `The parameter token's boundaries were established but while iterating over the parameter definitions we found the parameter token: '${Trim}'`, { parameter: Trim; generics: U; }> : { token: Trim; type: FromInputToken__String>; fromGeneric: false; }; type AsParameters = TParams extends [infer Head extends string, ...infer Rest extends readonly string[]] ? Head extends `${infer Name extends string}:${infer Type extends string}` ? DetermineType, TGenerics> extends infer Info extends { type: any; fromGeneric: false | string; token: string; } ? AsParameters; token: Info["token"]; fromGeneric: Info["fromGeneric"]; type: Info["type"]; }, GenericParam>]> : Err<`malformed-token`, `function parsing failed in call to DetermineType<...>`, { parameters: TParams; generics: TGenerics; result: TResult; determineType: DetermineType, TGenerics>; }> : Err<`malformed-token`, `The parameter token '' can not be parsed to find any type information!`, { result: TResult; }> : TResult extends readonly IT_Parameter[] ? TResult : Err<`malformed-token`, `Failed while trying to parse the parameters of a function`, { results: TResult; params: TParams; }>; type TakeParameters< /** the token string after generics have been taken */T extends string, /** the list of available parameters */P extends readonly GenericParam[]> = T extends `(${infer Rest extends string}` ? [RetainUntil, Trim>] extends [infer Block extends string, infer Rest extends string] ? Trim extends "" ? { parameters: []; generics: P; rest: Rest; } : NestedSplit extends infer KV extends readonly string[] ? { parameters: AsParameters; generics: P; rest: Rest; } : Err<"malformed-token", `The function's parameter block -- ${Block} -- was not able to be parsed!`, { token: T; block: Block; rest: Rest; generics: P; }> : Err<"malformed-token", `The opening parenthesis indicated a parameter block should follow but was unable to find the closing parenthesis in: ${Rest}`, { token: T; rest: Rest; generics: P; }> : Err<`wrong-handler`, `parameter blocks expect the leading character to be an open parenthesis`, { token: T; generics: P; }>; /** * **IT_TakeParameters**`` * * A reusable utility for both _functions_ and _generators_ which takes: * * - **generics** _when found_ * - **parameters** _when found_ * * Like other **take** utilities, this utility returns: * - a `Err` when parameters could not be found at the * head of the token string. * - a `Err` when either the generics block (`<${string}>`) or * parameters block (`(${string})`) is _established_ but can not be parsed. * * On successful parsing of a parameter block it will return `IT_Parameters` type * which can be used to help complete the `IT_Token<"fn">` or `IT_Token<"generator">` * blocks required by the utilities `IT_TakeFunction` and `IT_TakeGenerator`. */ type IT_TakeParameters = IT_TakeTokenGenerics extends Err<"invalid-token"> ? IT_TakeTokenGenerics : IT_TakeTokenGenerics extends IT_Generics ? TakeParameters["rest"], IT_TakeTokenGenerics["generics"]> : TakeParameters; //#endregion //#region src/runtime-types/type-defn/input-tokens/IT_TakePromise.d.ts type IT_TakePromise = T extends `Promise<${infer Rest extends string}` ? NestedSplit"> extends [infer Block extends string, ...infer Rest extends readonly string[]] ? FromInputToken__String extends Error ? Err<`malformed-token`, `Failed to parse the payload Promise interior: '${Block}'. ${FromInputToken__String["message"]}`, { token: T; block: Block; }> : { __kind: "IT_Token"; kind: "promise"; token: `Promise<${Block}>`; type: Promise>; rest: Trim">>; } : never : Err<"wrong-handler">; //#endregion //#region src/runtime-types/type-defn/input-tokens/IT_TakeSet.d.ts type IT_TakeSet = T extends `Set<${infer Rest}` ? NestedSplit"> extends [infer Block extends string, ...infer Rest extends readonly [string, ...string[]]] ? FromInputToken__String> extends Error ? Err<"malformed-token", `In Set, the token representing T -- '${Trim}' -- was not able to be parsed to a type. ${FromInputToken__String>["message"]}`> : { __kind: "IT_Token"; kind: "set"; token: `Set<${Trim}>`; type: Set>>; rest: Trim">>; } : never : Err<"wrong-handler/set">; //#endregion //#region src/runtime-types/type-defn/input-tokens/IT_TakeStringLiteral.d.ts /** * Join all parts with the separator, including between a non-empty * part and a trailing empty string. This preserves a trailing separator * when the split produced a final empty string. */ type JoinAll = [] extends T ? R : T extends [infer H extends string, ...infer Rest extends readonly string[]] ? Rest["length"] extends 0 ? R extends "" ? H : `${R}${S}${H}` : JoinAll : R; type EmptyString$1 = T extends `''${infer Rest}` ? { __kind: "IT_Token"; kind: "literal"; token: T; type: `""`; rest: Rest; } : T extends `""${infer Rest}` ? { __kind: "IT_Token"; kind: "literal"; token: T; type: `""`; rest: Rest; } : T extends `\`\`${infer Rest}` ? { __kind: "IT_Token"; kind: "literal"; token: T; type: `""`; rest: Rest; } : Err<"wrong-handler/empty-string">; type Quoted = T extends `${infer Head}${infer Rest}` ? Head extends infer Quote extends QuoteCharacter ? Contains extends true ? NestedSplit extends [infer Block extends string, ...infer Rest extends string[]] ? Block extends "" ? Err<"malformed-token/string-literal"> : { __kind: "IT_Token"; kind: "literal"; token: `${Quote}${Block}${Quote}`; type: AsLiteralTemplate; rest: Trim>; } : Err<`malformed-token/string-literal`, `While parsing a string literal starting with quote character ${Quote}; there was no terminating quote character of the same type!`, { token: T; }> : Err<"malformed-token/string-literal", `While parsing a string literal starting with quote character ${Quote}; there was no terminating quote character of the same type!`, { token: T; }> : Err<`wrong-handler/quoted`, `The parse string did not start with a quote character`> : Err<`wrong-handler/quoted`, `The parse string only had a single character`>; /** * matches on string literals defined like `String(foo)` */ type StringConstructor = T extends `String(${infer Rest}` ? Contains extends true ? NestedSplit extends [infer Block extends string, ...infer Rest extends string[]] ? { __kind: "IT_Token"; kind: "literal"; token: `String(${Block})`; type: AsLiteralTemplate; rest: Trim>; } : never : Err<"malformed-token/string-literal", `While parsing a string literal using the String(literal) syntax; there was no terminating ')' character!`, { token: T; }> : Err<"wrong-handler/string-literal", `The token didn't match that a of a string literal using the constructor syntax (e.g., 'String(literal)')`, { token: T; }>; /** * **IT_TakeStringLiteral**`` * * Attempts to parse a string literal from the _head_ of the parse string. */ type IT_TakeStringLiteral = EmptyString$1 extends IT_Token<"literal"> ? EmptyString$1 : StringConstructor extends IT_Token<"literal"> ? StringConstructor : Quoted extends IT_Token<"literal"> ? Quoted : StringConstructor extends Err<"malformed-token"> ? StringConstructor : Quoted extends Err<"malformed-token"> ? Quoted : IsNever> extends true ? Err<`malformed-token`> : IsNever> extends true ? Err<`malformed-token`> : Err<"wrong-handler/string-literal", `The IT_TakeString handler is unable to parse the head of: '${T}'`, { token: T; }>; //#endregion //#region src/runtime-types/type-defn/input-tokens/IT_TakeTokenGenerics.d.ts /** * the successful results of evaluating a single generic parameter */ interface TokenParsed { name: string; token: string; type: unknown; } /** * all of the tokens found in a generics block plus the "rest" */ interface GenericsParsed { generics: TokenParsed[]; rest: string; } type IT_TakeTokenGeneric = T extends `${infer Name extends string} extends ${infer Type extends string}` ? Trim extends infer CleanName extends string ? Trim extends infer CleanType extends string ? FromInputToken extends infer ParsedType ? { name: CleanName; token: CleanType; type: ParsedType; } : never : never : never : IsAlphanumeric> extends true ? { name: Trim; token: "unknown"; type: unknown; } : Err<`malformed-token/generic`, `The string -- '${T}' -- passed to TakeTokenGeneric is invalid as a generic name!`>; /** * */ type ParseGenerics = TPairs extends [infer Head extends string, ...infer Rest extends readonly string[]] ? IT_TakeTokenGeneric extends infer Result ? Result extends Error ? ErrContext : Result extends TokenParsed ? ParseGenerics : Err<`malformed-token/generic`, `The ParseGenerics<..> utility ran into a string pair which it could not parse into a generic parameter!`, { result: Result; }> : Err<"malformed-token/generic", `This shouldn't really happen but is the outcome of not being able to infer a type for 'IT_TakeTokenGeneric'`, { head: Head; }> : P; /** * **TakeTokenGenerics**`` * * Parses what is meant to be expected to be a a comma delimited set of * generic parameters terminating with a `>` character. * * **Note:** * - since this utility starts by stripping a leading character of `<` * (if it exists) you can pass in a token string that has _already_ had * this stripped off and this utility will work in the same way. * * * ```ts * { * generics: [ * { name: "T", type: string }, * { name: "U", type: number | boolean } * ], * rest: "= ..." * type Generics = TakeTokenGenerics<" = ..."> * ``` * * **Related**: `TakeKeyValueTokens` */ type IT_TakeTokenGenerics> = string extends T ? GenericsParsed | Error : NestedSplit"> extends [infer Block extends string, ...infer Rest extends readonly string[]] ? NestedSplit extends Error ? ErrContext, { utility: "TakeTokenGeneric"; token: `<${TClean}`; block: Block; }> : NestedSplit extends infer GenericPairs extends readonly string[] ? TrimEach extends infer TrimmedPairs extends readonly string[] ? ParseGenerics extends infer ParsedResult ? ParsedResult extends Error ? ErrContext : ParsedResult extends readonly TokenParsed[] ? { generics: ParsedResult; rest: Trim">>; } : Err<"malformed-token", `The parsed generics appear to be of an invalid type!`, { generics: ParsedResult; rest: Trim">>; }> : never : never : never : Err<`wrong-handler/generic`, `The string token passed in could not be parsed as a Generics block`, { token: `<${TClean}`; utility: "TakeTokenGenerics"; }>; //#endregion //#region src/runtime-types/type-defn/input-tokens/IT_TakeUnion.d.ts type HasEmptyString = T extends [infer Head extends string, ...infer Rest extends readonly string[]] ? Trim extends "" ? true : HasEmptyString : false; type ParseParts = As$1> extends Error ? GetInputToken> : GetInputToken> extends IT_Token ? ParseParts>]> : Err<"malformed-token", `The token '${Head}' was unable to be parsed into a type!`, { result: FromInputToken__String>; }> : R, readonly IT_Token[] | Error>; type Parse = As$1 extends Err<"malformed-token"> ? ValidateStructure : ValidateStructure extends readonly string[] ? (ValidateStructure extends [infer HeadTokenStr extends string, ...infer RestParts extends readonly string[]] ? (ValidateStructure extends infer ValidRest extends readonly string[] ? ParseParts extends infer TokensOrErr ? TokensOrErr extends Error ? Err<"malformed-token/union", `Attempt to parse members of a union type failed because one or more were unable to be parsed into a valid type. ${TokensOrErr["message"]}`, { parts: RestParts; }> : TokensOrErr extends infer RestTokens extends readonly IT_Token[] ? { __kind: "IT_Token"; kind: "union"; token: Trim], " | ">>; type: TupleToUnion<[FromInputToken__String>, ...FromInputToken__Tuple]>; rest: As$1["rest"], string>; members: [FromInputToken__String>, ...FromInputToken__Tuple]; } : never : never : never) : never) : Err<`malformed-token/union`>, IT_TakeOutcome<"union">>; /** * looks at the underlying tokens which will be part of the union; returns a `Err<"malformed-token">` if * an error is detected. * * - ensures no trailing empty string (which indicates | at end of string) * - ensure no interior members are empty strings (which indicates a duplicate '|' operator) * * If all passes then tokens are returned in a _trimmed_ form. */ type ValidateStructure = Trim> extends "" ? Err<`malformed-token/union`, `The union operator '|' was found at the end of the parse string. This is not allowed as the union operator is an inline operator and must have types on both sides of it!`, { parseString: T; }> : HasEmptyString extends true ? Err<`malformed-token/union`, `The union operator '|' was found next to another '|' operator. This is not allowed as the union operator is an inline operator and must have types on both sides of it!`, { parseString: T; }> : TrimEach; /** * **IT_TakeUnion**`` * * Takes a token (or undefined) and the remaining parse string. * * - if the remaining parse string starts with `|` then this utility will parse the remaining * string * - if the remaining parse string doesn't start with `|` then the Error "wrong-handler" is returned */ type IT_TakeUnion = As$1 extends `|${infer Rest extends string}` ? TToken extends undefined ? Err<`malformed-token/union`, `The union operator '|' was found at the beginning of the parse string. This is not allowed as the union operator is an inline operator and must have types on both sides of it!`, { parseString: TToken; previousToken: TToken; }> : NestedSplit"; "(": ")"; "=": ">"; }> extends infer Parts extends readonly string[] ? Parse<[`${As$1["token"]}`, ...Parts]> : never : Err<"wrong-handler/union", `The union handler only takes parse strings which start with '|'`, { parse: TParse; token: TToken; }>, IT_TakeOutcome<"union">>; //#endregion //#region src/runtime-types/type-defn/TokenMapper.d.ts /** * **TokenMapper** * * A simple key value store where: * * - the _keys_ must be strings and they represent the "tokens" your * token mapping solution (with the use of `DefineObjectWith`) * - the _values_ are the _types_ which the **key** represents * * This is meant to be used with `DefineObjectWith` type utility. */ type TokenMapper = Record; //#endregion //#region src/runtime-types/TypeOf.d.ts /** * **TypeOf** * * The possible _types_ returned by the Javascript `typeof` command. * * - most types such as `string`, `number`, `boolean`, `undefined`, etc. have very * straight forward "types" * - the `object` type however translates into `null` and any array or object * - even though `function` _is_ clearly separated from `object` at runtime with **typeof** * it does allow dictionary properties to be attached along with being a function. This * contrasts with Typescript which models an intersection between a function signature * and an object signature. * * **Related:** `TypeOfExtended` */ type TypeOf = TupleToUnion; /** * **TypeOfExtended** * * The base data structures we tend think of in Javascript including some * like `null` and `array` which are not reported by the **typeof** operator. * * This set of operators, while not natively supported by **typeof** is supported * by type and runtime utilities in this library. * * **Related:** `TypeOf`, `TypeTokens` */ type TypeOfExtended = TypeOf | "null" | "array" | "function-with-props"; /** * **GetTypeOf**`` * * type utility which converts a type string literal which represents * the value of this type from the standpoint of Javascript's `typeof` * operator. */ type GetTypeOf = (T extends string ? "string" : [T] extends [number] ? "number" : [T] extends [boolean] ? "boolean" : [T] extends [AnyFunction] ? "function" : [T] extends [AnyObject] | null | unknown[] ? "object" : [T] extends [bigint] ? "bigint" : [IsUndefined] extends [true] ? "undefined" : [T] extends [symbol] ? "symbol" : never) & TypeOf; /** * **ConvertTypeOf**`` * * Type utility which receives a `TypeOf` value and converts into a * comparable type. * * - please keep in mind that `object` types are converted to: * ```ts * AnyObject | null | unknown[] * ``` * - any runtime type which is seen as a `function` is converted to the * `AnyFunction` type alias which includes allowing for functions which * have dictionary props. */ type ConvertTypeOf = T extends "string" ? string : T extends "number" ? number : T extends "object" ? AnyObject | null | unknown[] : T extends "undefined" ? undefined : T extends "function" ? AnyFunction : T extends "bigint" ? number : T extends "symbol" ? symbol : T extends "boolean" ? boolean : never; //#endregion //#region src/runtime-types/TypeToken.d.ts /** * **BaseTypeToken** * * A very simple structure for `TypeTokens` to fit into. * * Use this type if you need to preserve type simplicity, otherwise * prefer `TypeToken` (or subsets like `AtomicToken`, `SingletonToken`, etc.) */ type BaseTypeToken = `${TypeTokenStart}${string}${TypeTokenStop}`; /** * TypeTokenAtomics * * The token names which are considered "atomic" */ type TypeTokenAtomics = typeof TT_ATOMICS$1[number]; type TypeTokenContainers = typeof TT_CONTAINERS$1[number]; type TypeTokenFunctions = typeof TT_FUNCTIONS$1[number]; type TypeTokenSingletons = typeof TT_SINGLETONS$1[number]; type TypeTokenSets = typeof TT_SETS$1[number]; /** * **TypeTokenKind** * * The full set of _type token_ kinds (aka, the first and * identifying part of the string token after the initial * token identifier) */ type TypeTokenKind = TypeTokenAtomics | TypeTokenContainers | TypeTokenFunctions | TypeTokenSets | TypeTokenSingletons; /** * string which indicates the start of a `TypeToken` */ type TypeTokenStart = typeof TT_START$1; /** * string which indicates the end of a `TypeToken` */ type TypeTokenStop = typeof TT_STOP$1; /** the _delimiter_ token used in a `TypeToken` */ type TypeTokenDelimiter = typeof TT_DELIMITER$1; type Delim = TypeTokenDelimiter; /** * **TypeToken** * * A **TypeToken** represents the general shape of all variants of the * TypeToken family. Variants are distinguished at the highest level * by their `TypeTokenKind`. * * You can use the generic `T` to isolate to one or more of these kinds * if you like but by default all are represented. */ type TypeToken = IsEqual extends true ? `${TypeTokenStart}${T}${"" | `${Delim}${string}`}${TypeTokenStop}` : T extends TypeTokenKind ? IsUnion extends true ? null : T extends TypeTokenSets ? `${TypeTokenStart}${T}${Delim}${TypeTokenLookup}${TypeTokenStop}` : T extends TypeTokenAtomics ? `${TypeTokenStart}${T}${TypeTokenStop}` : `${TypeTokenStart}${T}${TypeTokenStop}` | `${TypeTokenStart}${T}${Delim}${TypeTokenLookup}${TypeTokenStop}` : never; /** * the shape of `TypeToken` variants which represent one of the Singleton variants */ type TT_Singleton = TypeToken; /** the shape of `TypeToken` variants which represent one of the Atomic variants */ type TT_Atomic = TypeToken; /** the shape of `TypeToken` variants which a "set" of pattern based types */ type TT_Set = TypeToken; /** the shape of `TypeToken` variants which represent a function */ type TT_Function = TypeToken; /** the shape of `TypeToken` variants which represent a container */ type TT_Container = TypeToken; //#endregion //#region src/runtime-types/TypeToken-variants.d.ts type MakeDynamic = { [K in keyof T]: ReplaceAll, "${Metric}", MetricCategory> }; /** * Type extensions for the `string` variant * * Allow for wide "string", or a string literal. */ type TypeToken__String = `${string}`; type TypeToken__StringSet = MakeDynamic[number]; /** * Type extensions for the `number` variant. * * Allow for wide "number", a numeric literal. */ type TypeToken__Number = `::${number}`; type TypeToken__NumberSet = "bigInt" | `bigInt::${bigint}` | "digit" | `digit::${2 | 3 | 4}` | "integer"; type params = string; type rtn = string; type D$1 = TypeTokenDelimiter; type TypeToken__Fn = `[${params}]` | `[${params}]${D$1}${rtn}` | `any::${rtn}`; type TypeToken__Gen = `[${params}]` | `[${params}]${D$1}${rtn}` | `gen${D$1}any${D$1}${rtn}`; type TypeToken__FnSet = `withoutParams` | `withoutParams${D$1}${rtn}` | `booleanLogic` | `booleanLogic${D$1}[${params}]`; type RecVariant = typeof TYPE_TOKEN_REC_VARIANTS$1[number]; type RecKeyVariant = typeof TYPE_TOKEN_REC_KEY_VARIANTS$1[number]; type TypeToken__Rec = `${RecVariant}${D$1}${RecKeyVariant}` | `${D$1}kv${D$1}${string}` | `${D$1}kv${D$1}${string}${D$1}${"withUnknownIndex" | "withAnyIndex"}`; type TypeToken__Undefined = ""; type TypeToken__Null = ""; type TypeToken__Boolean = ""; type TypeToken__True = ""; type TypeToken__False = ""; type TypeToken__Never = ""; type TypeToken__Unknown = ""; type TypeToken__UnionSet = typeof TYPE_TOKEN_UNION_SET_VARIANTS$1[number]; interface _TypeTokenLookup { "string": TypeToken__String; "string-set": TypeToken__StringSet; "number": TypeToken__Number; "number-set": TypeToken__NumberSet; "undefined": TypeToken__Undefined; "null": TypeToken__Null; "boolean": TypeToken__Boolean; "true": TypeToken__True; "false": TypeToken__False; "never": TypeToken__Never; "unknown": TypeToken__Unknown; "fn": TypeToken__Fn; "fn-set": TypeToken__FnSet; "gen": TypeToken__Gen; "rec": TypeToken__Rec; "arr": ""; "map": ""; "weak": ""; "asUnion": ""; "union-set": TypeToken__UnionSet; } /** * **TypeTokenLookup**`` * * Adds allowed string literal variants for a given `TypeTokenKind` */ type TypeTokenLookup = T extends keyof _TypeTokenLookup ? _TypeTokenLookup[T] : ""; //#endregion //#region src/runtime-types/TypeTuple.d.ts /** * **TypeTuple**`` * * The Tuple containing: * - a type _representation_ * - a type guard to validate * - (optionally) a textual description of the type * * This provides a simple shorthand way of defining a type in a way * which can be used in the tooling for `Type` and `TypeDefn` but does * not represent a full-fledged `Type`. */ type TypeTuple = [type: TType, guard: TypeGuard, desc: TDesc]; //#endregion //#region src/generics/GenericParam.d.ts /** * **GenericParam** * * A structured representation of a generic parameter used by runtime types * like `InputToken`. * * **Related:** `GenericParamToken` */ interface GenericParam { /** the generic's name */ name: string; /** * a _string based_ `InputToken` representing the generic's * type. */ token: InputTokenSuggestions; /** * the **type** the given generic parameter _extends_ */ type: unknown; } //#endregion //#region src/kv/FromKv.d.ts type Intersect = T extends [infer Head extends Dictionary, ...infer Rest extends Dictionary[]] ? Intersect : R; type Convert$1 = T extends [infer Head extends KeyValue, ...infer Rest extends KeyValue[]] ? Head["required"] extends true ? Convert$1]> : Convert$1]> : ExpandRecursively>; /** * **FromKv**`` * * Converts a tuple of `KeyValue` objects into a narrowly typed object. * * ```ts * // { foo: 1; bar: "hi" } * type FooBar = FromKv<[ * { key: "foo", value: 1 }, * { key: "bar", value: "hi" } * ]>; * ``` * * **Related:** `ToKv`, `KeyValue` */ type FromKv = IsWideContainer extends true ? Dictionary : Convert$1; //#endregion //#region src/kv/KeyValue.d.ts /** * **KeyValue** * * A type used by utilities like `ToKv` and `FromKv` to convert * a Dictionary into a tuple of KeyValue's (or visa-versa). */ interface KeyValue { /** the _key_ of an object */ key: K; /** the _value_ of the object's @ `key` */ value: V; /** * whether this key/value pair is _required_ in the object definitions */ required: R; } //#endregion //#region src/kv/ToKv.d.ts interface ToKvOptions extends Partial { recurse?: number | boolean; } type Recurse = TVal extends Dictionary ? [IsFalse>] extends [true] ? TVal : ToKv : TVal; type Convert, TKv extends readonly KeyValue[] = []> = TKeys extends [infer Head extends ObjectKey, ...infer Rest extends ObjectKey[]] ? Head extends keyof TObj ? Head extends TOptional[number] ? Convert | undefined; required: false; }]> : Convert; required: true; }]> : never : TKv; interface Options { order: T["order"] extends SortOrder ? T["order"] : "natural"; start: T["start"] extends readonly unknown[] ? T["start"] : []; end: T["end"] extends readonly unknown[] ? T["end"] : []; offset: T["offset"] extends PropertyKey ? T["offset"] : "key"; recurse: T["recurse"] extends number | boolean ? T["recurse"] : false; } /** * **ToKv**`` * * Type utility which receives a Dictionary based object and converts * it to a tuple of `KeyValue` objects. * * ```ts * // [ {key: "id", value: 123 }, {key: "foo", value: "bar" } ] * type Arr = ToKv<{ id: 123, foo: "bar" }>; * ``` * * ### Options * * The optional second generic provides an object hash: * * 1. Sorting * * - by default the "natural order" found in the dictionary is used to * sort the resultant array * - you can, however, "pin" keys to the start or end * - you can also sort the keys in "asc" and "desc" order * - if a sort `order` is provided other than the default of "natural", * the symbol keys will be added to the start and then all string keys * will be sorted in the order specified * - all sorting functionality is provided by the `Sort<...>` utility * * 2. Depth * * - by default the conversion of dictionary objects to an array is only done * at the root level (e.g., values which are dictionaries are left as that type) * - if you would like to _recurse_ into object values you can modify the * `depth` property: * - `true` will recurse infinitely * - any numeric value will cap the depth of recursion to the specified depth * * * **Related:** `KeyValue`, `FromKv`, `toKeyValue()`, `fromKeyValue()` */ type ToKv = IsLiteralLikeObject extends true ? Convert>, readonly ObjectKey[]>, Options> : KeyValue[]; //#endregion //#region src/queues/FifoQueue.d.ts /** * A "First In, First out" queue (**FIFO**) */ interface FifoQueue { queue: TType[]; size: number; /** * reports back a boolean value to indicate whether the queue is empty or not */ isEmpty: () => boolean; /** * pushes additional items into the queue */ push: (...add: T) => void; /** * Drop a number of items from the top of the queue; if * quantity is not provided then 1 item will be dropped. */ drop: (quantity?: T) => void; /** clears the values in the queue */ clear: () => void; /** similar to `clear()` but returns the current queue items before clearing */ drain: () => TType[]; /** * Take 1 or more values from the top of the queue. */ take: (quantity?: T) => FixedLengthArray; [Symbol.iterator]: () => Iterator; } //#endregion //#region src/queues/LifoQueue.d.ts /** * A "Last In, First out" queue (**LIFO**) */ interface LifoQueue { queue: TType[]; size: number; /** * reports back a boolean value to indicate whether the queue is empty or not */ isEmpty: () => boolean; /** * pushes additional items into the queue */ push: (...add: T) => void; /** * Drop a number of items from the top of the queue; if * quantity is not provided then 1 item will be dropped. */ drop: (quantity?: T) => void; /** clears the values in the queue */ clear: () => void; /** similar to `clear()` but returns the current queue items before clearing */ drain: () => TType[]; /** * Take 1 or more values from the top of the queue. */ take: (quantity?: T) => FixedLengthArray; [Symbol.iterator]: () => Iterator; } //#endregion //#region src/regex/EscapeRegex.d.ts type EscapeRegex = AsFromTo<{ ".": "\\."; "*": "\\*"; "+": "\\+"; "?": "\\?"; "^": "\\^"; "$": "\\$"; "{": "\\{"; "}": "\\}"; "(": "\\("; ")": "\\)"; "|": "\\|"; "[": "\\["; "]": "\\]"; "\\": "\\\\"; }>; //#endregion //#region src/regex/ExtractCaptureGroups.d.ts type TemplateSegment = "{{string}}" | "{{number}}" | "{{boolean}}"; type SegmentToType = S extends "{{string}}" ? string : S extends "{{number}}" ? number : S extends "{{boolean}}" ? boolean : never; /** * Extracts the capture groups in a RegExp and their type. */ type IsSubset = T extends `.*(${string}).*` ? true : false; type ExtractCaptureGroups, Acc extends RegexGroupValue[] = []> = TTmpl extends `${infer _Before}{{${infer Segment}}}${infer After}` ? Segment extends "string" | "number" | "boolean" ? ExtractCaptureGroups]> : ExtractCaptureGroups : TSubset extends true ? [string, ...Acc] : Acc; //#endregion //#region src/regex/RegexArray.d.ts type RegexGroupValue = string | number | bigint | boolean | null | undefined; /** * Converts the pseudo Regex (which hasn't been escaped to be "real" regex) * back to the curly braced template blocks expected by the `StringLiteralTemplate` * utility. */ type PrettyRegexToTemplate = AsFromTo<{ "(.+?)": `{{string}}`; "(\\d+)": `{{number}}`; "(true|false)": `{{boolean}}`; }>; /** * Converts from _pretty_ regex to block template mode with `{{string}}`, etc. */ type AsTemplateString$1 = T extends `^${infer Inner}$` ? ReplaceAllFromTo : T extends `.*(${infer Inner}).*` ? `${string}${ReplaceAllFromTo}${string}` : never; type Groups = TStrategy extends "exact" ? ApplyTemplate : TStrategy extends "subset" ? [TValue, StringLiteralTemplate>, ...(ApplyTemplate, false> extends readonly [string, ...infer Rest] ? Rest : [])] : never; type _RegexArray = Expand & Record<"kind", "RegexArray"> & (TStrategy extends "subset" ? Record<"template", StripSurroundingStringTemplate> : Record<"template", TTemplate>) & Record<"matchStrategy", TStrategy> & RegExpExecArray & Record<"input", TValue>>; /*** * **RegexArray**`` * * When you call `exec()` on a regular expression you get a `RegExpExecArray` type * in return. Unfortunately this has no type information but this type tries to solve this. * * - When a successful match is made, the matched expression will be returned in it's entirety * as the first element (aka, index 0) * - the remaining array elements are the matches found within the parenthesis */ type RegexArray< /** the template in a RegExp-like format for human readability */TTemplate extends string, TValue extends string> = _RegexArray, TTemplate extends `.*(${string}` ? "subset" : "exact", TValue> extends infer R ? IsStringLiteral$1 extends true ? TValue extends StringLiteralTemplate> ? R : Err<"no-match"> : R : never; //#endregion //#region src/regex/RegexHandlingStrategy.d.ts /** * **RegexHandlingStrategy** * * Indicating whether the string value representing a `RegExp` should be matched * literally/exactly or whether it should be measured as a _substring_ of some larger * whole. */ type RegexHandlingStrategy = "exact" | "subset"; //#endregion //#region src/regex/RegularExpression.d.ts type RegexToTemplate = AsFromTo<{ "(.+?)": `${string}`; "(\\d+)": `${number}`; "(true|false)": `${boolean}`; }>; type AsTemplateString = T extends `^${infer Inner}$` ? ReplaceAllFromTo : T extends `.*(${infer Inner}).*` ? `${string}${ReplaceAllFromTo}${string}` : never; /** * A typed version of `RegExpExecArray` */ type RegexExecFn = (test: T) => RegexArray; /** * Provides strong typing to the **RegExp**'s `test()` function. * * - knows whether outcome is `true` or `false` if input string is a string literal * - if the input string is wide then result is always just a boolean value */ type RegexTestFn = string extends TInput ? boolean : TInput extends AsTemplateString ? true : false; /** * **RegularExpression**`` * * A `RegExp` created by a runtime utility which adds a `pattern` property * expressing the pattern used for the regular expression in a string literal form. */ type RegularExpression = Omit & { kind: "RegexpArray"; test: (test: T) => RegexTestFn; exec: RegexExecFn; pattern: TLitTemplate; }; //#endregion //#region src/sets/AddIfUnique.d.ts type Merge$1, readonly (PropertyKey & keyof B)[]>> = K extends [infer Head extends PropertyKey & keyof B, ...infer Rest extends readonly (PropertyKey & keyof B)[]] ? Head extends keyof A ? Merge$1 & Record, B, Rest> : Merge$1, B, Rest> : ExpandDictionary; /** * **AddIfUnique**`` * * Adds `TItem` to the end of `TList` if it's type does not * already exist in `TList`. * * - if `TOffset` is used -- _by default it is not_ -- then the * uniqueness comparison will be done on a property offset of * both the `TItem` and the `TList` items. * - when the offset type of `TItem` is found in `TList` then * no new items will be added to `TList` but the matched item * in `TList` will be updated to be a union with `TItem` */ type AddIfUnique = IsNull extends true ? Contains extends true ? TList : [...TList, TItem] : TOffset extends keyof TItem ? Contains, TItem[TOffset]> extends true ? { [K in keyof TList]: TOffset extends keyof TList[K] ? TList[K][TOffset] extends TItem[TOffset] ? Merge$1, As$1> : TList[K] : TList[K] } : [...TList, TItem] : TList; //#endregion //#region src/sets/DefineModifiers.d.ts /** * **DefineModifiers**`` * * Take a tuple of string literals and converts this into a "modifier" where * any of the defined modifiers can be expressed singularly as a string or as * part of a tuple array of modifiers. */ type DefineModifiers = null | T[number] | readonly (T[number])[]; //#endregion //#region src/sets/HasModifier.d.ts /** * **HasModifier**`` * * Tests whether `T` is defined in the modifiers set `TConfig`. * * - you can optionally include the full modifiers definition to get * type validation for `TTest`. */ type HasModifier[number], TConfig extends readonly string[] | string | null, TDefn extends readonly string[] | string | null = TConfig> = string extends TTest ? boolean : string extends TConfig ? boolean : IsNull extends true ? false : Contains, readonly string[]>, TTest>; //#endregion //#region src/sets/IntersectingKeys.d.ts /** * Efficiently filters tuples by removing never values using direct tail recursion */ type InTuple = A extends readonly [infer Head, ...infer Tail] ? Contains extends true ? InTuple : InTuple : Result; /** * **IntersectingKeys**`` * * Provides a tuple of keys which are shared between the two * containers passed in `A` and `B`. * * - will usable in both arrays and objects, it's more common to * use this with objects. * * **Related:** `Intersection` */ type IntersectingKeys = IsSameContainerType extends true ? A extends readonly unknown[] ? InTuple, NumericKeys>> : A extends Dictionary ? InTuple, readonly ObjectKey[]>, As$1, readonly ObjectKey[]>> : never : Err<`invalid-comparison/keys`, `The IntersectingKeys utility works when both A and B are the same type of container but that was not the case!`, { a: A; b: B; }>; //#endregion //#region src/sets/Intersection.d.ts /** compare objects with offset property */ type CompareWithOffset = A extends [infer AType, ...infer Rest] ? GetEach extends infer _BOffset extends readonly unknown[] ? O extends keyof AType ? Find$1 extends infer Found extends Dictionary ? CompareWithOffset>]> : CompareWithOffset : CompareWithOffset : never : ExpandDictionary; /** Improved detection for wide container values */ type DetectValues = A extends (infer AT)[] ? B extends (infer BT)[] ? IsLiteralLike extends true ? Each, "isLiteral"> extends true ? UnionFrom[] : A[number][] : IsLiteralLike extends true ? Each, "isLiteral"> extends true ? UnionFrom[] : B[number][] : If, [], (AT & BT)[]> : unknown[] : unknown[]; type CompareArrayValues = AValues extends readonly [infer AHead, ...infer ATail] ? ExistsInArrayExact extends true ? Contains extends true ? CompareArrayValues : CompareArrayValues : CompareArrayValues : Result; type CompareObjectValues = AValues extends readonly [infer AHead, ...infer ATail] ? ExistsInArrayExact extends true ? Contains extends true ? CompareObjectValues : CompareObjectValues : CompareObjectValues : Result; type ExistsInArrayExact = B extends readonly [infer BHead, ...infer BTail] ? IsEqual extends true ? true : ExistsInArrayExact : false; type Process$3 = IsSameContainerType extends true ? IsWideContainer extends true ? IsWideContainer extends true ? IsDictionary extends true ? IsDictionary extends true ? DetectValues, Values> : never : DetectValues, Values> : B extends readonly unknown[] ? UnionFrom[] : never : IsWideContainer extends true ? A extends readonly unknown[] ? UnionFrom[] : never : A extends readonly unknown[] ? B extends readonly unknown[] ? O extends null ? CompareArrayValues : CompareWithOffset> : never : CompareObjectValues, Values> : Err<`invalid-comparison/keys`, `The Intersection utility works when both A and B are the same type of container but that was not the case!`, { a: A; b: B; }>; /** * **Intersection**`` * * Compares the _values_ in `A` and `B` and returns the set of values found in both. * * - the `O` generic allows you to add an _offset_ which will be used on each element in the values * - when an offset is used the result will be an array of that properties value when both * `A` and `B` contain that value. * - this utility _can_ be used on both tuples/arrays and dictionaries but has more utility when * used with tuples/arrays. If you're considering using this with an object consider whether * `IntersectingKeys` might be a better option. * * #### Union Handling * - if both `A` and `B` are union types then the union type itself must be the same * - if one of `A` or `B` is a union type then the intersection type is the type of the * non-union member made to be _optional_ */ type Intersection = Process$3; //#endregion //#region src/sets/Keys.d.ts /** * **Keys**`` * * Provides the _explicit keys_ of a container `TContainer` as an array of values. * * - if the container is wide then the keys will be a wide array type * - if the container is a narrow type then a tuple of literal keys will be returned * * ```ts * type Obj = { foo: 1, bar: 2, [key: string]: unknown }; * type Arr = [1,2,3]; * // readonly ["foo", "bar"] * type K1 = Keys; * // readonly [0,1,2] * type K2 = Keys; * // number[] * type Arr = Keys; * // string[] * type Obj = Record; * ``` * * **Related:** `ValidKey`, `PublicKeys`, `PrivateKeys` */ type Keys$1 = As$1 : ObjectKeys, readonly (PropertyKey | (PropertyKey | undefined))[]>; /** * **WithTemplateKeys**`` * * Produces a tuple of keys where there a combination of * literal keys and then one or more _template_ keys */ type WithTemplateKeys<_TLiteral extends readonly unknown[], _TTemplate extends readonly string[]> = true; type _Public = [] extends TInput ? TOutput : _Public, First$1 extends `_${string}` ? TOutput : [...TOutput, First$1]>; /** * **PublicKeys**`` * * Provides a tuple of _keys_ for `TContainer` but unlike `Keys` it removes any * keys which start with an underscore character. */ type PublicKeys = Keys$1 extends readonly PropertyKey[] ? _Public> : never; /** * **PrivateKey** * * A `PrivateKey` is an object key that is preceded with a `_` character to indicate * that it is a _private_ property. */ type PrivateKey = `_${string}`; /** * **PrivateKeys**`` * * Keys on an object which have a `_` character as first part of the * name are considered private and this utility will create a union * of all the keys in this category. * * **Related:** `PublicKeys`, `Keys`, `PrivateKeyOf` */ type PrivateKeys = { [K in keyof T]: K extends `_${string}` ? K : never }[keyof T]; type _KeyOf = TupleToUnion> extends PropertyKey ? TupleToUnion> extends keyof TContainer ? TupleToUnion> : never : never; /** * **KeyOf**`` * * Provides a **union type** of keys for the passed in container. * * **Related:** `Keys`,`PublicKeys`,`PublicKeyOf` */ type KeyOf = IsWideUnion<_KeyOf> extends true ? "" : As$1<_KeyOf, string | symbol>; /** * **PublicKeyOf**`` * * Provides a **union type** of _public_ keys (aka, keys not starting with * underscore character) for the passed in container. * * **Related:** `Keys`,`PublicKeys`,`KeyOf` */ type PublicKeyOf = TupleToUnion> extends PropertyKey ? TupleToUnion> extends keyof TContainer ? TupleToUnion> : never : never; /** * **PrivateKeyOf**`` * * Provides a **union type** of _private_ keys (aka, keys starting with * underscore character) for the passed in container. * * **Related:** `Keys`,`PrivateKeys`,`KeyOf` */ type PrivateKeyOf = TupleToUnion> extends PropertyKey ? TupleToUnion> extends keyof TContainer ? TupleToUnion> : never : never; //#endregion //#region src/sets/SetCandidate.d.ts /** * **SetCandidate** * * A _set candidate_ is the base type for a type which can be converted * into a "set" (and have set operations applied). */ type SetCandidate = readonly unknown[] | Narrowable; //#endregion //#region src/sets/Unique.d.ts type Get$1 = IfNever; type Process$2 = [] extends TValues ? TResults : Process$2, TDeref, Push, IsScalar> extends true ? Not>> : Not extends true ? TResults : GetEach>, string | number | readonly unknown[]>, Get$1, TDeref>>>>>; /** * **Unique**`` * * Given a tuple of values, this utility will reduce the tuple to * _unique_ values in the set. * * - If the values are containers themselves, you can provide a `TDeref` * to point to a property which represents the "identity" of that container * - If you're comparing containers _without_ a `TDeref` property * then the full type signature will be used in deduplication * * ```ts * // ["foo", "bar"] * type FooBar = Unique<["foo","foo","bar"]>; * ``` */ type Unique = IfNever>, Process$2>; //#endregion //#region src/sets/UniqueKeys.d.ts /** * **UniqueKeys**`` * * Provides a **LeftRight** tuple which articulates the * _unique_ keys to each container's keys. * * The keys for each sides unique values are represented * a tuple of values. * * ```ts * type Foo = { foo: 1; bar: 2 }; * type Baz = { bar: 5; baz: 42, extra: "why not?" }; * // LeftRight<["foo"], ["baz", "extra"]> * type U = UniqueKeys; * ``` * - the example above with an _object_ container is the primary use case * but it can be used with array's too but please note it is primarily used * in this case to identify how the "longer" array has additional keys: * ```ts * type Short = [1,2]; // length 2 * type Long = [3,4,5,6,7,8,9,10]; // length 8 * // LeftRight<[], [2,3,4,5,6,7]> * type U = UniqueKeys; * ``` * * **Related:** `UniqueKeysUnion` */ type UniqueKeys = LeftRight>>, AsNumberWhenPossible>>>; //#endregion //#region src/sets/UniqueKeysUnion.d.ts /** * **UniqueKeysUnion**`` * * Provides a **LeftRight** tuple which articulates the * _unique_ keys to each container's keys. * * The keys for each sides unique values are represented * as a union type. * * ```ts * type Foo = { foo: 1; bar: 2 }; * type Baz = { bar: 5; baz: 42, extra: "why not?" }; * // [ "foo", "baz" | "extra" ] * type U = UniqueKeys; * ``` * * **Related:** `UniqueKeys` */ type UniqueKeysUnion = LeftRight, Exclude>; //#endregion //#region src/sets/UniqueKv.d.ts /** * **UniqueKv**`` * * Returns a `LeftRight` tuple containing the unique KV pairs found in `L` and `R`. Both `L` and `R` are expect to be an * object type of some sort. * * - this means that if _both_ `L` and `R` have a shared property but the values * are different then they are considered "unique" for each list. * * **Related:** `Unique`, `UniqueKeys` */ type UniqueKv = LeftRight, Exclude>; //#endregion //#region src/take/AsTakeState.d.ts /** * **AsTakeState**`` * * Ensures that if `T` is a _string_ that it's converted to an appropriate * `TakeState`. */ type AsTakeState = As$1; //#endregion //#region src/take/DropParser.d.ts /** * **DropRulePolicy** * * Determines how the matches to `enter` and `exit` tokens are included in * the **kept** or **dropped** properties: * * - `inclusive` - means that the `enter` and `exit` tokens * will be added to the **kept** property. * - `exclusive` - means the `enter` and `exit` tokens will * will be added to the dropped segments * - `drop-enter` - the `enter` tokens will be dropped * but the `exit` tokens will still be added to the **kept** * property * - `drop-exit` - the `exit` tokens will be dropped but the * `enter` tokens will still be added to the **kept** property */ type DropRulePolicy = "inclusive" | "exclusive" | "drop-enter" | "drop-exit"; /** * A user configurable rule to use with the `dropParser()` utility. * * **Related:** `FinalizedDropRule` */ interface DropRule { /** * the sub-strings which will push the parser _into_ * the "drop" state. */ enter: string | string[]; /** * the sub-strings which will push the parser _into_ * the "keep" state. */ exit: string | string[]; /** * You may optionally choose to state the _matching policy_: * * - `inclusive` - means that the `enter` and `exit` tokens * will be added to the **kept** property. * - `exclusive` - means the `enter` and `exit` tokens will * will be added to the **dropped** segments * - `drop-enter` - the `enter` tokens will be dropped * but the `exit` tokens will still be added to the **kept** * property * - `drop-exit` - the `exit` tokens will be dropped but the * `enter` tokens will still be added to the **kept** property * * By default the **policy** is set to `inclusive`. * * @default "inclusive" */ policy?: DropRulePolicy; } interface DropResult { kind: "drop-result"; kept: string; dropped: string[]; toString: () => string; } /** * looks through rules to find a match and if * there are more than one `enter` or `exit` token(s) * provided in the match, use the _longest_ one as the * "extractor" * * - returns `{ extract: string, rule: Rule }` when found * - otherwise `false` */ type FindLongestMatch = TRules extends [infer Head extends FinalizedDropRule, ...infer Rest extends readonly FinalizedDropRule[]] ? LongestToStartWith extends infer Found extends string ? { extract: Found; rule: Head; } : FindLongestMatch : false; interface Match$1 { /** the extracted string representing a **enter** or **exit** token */ extract: string; /** * if the new state is "drop" then store the entry `Rule` used */ newState: "keep" | FinalizedDropRule; policy: DropRulePolicy; } /** * Looks for a rule that might match the _beginning_ of the * parse string. * * - when a match is found, returns a tuple of: * - `{ newState, extract, policy }` * - the `newState` is either: * - when moving _into_ a **drop** state the matched `DropRule` * - when moving _into_ a **keep** state the string "keep" */ type MatchRule = TState extends "keep" ? FindLongestMatch extends { extract: infer Extract extends string; rule: infer RuleDefn extends FinalizedDropRule; } ? As$1<{ extract: Extract; newState: RuleDefn; policy: RuleDefn["policy"]; }, Match$1> : false : TState extends { policy: infer Policy extends DropRulePolicy; enter: infer _Enter extends string[]; exit: infer Exit extends string[]; } ? StartsWith extends true ? As$1<{ extract: As$1, string>; newState: "keep"; policy: Policy; }, Match$1> : false : never; /** * prevents a trailing empty space in the * "dropped" property. */ type RemoveEmptyDrop = T extends [...infer LeadIn extends readonly string[], infer Last extends string] ? Last extends "" ? LeadIn : T : T; type IsMovingToKeepState = T extends "keep" ? true : false; /** * enforces the policy set for updating the `kept` property */ type PolicyHandlerForKept = TPolicy extends "inclusive" ? IsMovingToKeepState extends true ? `${TKept}${TExtracted}` : `${TKept}${TExtracted}` : TPolicy extends "exclusive" ? IsMovingToKeepState extends true ? TKept : TKept : TPolicy extends "drop-enter" ? IsMovingToKeepState extends true ? `${TKept}${TExtracted}` : TKept : TPolicy extends "drop-exit" ? IsMovingToKeepState extends true ? TKept : `${TKept}${TExtracted}` : never; /** * enforces the policy set for updating the `dropped` property */ type PolicyHandlerForDropped = TPolicy extends "inclusive" ? IsMovingToKeepState extends true ? [...TDropped, ""] : TDropped : TPolicy extends "exclusive" ? IsMovingToKeepState extends true ? [...AppendToLast, ""] : [...TDropped, TExtracted] : TPolicy extends "drop-enter" ? IsMovingToKeepState extends true ? [...TDropped, ""] : [...TDropped, TExtracted] : TPolicy extends "drop-exit" ? IsMovingToKeepState extends true ? [...AppendToLast, ""] : TDropped : never; /** * **AsDropResult**`` * * A type utility which results the runtime's eventual parsing work. * The resultant type will will be a `DropResult` type which exposes: * * - the `kept` property is a string literal representing what * of the original content was "kept". * - the `dropped` property is an array of string literals representing * the parts/sub-strings which were removed. * - due to the inclusion of a `toString()` method, the returned `DropResult` * object can be easily be serialized into the `kept` property which is * typically what people want to extract. */ type AsDropResult = string extends TContent ? DropResult : MatchRule extends { newState: infer NewState extends "keep" | FinalizedDropRule; extract: infer Extracted extends string; policy: infer Policy extends DropRulePolicy; } ? AsDropResult, TRules, NewState, PolicyHandlerForKept, PolicyHandlerForDropped> : TContent extends `${infer Head extends string}${infer Rest}` ? TState extends "keep" ? AsDropResult : AsDropResult> : As$1<{ kind: "drop-result"; kept: TKept; dropped: RemoveEmptyDrop; toString: () => TKept; }, DropResult>; /** * A finalized `DropRule` */ interface FinalizedDropRule { /** enter tokens */ enter: string[]; /** exit tokens */ exit: string[]; /** token policy */ policy: DropRulePolicy; } /** KV component of `DropParser` */ interface DropParserKv { kind: "drop-parser"; rules: T; kept: string; dropped: string[]; } /** function component of `DropParser` */ type DropParserFn = (content: U) => AsDropResult; /** * **DropParser**`` * * A configured drop parser ready for content to be parsed. */ type DropParser = DropParserKv & DropParserFn; //#endregion //#region src/take/TakeParser.d.ts /** * **TakeParser** * * A parser function that is provided a `Take` state and must convert that into: * * 1. When able to parse the head of the parse string successfully: `[ taken: string, parsed: [State["parsed"], T] ]` * 2. When parser is not able to parse the head of the string: `[ taken: "", parsed: State["parsed"] ]` * 3. If parser engages to parse the head of the parse string but see's a structural problem with the input, * a tuple of the type `[ null, Error ]` should be returned. */ type TakeParser = (parse: T) => [taken: string, parsed: readonly unknown[]] | [null, Error]; //#endregion //#region src/take/TakeStart.d.ts type GetMatch = TMatch extends [infer Head extends string, ...infer Rest extends readonly string[]] ? StartsWith extends true ? Head : GetMatch : null; /** * **TakeStartCallback** * * A callback which receives the _matched value_ and the current state (as a `TakeState` object) * and must return an updated `TakeState` or */ type TakeStartCallback = (match: TMatch, state: TState) => TakeState | Err<"skip"> | Err<"no-token"> | Err<"invalid-token">; type TakeStartMatches__Callback = readonly [TakeStartCallback, string, ...readonly string[]]; type TakeStartMatches__Mapper = readonly [Dictionary]; type TakeStartMatches__Default = readonly [string, ...readonly string[]]; type TakeStartMatchesKind = "callback" | "mapper" | "default"; type TakeStartMatches = IsUnion extends true ? TakeStartMatches__Callback | TakeStartMatches__Mapper | TakeStartMatches__Default : T extends "callback" ? TakeStartMatches__Callback : T extends "mapper" ? TakeStartMatches__Mapper : T extends "default" ? TakeStartMatches__Default : never; /** * get the list of string literals which we are trying to match on */ type GetMatches = T extends TakeStartMatches<"callback"> ? Slice : T extends TakeStartMatches<"mapper"> ? StringKeys : T extends TakeStartMatches<"default"> ? T : never; /** * get's a lookup dictionary for when a "mapper" style is being used */ type GetLookup = T extends TakeStartMatches<"mapper"> ? T[0] : EmptyObject; /** * get's a callback function */ type GetCallback = T extends TakeStartMatches<"callback"> ? T[0] extends infer Callback extends TakeStartCallback ? Callback : Err<"invalid-callback", `The callback provided to the takeStart() utility was invalid. It must extend the type TakeStartCallback!`, { callback: T[0]; }> : (val: string, state: S) => S; type GetVariant = T extends TakeStartMatches<"callback"> ? "callback" : T extends TakeStartMatches<"mapper"> ? "mapper" : T extends TakeStartMatches<"default"> ? "default" : "invalid"; type GetToken = GetMatches extends infer Matches extends readonly string[] ? GetMatch extends infer Match extends string ? M extends TakeStartMatches<"callback"> ? FnReturn> extends TakeState ? FnReturn>["tokens"] : "shit" : M extends TakeStartMatches<"mapper"> ? GetLookup extends infer Lookup extends Dictionary ? Lookup[Match] extends [unknown, infer IT extends InputToken] ? FromInputToken extends Error ? Err<"invalid-token", `a takeStart() based function which used a token mapper had a problem with the key '${Match}'. When a user maps to a tuple, the second parameter is an InputToken but in this case the input token could not be parsed!`, { mapper: Lookup; }> : ["result", FromInputToken] : Lookup[Match] : never : M extends TakeStartMatches<"default"> ? Match : Err<"invalid-token/bad-match-type"> : Err<"no-match", `The variant type for the match types could not be matched to 'default', 'mapper', or 'callback'!`, { config: M; content: T; matches: Matches; }> : Err<`invalid-config`, `The match configuration used in the takeStart() utility is not valid!`, { config: M; }>; /** * **TakeStartFn**`(value) => TakeState | Error` * * A partial application of the `takeStart()` utility. * * - the match configuration is complete, * - ready for passing in values to start parsing */ type TakeStartFn = ((value: U) => TakeStart) & { variant: GetVariant; matches: GetMatches; }; /** * **TakeStart**`` * * Attempts to find any of the string literals in `TMatch` at the head of the * parse string. */ type TakeStart = As$1 extends infer State extends TakeState ? GetMatches extends infer Matches extends readonly string[] ? StartsWith extends true ? GetMatch extends infer Match extends Matches[number] ? GetToken extends Error ? GetToken : { kind: "TakeState"; parsed: [...State["parsed"], Match]; parseString: StripLeading; tokens: [...State["tokens"], GetToken]; } : State : never : never : never, TakeState | Error>; //#endregion //#region src/take/TakeState.d.ts interface TakeState { kind: "TakeState"; /** the segments of the parse string that were previously parsed */ parsed: string[]; /** the remaining _parse string_ after the **take** function parsed a section of it */ parseString: string; /** the tokens which have been parsed from the string so far */ tokens: T[]; } //#endregion //#region src/take/UpdateTake.d.ts /** * **UpdateTake**`` * * Updates an existing **TakeState** `TState` by: * * - the `TParsed` generic must always be a _string_ and will represent the "parsed" value * as well as the substring which will be removed from the `parseString` property * - the `TToken` generic -- when set -- will be what is added to the `tokens` property * - when `TToken` is not set it's value is set to `TToken` */ type UpdateTake = As$1<{ kind: "TakeState"; parsed: [...TState["parsed"], TParsed]; parseString: StripLeading; tokens: [...TState["tokens"], TToken]; }, TakeState>; //#endregion //#region src/unions/CapitalizeEachUnionMember.d.ts type Process$1 = [] extends T ? R[number] : Process$1, [...R, First$1 extends string ? Capitalize> : First$1]>; /** * **CapitalizeEachUnionMember**`` * * Capitalizes all string-derived union members in a union. */ type CapitalizeEachUnionMember = IsUnion extends true ? Process$1> : T extends string ? Capitalize : T; //#endregion //#region src/unions/OneOf.d.ts type MergeTypes = TTypes extends [infer Head, ...infer Rest] ? MergeTypes : TResult; type OnlyFirst = T & { [K in keyof Omit]?: never }; type _OneOf, TResult = never> = T extends [infer Head, ...infer Rest] ? _OneOf> : TResult; /** * **OneOf**`` * * Creates an _exclusive_ union between types of `T`. */ type OneOf = _OneOf; //#endregion //#region src/unions/Success.d.ts /** * **Sucess**`` * * Removes an Error from `T` where an error is part of the union * type of `T`; otherwise has no impact on the type. */ type Success$1 = Exclude; //#endregion //#region src/unions/UnionFilter.d.ts type RemoveEmptyObject = [] extends T ? RemoveNever[number] : RemoveEmptyObject, [...R, First$1 extends Dictionary ? Equals>["length"], number> extends true ? never : First$1 : First$1]>; /** * **UnionFilter**`` * * A type utility which receives a union type `U` and then eliminates * all elements of the union which _extend_ `E`. * * **Note:** _this is very much like `Exclude` utility but can handle * unions of containers as well as just scalar values._ * * **Related:** `UnionRetain` */ type UnionFilter = [U] extends [never] ? never : IsUnion extends true ? Some, "extends", EmptyObject> extends true ? Exclude>, RemoveEmptyObject>> : Exclude : U; //#endregion //#region src/unions/UnionFrom.d.ts /** * **UnionFrom**`` * * Creates a union type from the potential _values_ of a container. * * - you may optionally specify the `U` generic which represents the * "offset" to use. * - In cases where it set it will expect the root container's _values_ to be containers * themselves and the union will _offset_ by the index provided in `O`. */ type UnionFrom = T extends readonly unknown[] ? IsNull extends true ? T[number] : GetEach extends readonly unknown[] ? GetEach[number] : never : IsDictionary extends true ? IsNull extends true ? Values extends readonly unknown[] ? Values[number] : never : Err<`invalid-offset`, `The UnionFrom received an 'offset' value in the U generic. This feature is intended for tuples not objects!`, { container: T; offset: U; }> : never; //#endregion //#region src/unions/UnionMutate.d.ts type UnionMutationOp = "Capitalize" | "Lowercase" | "Uppercase" | "CamelCase" | "PascalCase" | "SnakeCase" | "KebabCase" | "Required"; type Mutate = TOp extends "Capitalize" ? { [K in keyof TElements]: TElements[K] extends string ? Capitalize : TElements[K] } : TOp extends "Uppercase" ? { [K in keyof TElements]: TElements[K] extends string ? Uppercase : TElements[K] } : TOp extends "Lowercase" ? { [K in keyof TElements]: TElements[K] extends string ? Lowercase : TElements[K] } : TOp extends "CamelCase" ? { [K in keyof TElements]: TElements[K] extends string ? CamelCase : TElements[K] } : TOp extends "PascalCase" ? { [K in keyof TElements]: TElements[K] extends string ? PascalCase : TElements[K] } : TOp extends "KebabCase" ? { [K in keyof TElements]: TElements[K] extends string ? KebabCase : TElements[K] } : TOp extends "SnakeCase" ? { [K in keyof TElements]: TElements[K] extends string ? SnakeCase : TElements[K] } : TOp extends "Required" ? NotFilter extends readonly unknown[] ? NotFilter : never : never; /** * **UnionMutate**`` * * Mutates `T` if it is a union, if it is not a union it passed through as is. * * Mutation operations include: * * - Capitalize, Lowercase * - CamelCase, PascalCase, KebabCase, SnakeCase * - Required (removed `undefined` in a union) */ type UnionMutate = [T] extends [never] ? never : IsUnion extends true ? Mutate, Op>[number] : T; //#endregion //#region src/validation/ValidateCharacterSet.d.ts type Test$2 = T extends `${infer Head extends string}${infer Rest}` ? Head extends U ? Test$2 : false : true; /** * **ValidateCharacterSet**`` * * Validates that `TContent` only has the characters found in `TCharset`: * * - if valid, `TContent` is proxied through "as is" * - if invalid, `E` is returned (which defaults to an error type of * "invalid-character" */ type ValidateCharacterSet> = string extends TContent ? TContent | E : string extends TCharset ? boolean : IsEqual extends true ? boolean : Test$2 extends true ? TContent : E extends Err<"invalid-character"> ? StripChars extends infer InvalidChars extends string ? Err<"invalid-character", `The content passed into ValidateCharacterSet had ${Length} character(s) which did not fit into the target character set!`, { invalid: Unique>; content: TContent; }> : never : E; //#endregion //#region src/validation/ValidateLength.d.ts type ValidateLengthOptions = { min: number; } | { max: number; } | { min: number; max: number; }; type ValidateMin = "min" extends keyof O ? O["min"] extends infer Min extends number ? IsGreaterThanOrEqual : never : true; type ValidateMax = "max" extends keyof O ? O["max"] extends infer Max extends number ? IsLessThanOrEqual : never : true; type NotMatched; max: IndexOf; }> = ValidateMin, O> extends false ? Err<`invalid-length/min`, T extends string ? `The string '${T}' is required to have a minimum of ${Opt["min"]} characters but had a length of ${Length}!` : T extends number ? `The number '${T}' is required to have a minimum of ${Opt["min"]} numeric digits (negative sign and decimal place marker are not counted) but had a length of ${Length}!` : T extends readonly unknown[] ? `The array '${ToStringLiteral__Array}' is required to have a minimum of ${Opt["min"]} elements but had a length of ${Length}!` : never, { content: T; options: Opt; length: Length; min: Opt["min"]; }> : ValidateMax, O> extends false ? Err<`invalid-length/max`, T extends string ? `The string '${T}' is required to have a maximum of ${Opt["max"]} characters but had a length of ${Length}!` : T extends number ? `The number '${T}' is required to have a maximum of ${Opt["max"]} numeric digits (negative sign and decimal place marker are not counted) but had a length of ${Length}!` : T extends readonly unknown[] ? `The array '${ToStringLiteral__Array}' is required to have a maximum of ${Opt["max"]} elements but had a length of ${Length}!` : never, { content: T; options: Opt; length: Length; max: Opt["max"]; }> : never; type Test$1 = [ValidateMin] extends [true] ? [ValidateMax] extends [true] ? T : NotMatched : NotMatched; /** * **ValidateLength**`` * * Tests whether the content in `T` has a length that matches the * constraints of `O`. The `O` generic: * * - provides a `min` property to set a minimum length * - provides a `max` property to set a maximum length * * If `T` does not match the constraints imposed by `O` then * a `Err` error will be returned. * * **Note:** the length of a number passed in refers to the number of * _numeric digits_. This means that characters like `-` or `.` which * might be present in a negative or floating point number are NOT counted. * * ```ts * // "foobar" * type Foobar = ValidateLength<"foobar", { max: 10 }>; * // Err<"invalid-type/max"> * type NotFoobar = Validate<"foobar", { min: 3; max: 4 }>; * ``` */ type ValidateLength = T extends readonly unknown[] ? [IsWideArray] extends [true] ? T | Err<`invalid-length/${"min" | "max"}`> : Test$1 : T extends string ? string extends T ? T | Err<`invalid-length/${"min" | "max"}`> : Test$1, O> : T extends number ? ValidateLength<`${T}`, O> extends `${number}` ? AsNumber> : ValidateLength<`${T}`, O> : never; //#endregion //#endregion export { ACCELERATION_METRICS_LOOKUP, ALPHA_CHARS, AMAZON_BOOKS, AMAZON_DNS, APPLE_DNS, AREA_METRICS_LOOKUP, AUSTRALIAN_NEWS, Abs, AbsMaybe, Acceleration, AccelerationMetrics, AccelerationUom, Add, AddIfUnique, AddKeyValue, AddPositive, AddUrlPathSegment, AfterFirst, AfterFirstChar, AfterLast, AllCaps, AllExtend, AllLengthOf, AllLiteral, AllNumericLiterals, AllOptionalElements, AllStringLiterals, AlphaChar, AlphanumericChar, AmazonUrl, AmericanExpress, And, AnyArray, AnyFunction, AnyMap, AnyObject, AnyQueryParams, AnySet, AnyWeakMap, Api, ApiCallback, ApiConfig, ApiEscape, ApiHandler, ApiOptions, ApiReturn, ApiState, ApiStateInitializer, ApiSurface, Append, AppendRight, AppendToLast, AppleUrl, ApplyCssHexShorthand, ApplyTemplate, AreIncompatible, AreSameLength, AreSameType, Area, AreaMetrics, AreaUom, ArgUnion, AriaDocStructureRoles, AriaLandmarkRoles, AriaLiveRegionRoles, AriaRole, AriaWidgetRoles, AriaWindowRoles, ArrayElementType, ArrayTo, ArrayToString, ArrayTypeDefn, As$1 as As, AsApi, AsArray, AsBoolean, AsChoice, AsClassSelector, AsContainer, AsDateMeta, AsDefined, AsDictionary, AsDoneFn, AsDropResult, AsEscapeFunction, AsFinalizedConfig, AsFnMeta, AsFourDigitYear, AsFromTo, AsFunction, AsHtmlComponentTag, AsHtmlTag, AsIndexOf, AsInputToken, AsLeft, AsLeftRight, AsLiteralTemplate, AsNarrowingFn, AsNegativeNumber, AsNestingApi, AsNestingConfig, AsNonNull, AsNumber, AsNumberWhenPossible, AsNumericArray, AsObject, AsObjectKey, AsObjectKeys, AsOptionalParamFn, AsOutputToken, AsPropertyKey, AsRecord, AsRef, AsRelativeDate, AsRgbObject, AsRgbTuple, AsRgbaObject, AsRight, AsSimpleType, AsSomething, AsStaticFn, AsStaticTemplate, AsString, AsStringUnion, AsTakeState, AsTemplateType, AsTemplateTypes, AsTuple, AsTwoDigitMonth, AsTypeSubtype, AsUnion, AsUnionOptions, AsUnionToken, AsVueComputedRef, AssertAssertionError, AssertContains, AssertEqual, AssertEquals, AssertError, AssertExtends, AssertFalse, AssertNotEqual, AssertSameValues, AssertTrue, AssertValidation, AssertionError, AssertionMapper, AssertionOp, AsyncFunction, Asynchronous, AustralianNewsCompanies, AustralianNewsUrls, AvailableConverters, Awaited$1 as Awaited, BACKSPACE, BCP47, BEL, BELGIUM_NEWS, BEST_BUY_DNS, BLOOD_MARKERS_LOOKUP, BRACKET_AND_QUOTE_NESTING, BRACKET_NESTING, BackTick, BareCssSelector, BaseType, BaseTypeToken, BeforeLast, BelgianNewsCompanies, BelgianNewsUrls, BespokeLiteral, BespokeUnion, BestBuyUrl, BetweenScope, BooleanLike, BooleanSort, BooleanSortOptions, Box, Bracket, BracketAndQuoteNesting, BracketNesting, Brand, BrandSymbol, Break$1 as Break, BuildDefinition, CANADIAN_NEWS, CARRIAGE_RETURN, CHEWY_DNS, CHINESE_NEWS, COMMA, COMMON_OBJ_PROPS, COMPARISON_OPERATIONS, CONSONANTS, CONTINENTS, COSTCO_DNS, CSS_COLOR_LOOKUP, CSS_NAMED_COLORS, CSV, CURRENCY_LOOKUP, CURRENT_METRICS_LOOKUP, CVS_DNS, Callback, CamelCase, CamelKeys, CanadianNewsCompanies, CanadianNewsUrls, CapFirstAlpha, CapitalizeEachUnionMember, CapitalizeWords, Cardinality, Cardinality0, Cardinality1, CardinalityExplicit, CardinalityFilter0, CardinalityFilter1, CardinalityIn, CardinalityInput, CardinalityNode, CardinalityOut, CargoDependency, CargoToml, Char$1 as Char, CharCount, Chars, ChewyUrl, ChineseNewsCompanies, ChineseNewsUrls, Choice, ChoiceApi, ChoiceApiConfig, ChoiceApiOptions, ChoiceBuilder, ChoiceCallback, ChoiceValue, ClosingBracket, ClosingMark, ClosingMarkPlus, CodePointOf, ColorFnOptOpacity, ColorFnValue, ColorParam, CombinedKeys, CommonHtmlElement, CommonObjProps, Comparator, Compare, CompareNumbers, ComparisonAccept, ComparisonDesc, ComparisonFn, ComparisonLookup, ComparisonMode, ComparisonOpConfig, ComparisonOperation, ComparisonParamConvert, ComparisonParamConvert__List, ComparisonParamConvert__Unit, Concat, ConfigDefinition, ConfiguredMap, Consonant, Consonants, Constant, ConstrainObject, ConstrainedObjectCallback, ConstrainedObjectIdentity, Constructor, Container, ContainerBlockKey, ContainerKeyGuarantee, Contains, ContainsAll, ContainsSome, Continent, Conversion, ConvertTypeOf, ConvertWideTokenNames, ConverterCoverage, ConverterDefn, CostCoUrl, CostcoUrl, Count$1 as Count, CountryPhoneNumber, Cr, CrThenIndent, CreateChoice, CreateKV, CreateLookup, CreditCard, CssAbsolutionPositioningProperties, CssAlignContent, CssAlignItems, CssAlignProperties, CssAlignSelf, CssAnimation, CssAnimationComposition, CssAnimationDelay, CssAnimationDirection, CssAnimationDuration, CssAnimationFillMode, CssAnimationIterationCount, CssAnimationPlayState, CssAnimationProperties, CssAnimationTimingFunction, CssAppearance, CssAspectRatio, CssBackdropFilter, CssBackgroundProperties, CssBorderCollapse, CssBorderImageRepeat, CssBorderImageSource, CssBorderInlineSizing, CssBorderProperties, CssBorderStyle, CssBorderWidth, CssBoxAlign, CssBoxDecorationBreak, CssBoxProperties, CssBoxShadow, CssBoxSizing, CssBreak, CssBreakInside, CssBreakProperties, CssCalc, CssClamp, CssClassSelector, CssColor, CssColorFn, CssColorLight, CssColorMix, CssColorMixLight, CssColorModel, CssColorSpace, CssColorSpacePrimary, CssContent, CssCursor, CssDefinition, CssDisplay, CssDisplayStatePseudoClasses, CssFlex, CssFlexBasis, CssFlexDirection, CssFlexFlow, CssFlexGrow, CssFlexShrink, CssFloat, CssFontFamily, CssFontFeatureSetting, CssFontKerning, CssFontLanguageOverride, CssFontPalette, CssFontProperties, CssFontStyle, CssFontSynthesis, CssFontWeight, CssFontWidth, CssFromDefnOption, CssFunctionalPseudoClass, CssGap, CssGlobal, CssHangingPunctuation, CssHexColor, CssHsb, CssHsl, CssIdSelector, CssImageOrientation, CssImageRendering, CssImageResolution, CssInputPseudoClasses, CssJustifyContent, CssJustifyItems, CssJustifyProperties, CssJustifySelf, CssKeyframeCallback, CssKeyframeTimestamp, CssKeyframeTimestampSuggest, CssLetterSpacing, CssLinguisticPseudoClasses, CssListStyle, CssLocationPseudoClasses, CssMargin, CssMarginBlock, CssMarginBlockEnd, CssMarginBlockStart, CssMarginBottom, CssMarginInline, CssMarginInlineEnd, CssMarginInlineStart, CssMarginLeft, CssMarginProperties, CssMarginRight, CssMarginTop, CssMixBlendMode, CssNamedColor, CssNamedColorLookup, CssNamedSizes, CssObjectFit, CssObjectPosition, CssOffsetDistance, CssOffsetPath, CssOffsetPosition, CssOffsetProperties, CssOkLch, CssOpacity, CssOutline, CssOutlineColor, CssOutlineOffset, CssOutlineProperties, CssOutlineStyle, CssOutlineWidth, CssOverflowAnchor, CssOverflowBlock, CssOverflowClipMargin, CssOverflowInline, CssOverflowProperties, CssOverflowX, CssOverflowY, CssPadding, CssPaddingBlock, CssPaddingBlockEnd, CssPaddingBlockStart, CssPaddingBottom, CssPaddingInline, CssPaddingInlineEnd, CssPaddingInlineStart, CssPaddingLeft, CssPaddingProperties, CssPaddingRight, CssPaddingTop, CssPerspectiveOrigin, CssPlaceContent, CssPlaceItems, CssPlaceProperties, CssPlaceSelf, CssPointerEvent, CssPosition, CssProperty, CssPseudoClass, CssPseudoClassDefn, CssResourceStatePseudoClasses, CssRgb, CssRgba, CssRotation, CssRound, CssSelector, CssSelectorOptions, CssSizing, CssSizingFunction, CssSizingLight, CssStroke, CssStrokeDasharray, CssStrokeProperties, CssTagSelector, CssTextAlign, CssTextDecorationLine, CssTextDecorationStyle, CssTextIndent, CssTextJustify, CssTextOrientation, CssTextOverflow, CssTextPosition, CssTextProperties, CssTextRendering, CssTextTransform, CssTextWrap, CssTextWrapMode, CssTextWrapStyle, CssTimePseudoClasses, CssTiming, CssTransform, CssTransformBox, CssTransformOrigin, CssTransformProperties, CssTransformStyle, CssTranslate, CssTranslateFn, CssTreePseudoClasses, CssUserActionPseudoClasses, CssVar, CssVarWithFallback, CssWhiteSpace, CssWhiteSpaceCollapse, CssWordBreak, CssWritingMode, Csv, CsvFormat, CsvToJsonTuple, CsvToStrUnion, CsvToTuple, CsvToTupleStr, CsvToUnion, CurrencyChar, Current, CurrentMetrics, CurrentUom, CvsUrl, DANISH_NEWS, DATE_TYPE, DAYS_OF_WEEK__Mon, DAYS_OF_WEEK__Sun, DEFAULT_MANY_TO_ONE_MAPPING, DEFAULT_ONE_TO_MANY_MAPPING, DEFAULT_ONE_TO_ONE_MAPPING, DELETE, DELL_DNS, DISTANCE_METRICS_LOOKUP, DOUBLE_LEAP_M1, DOUBLE_LEAP_M2, DOUBLE_LEAP_M3, DOUBLE_LEAP_M4, DOUBLE_LEAP_M5, DOUBLE_LEAP_MODERN, DUTCH_NEWS, DanishNewsCompanies, DanishNewsUrls, DashToSnake, DashUppercase, DateLike, DateMeta, DatePlus, DateSeparator, DateSource, DateType, DayJsLike, DaysInMonth, DecomposeMapConfig, Decrement, DefaultManyToOneMapping, DefaultNesting, DefaultOneToManyMapping, DefaultOneToOneMapping, DefaultOptions, DefaultTemplateBlocks, DefineModifiers, DefineObject, DefineObjectApi, DefineObjectWith, DefineStatelessApi, DefineTokenDetail, DefineTuple, Defined, DellUrl, Delta$1 as Delta, DeltaLight, DeployConfig, DialCountryCode, DictChangeValue, Dictionary, DictionaryTypeDefn, Digit$1 as Digit, DigitNonZero, Digital, DigitalLiteral, Digitize, DinersClub, Discover, Distance, DistanceMetrics, DistanceUom, DistinguishEmpty, Divide, DnsName, DockerCompose, DockerDependsOn, DockerService, DoesExtend, DoesExtendTypeguard, DoesNotExtend, DomainName, DoneFnTuple, DotPathFor, DoubleQuote, DropChars, DropLeading, DropParser, DropParserFn, DropParserKv, DropResult, DropRule, DropRulePolicy, DropTrailing, DropVariadic, DropVariadicHead, DropVariadicTail, DutchNewsCompanies, DutchNewsUrls, DynamicSegment, DynamicToken, DynamicTokenApi, EBAY_DNS, EDITORS, EM_SPACE, ENERGY_METRICS_LOOKUP, EN_SPACE, ESCAPE_CODE, ESCAPE_CODE_CHARS, ETSY_DNS, Each, EachAsString, EachAsStringLiteralTemplate, EachOperation, EbayUrl, ElementOf, EmSpace, Email, Empty, EmptyObject, EmptyString, EnSpace, EncodingDefinition, EndsWith, EndsWithNumber, Energy, EnergyMetrics, EnergyUom, EnsureKeys, EnsureLeading, EnsureLeadingEvery, EnsureSurround, EnsureTrailing, EntryExceptionRules, EpochInMs, EpochInSeconds, EqualGreaterLessorChar, EqualNotEqualChar, EqualityChar, Equals, EqualsSome__Partial, Err, ErrContext, ErrMsg, ErrType, EscapeCodeChars, EscapeFunction, EscapeRegex, EscapedSafeEncodingConversion, EsotericHtmlElement, EtsyUrl, Even, EvenNumber, Every, EveryLength, ExcludeIndex, Exif, ExifAttributionInfo, ExifCameraInfo, ExifCompression, ExifContrast, ExifDateTimeInfo, ExifEmbedPolicy, ExifExtraneous, ExifFlashValues, ExifGainControl, ExifGps, ExifLightSource, ExifPhotoContext, ExifPreviewColorSpace, ExifSaturation, ExifSceneCaptureType, ExifSharpness, ExifSubjectDistance, ExitExceptionRules, Expand, ExpandDictionary, ExpandRecursively, ExpandTuple, ExpandUnion, Expect, ExplicitFunction, ExplicitlyEmptyObject, Extends, ExtendsAll, ExtendsEvery, ExtendsNone, ExtendsSome, ExtractCaptureGroups, ExtractOptionalElements, ExtractOptionalKeys, ExtractRequiredElements, FALSY_TYPE_KINDS, FALSY_VALUES, FILE_SEPARATOR, FORM_FEED, FRENCH_NEWS, FREQUENCY_METRICS_LOOKUP, Fail, FailFast, FailFastOptions, Fallback, FalsyValue, FifoQueue, FillStringHole, Filter, FilterByNestingLevel, FilterEmptyStrings, FilterEmptyStringsInTerminalPosition, FilterFn, FinalizedDropRule, FinalizedMapConfig, Find$1 as Find, FindFunction, FindMaxLength, First$1 as First, FirstChar, FirstDefined, FirstKey, FirstOfEach, FirstSet, FirstString, FirstValue, FixedLengthArray, Flatten, FlattenUnion, FluentApi, FluentFn, FluentState, FnAllowingProps, FnArgsDefn, FnDefn, FnFrom, FnKeyValue, FnMeta, FnMetaShape, FnPropertiesDefn, FnReturn, FnReturnTypeDefn, FnWithDescription, FnWithProps, FourDigitYear, FrenchNewsCompanies, FrenchNewsUrls, Frequency, FrequencyMetrics, FrequencyUom, FromCsv, FromDefineObject, FromDefineTuple, FromDefn, FromDynamicSegment, FromInputToken, FromInputToken__Object, FromInputToken__String, FromInputToken__Tuple, FromKv, FromLiteralTemplate, FromLiteralTokens, FromMaybeRef, FromNamedDynamicSegment, FromNesting, FromRecordKeyDefn, FromShapeCallback, FromSimpleRecordKey, FromSimpleToken, FromTo, FromTypeDefn, FromWideTokens, FullWidthQuotation, FullyQualifiedUrl, GERMAN_NEWS, GITHUB_INSIGHT_CATEGORY_LOOKUP, GROUP_SEPARATOR, GenericParam, GermanNewsCompanies, GermanNewsUrls, Get, GetBrand, GetComparator, GetComparisonParams, GetDefaultPort, GetEach, GetEachOptions, GetEscapeFunction, GetExitToken, GetFixedKeys, GetIndexKeys, GetInference, GetInferenceProps, GetInputToken, GetMonthAbbrev, GetMonthName, GetMonthNumber, GetNextLevelConfig, GetNonVariadicLength, GetOpConfig, GetOptionalElementCount, GetOptions, GetParentConfig, GetPhoneCountryCode, GetPhoneNumberType, GetQueryParameterDynamics, GetRequiredElementCount, GetSeason, GetTemplateBlocks, GetTemplateParams, GetTokenNames, GetTypeOf, GetUrlDynamics, GetUrlPath, GetUrlPathDynamics, GetUrlPort, GetUrlProtocol, GetUrlProtocolPrefix, GetUrlQueryParams, GetUrlSource, GetYear, GetYouTubePageType, GitRef, GithubActionsUrl, GithubInsightPageType, GithubInsightUrl, GithubOrgUrl, GithubRepoBranchesUrl, GithubRepoDiscussionUrl, GithubRepoDiscussionsUrl, GithubRepoIssueUrl, GithubRepoIssuesListUrl, GithubRepoProjectUrl, GithubRepoProjectsUrl, GithubRepoPullRequestUrl, GithubRepoPullRequestsUrl, GithubRepoReleaseTagUrl, GithubRepoReleasesUrl, GithubRepoTagsUrl, GithubRepoUrl, GithubUrl, Grammar, GrammarEncoder, GrammarTypeDefinition, GreaterThan, GreaterThanOrEqual, HAIR_SPACE, HASH_TABLE_ALPHA_LOWER, HASH_TABLE_ALPHA_UPPER, HASH_TABLE_CHAR, HASH_TABLE_DIGIT, HASH_TABLE_OTHER, HASH_TABLE_SPECIAL, HASH_TABLE_WIDE, HEMISPHERE, HEXADECIMAL_CHAR, HM_DNS, HOME_DEPOT_DNS, HORIZONTAL_TAB, HTML_ATOMIC_TAGS, HTML_BLOCK_TAGS, HairSpace, HandMUrl, Handle, HandleDoneFn, HandleErr, HasAny, HasArray, HasCharacters, HasErrors, HasEscapeFunction, HasEvery, HasFalse, HasFunctionKeys, HasIndex, HasIndexKeys, HasIndexSignature, HasIpAddress, HasModifier, HasNetworkProtocolReference, HasNever, HasNoParameters, HasNonTemplateLiteral, HasOneParameter, HasOptionalElements, HasOptionalElements__Tuple, HasOtherCharacters, HasParameters, HasPhoneCountryCode, HasProp, HasQueryParameter, HasRequiredElements, HasRequiredProps, HasSameKeys, HasSameValues, HasTemplateLiteral, HasTrue, HasTypedFunctionKeys, HasUnionType, HasUppercase, HasUrlPath, HasUrlSource, HasVariadicHead, HasVariadicInterior, HasVariadicParameters, HasVariadicTail, HasWideBoolean, HasWideValues, HaveSameNumericSign, Healthcheck, Hemisphere, HexColor, HexColorToRgbObject, HexColorToRgbTuple, HexToDecimal, HexToDecimalArray, HexadecimalChar, HomeDepotUrl, HtmlBodyElement, HtmlElement, HtmlFrameworkElement, HtmlFunctionalElement, HtmlHeaderElement, HtmlInputElement, HtmlListElement, HtmlMediaElement, HtmlStructuralElement, HtmlSymantecElement, HtmlTableElement, HtmlTag, HtmlTagAtomic, HtmlTagClose, HtmlTagOpen, Html__AtomicTag, Html__BlockTag, HttpHeader, HttpHeaders, HttpHeadingKeys, HttpVerb, HttpVerbsWithBody, HttpVerbsWithoutBody, IANA_TIMEZONES, IANA_TIMEZONES__AFRICA, IANA_TIMEZONES__AMERICA, IANA_TIMEZONES__ANTARCTICA, IANA_TIMEZONES__ASIA, IANA_TIMEZONES__ATLANTIC, IANA_TIMEZONES__AUSTRALIA, IANA_TIMEZONES__EUROPE, IANA_TIMEZONES__INDIAN, IANA_TIMEZONES__OTHER, IANA_TIMEZONES__PACIFIC, IDEOGRAPHIC_SPACE, IKEA_DNS, IMAGE_FORMAT_LOOKUP, INDIAN_NEWS, INTERPOLATION_BLOCKS, IP6Multicast, IP6Unicast, IPv4, IPv6, ISO3166_1, ISO639_2, ISO639_3, ISO_DATE_30, ISO_DATE_31, ITALIAN_NEWS, IT_ATOMIC_TOKENS, IT_AtomicToken, IT_BooleanLiteralToken, IT_CONTAINER_TOKENS, IT_Combinators, IT_Failure, IT_Generics, IT_KvType, IT_LITERAL_TOKENS, IT_NumericLiteralToken, IT_Parameter, IT_ParameterResults, IT_StringLiteralToken, IT_TakeArray, IT_TakeAtomic, IT_TakeFunction, IT_TakeGenerator, IT_TakeGroup, IT_TakeIntersection, IT_TakeKind, IT_TakeKvObjects, IT_TakeLiteralArray, IT_TakeNumericLiteral, IT_TakeObjectLiteral, IT_TakeOutcome, IT_TakeParameters, IT_TakePromise, IT_TakeSet, IT_TakeStringLiteral, IT_TakeTokenGeneric, IT_TakeTokenGenerics, IT_TakeUnion, IT_Token, IT_Token_Array, IT_Token_Atomic, IT_Token_Base, IT_Token_Function, IT_Token_Generator, IT_Token_Group, IT_Token_Intersection, IT_Token_Kv, IT_Token_Literal, IT_Token_Literal_Array, IT_Token_Object_Literal, IT_Token_Promise, IT_Token_Set, IT_Token_Union, IT_TupleToOutputToken, IanaAfrica, IanaAmerica, IanaAntarctica, IanaAsia, IanaEurope, IanaPacific, IanaZone, IanaZoneArea, IdentityFn, IdentityFunction, IdeographicSpace, If, IfAllExtend, IfAllLiteral, IfEqual, IfEquals, IfLeft, IfLength, IfLiteralKind, IfNever, IfUnset, IfUnsetOrUndefined, IkeaUrl, ImgFormat, ImgFormatWeb, Immutable, InBetween, InBetweenOptions, Increment, Indent, Indent2, Indent4, IndentSpaces, IndentTab, IndexOf, Indexable, IndexableObject, IndianNewsCompanies, IndianNewsUrls, InlineSvg, InputToken, InputTokenSuggestions, InputToken__SimpleTokens, Integer, IntegerBrand, InternationalPhoneNumber, IntersectingKeys, Intersection, IntersectionToTuple, IntoTemplate, Inverse, InvertNumericSign, Ip4Address, Ip4AddressLike, Ip4Netmask16, Ip4Netmask24, Ip4Netmask32, Ip4Netmask8, Ip4NetmaskSuggestion, Ip4Octet, Ip4Subnet, Ip4SubnetLike, Ip6Address, Ip6AddressFull, Ip6AddressLike, Ip6Group, Ip6GroupExpansion, Ip6Loopback, Ip6Subnet, Ip6SubnetLike, IsAfter, IsAllCaps, IsAllLowercase, IsAlphanumeric, IsAmericanExpress, IsAny, IsAnyEqual, IsArray, IsAtomicTag, IsBalanced, IsBefore, IsBetweenExclusively, IsBetweenInclusively, IsBoolean, IsBooleanLike, IsBooleanLiteral, IsBranded, IsCapitalized, IsComputedRef, IsContainer, IsCreditCard, IsCssHexadecimal, IsCssRgbString, IsCsv, IsDateLike, IsDayJs, IsDefaultNumericPercentage, IsDefined, IsDictionary, IsDictionaryDefinition, IsDomainName, IsDotPath, IsDoubleLeap, IsEmpty, IsEmptyArray, IsEmptyContainer, IsEmptyObject, IsEmptyString, IsEntryToken, IsEpochInMilliseconds, IsEpochInSeconds, IsEqual, IsErrMsg, IsError, IsEscapeFunction, IsExitToken, IsFalse, IsFalsy, IsFloat, IsFnWithDictionary, IsFourDigitYear, IsFunction, IsGreaterThan, IsGreaterThanOrEqual, IsHexColor, IsHexadecimal, IsHtmlClosingTag, IsInputToken, IsInputTokenSuccess, IsInteger, IsIp4Address, IsIp4Octet, IsIp6Address, IsIp6HexGroup, IsIpAddress, IsIsoDate, IsIsoDateTime, IsIsoFullDate, IsIsoFullDateTime, IsIsoMonthDate, IsIsoTime, IsIsoYear, IsIsoYearMonth, IsIterable, IsJsDate, IsLeapYear, IsLength, IsLessThan, IsLessThanOrEqual, IsLiteral, IsLiteralContainer, IsLiteralFn, IsLiteralKind, IsLiteralLike, IsLiteralLikeArray, IsLiteralLikeObject, IsLiteralLikeTuple, IsLiteralNumber, IsLiteralObject, IsLiteralScalar, IsLiteralString, IsLiteralTuple, IsLiteralUnion, IsLowerAlpha, IsLuxonDateTime, IsMixedUnion, IsMoment, IsNarrower, IsNarrowingFn, IsNegativeNumber, IsNestingConfig, IsNestingKeyValue, IsNestingMatchEnd, IsNestingTuple, IsNever, IsNonEmptyContainer, IsNonEmptyObject, IsNonLiteralUnion, IsNot$1 as IsNot, IsNotEqual, IsNothing, IsNull, IsNumber, IsNumberLike, IsNumericArray, IsNumericLiteral, IsObject, IsObjectKeyRequiringQuotes, IsOk, IsOptional, IsPercentage, IsPhoneNumber, IsPositiveNumber, IsReadonlyArray, IsReadonlyObject, IsRequired, IsRgbObject, IsRgbTuple, IsRgbaObject, IsSameContainerType, IsSameDay, IsSameMonth, IsSameMonthYear, IsSameYear, IsScalar, IsSet, IsSingleChar, IsSingleSided, IsSingularNoun, IsStaticFn, IsStaticTemplate, IsStrictEmptyObject, IsStrictPromise, IsString, IsStringLiteral$1 as IsStringLiteral, IsSubstring, IsSymbol, IsTemplateLiteral, IsThenable, IsTrue, IsTruthy, IsTuple, IsTwoDigitDate, IsTwoDigitMonth, IsUndefined, IsUnion, IsUnionArray, IsUniqueSymbol, IsUnitPrimitive, IsUnknown, IsUnset, IsUrl, IsValidDotPath, IsValidIndex, IsVariable, IsVariadicArray, IsVisaMastercard, IsVueRef, IsWhitespace, IsWideArray, IsWideBoolean, IsWideContainer, IsWideNumber, IsWideObject, IsWideScalar, IsWideString, IsWideSymbol, IsWideType, IsWideUnion, IsYouTubePlaylist, IsYouTubeUrl, IsYouTubeVideoUrl, Iso3166Alpha2Lookup, Iso3166Alpha3Lookup, Iso3166CodeLookup, Iso3166CountryLookup, Iso3166_1_Alpha2, Iso3166_1_Alpha3, Iso3166_1_CountryCode, Iso3166_1_CountryName, Iso3166_1_Lookup, Iso3166_1_Token, IsoDate$1 as IsoDate, IsoDate30, IsoDate31, IsoDateTime, IsoFullDate, IsoFullDateTimeLike, IsoModernDoubleLeap, IsoMonthDate, IsoTime, IsoTimeLike, IsoYear, IsoYearMonth, IsolateErrors, IsolatedResults, ItalianNewsCompanies, ItalianNewsUrls, JAPANESE_NEWS, JapaneseNewsCompanies, JapaneseNewsUrls, Jcb, Join, Joiner, JsDateLike, JsonRxEncodingSpecifier, JsonRxMessageEncoding, JsonRxPayloadEncoding, JsonRxProtocol, JustFunction, KNOWN_NESTING_CONFIGURATIONS, KROGER_DNS, KebabCase, KebabKeys, KeyOf, KeyValue, KeyframeApi, Keys$1 as Keys, KeysEqualValue, KeysNotEqualValue, KeysOverlap, KeysUnion, KeysWithError, KeysWithValue, KeysWithoutValue, KlassMeta, KnownNestingConfig, KrogerUrl, KvFn, KvFnDefn, LINE_FEED, LITERAL_TYPE_KINDS, LOCALES, LOWER_ALPHA_CHARS, LOWES_DNS, LUMINOSITY_METRICS_LOOKUP, Last$1 as Last, LastChar, LastOfEach, LeadingNonAlpha, Left$1 as Left, LeftContains, LeftDoubleMark, LeftEquals, LeftExtends, LeftHeavyDoubleTurned, LeftHeavySingleTurned, LeftIncludes, LeftLowDoublePrime, LeftReversedDoublePrime, LeftRight, LeftRight__Operations, LeftSingleMark, LeftWhitespace, Length, LessThan, LessThanOrEqual, LexerDelta, LexerState, LifoQueue, LikeRegExp, List, LiteralFnModifiers, LiteralLikeModifiers, LiteralModifiers, LiteralNumberModifiers, LiteralObjectModifiers, LiteralStringModifiers, LocalPhoneNumber, Locale, LocaleWithSubTag, LoggingOptions, Logic, LogicFunction, LogicHandler, LogicOptions, LogicalCombinator, LogicalReturns, Longest, LongestCommonPrefix, LongestToStartWith, LowerAllCaps, LowerAlphaChar, LowesUrl, Luminosity, LuminosityMetrics, LuminosityUom, LuxonLikeDateTime, LuxonStaticDateTime, MACYS_DNS, MARKED, MASS_METRICS_LOOKUP, MEXICAN_NEWS, MIME_TYPES, MONTH_ABBR, MONTH_ABBREV_LOOKUP, MONTH_NAME, MONTH_NAME_LOOKUP, MONTH_TO_SEASON_LOOKUP, MacysUrl, Maestro, MakeKeysOptional, MakeKeysRequired, MakeOptional, MakePropsMutable, MakeRequired, ManyToMany, ManyToOne, ManyToZero, MapCard, MapCardinality, MapCardinalityFrom, MapCardinalityIllustrated, MapConfig, MapCoverage, MapFn, MapFnInput, MapFnOutput, MapIR, MapInput, MapInputFrom, MapKeyDefn, MapKeys, MapKeysOptions, MapOR, MapOutput, MapOutputFrom, MapTo, MapToString, MapValueDefn, MapperApi, MapperOld, Marked, Mass, MassMetrics, MassUom, Mastercard, MatchChar, Max$1 as Max, MaxLength, MaxSafeInteger, MaybeRef, Merge, MergeKVs, MergeObjects, MergeScalars, MergeTuples, Metric, MetricCategory, MetricTypeGuard, MexicanNewsCompanies, MexicanNewsUrls, MimeTypes, Min$1 as Min, MinLength, MinLengthArray, MinimalDigitDate, MinimalDigitDate__Suffixed, MixObjects, Mod, ModernDoubleLeap, MomentLike, MonthAbbrev, MonthDateDigit, MonthInSeason, MonthName, MonthNumber, MonthNumeric, MultiChoiceCallback, MultipleChoice, Multiply, Mutable, MutableProps, MutablePropsExclusive, NARROW_CONTAINER_TYPE_KINDS, NARROW_NO_BREAK_SPACE, NBSP, NETWORK_PROTOCOL, NETWORK_PROTOCOL_INSECURE, NETWORK_PROTOCOL_LOOKUP, NETWORK_PROTOCOL_SECURE, NIKE_DNS, NON_BREAKING_SPACE, NON_ZERO_NUMERIC_CHAR, NORWEGIAN_NEWS, NOT_APPLICABLE, NOT_DEFINED, NO_DEFAULT_VALUE, NO_MATCH, NULL_CHAR, NUMERIC_CHAR, NUMERIC_DIGIT, NamedColor, NamedColorMinimal, NamedColor_Blue, NamedColor_Brown, NamedColor_Cyan, NamedColor_Gray, NamedColor_Green, NamedColor_Orange, NamedColor_Pink, NamedColor_Purple, NamedColor_Red, NamedColor_White, NamedColor_Yellow, NamedDynamicSegment, NamingConvention, Narrow, NarrowContainer, NarrowNonBreakingSpace, NarrowObject, Narrowable, NarrowableDefined, NarrowableScalar, NarrowingFn, NarrowlyContains, NegDelta, Negative, Nest, NestedException, NestedSplit, NestedSplitPolicy, NestedString, Nesting, NestingApi, NestingKeyValue, NestingKeyValueConfig, NestingKeyValueEntry, NestingTuple, NestingTupleConfig, NetworkConfig, NetworkDefinition, NetworkProtocol, NetworkProtocolPrefix, Never, NewsUrls, NextDigit, NikeUrl, NoDefaultValue, NoMatch, NodeCallback, NonAlphaChar, NonArray, NonBreakingSpace, NonNumericKeys, NonStringKeys, NonZeroNumericChar, None, NorwegianNewsCompanies, NorwegianNewsUrls, Not, NotApplicable, NotDefined, NotEqual, NotFilter, NotLength, NotNull, Nothing, NpmVersion, NumberLike, NumericChar, NumericChar__NonZero, NumericChar__OneToFive, NumericChar__OneToFour, NumericChar__OneToThree, NumericChar__OneToTwo, NumericChar__ZeroToFive, NumericChar__ZeroToFour, NumericChar__ZeroToOne, NumericChar__ZeroToThree, NumericChar__ZeroToTwo, NumericKeys, NumericRange, NumericSequence, NumericSign, NumericSort, NumericSortOptions, OPTION, ObjKeyDefn, ObjectApiCallback, ObjectKey, ObjectKeys, ObjectMap, ObjectMapConversion, ObjectMapper, ObjectMapperCallback, ObjectToApi, ObjectToCssString, ObjectToJsString, ObjectToJsonString, ObjectToKeyframeString, ObjectToString, ObjectValuesAsStringLiteralTemplate, OddNumber, OldSchoolHtmlElement, OnPass, OnPassRemap, OneOf, OneToMany, OneToOne, OneToZero, OnlyFixedKeys, OnlyFn, OnlyFnProps, OnlyIndexKeys, OnlyOptional, OpeningBracket, OpeningMark, OpeningMarkPlus, Opt$1 as Opt, OptCr, OptCrThenIndent, OptModifier, OptNumber, OptPercent, OptRecord, OptRequired, OptSpace, OptSpace2, OptSpace4, OptUrlQueryParameters, OptWhitespace, OptWhitespaceAll, OptionalKeys, OptionalKeysTuple, OptionalParamFn, OptionalProps, OptionalSimpleScalarTokens, OptionalSpace, Or, OutputToken, PHONE_COUNTRY_CODES, PHONE_FORMAT, PLURAL_EXCEPTIONS, PLURAL_EXCEPTIONS_OLD, POWER_METRICS_LOOKUP, PRESSURE_METRICS_LOOKUP, PROTOCOL_DEFAULT_PORTS, PROXMOX_CT_STATE, PackageJson, PadEnd, PadStart, ParameterlessFn, ParseDate, ParseInt, ParseTime, ParsedDate, ParsedTime, PascalCase, PascalKeys, Passthrough, PathJoin, PercentChar, Percentage, PhoneAreaCode, PhoneCountryCode, PhoneCountryLookup, PhoneFormat, PhoneNumber, PhoneNumberDelimiter, PhoneNumberType, PhoneNumberWithCountryCode, PhoneShortCode, PluralExceptions, Pluralize, PlusMinus, Pop, PortMapping, PortSpecifierOptions, Power, PowerMetrics, PowerUom, Precision, Prepend, PrependAll, Pressure, PressureMetrics, PressureUom, PriorDigit, PrivateKey, PrivateKeyOf, PrivateKeys, Process, PromiseAll, Promised, Promisify, PropertyChar, ProtocolOptions, ProxyErr, PublicKeyOf, PublicKeys, Punctuation, Push, QUOTE_NESTING, QuotationMark, QuotationMarkPlus, QuoteCharacter, QuoteNesting, RECORD_SEPARATOR, REPO_PAGE_TYPES, REPO_SOURCES, REPO_SOURCE_LOOKUP, RESISTANCE_METRICS_LOOKUP, RESULT, RGB, RGBA, RawPhoneNumber, ReadonlyKeys, ReadonlyProps, RecKeyVariant, RecVariant, RecordKeyDefn, RecordKeyWideTokens, RecordValueTypeDefn, ReduceValues, RegexArray, RegexExecFn, RegexGroupValue, RegexHandlingStrategy, RegexTestFn, RegularExpression, RegularFn, RelativeUrl, RemoveBoolean, RemoveEmpty, RemoveFnProps, RemoveFromEnd, RemoveFromStart, RemoveHttpProtocol, RemoveIndex, RemoveIndexKeys, RemoveMarked, RemoveNetworkProtocol$1 as RemoveNetworkProtocol, RemoveNever, RemovePhoneCountryCode, RemoveUndefined, RemoveUrlPort$1 as RemoveUrlPort, RemoveUrlSource$1 as RemoveUrlSource, RemoveWhitespace, RenameKey, RenderTime, Repeat, Replace, ReplaceAll, ReplaceAllFromTo, ReplaceAllToFrom, ReplaceBooleanInterpolation, ReplaceFromTo, ReplaceLast, ReplaceNumericInterpolation, ReplaceStringInterpolation, ReplaceType, RepoPageType, RepoSource, RepoUrls, RequireProps, RequiredKeys, RequiredKeysTuple, RequiredProps, RequiredSimpleScalarTokens, Resistance, ResistanceMetrics, ResistanceUom, ResolvedTokenType, RestEndpoint, RestMethod, RetailUrl, RetainAfter, RetainAfterLast, RetainBetween, RetainChars, RetainLiterals, RetainUntil, RetainUntil__Nested, RetainUntil__NestedOptions, RetainWhile, RetainWideTypes, ReturnTypes, ReturnValues, Returns, ReturnsBoolean, ReturnsFalse, ReturnsTrue, Reverse, ReverseLookup, Rfc1812, Rfc1812Like, RgbColor, RgbDecimalString, RgbTuple, RgbaColor, Right$1 as Right, RightContains, RightDoubleMark, RightEquals, RightExtends, RightHeavyDoubleTurned, RightHeavySingleTurned, RightIncludes, RightReversedDoublePrime, RightSingleMark, RightWhitespace, RuntimeTakeFunction, RuntimeUnion, SAFE_ENCODING_KEYS, SAFE_ENCODING__BRACKETS, SAFE_ENCODING__QUOTES, SAFE_ENCODING__WHITESPACE, SEASONS, SEASON_TO_MONTH_LOOKUP, SHALLOW_BRACKET_AND_QUOTE_NESTING, SHALLOW_BRACKET_NESTING, SHALLOW_QUOTE_NESTING, SHAPE_DELIMITER, SHAPE_PREFIXES, SIMPLE_ARRAY_TOKENS, SIMPLE_CONTAINER_TOKENS, SIMPLE_DICT_TOKENS, SIMPLE_DICT_VALUES, SIMPLE_FN_TOKENS, SIMPLE_MAP_KEYS, SIMPLE_MAP_TOKENS, SIMPLE_MAP_VALUES, SIMPLE_OPT_SCALAR_TOKENS, SIMPLE_SCALAR_TOKENS, SIMPLE_SET_TOKENS, SIMPLE_SET_TYPES, SIMPLE_TOKENS, SIMPLE_UNION_TOKENS, SINGULAR_NOUN_ENDINGS, SKeys, SOCIAL_MEDIA, SOUTH_KOREAN_NEWS, SPACE, SPACE_CHARS, SPANISH_NEWS, SPEED_METRICS_LOOKUP, SWISS_NEWS, SafeDecode, SafeDecodingConversion, SafeDecodingKey__Brackets, SafeDecodingKey__Quotes, SafeDecodingKey__Whitespace, SafeEncode, SafeEncodeEscaped, SafeEncodingConversion, SafeEncodingGroup, SafeEncodingKey__Brackets, SafeEncodingKey__Quotes, SafeEncodingKey__Whitespace, SafeString, SafeStringDecoder, SafeStringEncoder, Scalar, ScalarCallback, ScalarNotSymbol, Season, Second$1 as Second, SecondOfEach, SecretDefinition, SemanticDependency, SemanticVersion, SerializedComma, SerializedData, Set$1 as Set, SetCandidate, SetIndex, SetKey, SetKeyForce, SetKeyStrict, SetKeysTo, SetToString, ShallowBracketAndQuoteNesting, ShallowBracketNesting, ShallowQuoteNesting, Shape, ShapeApi, ShapeApiImplementation, ShapeApi__Scalars, ShapeCallback, ShapeSuggest, ShapeTupleOrUnion, SharedKeys, Shift, ShiftDecimalPlace, Shortest, SimpleArrayToken, SimpleContainerToken, SimpleDictToken, SimpleMapToken, SimpleScalarToken, SimpleSetToken, SimpleToken, SimpleType, SimpleTypeArray, SimpleTypeDict, SimpleTypeMap, SimpleTypeScalar, SimpleTypeSet, SimpleTypeUnion, SimpleUnionToken, SimplifyObject, SingleQuote, SingularNoun, SingularNounEnding, SizingUnits, Slice, SliceArray, SliceString, SmartMark, SmartMarkPlus, SnakeCase, SnakeKeys, SocialMediaPlatform, SocialMediaProfileUrl, SocialMediaUrl, Solo, Some, SomeEqual, SomeExtend, Something, Sort, SortByKey, SortByKeyOptions, SortByLength, SortOptions, SortOrder, SouthKoreanNewsCompanies, SouthKoreanNewsUrls, SpaceChars, SpanishNewsCompanies, SpanishNewsUrls, SpecialChar, Speed, SpeedMetrics, SpeedUom, Split, Split2, SplitAtVariadic, SplitOnWhitespace, StackFrame, StackTrace, StandardMark, StartingWithTypeGuard, StartsWith, StartsWithNumber, StartsWithTemplateLiteral, StaticFn, StaticTakeFunction__CallBack, StaticTakeFunction__Rtn, StaticTemplateSections, StaticToken, StaticTokenApi, StrLen, StringDelimiter, StringEncoder, StringIsAfter, StringKeys, StringLength, StringLiteralFromTuple, StringLiteralTemplate, StringLiteralToken, StringLiteralType, StringSort, StringSortOptions, StringTokenUtilities, StripAfter, StripAfterLast, StripBefore, StripChars, StripFirst, StripLeading, StripLeadingStringTemplate, StripLeadingTemplate, StripLeftNonAlpha, StripSlash, StripSurround, StripSurroundConfigured, StripSurrounding, StripSurroundingStringTemplate, StripTrailing, StripTrailingStringTemplate, StripUntil, StripWhile, StrongMap, StrongMapTransformer, StrongMapTypes, StructuredStringType, Subtract, Success$1 as Success, Suggest, SuggestHexadecimal, SuggestIp6SubnetMask, SuggestIpAddress, Sum$1 as Sum, Surround, SurroundWith, SwissNewsCompanies, SwissNewsUrls, SymbolKind, SyncFunction, Synchronous, TARGET_DNS, TEMPERATURE_METRICS_LOOKUP, THIN_SPACE, TIME_METRICS_LOOKUP, TLD, TOP_LEVEL_DOMAINS, TSV, TT_ATOMICS, TT_Atomic, TT_CONTAINERS, TT_Container, TT_DELIMITER, TT_FUNCTIONS, TT_Function, TT_KIND_VARIANTS, TT_SETS, TT_SINGLETONS, TT_START, TT_STOP, TT_Set, TT_Singleton, TURKISH_NEWS, TW_CHROMA, TW_CHROMA_100, TW_CHROMA_200, TW_CHROMA_300, TW_CHROMA_400, TW_CHROMA_50, TW_CHROMA_500, TW_CHROMA_600, TW_CHROMA_700, TW_CHROMA_800, TW_CHROMA_900, TW_CHROMA_950, TW_COLOR_TARGETS, TW_HUE, TW_HUE_NEUTRAL, TW_HUE_STATIC, TW_HUE_VIBRANT, TW_LUMINOSITY, TW_LUMIN_100, TW_LUMIN_200, TW_LUMIN_300, TW_LUMIN_400, TW_LUMIN_50, TW_LUMIN_500, TW_LUMIN_600, TW_LUMIN_700, TW_LUMIN_800, TW_LUMIN_900, TW_LUMIN_950, TW_MODIFIERS, TW_MODIFIERS_CORE, TW_MODIFIERS_ORDER, TW_MODIFIERS_RELN, TW_MODIFIERS_SIZING, TYPE_COMPARISONS, TYPE_KINDS, TYPE_OF, TYPE_TOKEN_REC_KEY_VARIANTS, TYPE_TOKEN_REC_VARIANTS, TYPE_TOKEN_STRING_SET_VARIANTS, TYPE_TOKEN_UNION_SET_VARIANTS, TYPE_TRANSFORMS, TakeDate, TakeFirst, TakeFunction, TakeFunction__Options, TakeHours, TakeLast, TakeMilliseconds, TakeMinutes, TakeMonth, TakeNestedString, TakeNumeric, TakeNumericOptions, TakeOptionalElements, TakeParser, TakeProp, TakeRequiredElements, TakeSeconds, TakeStart, TakeStartCallback, TakeStartFn, TakeStartMatches, TakeStartMatchesKind, TakeStartMatches__Callback, TakeStartMatches__Default, TakeStartMatches__Mapper, TakeState, TakeTimezone, TakeUtility, TakeWrapper, TakeYear, TargetUrl, Temperature, TemperatureMetrics, TemperatureUom, TemplateBlock__BARE, TemplateBlocks, TemplateMap, TemplateMap__Basic, TemplateMap__Generics, TemplateParams, TemporalInstanceLike, TemporalLike, TemporalPlainDateTimeLike, TemporalTimeZoneLike, TemporalZonedDateTimeLike, Test, Thenable, ThinSpace, ThreeDigitMillisecond, TimeMetric, TimeMetrics, TimeUom, TimeZoneExplicit, TimezoneOffset, ToBoolean, ToCSV, ToChoices, ToCsv, ToFn, ToInteger, ToIntegerOp, ToJson, ToJsonArray, ToJsonObject, ToJsonOptions, ToJsonScalar, ToJsonValue, ToKv, ToKvOptions, ToLiteralOptions, ToNumber, ToNumericArray, ToPhoneFormat, ToString, ToStringArray, ToStringLiteral, ToStringLiteral__Array, ToStringLiteral__Object, ToStringLiteral__Scalar, ToStringLiteral__Union, ToUnion, Token$1 as Token, TokenIsStatic, TokenMapper, TokenName, TokenParamsConstraint, TokenResolver, TokenSyntax, TokenType, TokenizeStringLiteral, Tokenizer, Trim, TrimCharEnd, TrimDictionary, TrimEach, TrimEnd, TrimLeft, TrimRight, TrimStart, Truncate, TruncateAtLen, TruthyReturns, Tuple$1 as Tuple, TupleDefn, TupleMeta, TupleRange, TupleToIntersection, TupleToUnion, TurkishNewsCompanies, TurkishNewsUrls, TwChroma, TwChroma100, TwChroma200, TwChroma300, TwChroma400, TwChroma50, TwChroma500, TwChroma600, TwChroma700, TwChroma800, TwChroma900, TwChroma950, TwChromaLookup, TwColor, TwColorOptionalOpacity, TwColorTarget, TwColorWithLuminosity, TwColorWithLuminosityOpacity, TwHue, TwLumi100, TwLumi200, TwLumi300, TwLumi400, TwLumi50, TwLumi500, TwLumi600, TwLumi700, TwLumi800, TwLumi900, TwLumi950, TwLuminosity, TwLuminosityLookup, TwModifier, TwModifier__Core, TwModifier__Order, TwModifier__Reln, TwModifier__Size, TwModifiers, TwNeutralColor, TwSizeResponsive, TwStaticColor, TwTarget__Color, TwTarget__ColorLuminosity, TwTarget__ColorLuminosityWithOpacity, TwTarget__ColorName, TwTarget__ColorWithOptPrefixes, TwTarget__Color__Light, TwVibrantColor, TwoDigitDate, TwoDigitHour, TwoDigitMinute, TwoDigitMonth, TwoDigitSecond, Type$1 as Type, TypeDefaultValue, TypeDefinition, TypeDefn, TypeDefnValidations, TypeGuard, TypeHasDefaultValue, TypeHasUnderlying, TypeHasValidations, TypeIsRequired, TypeKind, TypeKindContainer, TypeKindContainerNarrow, TypeKindContainerWide, TypeKindFalsy, TypeKindLiteral, TypeKindWide, TypeOf, TypeOfArray, TypeOfExtended, TypeOfTypeGuard, TypeOptions, TypeReplace, TypeRequired, TypeStrength, TypeSubtype, TypeToken, TypeTokenAtomics, TypeTokenContainers, TypeTokenDelimiter, TypeTokenFunctions, TypeTokenKind, TypeTokenLookup, TypeTokenSets, TypeTokenSingletons, TypeTokenStart, TypeTokenStop, TypeToken__Boolean, TypeToken__False, TypeToken__Fn, TypeToken__FnSet, TypeToken__Gen, TypeToken__Never, TypeToken__Null, TypeToken__Number, TypeToken__NumberSet, TypeToken__Rec, TypeToken__String, TypeToken__StringSet, TypeToken__True, TypeToken__Undefined, TypeToken__UnionSet, TypeToken__Unknown, TypeTuple, TypeUnderlying, TypedError, TypedFunction, TypedFunctionWithDictionary, TypedParameter, UK_NEWS, UNIT_SEPARATOR, UPPER_ALPHA_CHARS, US_NEWS, US_STATE_LOOKUP, US_STATE_LOOKUP_PROVINCES, US_STATE_LOOKUP_STRICT, UUID, UUID_Urn, UkNewsCompanies, UkNewsUrls, Unbrand, UnbrandValues, UnderlyingType, UnionArrayToTuple, UnionElDefn, UnionExtends, UnionFilter, UnionFrom, UnionFromProp, UnionHasArray, UnionIncludes, UnionMemberEquals, UnionMemberExtends, UnionMutate, UnionMutationOp, UnionToIntersection, UnionToString, UnionToTuple, UnionToTuple__PreserveBoolean, UnionWithAll, Unique, UniqueKeys, UniqueKeysUnion, UniqueKv, Unset, UntilLast, UntilLastOptions, Uom, UomTypeGuard, UpdateTake, UpperAlphaChar, UpsertKeyValue, Uri, UrlBuilder, UrlMeta, UrlOptions, UrlPath, UrlPathChars, UrlPort, UrlQueryParameters, UrlsFrom, UsNewsCompanies, UsNewsUrls, UsPhoneNumber, UsStateAbbrev, UsStateName, VERTICAL_TAB, VOLTAGE_METRICS_LOOKUP, VOLUME_METRICS_LOOKUP, ValidKey, Validate, ValidateCharacterSet, ValidateLength, ValidateLengthOptions, ValidateMax, ValidateMin, ValidationFunction, ValueAtDotPath, ValueCallback, ValueOrReturnValue, Values, Variable, VariableChar, VariadicParameterModifiers, VariadicType, Visa, VisaMastercard, Voltage, VoltageMetrics, VoltageUom, Volume, VolumeDefinition, VolumeMapping, VolumeMetrics, VolumeUom, VueComputedRef, VueRef, WALGREENS_DNS, WALMART_DNS, WAYFAIR_DNS, WEEKEND_DAY, WEEKEND_DAY_ABBREV, WEEK_DAY, WEEK_DAY_ABBREV, WHITESPACE_CHARS, WHOLE_FOODS_DNS, WIDE_CONTAINER_TYPE_KINDS, WIDE_TYPE_KINDS, WalgreensUrl, WalmartUrl, WayFairUrl, WeakMapKeyDefn, WeakMapToString, WeakMapValueDefn, When, WhenErr, WhenNever, WhereLeft, Whitespace, WhitespaceAll, WholeFoodsUrl, WideAssignment, WideContainerNames, WideScalarModifiers, WideTokenNames, WideTypeName, Widen, WidenContainer, WidenFn, WidenFunc, WidenFunction, WidenLiteral, WidenScalar, WidenTuple, WidenUnion, WidenValues, WithDefault, WithKeys, WithNumericKeys, WithStringKeys, WithTemplateKeys, WithValue, WithoutKeys, WithoutValue, WrapperFn, Xor, YouTubeCreatorUrl, YouTubeEmbedUrl, YouTubeFeedType, YouTubeFeedUrl, YouTubeHistoryUrl, YouTubeHome, YouTubeLikedPlaylistUrl, YouTubeMeta, YouTubePageType, YouTubePlaylistUrl, YouTubeShareUrl, YouTubeSubscriptionsUrl, YouTubeUrl, YouTubeUsersPlaylistUrl, YouTubeVideoUrl, YouTubeVideosInPlaylist, ZARA_DNS, ZIP_TO_STATE, ZaraUrl, Zero, ZeroToMany, ZeroToOne, ZeroToZero, Zip5, ZipCode, ZipPlus4, ZipToState, _TrimDict, abs, add, addFnToProps, addPropsToFn, addToken, afterFirst, and, append, array, asArray, asChars, asCssRgb, asDate, asDateTime, asEpochTimestamp, asFourDigitYear, asFromTo, asInputToken, asIsoDate, asIsoDateTime, asNumber, asOutputFunction, asPhoneFormat, asRecord, asRgbObject, asRgbaObject, asString, asTakeState, asTemplate, asTwoDigitMonth, asType, asTypeSubtype, asTypedError, asUnion, asVueRef, between, boolean, brand, capitalize, cardType, choices, compare, contains, convertCssRgbStringToRgbObject, createConstant, createConverter, createCssKeyframe, createCssSelector, createErrorCondition, createFifoQueue, createFixedLengthArray, createFnWithProps, createGrammar, createLifoQueue, createNestingConfig, createStaticTakeFunction, createTakeFunction, createTakeStartEndFunction, createTakeWhileFunction, createTemplateRegExp, createToken, createTokenSyntax, cssColor, cssFromDefinition, csv, dateObjectToIso, daysInMonth, decrement, defineCss, defineObj, defineObject, defineObjectWith, defineTuple, doesExtend, dropFirstStackFrame, dropParser, eachAsString, endsWith, endsWithTypeguard, ensureLeading, ensureSurround, ensureTrailing, entries, equalsSome, err, errCondition, every, fallback, filter, filterEmpty, filterUndefined, find, firstChar, fn, fnProps, fourDigitYear, freeze, fromDefineObject, fromDefineTuple, fromInputToken, fromKeyValue, get, getDaysBetween, getEach, getMonthAbbrev, getMonthName, getMonthNumber, getPhoneCountryCode, getSeason, getTailwindModifiers, getToday, getTokenData, getTokenKind, getTomorrow, getTypeSubtype, getUrlBase, getUrlDefaultPort, getUrlDynamics, getUrlPath, getUrlPort, getUrlProtocol, getUrlQueryParams, getUrlSource, getWeekNumber, getYear, getYesterday, getYouTubePageType, handleDoneFn, hasCountryCode, hasDefaultValue, hasErrorConditions, hasHtml, hasIndexOf, hasKeys, hasNonStringKeys, hasOnlyStringKeys, hasOnlyStringValues, hasOnlySymbolKeys, hasOverlappingKeys, hasProtocol, hasProtocolPrefix, hasSymbolKeys, hasUrlPort, hasUrlQueryParameter, hasValidHtml, hasWhiteSpace, hexColorToRgbObject, hexColorToRgbTuple, idLiteral, idTypeGuard, identity, ifArray, ifArrayPartial, ifBoolean, ifChar, ifContainer, ifDefined, ifEmpty, ifEqual, ifError, ifFalse, ifFunction, ifHasKey, ifLength, ifLowercaseChar, ifNotNull, ifNull, ifNumber, ifObject, ifSameType, ifScalar, ifString, ifTrue, ifUndefined, ifUppercaseChar, increment, indexOf, infer, integer, intersect, intersection, ip6GroupExpansion, isAccelerationMetric, isAccelerationUom, isAfter, isAlpha, isAmazonUrl, isAmericanExpress, isApi, isApiSurface, isAppleUrl, isAreaMetric, isAreaUom, isArray, isAustralianNewsUrl, isBefore, isBelgiumNewsUrl, isBestBuyUrl, isBitbucketUrl, isBoolean, isBooleanArray, isBooleanLike, isCanadianNewsUrl, isChineseNewsUrl, isCodeCommitUrl, isComparisonOperation, isConstant, isContainer, isCostCoUrl, isCountryAbbrev, isCountryCode2, isCountryCode3, isCountryName, isCreditCard, isCssAspectRatio, isCssNamedColor, isCssRgbString, isCsv, isCurrentMetric, isCurrentUom, isCvsUrl, isDanishNewsUrl, isDate, isDateLike, isDateMeta, isDayJs, isDefineObject, isDefineTuple, isDefined, isDellUrl, isDeltaReturn, isDictionary, isDistanceMetric, isDistanceUom, isDomainName, isDoneFn, isDoubleLeap, isDropResult, isDutchNewsUrl, isEbayUrl, isEmail, isEmpty, isEnergyMetric, isEnergyUom, isEpochInMilliseconds, isEpochInSeconds, isEqual, isErr, isError, isEscapeFunction, isEtsyUrl, isEven, isFalse, isFalsy, isFnWithParams, isFnWithoutParams, isFourDigitYear, isFrenchNewsUrl, isFrequencyMetric, isFrequencyUom, isFunction, isGermanNewsUrl, isGithubIssueUrl, isGithubIssuesListUrl, isGithubOrgUrl, isGithubProjectUrl, isGithubProjectsListUrl, isGithubReleaseTagUrl, isGithubReleasesListUrl, isGithubRepoReleaseTagUrl, isGithubRepoReleasesUrl, isGithubRepoUrl, isGithubUrl, isGreaterThan, isGreaterThanOrEqual, isHexColor, isHexadecimal, isHmUrl, isHomeDepotUrl, isHtml, isHtmlComponentTag, isHtmlElement, isIanaTimezone, isIkeaUrl, isInUnion, isIndexable, isIndianNewsUrl, isInlineSvg, isInputToken, isInputToken__String, isInteger, isIp4Address, isIp6Address, isIp6Subnet, isIpAddress, isIso3166Alpha2, isIso3166Alpha3, isIso3166CountryCode, isIso3166CountryName, isIsoDate, isIsoDateTime, isIsoExplicitDate, isIsoExplicitTime, isIsoImplicitDate, isIsoImplicitTime, isIsoMonthDate, isIsoTime, isIsoYear, isIsoYearMonth, isItalianNewsUrl, isJapaneseNewsUrl, isKrogersUrl, isLeapYear, isLeftRight, isLength, isLikeRegExp, isLowesUrl, isLuminosityMetric, isLuminosityUom, isLuxonDate, isMacysUrl, isMap, isMassMetric, isMassUom, isMastercard, isMetric, isMetricCategory, isMexicanNewsUrl, isMinimalDigitDate, isMoment, isMonthAbbrev, isMonthName, isNamedColor, isNamedNestingConfig, isNarrowable, isNarrowableArray, isNarrowableDictionary, isNegativeNumber, isNestingEnd, isNestingEndMatch, isNestingKeyValue, isNestingStart, isNestingTuple, isNever, isNewsUrl, isNikeUrl, isNorwegianNewsUrl, isNotEmpty, isNotError, isNotNull, isNotUnset, isNothing, isNull, isNumber, isNumberLike, isNumericArray, isNumericString, isObject, isObjectKey, isObjectKeyRequiringQuotes, isOdd, isOk, isOptionalParamFunction, isParsedDate, isPhoneNumber, isPowerMetric, isPowerUom, isPressureMetric, isPressureUom, isProtocol, isProtocolPrefix, isReadonlyArray, isRef, isRegExp, isRepoSource, isRepoUrl, isResistanceMetric, isResistanceUom, isRetailUrl, isRgbColor, isRgbDecimal, isRgbObject, isRgbTuple, isRgbaObject, isRuntimeUnion, isSameDay, isSameMonth, isSameMonthYear, isSameTypeOf, isSameYear, isScalar, isSemanticVersion, isSet, isSetContainer, isShape, isShapeCallback, isSimpleContainerToken, isSimpleContainerTokenTuple, isSimpleScalarToken, isSimpleScalarTokenTuple, isSimpleToken, isSimpleTokenTuple, isSocialMediaProfileUrl, isSocialMediaUrl, isSouthKoreanNewsUrl, isSpanishNewsUrl, isSpecificConstant, isSpeedMetric, isSpeedUom, isStaticTemplate, isString, isStringArray, isStringLiteral, isStringOrNumericArray, isSwissNewsUrl, isSymbol, isTailwindColor, isTailwindColorClass, isTailwindColorName, isTailwindColorTarget, isTailwindColorWithLuminosity, isTailwindColorWithLuminosityAndOpacity, isTailwindModifier, isTakeState, isTargetUrl, isTemperatureMetric, isTemperatureUom, isTemporalDate, isThenable, isThisMonth, isThisWeek, isThisYear, isThreeDigitMillisecond, isTimeMetric, isTimeUom, isTimezoneOffset, isToday, isTomorrow, isTrimable, isTrue, isTruthy, isTuple, isTurkishNewsUrl, isTwoDigitDate, isTwoDigitHour, isTwoDigitMinute, isTwoDigitMonth, isTwoDigitSecond, isTypeOf, isTypeSubtype, isTypeTuple, isTypedError, isUkNewsUrl, isUndefined, isUnset, isUom, isUomCategory, isUri, isUrl, isUrlPath, isUrlSource, isUsNewsUrl, isUsPhoneNumber, isUsStateAbbreviation, isUsStateName, isValidAtomicTag, isValidBlockTag, isValidComparisonParams, isValidHtml, isValidHtmlTag, isVariable, isVisa, isVisaMastercard, isVoltageMetric, isVoltageUom, isVolumeMetric, isVolumeUom, isWalgreensUrl, isWalmartUrl, isWayfairUrl, isWeakMap, isWholeFoodsUrl, isYesterday, isYouTubeCreatorUrl, isYouTubeFeedHistoryUrl, isYouTubeFeedUrl, isYouTubePlaylistUrl, isYouTubePlaylistsUrl, isYouTubeShareUrl, isYouTubeSubscriptionsUrl, isYouTubeTrendingUrl, isYouTubeUrl, isYouTubeVideoUrl, isYouTubeVideosInPlaylist, isZaraUrl, isZipCode, isZipCode5, isZipPlus4, joinWith, keysOf, keysWithError, kindLiteral, last, lastChar, lessThan, lessThanOrEqual, literal, logicalReturns, lookupCountryAlpha2, lookupCountryAlpha3, lookupCountryCode, lookupCountryName, lowercase, map, maybePhoneNumber, mergeObjects, mergeScalars, mergeTuples, mutable, nameLiteral, narrow, nbsp, nestedSplit, nesting, not, nullType, objectValues, omitKeys, optional, optionalOrNull, or, orNull, parseColor, parseDate, parseDateObject, parseIsoDate, parseNamedColor, parseNumericDate, parseRgbColor, pathJoin, pluralize, pop, record, regexToken, removePhoneCountryCode, removeTailwindModifiers, removeUrlProtocol, replace, replaceAll, replaceAllFromTo, result, retainAfter, retainAfterInclusive, retainChars, retainKeys, retainUntil, retainUntilInclusive, retainUntil__Nested, retainWhile, reverse, reverseLookup, rightWhitespace, setupSafeStringEncoding, shape, sharedKeys, shift, simpleContainerToken, simpleContainerType, simpleScalarToken, simpleScalarType, simpleToken, simpleType, slice, sortByKey, sortByLength, split, startsWith, startsWithTypeguard, stripAfter, stripAfterLast, stripBefore, stripChars, stripLeading, stripParenthesis, stripSurround, stripTrailing, stripUntil, stripWhile, surround, take, takeNumericCharacters, takeStart, takeStringToken, threeDigitMillisecond, toAllCaps, toCamelCase, toInteger, toIsoDateString, toJSON, toJson, toKebabCase, toKeyValue, toLowercase, toNumber, toNumericArray, toPascalCase, toSnakeCase, toString, toStringLiteral, toStringLiteral__Object, toStringLiteral__Tuple, toStringToken, trim, trimEnd, trimStart, truncate, tuple, twColor, twoDigitHour, twoDigitMinute, twoDigitSecond, typedError, unbrand, uncapitalize, undefinedType, unionize, unique, uniqueKeys, unknown, unset, urlMeta, usingLookup, validHtmlAttributes, valuesOf, weakMap, widen, withDefaults, withKeys, withValue, withoutKeys, withoutValue, youtubeEmbed, youtubeMeta }; //# sourceMappingURL=index.d.cts.map