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AAgB,MAAM,EAAE,MAAM,CAAC,QAAQ,CAAC,CAAC;IACzC,SAAgB,IAAI,EAAE,MAAM,CAAC,QAAQ,CAAC,CAAC;IACvC,SAAgB,IAAI,EAAE,MAAM,CAAC,QAAQ,CAAC,CAAC;gBAE3B,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ;CAatC","file":"type.d.ts","sourcesContent":["/**\n *\tMIT License\n *\n *\tCopyright (c) 2019 - 2021 Toreda, Inc.\n *\n *\tPermission is hereby granted, free of charge, to any person obtaining a copy\n *\tof this software and associated documentation files (the \"Software\"), to deal\n *\tin the Software without restriction, including without limitation the rights\n *\tto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *\tcopies of the Software, and to permit persons to whom the Software is\n *\tfurnished to do so, subject to the following conditions:\n\n * \tThe above copyright notice and this permission notice shall be included in all\n * \tcopies or substantial portions of the Software.\n *\n * \tTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *\tIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *\tFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * \tAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *\tLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *\tOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * \tSOFTWARE.\n *\n */\n\nimport {IsArray, isArrayMake} from '../is/array';\nimport {IsBig, isBigMake} from '../is/big';\nimport {IsBigInt, isBigIntMake} from '../is/big-int';\nimport {IsBoolean, isBooleanMake} from '../is/boolean';\nimport {IsDbl, isDblMake} from '../is/dbl';\nimport {IsFloat, isFloatMake} from '../is/float';\nimport {IsInt, isIntMake} from '../is/int';\nimport {IsNull, isNullMake} from '../is/null';\nimport {IsText, isTextMake} from '../is/text';\nimport {IsUInt, isUIntMake} from '../is/uint';\n\nimport {Rule} from '../rule';\nimport {RuleMods} from './mods';\n\n/**\n * @category Rules\n */\nexport class RuleType {\n\tpublic readonly array: IsArray<RuleType>;\n\tpublic readonly big: IsBig<RuleType>;\n\tpublic readonly bigInt: IsBigInt<RuleType>;\n\tpublic readonly boolean: IsBoolean<RuleType>;\n\tpublic readonly dbl: IsDbl<RuleType>;\n\tpublic readonly float: IsFloat<RuleType>;\n\tpublic readonly int: IsInt<RuleType>;\n\tpublic readonly null: IsNull<RuleType>;\n\tpublic readonly string: IsText<RuleType>;\n\tpublic readonly text: IsText<RuleType>;\n\tpublic readonly uint: IsUInt<RuleType>;\n\n\tconstructor(rule: Rule, mods: RuleMods) {\n\t\tthis.array = isArrayMake<RuleType>(this, rule, mods);\n\t\tthis.big = isBigMake<RuleType>(this, rule, mods);\n\t\tthis.bigInt = isBigIntMake<RuleType>(this, rule, mods);\n\t\tthis.boolean = isBooleanMake<RuleType>(this, rule, mods);\n\t\tthis.dbl = isDblMake<RuleType>(this, rule, mods);\n\t\tthis.float = isFloatMake<RuleType>(this, rule, mods);\n\t\tthis.int = isIntMake<RuleType>(this, rule, mods);\n\t\tthis.null = isNullMake<RuleType>(this, rule, mods);\n\t\tthis.string = isTextMake<RuleType>(this, rule, mods);\n\t\tthis.text = isTextMake<RuleType>(this, rule, mods);\n\t\tthis.uint = isUIntMake<RuleType>(this, rule, mods);\n\t}\n}\n"]}