Available on crate feature
roblox
only.Expand description
Contains the types necessary to parse Luau. The module name is a misnomer from when Luau was just types. It will be renamed to “luau” in the future.
Structs
- A Compound Assignment statement, such as
x += 1
orx -= 1
- An elseif expression in a bigger
IfExpression
expression - An exported type declaration, such as
export type Meters = number
- The generics used in a
TypeDeclaration
. - A generic declaration parameter us in
GenericDeclaration
. Consists of aGenericParameterInfo
and an optional default type. - An if statement
- An interpolated string, such as
`hello, {"world"}!`
. “segments”, made up ofInterpolatedStringSegment
s, is each part of the string, up until thelast_string
. The number of segments is the number of expressions used. For example,`1{2}3`
would have one segment, with literal “1” (marked with aTokenType
ofInterpolatedString { token: "1", kind: InterpolatedStringKind::Begin }
), and the expression2
. Thelast_string
would be the literal 3, with a backtick afterwards. - Segments of an interpolated string, as seen in
InterpolatedString
. Read the documentation forInterpolatedString
for more information. - A type argument specified in a callback type, the
count: number
in(count: number) -> ()
- A type assertion using
::
, such as:: number
. - A type declaration, such as
type Meters = number
- A type field used within table types. The
foo: number
in{ foo: number }
. - A type specifier, the
: number
inlocal foo: number
Enums
- Compound operators, such as X += Y or X -= Y
- A generic declaration parameter used in
GenericDeclaration
. Can either be a name or a variadic pack. - A subset of TypeInfo that consists of items which can only be used as an index, such as
Foo
andFoo<Bar>
, - A key in a
TypeField
. Can either be a name or an index signature. - Any type, such as
string
,boolean?
,number | boolean
, etc.