Show raw api
{
"functions": [
{
"name": "type",
"desc": "Creates a checker using Lua's native `type()`.\n\n```lua\nlocal isTable = t.type(\"table\")\nprint(isTable({})) --> true\n```",
"params": [
{
"name": "typeName",
"desc": "The Lua type name to check against",
"lua_type": "string"
}
],
"returns": [
{
"desc": "",
"lua_type": "Check"
}
],
"function_type": "static",
"source": {
"line": 94,
"path": "lib/t/src/init.luau"
}
},
{
"name": "typeof",
"desc": "Creates a checker using Roblox's `typeof()`.\n\n```lua\nlocal isVector3 = t.typeof(\"Vector3\")\nprint(isVector3(Vector3.zero)) --> true\n```",
"params": [
{
"name": "typeName",
"desc": "The Roblox type name to check against",
"lua_type": "string"
}
],
"returns": [
{
"desc": "",
"lua_type": "Check"
}
],
"function_type": "static",
"source": {
"line": 119,
"path": "lib/t/src/init.luau"
}
},
{
"name": "any",
"desc": "Matches any type except nil.\n\n```lua\nprint(t.any(\"value\")) --> true\nprint(t.any(nil)) --> false, \"any expected, got nil\"\n```",
"params": [
{
"name": "value",
"desc": "",
"lua_type": "any"
}
],
"returns": [
{
"desc": "",
"lua_type": "boolean"
},
{
"desc": "",
"lua_type": "string?"
}
],
"function_type": "static",
"source": {
"line": 147,
"path": "lib/t/src/init.luau"
}
},
{
"name": "boolean",
"desc": "Ensures Lua primitive boolean type.",
"params": [
{
"name": "value",
"desc": "",
"lua_type": "any"
}
],
"returns": [
{
"desc": "",
"lua_type": "boolean"
},
{
"desc": "",
"lua_type": "string?"
}
],
"function_type": "static",
"source": {
"line": 164,
"path": "lib/t/src/init.luau"
}
},
{
"name": "buffer",
"desc": "Ensures Lua primitive buffer type.",
"params": [
{
"name": "value",
"desc": "",
"lua_type": "any"
}
],
"returns": [
{
"desc": "",
"lua_type": "boolean"
},
{
"desc": "",
"lua_type": "string?"
}
],
"function_type": "static",
"source": {
"line": 174,
"path": "lib/t/src/init.luau"
}
},
{
"name": "callback",
"desc": "Ensures Lua primitive function type.",
"params": [
{
"name": "value",
"desc": "",
"lua_type": "any"
}
],
"returns": [
{
"desc": "",
"lua_type": "boolean"
},
{
"desc": "",
"lua_type": "string?"
}
],
"function_type": "static",
"source": {
"line": 184,
"path": "lib/t/src/init.luau"
}
},
{
"name": "nan",
"desc": "Ensures value is NaN.\n\n```lua\nprint(t.nan(0 / 0)) --> true\nprint(t.nan(5)) --> false, \"unexpected non-NaN value\"\n```",
"params": [
{
"name": "value",
"desc": "",
"lua_type": "any"
}
],
"returns": [
{
"desc": "",
"lua_type": "boolean"
},
{
"desc": "",
"lua_type": "string?"
}
],
"function_type": "static",
"source": {
"line": 201,
"path": "lib/t/src/init.luau"
}
},
{
"name": "none",
"desc": "Ensures Lua primitive nil type.",
"params": [
{
"name": "value",
"desc": "",
"lua_type": "any"
}
],
"returns": [
{
"desc": "",
"lua_type": "boolean"
},
{
"desc": "",
"lua_type": "string?"
}
],
"function_type": "static",
"source": {
"line": 223,
"path": "lib/t/src/init.luau"
}
},
{
"name": "number",
"desc": "Ensures value is a non-NaN number.\n\n```lua\nprint(t.number(42)) --> true\nprint(t.number(0 / 0)) --> false, \"unexpected NaN value\"\n```",
"params": [
{
"name": "value",
"desc": "",
"lua_type": "any"
}
],
"returns": [
{
"desc": "",
"lua_type": "boolean"
},
{
"desc": "",
"lua_type": "string?"
}
],
"function_type": "static",
"source": {
"line": 240,
"path": "lib/t/src/init.luau"
}
},
{
"name": "string",
"desc": "Ensures Lua primitive string type.",
"params": [
{
"name": "value",
"desc": "",
"lua_type": "any"
}
],
"returns": [
{
"desc": "",
"lua_type": "boolean"
},
{
"desc": "",
"lua_type": "string?"
}
],
"function_type": "static",
"source": {
"line": 262,
"path": "lib/t/src/init.luau"
}
},
{
"name": "table",
"desc": "Ensures Lua primitive table type.",
"params": [
{
"name": "value",
"desc": "",
"lua_type": "any"
}
],
"returns": [
{
"desc": "",
"lua_type": "boolean"
},
{
"desc": "",
"lua_type": "string?"
}
],
"function_type": "static",
"source": {
"line": 272,
"path": "lib/t/src/init.luau"
}
},
{
"name": "thread",
"desc": "Ensures Lua primitive thread type.",
"params": [
{
"name": "value",
"desc": "",
"lua_type": "any"
}
],
"returns": [
{
"desc": "",
"lua_type": "boolean"
},
{
"desc": "",
"lua_type": "string?"
}
],
"function_type": "static",
"source": {
"line": 282,
"path": "lib/t/src/init.luau"
}
},
{
"name": "userdata",
"desc": "Ensures Lua primitive userdata type.",
"params": [
{
"name": "value",
"desc": "",
"lua_type": "any"
}
],
"returns": [
{
"desc": "",
"lua_type": "boolean"
},
{
"desc": "",
"lua_type": "string?"
}
],
"function_type": "static",
"source": {
"line": 292,
"path": "lib/t/src/init.luau"
}
},
{
"name": "vector",
"desc": "Ensures Lua primitive vector type.",
"params": [
{
"name": "value",
"desc": "",
"lua_type": "any"
}
],
"returns": [
{
"desc": "",
"lua_type": "boolean"
},
{
"desc": "",
"lua_type": "string?"
}
],
"function_type": "static",
"source": {
"line": 302,
"path": "lib/t/src/init.luau"
}
},
{
"name": "Axes",
"desc": "Ensures Roblox Axes type.",
"params": [
{
"name": "value",
"desc": "",
"lua_type": "any"
}
],
"returns": [
{
"desc": "",
"lua_type": "boolean"
},
{
"desc": "",
"lua_type": "string?"
}
],
"function_type": "static",
"source": {
"line": 314,
"path": "lib/t/src/init.luau"
}
},
{
"name": "BrickColor",
"desc": "Ensures Roblox BrickColor type.",
"params": [
{
"name": "value",
"desc": "",
"lua_type": "any"
}
],
"returns": [
{
"desc": "",
"lua_type": "boolean"
},
{
"desc": "",
"lua_type": "string?"
}
],
"function_type": "static",
"source": {
"line": 324,
"path": "lib/t/src/init.luau"
}
},
{
"name": "CatalogSearchParams",
"desc": "Ensures Roblox CatalogSearchParams type.",
"params": [
{
"name": "value",
"desc": "",
"lua_type": "any"
}
],
"returns": [
{
"desc": "",
"lua_type": "boolean"
},
{
"desc": "",
"lua_type": "string?"
}
],
"function_type": "static",
"source": {
"line": 334,
"path": "lib/t/src/init.luau"
}
},
{
"name": "CFrame",
"desc": "Ensures Roblox CFrame type.",
"params": [
{
"name": "value",
"desc": "",
"lua_type": "any"
}
],
"returns": [
{
"desc": "",
"lua_type": "boolean"
},
{
"desc": "",
"lua_type": "string?"
}
],
"function_type": "static",
"source": {
"line": 344,
"path": "lib/t/src/init.luau"
}
},
{
"name": "Color3",
"desc": "Ensures Roblox Color3 type.",
"params": [
{
"name": "value",
"desc": "",
"lua_type": "any"
}
],
"returns": [
{
"desc": "",
"lua_type": "boolean"
},
{
"desc": "",
"lua_type": "string?"
}
],
"function_type": "static",
"source": {
"line": 354,
"path": "lib/t/src/init.luau"
}
},
{
"name": "ColorSequence",
"desc": "Ensures Roblox ColorSequence type.",
"params": [
{
"name": "value",
"desc": "",
"lua_type": "any"
}
],
"returns": [
{
"desc": "",
"lua_type": "boolean"
},
{
"desc": "",
"lua_type": "string?"
}
],
"function_type": "static",
"source": {
"line": 364,
"path": "lib/t/src/init.luau"
}
},
{
"name": "ColorSequenceKeypoint",
"desc": "Ensures Roblox ColorSequenceKeypoint type.",
"params": [
{
"name": "value",
"desc": "",
"lua_type": "any"
}
],
"returns": [
{
"desc": "",
"lua_type": "boolean"
},
{
"desc": "",
"lua_type": "string?"
}
],
"function_type": "static",
"source": {
"line": 374,
"path": "lib/t/src/init.luau"
}
},
{
"name": "Content",
"desc": "Ensures Roblox Content type.",
"params": [
{
"name": "value",
"desc": "",
"lua_type": "any"
}
],
"returns": [
{
"desc": "",
"lua_type": "boolean"
},
{
"desc": "",
"lua_type": "string?"
}
],
"function_type": "static",
"source": {
"line": 384,
"path": "lib/t/src/init.luau"
}
},
{
"name": "DateTime",
"desc": "Ensures Roblox DateTime type.",
"params": [
{
"name": "value",
"desc": "",
"lua_type": "any"
}
],
"returns": [
{
"desc": "",
"lua_type": "boolean"
},
{
"desc": "",
"lua_type": "string?"
}
],
"function_type": "static",
"source": {
"line": 394,
"path": "lib/t/src/init.luau"
}
},
{
"name": "DockWidgetPluginGuiInfo",
"desc": "Ensures Roblox DockWidgetPluginGuiInfo type.",
"params": [
{
"name": "value",
"desc": "",
"lua_type": "any"
}
],
"returns": [
{
"desc": "",
"lua_type": "boolean"
},
{
"desc": "",
"lua_type": "string?"
}
],
"function_type": "static",
"source": {
"line": 404,
"path": "lib/t/src/init.luau"
}
},
{
"name": "Enum",
"desc": "Ensures Roblox Enum type.",
"params": [
{
"name": "value",
"desc": "",
"lua_type": "any"
}
],
"returns": [
{
"desc": "",
"lua_type": "boolean"
},
{
"desc": "",
"lua_type": "string?"
}
],
"function_type": "static",
"source": {
"line": 414,
"path": "lib/t/src/init.luau"
}
},
{
"name": "EnumItem",
"desc": "Ensures Roblox EnumItem type.",
"params": [
{
"name": "value",
"desc": "",
"lua_type": "any"
}
],
"returns": [
{
"desc": "",
"lua_type": "boolean"
},
{
"desc": "",
"lua_type": "string?"
}
],
"function_type": "static",
"source": {
"line": 424,
"path": "lib/t/src/init.luau"
}
},
{
"name": "Enums",
"desc": "Ensures Roblox Enums type.",
"params": [
{
"name": "value",
"desc": "",
"lua_type": "any"
}
],
"returns": [
{
"desc": "",
"lua_type": "boolean"
},
{
"desc": "",
"lua_type": "string?"
}
],
"function_type": "static",
"source": {
"line": 434,
"path": "lib/t/src/init.luau"
}
},
{
"name": "Faces",
"desc": "Ensures Roblox Faces type.",
"params": [
{
"name": "value",
"desc": "",
"lua_type": "any"
}
],
"returns": [
{
"desc": "",
"lua_type": "boolean"
},
{
"desc": "",
"lua_type": "string?"
}
],
"function_type": "static",
"source": {
"line": 444,
"path": "lib/t/src/init.luau"
}
},
{
"name": "FloatCurveKey",
"desc": "Ensures Roblox FloatCurveKey type.",
"params": [
{
"name": "value",
"desc": "",
"lua_type": "any"
}
],
"returns": [
{
"desc": "",
"lua_type": "boolean"
},
{
"desc": "",
"lua_type": "string?"
}
],
"function_type": "static",
"source": {
"line": 454,
"path": "lib/t/src/init.luau"
}
},
{
"name": "Font",
"desc": "Ensures Roblox Font type.",
"params": [
{
"name": "value",
"desc": "",
"lua_type": "any"
}
],
"returns": [
{
"desc": "",
"lua_type": "boolean"
},
{
"desc": "",
"lua_type": "string?"
}
],
"function_type": "static",
"source": {
"line": 464,
"path": "lib/t/src/init.luau"
}
},
{
"name": "Instance",
"desc": "Ensures Roblox Instance type.",
"params": [
{
"name": "value",
"desc": "",
"lua_type": "any"
}
],
"returns": [
{
"desc": "",
"lua_type": "boolean"
},
{
"desc": "",
"lua_type": "string?"
}
],
"function_type": "static",
"source": {
"line": 474,
"path": "lib/t/src/init.luau"
}
},
{
"name": "NumberRange",
"desc": "Ensures Roblox NumberRange type.",
"params": [
{
"name": "value",
"desc": "",
"lua_type": "any"
}
],
"returns": [
{
"desc": "",
"lua_type": "boolean"
},
{
"desc": "",
"lua_type": "string?"
}
],
"function_type": "static",
"source": {
"line": 484,
"path": "lib/t/src/init.luau"
}
},
{
"name": "NumberSequence",
"desc": "Ensures Roblox NumberSequence type.",
"params": [
{
"name": "value",
"desc": "",
"lua_type": "any"
}
],
"returns": [
{
"desc": "",
"lua_type": "boolean"
},
{
"desc": "",
"lua_type": "string?"
}
],
"function_type": "static",
"source": {
"line": 494,
"path": "lib/t/src/init.luau"
}
},
{
"name": "NumberSequenceKeypoint",
"desc": "Ensures Roblox NumberSequenceKeypoint type.",
"params": [
{
"name": "value",
"desc": "",
"lua_type": "any"
}
],
"returns": [
{
"desc": "",
"lua_type": "boolean"
},
{
"desc": "",
"lua_type": "string?"
}
],
"function_type": "static",
"source": {
"line": 504,
"path": "lib/t/src/init.luau"
}
},
{
"name": "OverlapParams",
"desc": "Ensures Roblox OverlapParams type.",
"params": [
{
"name": "value",
"desc": "",
"lua_type": "any"
}
],
"returns": [
{
"desc": "",
"lua_type": "boolean"
},
{
"desc": "",
"lua_type": "string?"
}
],
"function_type": "static",
"source": {
"line": 514,
"path": "lib/t/src/init.luau"
}
},
{
"name": "Path2DControlPoint",
"desc": "Ensures Roblox Path2DControlPoint type.",
"params": [
{
"name": "value",
"desc": "",
"lua_type": "any"
}
],
"returns": [
{
"desc": "",
"lua_type": "boolean"
},
{
"desc": "",
"lua_type": "string?"
}
],
"function_type": "static",
"source": {
"line": 524,
"path": "lib/t/src/init.luau"
}
},
{
"name": "PathWaypoint",
"desc": "Ensures Roblox PathWaypoint type.",
"params": [
{
"name": "value",
"desc": "",
"lua_type": "any"
}
],
"returns": [
{
"desc": "",
"lua_type": "boolean"
},
{
"desc": "",
"lua_type": "string?"
}
],
"function_type": "static",
"source": {
"line": 534,
"path": "lib/t/src/init.luau"
}
},
{
"name": "PhysicalProperties",
"desc": "Ensures Roblox PhysicalProperties type.",
"params": [
{
"name": "value",
"desc": "",
"lua_type": "any"
}
],
"returns": [
{
"desc": "",
"lua_type": "boolean"
},
{
"desc": "",
"lua_type": "string?"
}
],
"function_type": "static",
"source": {
"line": 544,
"path": "lib/t/src/init.luau"
}
},
{
"name": "Random",
"desc": "Ensures Roblox Random type.",
"params": [
{
"name": "value",
"desc": "",
"lua_type": "any"
}
],
"returns": [
{
"desc": "",
"lua_type": "boolean"
},
{
"desc": "",
"lua_type": "string?"
}
],
"function_type": "static",
"source": {
"line": 554,
"path": "lib/t/src/init.luau"
}
},
{
"name": "Ray",
"desc": "Ensures Roblox Ray type.",
"params": [
{
"name": "value",
"desc": "",
"lua_type": "any"
}
],
"returns": [
{
"desc": "",
"lua_type": "boolean"
},
{
"desc": "",
"lua_type": "string?"
}
],
"function_type": "static",
"source": {
"line": 564,
"path": "lib/t/src/init.luau"
}
},
{
"name": "RaycastParams",
"desc": "Ensures Roblox RaycastParams type.",
"params": [
{
"name": "value",
"desc": "",
"lua_type": "any"
}
],
"returns": [
{
"desc": "",
"lua_type": "boolean"
},
{
"desc": "",
"lua_type": "string?"
}
],
"function_type": "static",
"source": {
"line": 574,
"path": "lib/t/src/init.luau"
}
},
{
"name": "RaycastResult",
"desc": "Ensures Roblox RaycastResult type.",
"params": [
{
"name": "value",
"desc": "",
"lua_type": "any"
}
],
"returns": [
{
"desc": "",
"lua_type": "boolean"
},
{
"desc": "",
"lua_type": "string?"
}
],
"function_type": "static",
"source": {
"line": 584,
"path": "lib/t/src/init.luau"
}
},
{
"name": "RBXScriptConnection",
"desc": "Ensures Roblox RBXScriptConnection type.",
"params": [
{
"name": "value",
"desc": "",
"lua_type": "any"
}
],
"returns": [
{
"desc": "",
"lua_type": "boolean"
},
{
"desc": "",
"lua_type": "string?"
}
],
"function_type": "static",
"source": {
"line": 594,
"path": "lib/t/src/init.luau"
}
},
{
"name": "RBXScriptSignal",
"desc": "Ensures Roblox RBXScriptSignal type.",
"params": [
{
"name": "value",
"desc": "",
"lua_type": "any"
}
],
"returns": [
{
"desc": "",
"lua_type": "boolean"
},
{
"desc": "",
"lua_type": "string?"
}
],
"function_type": "static",
"source": {
"line": 604,
"path": "lib/t/src/init.luau"
}
},
{
"name": "Rect",
"desc": "Ensures Roblox Rect type.",
"params": [
{
"name": "value",
"desc": "",
"lua_type": "any"
}
],
"returns": [
{
"desc": "",
"lua_type": "boolean"
},
{
"desc": "",
"lua_type": "string?"
}
],
"function_type": "static",
"source": {
"line": 614,
"path": "lib/t/src/init.luau"
}
},
{
"name": "Region3",
"desc": "Ensures Roblox Region3 type.",
"params": [
{
"name": "value",
"desc": "",
"lua_type": "any"
}
],
"returns": [
{
"desc": "",
"lua_type": "boolean"
},
{
"desc": "",
"lua_type": "string?"
}
],
"function_type": "static",
"source": {
"line": 624,
"path": "lib/t/src/init.luau"
}
},
{
"name": "Region3int16",
"desc": "Ensures Roblox Region3int16 type.",
"params": [
{
"name": "value",
"desc": "",
"lua_type": "any"
}
],
"returns": [
{
"desc": "",
"lua_type": "boolean"
},
{
"desc": "",
"lua_type": "string?"
}
],
"function_type": "static",
"source": {
"line": 634,
"path": "lib/t/src/init.luau"
}
},
{
"name": "RotationCurveKey",
"desc": "Ensures Roblox RotationCurveKey type.",
"params": [
{
"name": "value",
"desc": "",
"lua_type": "any"
}
],
"returns": [
{
"desc": "",
"lua_type": "boolean"
},
{
"desc": "",
"lua_type": "string?"
}
],
"function_type": "static",
"source": {
"line": 644,
"path": "lib/t/src/init.luau"
}
},
{
"name": "Secret",
"desc": "Ensures Roblox Secret type.",
"params": [
{
"name": "value",
"desc": "",
"lua_type": "any"
}
],
"returns": [
{
"desc": "",
"lua_type": "boolean"
},
{
"desc": "",
"lua_type": "string?"
}
],
"function_type": "static",
"source": {
"line": 654,
"path": "lib/t/src/init.luau"
}
},
{
"name": "SecurityCapabilities",
"desc": "Ensures Roblox SecurityCapabilities type.",
"params": [
{
"name": "value",
"desc": "",
"lua_type": "any"
}
],
"returns": [
{
"desc": "",
"lua_type": "boolean"
},
{
"desc": "",
"lua_type": "string?"
}
],
"function_type": "static",
"source": {
"line": 664,
"path": "lib/t/src/init.luau"
}
},
{
"name": "SharedTable",
"desc": "Ensures Roblox SharedTable type.",
"params": [
{
"name": "value",
"desc": "",
"lua_type": "any"
}
],
"returns": [
{
"desc": "",
"lua_type": "boolean"
},
{
"desc": "",
"lua_type": "string?"
}
],
"function_type": "static",
"source": {
"line": 674,
"path": "lib/t/src/init.luau"
}
},
{
"name": "TweenInfo",
"desc": "Ensures Roblox TweenInfo type.",
"params": [
{
"name": "value",
"desc": "",
"lua_type": "any"
}
],
"returns": [
{
"desc": "",
"lua_type": "boolean"
},
{
"desc": "",
"lua_type": "string?"
}
],
"function_type": "static",
"source": {
"line": 684,
"path": "lib/t/src/init.luau"
}
},
{
"name": "UDim",
"desc": "Ensures Roblox UDim type.",
"params": [
{
"name": "value",
"desc": "",
"lua_type": "any"
}
],
"returns": [
{
"desc": "",
"lua_type": "boolean"
},
{
"desc": "",
"lua_type": "string?"
}
],
"function_type": "static",
"source": {
"line": 694,
"path": "lib/t/src/init.luau"
}
},
{
"name": "UDim2",
"desc": "Ensures Roblox UDim2 type.",
"params": [
{
"name": "value",
"desc": "",
"lua_type": "any"
}
],
"returns": [
{
"desc": "",
"lua_type": "boolean"
},
{
"desc": "",
"lua_type": "string?"
}
],
"function_type": "static",
"source": {
"line": 704,
"path": "lib/t/src/init.luau"
}
},
{
"name": "ValueCurveKey",
"desc": "Ensures Roblox ValueCurveKey type.",
"params": [
{
"name": "value",
"desc": "",
"lua_type": "any"
}
],
"returns": [
{
"desc": "",
"lua_type": "boolean"
},
{
"desc": "",
"lua_type": "string?"
}
],
"function_type": "static",
"source": {
"line": 714,
"path": "lib/t/src/init.luau"
}
},
{
"name": "Vector2",
"desc": "Ensures Roblox Vector2 type.",
"params": [
{
"name": "value",
"desc": "",
"lua_type": "any"
}
],
"returns": [
{
"desc": "",
"lua_type": "boolean"
},
{
"desc": "",
"lua_type": "string?"
}
],
"function_type": "static",
"source": {
"line": 724,
"path": "lib/t/src/init.luau"
}
},
{
"name": "Vector2int16",
"desc": "Ensures Roblox Vector2int16 type.",
"params": [
{
"name": "value",
"desc": "",
"lua_type": "any"
}
],
"returns": [
{
"desc": "",
"lua_type": "boolean"
},
{
"desc": "",
"lua_type": "string?"
}
],
"function_type": "static",
"source": {
"line": 734,
"path": "lib/t/src/init.luau"
}
},
{
"name": "Vector3",
"desc": "Ensures Roblox Vector3 type.",
"params": [
{
"name": "value",
"desc": "",
"lua_type": "any"
}
],
"returns": [
{
"desc": "",
"lua_type": "boolean"
},
{
"desc": "",
"lua_type": "string?"
}
],
"function_type": "static",
"source": {
"line": 744,
"path": "lib/t/src/init.luau"
}
},
{
"name": "Vector3int16",
"desc": "Ensures Roblox Vector3int16 type.",
"params": [
{
"name": "value",
"desc": "",
"lua_type": "any"
}
],
"returns": [
{
"desc": "",
"lua_type": "boolean"
},
{
"desc": "",
"lua_type": "string?"
}
],
"function_type": "static",
"source": {
"line": 754,
"path": "lib/t/src/init.luau"
}
},
{
"name": "literal",
"desc": "Ensures value is a given literal value. When given multiple arguments,\ncreates a union of the provided literals.\n\n```lua\nlocal stateCheck = t.literal(\"idle\", \"running\")\nprint(stateCheck(\"idle\")) --> true\n```",
"params": [
{
"name": "...",
"desc": "The literal value(s) to match",
"lua_type": "any"
}
],
"returns": [
{
"desc": "",
"lua_type": "Check"
}
],
"function_type": "static",
"source": {
"line": 774,
"path": "lib/t/src/init.luau"
}
},
{
"name": "exactly",
"desc": "Alias for `t.literal`.",
"params": [
{
"name": "...",
"desc": "The literal value(s) to match",
"lua_type": "any"
}
],
"returns": [
{
"desc": "",
"lua_type": "Check<V>"
}
],
"function_type": "static",
"deprecated": {
"version": "Use `t.literal` instead.",
"desc": null
},
"source": {
"line": 803,
"path": "lib/t/src/init.luau"
}
},
{
"name": "keyOf",
"desc": "Returns a `t.union` of each key in the table as a `t.literal`.\n\n```lua\nlocal isMode = t.keyOf({ Easy = true, Hard = true })\nprint(isMode(\"Easy\")) --> true\n```",
"params": [
{
"name": "keyTable",
"desc": "The table whose keys are the allowed values",
"lua_type": "{[K]: any}"
}
],
"returns": [
{
"desc": "",
"lua_type": "Check<K>"
}
],
"function_type": "static",
"source": {
"line": 818,
"path": "lib/t/src/init.luau"
}
},
{
"name": "valueOf",
"desc": "Returns a `t.union` of each value in the table as a `t.literal`.\n\n```lua\nlocal isRank = t.valueOf({ Bronze = 1, Silver = 2 })\nprint(isRank(2)) --> true\n```",
"params": [
{
"name": "valueTable",
"desc": "The table whose values are the allowed values",
"lua_type": "{[any]: V}"
}
],
"returns": [
{
"desc": "",
"lua_type": "Check"
}
],
"function_type": "static",
"source": {
"line": 842,
"path": "lib/t/src/init.luau"
}
},
{
"name": "integer",
"desc": "Ensures value is an integer (whole number).\n\n```lua\nprint(t.integer(8)) --> true\nprint(t.integer(8.5)) --> false, \"integer expected, got 8.5\"\n```",
"params": [
{
"name": "value",
"desc": "",
"lua_type": "any"
}
],
"returns": [
{
"desc": "",
"lua_type": "boolean"
},
{
"desc": "",
"lua_type": "string?"
}
],
"function_type": "static",
"source": {
"line": 867,
"path": "lib/t/src/init.luau"
}
},
{
"name": "integerMin",
"desc": "Ensures value is an integer where `min <= value`.\n\n```lua\nlocal atLeastTen = t.integerMin(10)\nprint(atLeastTen(12)) --> true\n```",
"params": [
{
"name": "min",
"desc": "The inclusive minimum bound",
"lua_type": "number"
}
],
"returns": [
{
"desc": "",
"lua_type": "Check"
}
],
"function_type": "static",
"source": {
"line": 893,
"path": "lib/t/src/init.luau"
}
},
{
"name": "integerMax",
"desc": "Ensures value is an integer where `value <= max`.\n\n```lua\nlocal atMostTen = t.integerMax(10)\nprint(atMostTen(8)) --> true\n```",
"params": [
{
"name": "max",
"desc": "The inclusive maximum bound",
"lua_type": "number"
}
],
"returns": [
{
"desc": "",
"lua_type": "Check"
}
],
"function_type": "static",
"source": {
"line": 922,
"path": "lib/t/src/init.luau"
}
},
{
"name": "integerMinExclusive",
"desc": "Ensures value is an integer where `min < value`.\n\n```lua\nlocal positive = t.integerMinExclusive(0)\nprint(positive(1)) --> true\n```",
"params": [
{
"name": "min",
"desc": "The exclusive minimum bound",
"lua_type": "number"
}
],
"returns": [
{
"desc": "",
"lua_type": "Check"
}
],
"function_type": "static",
"source": {
"line": 951,
"path": "lib/t/src/init.luau"
}
},
{
"name": "integerMaxExclusive",
"desc": "Ensures value is an integer where `value < max`.\n\n```lua\nlocal belowTen = t.integerMaxExclusive(10)\nprint(belowTen(9)) --> true\n```",
"params": [
{
"name": "max",
"desc": "The exclusive maximum bound",
"lua_type": "number"
}
],
"returns": [
{
"desc": "",
"lua_type": "Check"
}
],
"function_type": "static",
"source": {
"line": 980,
"path": "lib/t/src/init.luau"
}
},
{
"name": "integerPositive",
"desc": "Ensures value is an integer greater than 0.",
"params": [
{
"name": "value",
"desc": "",
"lua_type": "any"
}
],
"returns": [
{
"desc": "",
"lua_type": "boolean"
},
{
"desc": "",
"lua_type": "string?"
}
],
"function_type": "static",
"source": {
"line": 1004,
"path": "lib/t/src/init.luau"
}
},
{
"name": "integerNegative",
"desc": "Ensures value is an integer less than 0.",
"params": [
{
"name": "value",
"desc": "",
"lua_type": "any"
}
],
"returns": [
{
"desc": "",
"lua_type": "boolean"
},
{
"desc": "",
"lua_type": "string?"
}
],
"function_type": "static",
"source": {
"line": 1014,
"path": "lib/t/src/init.luau"
}
},
{
"name": "integerConstrained",
"desc": "Ensures value is an integer where `min <= value <= max`.\n\n```lua\nlocal levelCheck = t.integerConstrained(1, 100)\nprint(levelCheck(25)) --> true\n```",
"params": [
{
"name": "min",
"desc": "The inclusive minimum bound",
"lua_type": "number"
},
{
"name": "max",
"desc": "The inclusive maximum bound",
"lua_type": "number"
}
],
"returns": [
{
"desc": "",
"lua_type": "Check"
}
],
"function_type": "static",
"source": {
"line": 1030,
"path": "lib/t/src/init.luau"
}
},
{
"name": "integerConstrainedExclusive",
"desc": "Ensures value is an integer where `min < value < max`.\n\n```lua\nlocal bounded = t.integerConstrainedExclusive(0, 10)\nprint(bounded(5)) --> true\n```",
"params": [
{
"name": "min",
"desc": "The exclusive minimum bound",
"lua_type": "number"
},
{
"name": "max",
"desc": "The exclusive maximum bound",
"lua_type": "number"
}
],
"returns": [
{
"desc": "",
"lua_type": "Check"
}
],
"function_type": "static",
"source": {
"line": 1063,
"path": "lib/t/src/init.luau"
}
},
{
"name": "numberMin",
"desc": "Ensures value is a number where `min <= value`.\n\n```lua\nlocal atLeastTen = t.numberMin(10)\nprint(atLeastTen(12)) --> true\n```",
"params": [
{
"name": "min",
"desc": "The inclusive minimum bound",
"lua_type": "number"
}
],
"returns": [
{
"desc": "",
"lua_type": "Check"
}
],
"function_type": "static",
"source": {
"line": 1095,
"path": "lib/t/src/init.luau"
}
},
{
"name": "numberMax",
"desc": "Ensures value is a number where `value <= max`.\n\n```lua\nlocal atMostTen = t.numberMax(10)\nprint(atMostTen(8)) --> true\n```",
"params": [
{
"name": "max",
"desc": "The inclusive maximum bound",
"lua_type": "number"
}
],
"returns": [
{
"desc": "",
"lua_type": "Check"
}
],
"function_type": "static",
"source": {
"line": 1123,
"path": "lib/t/src/init.luau"
}
},
{
"name": "numberMinExclusive",
"desc": "Ensures value is a number where `min < value`.\n\n```lua\nlocal positive = t.numberMinExclusive(0)\nprint(positive(1)) --> true\n```",
"params": [
{
"name": "min",
"desc": "The exclusive minimum bound",
"lua_type": "number"
}
],
"returns": [
{
"desc": "",
"lua_type": "Check"
}
],
"function_type": "static",
"source": {
"line": 1151,
"path": "lib/t/src/init.luau"
}
},
{
"name": "numberMaxExclusive",
"desc": "Ensures value is a number where `value < max`.\n\n```lua\nlocal belowTen = t.numberMaxExclusive(10)\nprint(belowTen(9)) --> true\n```",
"params": [
{
"name": "max",
"desc": "The exclusive maximum bound",
"lua_type": "number"
}
],
"returns": [
{
"desc": "",
"lua_type": "Check"
}
],
"function_type": "static",
"source": {
"line": 1179,
"path": "lib/t/src/init.luau"
}
},
{
"name": "numberPositive",
"desc": "Ensures value is a number greater than 0.",
"params": [
{
"name": "value",
"desc": "",
"lua_type": "any"
}
],
"returns": [
{
"desc": "",
"lua_type": "boolean"
},
{
"desc": "",
"lua_type": "string?"
}
],
"function_type": "static",
"source": {
"line": 1202,
"path": "lib/t/src/init.luau"
}
},
{
"name": "numberNegative",
"desc": "Ensures value is a number less than 0.",
"params": [
{
"name": "value",
"desc": "",
"lua_type": "any"
}
],
"returns": [
{
"desc": "",
"lua_type": "boolean"
},
{
"desc": "",
"lua_type": "string?"
}
],
"function_type": "static",
"source": {
"line": 1212,
"path": "lib/t/src/init.luau"
}
},
{
"name": "numberConstrained",
"desc": "Ensures value is a number where `min <= value <= max`.\n\n```lua\nlocal healthCheck = t.numberConstrained(0, 100)\nprint(healthCheck(75)) --> true\n```",
"params": [
{
"name": "min",
"desc": "The inclusive minimum bound",
"lua_type": "number"
},
{
"name": "max",
"desc": "The inclusive maximum bound",
"lua_type": "number"
}
],
"returns": [
{
"desc": "",
"lua_type": "Check"
}
],
"function_type": "static",
"source": {
"line": 1228,
"path": "lib/t/src/init.luau"
}
},
{
"name": "numberConstrainedExclusive",
"desc": "Ensures value is a number where `min < value < max`.\n\n```lua\nlocal unitInterval = t.numberConstrainedExclusive(0, 1)\nprint(unitInterval(0.5)) --> true\n```",
"params": [
{
"name": "min",
"desc": "The exclusive minimum bound",
"lua_type": "number"
},
{
"name": "max",
"desc": "The exclusive maximum bound",
"lua_type": "number"
}
],
"returns": [
{
"desc": "",
"lua_type": "Check"
}
],
"function_type": "static",
"source": {
"line": 1261,
"path": "lib/t/src/init.luau"
}
},
{
"name": "match",
"desc": "Ensures value is a string matching the given Lua pattern.\n\n```lua\nlocal isSlug = t.match(\"^[a-z]+%-%d+$\")\nprint(isSlug(\"entry-42\")) --> true\n```",
"params": [
{
"name": "pattern",
"desc": "The Lua pattern to match against",
"lua_type": "string"
}
],
"returns": [
{
"desc": "",
"lua_type": "Check<string>"
}
],
"function_type": "static",
"source": {
"line": 1297,
"path": "lib/t/src/init.luau"
}
},
{
"name": "optional",
"desc": "Ensures value is either nil or passes the given check.\n\n```lua\nlocal maybeString = t.optional(t.string)\nprint(maybeString(nil)) --> true\n```",
"params": [
{
"name": "check",
"desc": "The check to apply when the value is non-nil",
"lua_type": "Check<V>"
}
],
"returns": [
{
"desc": "",
"lua_type": "Check<V?>"
}
],
"function_type": "static",
"source": {
"line": 1325,
"path": "lib/t/src/init.luau"
}
},
{
"name": "where",
"desc": "Refines an existing check with an additional predicate.\n\n```lua\nlocal nonEmptyString = t.where(t.string, function(value)\n\treturn #value > 0, \"string must not be empty\"\nend)\n```",
"params": [
{
"name": "check",
"desc": "The base check that must pass first",
"lua_type": "Check<V>"
},
{
"name": "predicate",
"desc": "Additional validation applied after `check`",
"lua_type": "(value: V) -> (boolean, string?)"
}
],
"returns": [
{
"desc": "",
"lua_type": "Check<V>"
}
],
"function_type": "static",
"source": {
"line": 1357,
"path": "lib/t/src/init.luau"
}
},
{
"name": "tuple",
"desc": "Matches a tuple of values against a tuple of checks.\n\n```lua\nlocal fooArgs = t.tuple(t.string, t.number)\nprint(fooArgs(\"score\", 50)) --> true\n```",
"params": [
{
"name": "...",
"desc": "The check for each tuple position, in order",
"lua_type": "Check"
}
],
"returns": [
{
"desc": "",
"lua_type": "CheckTuple"
}
],
"function_type": "static",
"source": {
"line": 1393,
"path": "lib/t/src/init.luau"
}
},
{
"name": "strictTuple",
"desc": "Matches a tuple of values against a tuple of checks and disallows excess arguments.\n\n```lua\nlocal createArgs = t.strictTuple(t.string, t.number)\nprint(createArgs(\"score\", 50)) --> true\n```",
"params": [
{
"name": "...",
"desc": "The check for each tuple position, in order",
"lua_type": "Check"
}
],
"returns": [
{
"desc": "",
"lua_type": "CheckTuple"
}
],
"function_type": "static",
"source": {
"line": 1421,
"path": "lib/t/src/init.luau"
}
},
{
"name": "keys",
"desc": "Ensures all keys in a table pass the given check.\n\n```lua\nlocal stringKeys = t.keys(t.string)\nprint(stringKeys({ Name = true })) --> true\n```",
"params": [
{
"name": "check",
"desc": "The check applied to each key",
"lua_type": "Check<K>"
}
],
"returns": [
{
"desc": "",
"lua_type": "Check<{ [K]: unknown }>"
}
],
"function_type": "static",
"source": {
"line": 1455,
"path": "lib/t/src/init.luau"
}
},
{
"name": "values",
"desc": "Ensures all values in a table pass the given check.\n\n```lua\nlocal numberValues = t.values(t.number)\nprint(numberValues({ Coins = 10 })) --> true\n```",
"params": [
{
"name": "check",
"desc": "The check applied to each value",
"lua_type": "Check<V>"
}
],
"returns": [
{
"desc": "",
"lua_type": "Check<{ [any]: V }>"
}
],
"function_type": "static",
"source": {
"line": 1486,
"path": "lib/t/src/init.luau"
}
},
{
"name": "map<K, V>",
"desc": "Ensures value is a table where all keys pass `keyCheck` and all values pass `valueCheck`.\n\n```lua\nlocal scoreMap = t.map(t.string, t.number)\nprint(scoreMap({ Alpha = 10 })) --> true\n```",
"params": [
{
"name": "keyCheck",
"desc": "Check applied to each key",
"lua_type": "Check<K>"
},
{
"name": "valueCheck",
"desc": "Check applied to each value",
"lua_type": "Check<V>"
}
],
"returns": [
{
"desc": "",
"lua_type": "Check<{ [K]: V }>"
}
],
"function_type": "static",
"source": {
"line": 1518,
"path": "lib/t/src/init.luau"
}
},
{
"name": "set",
"desc": "Ensures value is a set — a table where all keys pass `valueCheck` and all values are `true`.\n\n```lua\nlocal tagSet = t.set(t.string)\nprint(tagSet({ Fast = true, Active = true })) --> true\n```",
"params": [
{
"name": "valueCheck",
"desc": "Check applied to each key",
"lua_type": "Check<K>"
}
],
"returns": [
{
"desc": "",
"lua_type": "Check<{ [K]: true }>"
}
],
"function_type": "static",
"source": {
"line": 1550,
"path": "lib/t/src/init.luau"
}
},
{
"name": "array",
"desc": "Ensures value is a sequential array where every element passes the given check.\n\n```lua\nlocal stringArray = t.array(t.string)\nprint(stringArray({ \"a\", \"b\" })) --> true\n```",
"params": [
{
"name": "check",
"desc": "The check applied to each element",
"lua_type": "Check<V>"
}
],
"returns": [
{
"desc": "",
"lua_type": "Check<{V}>"
}
],
"function_type": "static",
"source": {
"line": 1570,
"path": "lib/t/src/init.luau"
}
},
{
"name": "strictArray",
"desc": "Ensures value is an array with an exact sequence of element types.\nThe array must not be longer than the number of provided checks.\n\n```lua\nlocal playerTuple = t.strictArray(t.string, t.number)\nprint(playerTuple({ \"Builderman\", 100 })) --> true\n```",
"params": [
{
"name": "...",
"desc": "The checks for each array index, in order",
"lua_type": "Check"
}
],
"returns": [
{
"desc": "",
"lua_type": "Check<{ any }>"
}
],
"function_type": "static",
"source": {
"line": 1612,
"path": "lib/t/src/init.luau"
}
},
{
"name": "union",
"desc": "Creates a union type that passes if any of the given checks pass.\n\n```lua\nlocal stringOrNumber = t.union(t.string, t.number)\nprint(stringOrNumber(5)) --> true\n```",
"params": [
{
"name": "...",
"desc": "The checks to union",
"lua_type": "Check"
}
],
"returns": [
{
"desc": "",
"lua_type": "Check"
}
],
"function_type": "static",
"source": {
"line": 1655,
"path": "lib/t/src/init.luau"
}
},
{
"name": "anyOf",
"desc": "Alias for `t.union`.",
"params": [
{
"name": "...",
"desc": "The checks to union",
"lua_type": "Check"
}
],
"returns": [
{
"desc": "",
"lua_type": "Check"
}
],
"function_type": "static",
"source": {
"line": 1681,
"path": "lib/t/src/init.luau"
}
},
{
"name": "some",
"desc": "Alias for `t.union`.",
"params": [
{
"name": "...",
"desc": "The checks to union",
"lua_type": "Check"
}
],
"returns": [
{
"desc": "",
"lua_type": "Check"
}
],
"function_type": "static",
"deprecated": {
"version": "Use `t.union` instead.",
"desc": null
},
"source": {
"line": 1691,
"path": "lib/t/src/init.luau"
}
},
{
"name": "intersection",
"desc": "Creates an intersection type that passes only if all of the given checks pass.\n\n```lua\nlocal positiveInteger = t.intersection(t.integer, t.numberPositive)\nprint(positiveInteger(4)) --> true\n```",
"params": [
{
"name": "...",
"desc": "The checks to intersect",
"lua_type": "Check"
}
],
"returns": [
{
"desc": "",
"lua_type": "Check<V>"
}
],
"function_type": "static",
"source": {
"line": 1706,
"path": "lib/t/src/init.luau"
}
},
{
"name": "allOf",
"desc": "Alias for `t.intersection`.",
"params": [
{
"name": "...",
"desc": "The checks to intersect",
"lua_type": "Check<V>"
}
],
"returns": [
{
"desc": "",
"lua_type": "Check<V>"
}
],
"function_type": "static",
"source": {
"line": 1730,
"path": "lib/t/src/init.luau"
}
},
{
"name": "every",
"desc": "Alias for `t.intersection`.",
"params": [
{
"name": "...",
"desc": "The checks to intersect",
"lua_type": "Check<V>"
}
],
"returns": [
{
"desc": "",
"lua_type": "Check<V>"
}
],
"function_type": "static",
"deprecated": {
"version": "Use `t.intersection` instead.",
"desc": null
},
"source": {
"line": 1740,
"path": "lib/t/src/init.luau"
}
},
{
"name": "interface",
"desc": "Ensures value is a table matching the given interface definition.\nExtra fields on the table are allowed.\n\n```lua\nlocal playerCheck = t.interface({\n\tName = t.string,\n\tHealth = t.number,\n})\n```",
"params": [
{
"name": "checkTable",
"desc": "Map of field name to checker",
"lua_type": "{[any]: Check}"
}
],
"returns": [
{
"desc": "",
"lua_type": "Check<{ [any]: any }>"
}
],
"function_type": "static",
"source": {
"line": 1778,
"path": "lib/t/src/init.luau"
}
},
{
"name": "partialInterface",
"desc": "Ensures value is a table whose known fields pass the given checks when present.\nMissing fields are allowed.\n\nEquivalent to wrapping all the values of `checkTable` in a `t.interface` with `t.optional`.\n\n```lua\nlocal patchCheck = t.partialInterface({\n\tName = t.string,\n\tHealth = t.number,\n})\n```",
"params": [
{
"name": "checkTable",
"desc": "Map of field name to checker for optional fields",
"lua_type": "{[any]: Check}"
}
],
"returns": [
{
"desc": "",
"lua_type": "Check<{ [any]: any }>"
}
],
"function_type": "static",
"source": {
"line": 1814,
"path": "lib/t/src/init.luau"
}
},
{
"name": "strictInterface",
"desc": "Ensures value is a table matching the given interface definition exactly.\nAny extra fields not present in `checkTable` will cause the check to fail.\n\n```lua\nlocal exactPlayerCheck = t.strictInterface({\n\tName = t.string,\n\tHealth = t.number,\n})\n```",
"params": [
{
"name": "checkTable",
"desc": "Map of field name to checker",
"lua_type": "{[any]: Check}"
}
],
"returns": [
{
"desc": "",
"lua_type": "Check<{ [any]: any }>"
}
],
"function_type": "static",
"source": {
"line": 1852,
"path": "lib/t/src/init.luau"
}
},
{
"name": "attributes",
"desc": "Ensures an Instance has attributes whose values pass the corresponding checks.\n\n```lua\nlocal hasValidAttributes = t.attributes({\n\tHealth = t.numberConstrained(0, 100),\n\tDisplayName = t.match(\"^Player%d+$\"),\n})\n```",
"params": [
{
"name": "checkTable",
"desc": "Map of attribute name to checker",
"lua_type": "{[string]: Check}"
}
],
"returns": [
{
"desc": "",
"lua_type": "Check<Instance>"
}
],
"function_type": "static",
"source": {
"line": 1905,
"path": "lib/t/src/init.luau"
}
},
{
"name": "properties",
"desc": "Ensures an Instance has properties whose values pass the corresponding checks.\n\n```lua\nlocal validNpcRef = t.properties({\n\tName = t.literal(\"Boss\", \"Minion\"),\n\tValue = t.instanceOf(\"Model\"),\n})\n```",
"params": [
{
"name": "checkTable",
"desc": "Map of property name to checker",
"lua_type": "{[string]: Check}"
}
],
"returns": [
{
"desc": "",
"lua_type": "Check<Instance>"
}
],
"function_type": "static",
"source": {
"line": 1938,
"path": "lib/t/src/init.luau"
}
},
{
"name": "instanceOf",
"desc": "Ensures value is an Instance whose `ClassName` exactly matches the given class name.\n\n```lua\nlocal isFolder = t.instanceOf(\"Folder\")\nprint(isFolder(Instance.new(\"Folder\"))) --> true\n```\n\nExample with child checks:\n```lua\nlocal isModelWithDisplayName = t.instanceOf(\"Model\", {\n\tDisplayName = t.instanceOf(\"StringValue\"),\n})\nprint(isModelWithDisplayName(model)) --> true if model has a StringValue child named DisplayName\n```\n\nCompose additional checks with `t.intersection`:\n```lua\nlocal checkModel = t.intersection(\n\tt.instanceOf(\"Model\", {\n\t\tConfig = t.instanceOf(\"StringValue\"),\n\t}),\n\tt.attributes({\n\tEnabled = t.boolean,\n\t}),\n\tt.properties({\n\tName = t.string,\n\t})\n)\n```",
"params": [
{
"name": "className",
"desc": "The exact class name to match",
"lua_type": "string"
},
{
"name": "childTable",
"desc": "Optional map of child names to checks",
"lua_type": "{[string]: Check<Instance>}?"
}
],
"returns": [
{
"desc": "",
"lua_type": "Check<Instance>"
}
],
"function_type": "static",
"source": {
"line": 2001,
"path": "lib/t/src/init.luau"
}
},
{
"name": "instance",
"desc": "Alias for `t.instanceOf`.",
"params": [
{
"name": "className",
"desc": "The exact class name to match",
"lua_type": "string"
},
{
"name": "childTable",
"desc": "Optional map of child names to checks",
"lua_type": "{[string]: Check<Instance>}?"
}
],
"returns": [
{
"desc": "",
"lua_type": "Check<Instance>"
}
],
"function_type": "static",
"deprecated": {
"version": "Use `t.instanceOf` instead.",
"desc": null
},
"source": {
"line": 2032,
"path": "lib/t/src/init.luau"
}
},
{
"name": "instanceIsA",
"desc": "Ensures value is an Instance that passes `value:IsA(className)`.\n\n```lua\nlocal isGuiObject = t.instanceIsA(\"GuiObject\")\nprint(isGuiObject(Instance.new(\"Frame\"))) --> true\n```\n\nCompose alternative schemas with `t.union`:\n```lua\nlocal folderOrModel = t.union(\n\tt.instanceOf(\"Folder\"),\n\tt.instanceOf(\"Model\")\n)\n```",
"params": [
{
"name": "className",
"desc": "The class name to use with `IsA`",
"lua_type": "string"
},
{
"name": "childTable",
"desc": "Optional map of child names to checks",
"lua_type": "{[string]: Check<Instance>}?"
}
],
"returns": [
{
"desc": "",
"lua_type": "Check<Instance>"
}
],
"function_type": "static",
"source": {
"line": 2056,
"path": "lib/t/src/init.luau"
}
},
{
"name": "children",
"desc": "Ensures an Instance tree has named children that pass the corresponding checks.\nEach entry in `checkTable` must be satisfied by a child with that exact name.\n\n```lua\nlocal hasConfig = t.children({\n\tConfig = t.instanceOf(\"StringValue\"),\n})\n```\n\n:::warning\nIf the instance has multiple children with the same name, this check will always fail.\n:::",
"params": [
{
"name": "checkTable",
"desc": "Map of child name to checker",
"lua_type": "{[string]: Check<Instance>}"
}
],
"returns": [
{
"desc": "",
"lua_type": "Check<Instance>"
}
],
"function_type": "static",
"source": {
"line": 2097,
"path": "lib/t/src/init.luau"
}
},
{
"name": "itemOfEnum",
"desc": "Ensures value is an EnumItem belonging to the given Enum type.\n\n:::tip Choosing the right Enum check\nThere are three related validators:\n- `t.itemOfEnum(enum)` checks for a specific enum type like `Enum.Material`.\n- `t.EnumItem` accepts any `EnumItem`.\n- `t.Enum` accepts an enum container like `Enum.Material` itself.\n:::\n\n```lua\nlocal isMaterial = t.itemOfEnum(Enum.Material)\nprint(isMaterial(Enum.Material.Slate)) --> true\nprint(isMaterial(Enum.KeyCode.A)) --> false\n```",
"params": [
{
"name": "enum",
"desc": "The Enum type to check against",
"lua_type": "Enum"
}
],
"returns": [
{
"desc": "",
"lua_type": "Check<EnumItem>"
}
],
"function_type": "static",
"source": {
"line": 2150,
"path": "lib/t/src/init.luau"
}
},
{
"name": "wrap",
"desc": "Wraps a callback with an argument-check assertion. The returned function\nwill `assert` the check before forwarding to the original callback.\n\n```lua\nlocal add = t.wrap(function(a, b)\n\treturn a + b\nend, t.tuple(t.number, t.number))\n```",
"params": [
{
"name": "callback",
"desc": "The function to wrap",
"lua_type": "(...any) -> ...any"
},
{
"name": "checkArgs",
"desc": "The check asserted on the arguments",
"lua_type": "CheckTuple"
}
],
"returns": [
{
"desc": "",
"lua_type": "(...any) -> ...any"
}
],
"function_type": "static",
"source": {
"line": 2188,
"path": "lib/t/src/init.luau"
}
},
{
"name": "wrapArgs",
"desc": "Wraps a callback with an argument-check assertion, taking variadic\nsingle-value checks and composing them into a tuple check internally.\n\n```lua\nlocal add = t.wrapArgs(function(a, b)\n\treturn a + b\nend, t.number, t.number)\n```",
"params": [
{
"name": "callback",
"desc": "The function to wrap",
"lua_type": "(...any) -> ...any"
},
{
"name": "...",
"desc": "Positional checks composed via `t.tuple`",
"lua_type": "Check"
}
],
"returns": [
{
"desc": "",
"lua_type": "(...any) -> ...any"
}
],
"function_type": "static",
"source": {
"line": 2213,
"path": "lib/t/src/init.luau"
}
},
{
"name": "strict",
"desc": "Wraps a check in an `assert`, producing a function that throws on failure.\n\n```lua\nlocal assertString = t.strict(t.tuple(t.string))\nassertString(\"hello\")\n```",
"params": [
{
"name": "check",
"desc": "The check to wrap",
"lua_type": "CheckTuple"
}
],
"returns": [
{
"desc": "",
"lua_type": "(...any) -> ()"
}
],
"function_type": "static",
"source": {
"line": 2235,
"path": "lib/t/src/init.luau"
}
}
],
"properties": [],
"types": [
{
"name": "Check<V>",
"desc": "A function that validates a single value and returns `true` on success or `false, errorMessage` on failure.\n`V` is a phantom type tag used for composition — callers may pass any value regardless of V.",
"lua_type": "(value: V | any) -> (boolean, string?)",
"source": {
"line": 51,
"path": "lib/t/src/init.luau"
}
},
{
"name": "CheckStrict<V>",
"desc": "A function that validates a single value and returns `true` on success or `false, errorMessage` on failure.\nUnlike `Check`, a `CheckStrict` is used for strict checks that will potentially error on invalid input.",
"lua_type": "(value: V) -> (boolean, string?)",
"ignore": true,
"source": {
"line": 60,
"path": "lib/t/src/init.luau"
}
},
{
"name": "CheckTuple<V...>",
"desc": "A function that validates a list of positional arguments and returns `true` on success or `false, errorMessage` on failure.",
"lua_type": "(...: V...) -> (boolean, string?)",
"source": {
"line": 67,
"path": "lib/t/src/init.luau"
}
}
],
"name": "T",
"desc": "A composable runtime typechecker for Luau and Roblox.\n\nEach check returns `true` on success or `false, errorMessage` on\nfailure, which makes the library useful both for defensive assertions and\nreusable configuration validation.\n\n### Examples\n\n```lua\nlocal t = require(path.to.t)\n\nlocal ok, err = t.string(\"hello\")\nprint(ok, err) --> true nil\n\nlocal checkPlayer = t.interface({\n Name = t.string,\n Health = t.numberConstrained(0, 100),\n})\n\nprint(checkPlayer({ Name = \"Builderman\", Health = 100 })) --> true\nprint(checkPlayer({ Name = \"Builderman\", Health = 150 })) --> false [interface] ...\n```\n\n```lua\nlocal t = require(path.to.t)\n\n\nlocal isStringArray = t.array(t.string)\nassert(isStringArray({ \"a\", \"b\", \"c\" })) -- true\nassert(isStringArray({ \"a\", 1, \"c\" })) -- false, bad value for key 2: string expected, got number\n```",
"source": {
"line": 40,
"path": "lib/t/src/init.luau"
}
}