types
local types = require("@std/syntax/types")WARNING
These APIs are still open to future evolution. In new major versions, they may change in backwards incompatible ways.
Summary
Types
CstAttribute
type CstAttribute = luau.CstAttributeCstElseIfExpr
type CstElseIfExpr = luau.CstElseIfExprCstElseIfStat
type CstElseIfStat = luau.CstElseIfStatCstEof
type CstEof = luau.CstEofCstExpr
type CstExpr = luau.CstExprCstExprBinary
type CstExprBinary = luau.CstExprBinaryCstExprCall
type CstExprCall = luau.CstExprCallCstExprConstantBool
type CstExprConstantBool = luau.CstExprConstantBoolCstExprConstantInteger
type CstExprConstantInteger = luau.CstExprConstantIntegerCstExprConstantNil
type CstExprConstantNil = luau.CstExprConstantNilCstExprConstantNumber
type CstExprConstantNumber = luau.CstExprConstantNumberCstExprConstantString
type CstExprConstantString = luau.CstExprConstantStringCstExprFunction
type CstExprFunction = luau.CstExprFunctionCstExprGlobal
type CstExprGlobal = luau.CstExprGlobalCstExprGroup
type CstExprGroup = luau.CstExprGroupCstExprIfElse
type CstExprIfElse = luau.CstExprIfElseCstExprIndexExpr
type CstExprIndexExpr = luau.CstExprIndexExprCstExprIndexName
type CstExprIndexName = luau.CstExprIndexNameCstExprInstantiate
type CstExprInstantiate = luau.CstExprInstantiateCstExprInterpString
type CstExprInterpString = luau.CstExprInterpStringCstExprLocal
type CstExprLocal = luau.CstExprLocalCstExprTable
type CstExprTable = luau.CstExprTableCstExprTypeAssertion
type CstExprTypeAssertion = luau.CstExprTypeAssertionCstExprUnary
type CstExprUnary = luau.CstExprUnaryCstExprVarargs
type CstExprVarargs = luau.CstExprVarargsCstFunctionTypeParameter
type CstFunctionTypeParameter = luau.CstFunctionTypeParameterCstGenericType
type CstGenericType = luau.CstGenericTypeCstGenericTypePack
type CstGenericTypePack = luau.CstGenericTypePackCstLocal
type CstLocal = luau.CstLocalCstNode
type CstNode = luau.CstNodeCstStat
type CstStat = luau.CstStatCstStatAssign
type CstStatAssign = luau.CstStatAssignCstStatBlock
type CstStatBlock = luau.CstStatBlockCstStatBreak
type CstStatBreak = luau.CstStatBreakCstStatCompoundAssign
type CstStatCompoundAssign = luau.CstStatCompoundAssignCstStatConst
type CstStatConst = luau.CstStatConstCstStatContinue
type CstStatContinue = luau.CstStatContinueCstStatDo
type CstStatDo = luau.CstStatDoCstStatExpr
type CstStatExpr = luau.CstStatExprCstStatFor
type CstStatFor = luau.CstStatForCstStatForIn
type CstStatForIn = luau.CstStatForInCstStatFunction
type CstStatFunction = luau.CstStatFunctionCstStatIf
type CstStatIf = luau.CstStatIfCstStatLocal
type CstStatLocal = luau.CstStatLocalCstStatLocalFunction
type CstStatLocalFunction = luau.CstStatLocalFunctionCstStatRepeat
type CstStatRepeat = luau.CstStatRepeatCstStatReturn
type CstStatReturn = luau.CstStatReturnCstStatTypeAlias
type CstStatTypeAlias = luau.CstStatTypeAliasCstStatTypeFunction
type CstStatTypeFunction = luau.CstStatTypeFunctionCstStatWhile
type CstStatWhile = luau.CstStatWhileCstTableExprGeneralItem
type CstTableExprGeneralItem = luau.CstTableExprGeneralItemCstTableExprItem
type CstTableExprItem = luau.CstTableExprItemCstTableExprListItem
type CstTableExprListItem = luau.CstTableExprListItemCstTableExprRecordItem
type CstTableExprRecordItem = luau.CstTableExprRecordItemCstTableTypeItem
type CstTableTypeItem = luau.CstTableTypeItemCstTableTypeItemIndexer
type CstTableTypeItemIndexer = luau.CstTableTypeItemIndexerCstTableTypeItemProperty
type CstTableTypeItemProperty = luau.CstTableTypeItemPropertyCstTableTypeItemStringProperty
type CstTableTypeItemStringProperty = luau.CstTableTypeItemStringPropertyCstType
type CstType = luau.CstTypeCstTypeArray
type CstTypeArray = luau.CstTypeArrayCstTypeFunction
type CstTypeFunction = luau.CstTypeFunctionCstTypeGroup
type CstTypeGroup = luau.CstTypeGroupCstTypeIntersection
type CstTypeIntersection = luau.CstTypeIntersectionCstTypeOptional
type CstTypeOptional = luau.CstTypeOptionalCstTypePack
type CstTypePack = luau.CstTypePackCstTypePackExplicit
type CstTypePackExplicit = luau.CstTypePackExplicitCstTypePackGeneric
type CstTypePackGeneric = luau.CstTypePackGenericCstTypePackVariadic
type CstTypePackVariadic = luau.CstTypePackVariadicCstTypeReference
type CstTypeReference = luau.CstTypeReferenceCstTypeSingletonBool
type CstTypeSingletonBool = luau.CstTypeSingletonBoolCstTypeSingletonString
type CstTypeSingletonString = luau.CstTypeSingletonStringCstTypeTable
type CstTypeTable = luau.CstTypeTableCstTypeTypeof
type CstTypeTypeof = luau.CstTypeTypeofCstTypeUnion
type CstTypeUnion = luau.CstTypeUnionMultiLineComment
type MultiLineComment = luau.MultiLineCommentParseResult
type ParseResult = luau.ParseResultReplacement
The type of a replacement for a CST node.
A replacement can be:
A string, which will be used as the replacement text for the node, with any surrounding trivia preserved.
An object with a
contentproperty containing the replacement string, and an optionalpreserveTriviaboolean property.
If preserveTrivia is true, the replaced CST node's attached trivia (whitespace and comments) will be reserialized with the replacement content.
If false, the trivia will be discarded. If omitted, trivia is preserved by default.
Note that trailing trivia for a token consists of all whitespace and comments that follow it up to and including a newline.
Any trivia after the first seen newline is considered leading trivia for the next token.
type Replacement = string | { content: string, preserveTrivia: boolean? }Replacements
A mapping of CST nodes to their replacements, used with @std/syntax/printer and lute transform to specify how CSTs should be mutated.
type Replacements = { [CstNode]: Replacement }SingleLineComment
type SingleLineComment = luau.SingleLineCommentSpan
type Span = luau.SpanTrivia
type Trivia = luau.TriviaType
type Type = luau.TypeTypePack
type TypePack = luau.TypePackWhitespace
type Whitespace = luau.Whitespace