checker

package
v0.0.0-...-563c3ff Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 25, 2025 License: Apache-2.0 Imports: 31 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SignatureKeyErased         string = "-"
	SignatureKeyCanonical      string = "*"
	SignatureKeyBase           string = "#"
	SignatureKeyInner          string = "<"
	SignatureKeyOuter          string = ">"
	SignatureKeyImplementation string = "+"
)
View Source
const (
	IterationUseAllowsSyncIterablesFlag  IterationUse = 1 << 0
	IterationUseAllowsAsyncIterablesFlag IterationUse = 1 << 1
	IterationUseAllowsStringInputFlag    IterationUse = 1 << 2
	IterationUseForOfFlag                IterationUse = 1 << 3
	IterationUseYieldStarFlag            IterationUse = 1 << 4
	IterationUseSpreadFlag               IterationUse = 1 << 5
	IterationUseDestructuringFlag        IterationUse = 1 << 6
	IterationUsePossiblyOutOfBounds      IterationUse = 1 << 7
	// Spread, Destructuring, Array element assignment
	IterationUseElement                  = IterationUseAllowsSyncIterablesFlag
	IterationUseSpread                   = IterationUseAllowsSyncIterablesFlag | IterationUseSpreadFlag
	IterationUseDestructuring            = IterationUseAllowsSyncIterablesFlag | IterationUseDestructuringFlag
	IterationUseForOf                    = IterationUseAllowsSyncIterablesFlag | IterationUseAllowsStringInputFlag | IterationUseForOfFlag
	IterationUseForAwaitOf               = IterationUseAllowsSyncIterablesFlag | IterationUseAllowsAsyncIterablesFlag | IterationUseAllowsStringInputFlag | IterationUseForOfFlag
	IterationUseYieldStar                = IterationUseAllowsSyncIterablesFlag | IterationUseYieldStarFlag
	IterationUseAsyncYieldStar           = IterationUseAllowsSyncIterablesFlag | IterationUseAllowsAsyncIterablesFlag | IterationUseYieldStarFlag
	IterationUseGeneratorReturnType      = IterationUseAllowsSyncIterablesFlag
	IterationUseAsyncGeneratorReturnType = IterationUseAllowsAsyncIterablesFlag
	IterationUseCacheFlags               = IterationUseAllowsSyncIterablesFlag | IterationUseAllowsAsyncIterablesFlag | IterationUseForOfFlag
)
View Source
const (
	TypeFlagsNone            TypeFlags = 0
	TypeFlagsAny             TypeFlags = 1 << 0
	TypeFlagsUnknown         TypeFlags = 1 << 1
	TypeFlagsUndefined       TypeFlags = 1 << 2
	TypeFlagsNull            TypeFlags = 1 << 3
	TypeFlagsVoid            TypeFlags = 1 << 4
	TypeFlagsString          TypeFlags = 1 << 5
	TypeFlagsNumber          TypeFlags = 1 << 6
	TypeFlagsBigInt          TypeFlags = 1 << 7
	TypeFlagsBoolean         TypeFlags = 1 << 8
	TypeFlagsESSymbol        TypeFlags = 1 << 9 // Type of symbol primitive introduced in ES6
	TypeFlagsStringLiteral   TypeFlags = 1 << 10
	TypeFlagsNumberLiteral   TypeFlags = 1 << 11
	TypeFlagsBigIntLiteral   TypeFlags = 1 << 12
	TypeFlagsBooleanLiteral  TypeFlags = 1 << 13
	TypeFlagsUniqueESSymbol  TypeFlags = 1 << 14 // unique symbol
	TypeFlagsEnumLiteral     TypeFlags = 1 << 15 // Always combined with StringLiteral, NumberLiteral, or Union
	TypeFlagsEnum            TypeFlags = 1 << 16 // Numeric computed enum member value (must be right after EnumLiteral, see getSortOrderFlags)
	TypeFlagsNonPrimitive    TypeFlags = 1 << 17 // intrinsic object type
	TypeFlagsNever           TypeFlags = 1 << 18 // Never type
	TypeFlagsTypeParameter   TypeFlags = 1 << 19 // Type parameter
	TypeFlagsObject          TypeFlags = 1 << 20 // Object type
	TypeFlagsIndex           TypeFlags = 1 << 21 // keyof T
	TypeFlagsTemplateLiteral TypeFlags = 1 << 22 // Template literal type
	TypeFlagsStringMapping   TypeFlags = 1 << 23 // Uppercase/Lowercase type
	TypeFlagsSubstitution    TypeFlags = 1 << 24 // Type parameter substitution
	TypeFlagsIndexedAccess   TypeFlags = 1 << 25 // T[K]
	TypeFlagsConditional     TypeFlags = 1 << 26 // T extends U ? X : Y
	TypeFlagsUnion           TypeFlags = 1 << 27 // Union (T | U)
	TypeFlagsIntersection    TypeFlags = 1 << 28 // Intersection (T & U)
	TypeFlagsReserved1       TypeFlags = 1 << 29 // Used by union/intersection type construction
	TypeFlagsReserved2       TypeFlags = 1 << 30 // Used by union/intersection type construction
	TypeFlagsReserved3       TypeFlags = 1 << 31

	TypeFlagsAnyOrUnknown                  = TypeFlagsAny | TypeFlagsUnknown
	TypeFlagsNullable                      = TypeFlagsUndefined | TypeFlagsNull
	TypeFlagsLiteral                       = TypeFlagsStringLiteral | TypeFlagsNumberLiteral | TypeFlagsBigIntLiteral | TypeFlagsBooleanLiteral
	TypeFlagsUnit                          = TypeFlagsEnum | TypeFlagsLiteral | TypeFlagsUniqueESSymbol | TypeFlagsNullable
	TypeFlagsFreshable                     = TypeFlagsEnum | TypeFlagsLiteral
	TypeFlagsStringOrNumberLiteral         = TypeFlagsStringLiteral | TypeFlagsNumberLiteral
	TypeFlagsStringOrNumberLiteralOrUnique = TypeFlagsStringLiteral | TypeFlagsNumberLiteral | TypeFlagsUniqueESSymbol
	TypeFlagsDefinitelyFalsy               = TypeFlagsStringLiteral | TypeFlagsNumberLiteral | TypeFlagsBigIntLiteral | TypeFlagsBooleanLiteral | TypeFlagsVoid | TypeFlagsUndefined | TypeFlagsNull
	TypeFlagsPossiblyFalsy                 = TypeFlagsDefinitelyFalsy | TypeFlagsString | TypeFlagsNumber | TypeFlagsBigInt | TypeFlagsBoolean
	TypeFlagsIntrinsic                     = TypeFlagsAny | TypeFlagsUnknown | TypeFlagsString | TypeFlagsNumber | TypeFlagsBigInt | TypeFlagsESSymbol | TypeFlagsVoid | TypeFlagsUndefined | TypeFlagsNull | TypeFlagsNever | TypeFlagsNonPrimitive
	TypeFlagsStringLike                    = TypeFlagsString | TypeFlagsStringLiteral | TypeFlagsTemplateLiteral | TypeFlagsStringMapping
	TypeFlagsNumberLike                    = TypeFlagsNumber | TypeFlagsNumberLiteral | TypeFlagsEnum
	TypeFlagsBigIntLike                    = TypeFlagsBigInt | TypeFlagsBigIntLiteral
	TypeFlagsBooleanLike                   = TypeFlagsBoolean | TypeFlagsBooleanLiteral
	TypeFlagsEnumLike                      = TypeFlagsEnum | TypeFlagsEnumLiteral
	TypeFlagsESSymbolLike                  = TypeFlagsESSymbol | TypeFlagsUniqueESSymbol
	TypeFlagsVoidLike                      = TypeFlagsVoid | TypeFlagsUndefined
	TypeFlagsPrimitive                     = TypeFlagsStringLike | TypeFlagsNumberLike | TypeFlagsBigIntLike | TypeFlagsBooleanLike | TypeFlagsEnumLike | TypeFlagsESSymbolLike | TypeFlagsVoidLike | TypeFlagsNull
	TypeFlagsDefinitelyNonNullable         = TypeFlagsStringLike | TypeFlagsNumberLike | TypeFlagsBigIntLike | TypeFlagsBooleanLike | TypeFlagsEnumLike | TypeFlagsESSymbolLike | TypeFlagsObject | TypeFlagsNonPrimitive
	TypeFlagsDisjointDomains               = TypeFlagsNonPrimitive | TypeFlagsStringLike | TypeFlagsNumberLike | TypeFlagsBigIntLike | TypeFlagsBooleanLike | TypeFlagsESSymbolLike | TypeFlagsVoidLike | TypeFlagsNull
	TypeFlagsUnionOrIntersection           = TypeFlagsUnion | TypeFlagsIntersection
	TypeFlagsStructuredType                = TypeFlagsObject | TypeFlagsUnion | TypeFlagsIntersection
	TypeFlagsTypeVariable                  = TypeFlagsTypeParameter | TypeFlagsIndexedAccess
	TypeFlagsInstantiableNonPrimitive      = TypeFlagsTypeVariable | TypeFlagsConditional | TypeFlagsSubstitution
	TypeFlagsInstantiablePrimitive         = TypeFlagsIndex | TypeFlagsTemplateLiteral | TypeFlagsStringMapping
	TypeFlagsInstantiable                  = TypeFlagsInstantiableNonPrimitive | TypeFlagsInstantiablePrimitive
	TypeFlagsStructuredOrInstantiable      = TypeFlagsStructuredType | TypeFlagsInstantiable
	TypeFlagsObjectFlagsType               = TypeFlagsAny | TypeFlagsNullable | TypeFlagsNever | TypeFlagsObject | TypeFlagsUnion | TypeFlagsIntersection
	TypeFlagsSimplifiable                  = TypeFlagsIndexedAccess | TypeFlagsConditional
	TypeFlagsSingleton                     = TypeFlagsAny | TypeFlagsUnknown | TypeFlagsString | TypeFlagsNumber | TypeFlagsBoolean | TypeFlagsBigInt | TypeFlagsESSymbol | TypeFlagsVoid | TypeFlagsUndefined | TypeFlagsNull | TypeFlagsNever | TypeFlagsNonPrimitive
	// 'TypeFlagsNarrowable' types are types where narrowing actually narrows.
	// This *should* be every type other than null, undefined, void, and never
	TypeFlagsNarrowable = TypeFlagsAny | TypeFlagsUnknown | TypeFlagsStructuredOrInstantiable | TypeFlagsStringLike | TypeFlagsNumberLike | TypeFlagsBigIntLike | TypeFlagsBooleanLike | TypeFlagsESSymbol | TypeFlagsUniqueESSymbol | TypeFlagsNonPrimitive
	// The following flags are aggregated during union and intersection type construction
	TypeFlagsIncludesMask = TypeFlagsAny | TypeFlagsUnknown | TypeFlagsPrimitive | TypeFlagsNever | TypeFlagsObject | TypeFlagsUnion | TypeFlagsIntersection | TypeFlagsNonPrimitive | TypeFlagsTemplateLiteral | TypeFlagsStringMapping
	// The following flags are used for different purposes during union and intersection type construction
	TypeFlagsIncludesMissingType             = TypeFlagsTypeParameter
	TypeFlagsIncludesNonWideningType         = TypeFlagsIndex
	TypeFlagsIncludesWildcard                = TypeFlagsIndexedAccess
	TypeFlagsIncludesEmptyObject             = TypeFlagsConditional
	TypeFlagsIncludesInstantiable            = TypeFlagsSubstitution
	TypeFlagsIncludesConstrainedTypeVariable = TypeFlagsReserved1
	TypeFlagsIncludesError                   = TypeFlagsReserved2
	TypeFlagsNotPrimitiveUnion               = TypeFlagsAny | TypeFlagsUnknown | TypeFlagsVoid | TypeFlagsNever | TypeFlagsObject | TypeFlagsIntersection | TypeFlagsIncludesInstantiable
)
View Source
const (
	ObjectFlagsNone                                       ObjectFlags = 0
	ObjectFlagsClass                                      ObjectFlags = 1 << 0  // Class
	ObjectFlagsInterface                                  ObjectFlags = 1 << 1  // Interface
	ObjectFlagsReference                                  ObjectFlags = 1 << 2  // Generic type reference
	ObjectFlagsTuple                                      ObjectFlags = 1 << 3  // Synthesized generic tuple type
	ObjectFlagsAnonymous                                  ObjectFlags = 1 << 4  // Anonymous
	ObjectFlagsMapped                                     ObjectFlags = 1 << 5  // Mapped
	ObjectFlagsInstantiated                               ObjectFlags = 1 << 6  // Instantiated anonymous or mapped type
	ObjectFlagsObjectLiteral                              ObjectFlags = 1 << 7  // Originates in an object literal
	ObjectFlagsEvolvingArray                              ObjectFlags = 1 << 8  // Evolving array type
	ObjectFlagsObjectLiteralPatternWithComputedProperties ObjectFlags = 1 << 9  // Object literal pattern with computed properties
	ObjectFlagsReverseMapped                              ObjectFlags = 1 << 10 // Object contains a property from a reverse-mapped type
	ObjectFlagsJsxAttributes                              ObjectFlags = 1 << 11 // Jsx attributes type
	ObjectFlagsJSLiteral                                  ObjectFlags = 1 << 12 // Object type declared in JS - disables errors on read/write of nonexisting members
	ObjectFlagsFreshLiteral                               ObjectFlags = 1 << 13 // Fresh object literal
	ObjectFlagsArrayLiteral                               ObjectFlags = 1 << 14 // Originates in an array literal
	ObjectFlagsPrimitiveUnion                             ObjectFlags = 1 << 15 // Union of only primitive types
	ObjectFlagsContainsWideningType                       ObjectFlags = 1 << 16 // Type is or contains undefined or null widening type
	ObjectFlagsContainsObjectOrArrayLiteral               ObjectFlags = 1 << 17 // Type is or contains object literal type
	ObjectFlagsNonInferrableType                          ObjectFlags = 1 << 18 // Type is or contains anyFunctionType or silentNeverType
	ObjectFlagsCouldContainTypeVariablesComputed          ObjectFlags = 1 << 19 // CouldContainTypeVariables flag has been computed
	ObjectFlagsCouldContainTypeVariables                  ObjectFlags = 1 << 20 // Type could contain a type variable
	ObjectFlagsMembersResolved                            ObjectFlags = 1 << 21 // Members have been resolved

	ObjectFlagsClassOrInterface   = ObjectFlagsClass | ObjectFlagsInterface
	ObjectFlagsRequiresWidening   = ObjectFlagsContainsWideningType | ObjectFlagsContainsObjectOrArrayLiteral
	ObjectFlagsPropagatingFlags   = ObjectFlagsContainsWideningType | ObjectFlagsContainsObjectOrArrayLiteral | ObjectFlagsNonInferrableType
	ObjectFlagsInstantiatedMapped = ObjectFlagsMapped | ObjectFlagsInstantiated
	// Object flags that uniquely identify the kind of ObjectType
	ObjectFlagsObjectTypeKindMask = ObjectFlagsClassOrInterface | ObjectFlagsReference | ObjectFlagsTuple | ObjectFlagsAnonymous | ObjectFlagsMapped | ObjectFlagsReverseMapped | ObjectFlagsEvolvingArray | ObjectFlagsInstantiationExpressionType | ObjectFlagsSingleSignatureType
	// Flags that require TypeFlags.Object
	ObjectFlagsContainsSpread              = 1 << 22 // Object literal contains spread operation
	ObjectFlagsObjectRestType              = 1 << 23 // Originates in object rest declaration
	ObjectFlagsInstantiationExpressionType = 1 << 24 // Originates in instantiation expression
	ObjectFlagsSingleSignatureType         = 1 << 25 // A single signature type extracted from a potentially broader type
	ObjectFlagsIsClassInstanceClone        = 1 << 26 // Type is a clone of a class instance type
	// Flags that require TypeFlags.Object and ObjectFlags.Reference
	ObjectFlagsIdenticalBaseTypeCalculated = 1 << 27 // has had `getSingleBaseForNonAugmentingSubtype` invoked on it already
	ObjectFlagsIdenticalBaseTypeExists     = 1 << 28 // has a defined cachedEquivalentBaseType member
	// Flags that require TypeFlags.UnionOrIntersection or TypeFlags.Substitution
	ObjectFlagsIsGenericTypeComputed = 1 << 22 // IsGenericObjectType flag has been computed
	ObjectFlagsIsGenericObjectType   = 1 << 23 // Union or intersection contains generic object type
	ObjectFlagsIsGenericIndexType    = 1 << 24 // Union or intersection contains generic index type
	ObjectFlagsIsGenericType         = ObjectFlagsIsGenericObjectType | ObjectFlagsIsGenericIndexType
	// Flags that require TypeFlags.Union
	ObjectFlagsContainsIntersections      = 1 << 25 // Union contains intersections
	ObjectFlagsIsUnknownLikeUnionComputed = 1 << 26 // IsUnknownLikeUnion flag has been computed
	ObjectFlagsIsUnknownLikeUnion         = 1 << 27 // Union of null, undefined, and empty object type
	// Flags that require TypeFlags.Intersection
	ObjectFlagsIsNeverIntersectionComputed = 1 << 25 // IsNeverLike flag has been computed
	ObjectFlagsIsNeverIntersection         = 1 << 26 // Intersection reduces to never
	ObjectFlagsIsConstrainedTypeVariable   = 1 << 27 // T & C, where T's constraint and C are primitives, object, or {}
)

Types included in TypeFlags.ObjectFlagsType have an objectFlags property. Some ObjectFlags are specific to certain types and reuse the same bit position. Those ObjectFlags require a check for a certain TypeFlags value to determine their meaning.

View Source
const (
	ElementFlagsNone        ElementFlags = 0
	ElementFlagsRequired    ElementFlags = 1 << 0 // T
	ElementFlagsOptional    ElementFlags = 1 << 1 // T?
	ElementFlagsRest        ElementFlags = 1 << 2 // ...T[]
	ElementFlagsVariadic    ElementFlags = 1 << 3 // ...T
	ElementFlagsFixed                    = ElementFlagsRequired | ElementFlagsOptional
	ElementFlagsVariable                 = ElementFlagsRest | ElementFlagsVariadic
	ElementFlagsNonRequired              = ElementFlagsOptional | ElementFlagsRest | ElementFlagsVariadic
	ElementFlagsNonRest                  = ElementFlagsRequired | ElementFlagsOptional | ElementFlagsVariadic
)
View Source
const MAX_REVERSE_MAPPED_NESTING_INSPECTION_DEPTH = 3

Variables

View Source
var JsxNames = struct {
	JSX                                    string
	IntrinsicElements                      string
	ElementClass                           string
	ElementAttributesPropertyNameContainer string
	ElementChildrenAttributeNameContainer  string
	Element                                string
	ElementType                            string
	IntrinsicAttributes                    string
	IntrinsicClassAttributes               string
	LibraryManagedAttributes               string
}{
	JSX:                                    "JSX",
	IntrinsicElements:                      "IntrinsicElements",
	ElementClass:                           "ElementClass",
	ElementAttributesPropertyNameContainer: "ElementAttributesProperty",
	ElementChildrenAttributeNameContainer:  "ElementChildrenAttribute",
	Element:                                "Element",
	ElementType:                            "ElementType",
	IntrinsicAttributes:                    "IntrinsicAttributes",
	IntrinsicClassAttributes:               "IntrinsicClassAttributes",
	LibraryManagedAttributes:               "LibraryManagedAttributes",
}
View Source
var LanguageFeatureMinimumTarget = LanguageFeatureMinimumTargetMap{
	Classes:                           core.ScriptTargetES2015,
	ForOf:                             core.ScriptTargetES2015,
	Generators:                        core.ScriptTargetES2015,
	Iteration:                         core.ScriptTargetES2015,
	SpreadElements:                    core.ScriptTargetES2015,
	RestElements:                      core.ScriptTargetES2015,
	TaggedTemplates:                   core.ScriptTargetES2015,
	DestructuringAssignment:           core.ScriptTargetES2015,
	BindingPatterns:                   core.ScriptTargetES2015,
	ArrowFunctions:                    core.ScriptTargetES2015,
	BlockScopedVariables:              core.ScriptTargetES2015,
	ObjectAssign:                      core.ScriptTargetES2015,
	RegularExpressionFlagsUnicode:     core.ScriptTargetES2015,
	RegularExpressionFlagsSticky:      core.ScriptTargetES2015,
	Exponentiation:                    core.ScriptTargetES2016,
	AsyncFunctions:                    core.ScriptTargetES2017,
	ForAwaitOf:                        core.ScriptTargetES2018,
	AsyncGenerators:                   core.ScriptTargetES2018,
	AsyncIteration:                    core.ScriptTargetES2018,
	ObjectSpreadRest:                  core.ScriptTargetES2018,
	RegularExpressionFlagsDotAll:      core.ScriptTargetES2018,
	BindinglessCatch:                  core.ScriptTargetES2019,
	BigInt:                            core.ScriptTargetES2020,
	NullishCoalesce:                   core.ScriptTargetES2020,
	OptionalChaining:                  core.ScriptTargetES2020,
	LogicalAssignment:                 core.ScriptTargetES2021,
	TopLevelAwait:                     core.ScriptTargetES2022,
	ClassFields:                       core.ScriptTargetES2022,
	PrivateNamesAndClassStaticBlocks:  core.ScriptTargetES2022,
	RegularExpressionFlagsHasIndices:  core.ScriptTargetES2022,
	ShebangComments:                   core.ScriptTargetESNext,
	UsingAndAwaitUsing:                core.ScriptTargetESNext,
	ClassAndClassElementDecorators:    core.ScriptTargetESNext,
	RegularExpressionFlagsUnicodeSets: core.ScriptTargetESNext,
}
View Source
var ReactNames = struct {
	Fragment string
}{
	Fragment: "Fragment",
}

Functions

func CompareTypes

func CompareTypes(t1, t2 *Type) int

func GetCombinedLocalAndExportSymbolFlags

func GetCombinedLocalAndExportSymbolFlags(symbol *ast.Symbol) ast.SymbolFlags

See comment on `declareModuleMember` in `binder.go`.

func GetDeclarationModifierFlagsFromSymbol

func GetDeclarationModifierFlagsFromSymbol(s *ast.Symbol) ast.ModifierFlags

func GetResolvedSignatureForSignatureHelp

func GetResolvedSignatureForSignatureHelp(node *ast.Node, argumentCount int, c *Checker) (*Signature, []*Signature)

func GetSingleVariableOfVariableStatement

func GetSingleVariableOfVariableStatement(node *ast.Node) *ast.Node

func HasModifier

func HasModifier(node *ast.Node, flags ast.ModifierFlags) bool

func IsExternalModuleSymbol

func IsExternalModuleSymbol(moduleSymbol *ast.Symbol) bool

True if the symbol is for an external module, as opposed to a namespace.

func IsInTypeQuery

func IsInTypeQuery(node *ast.Node) bool

func IsKnownSymbol

func IsKnownSymbol(symbol *ast.Symbol) bool

func IsTupleType

func IsTupleType(t *Type) bool

func IsTypeAny

func IsTypeAny(t *Type) bool

func NewDiagnosticChainForNode

func NewDiagnosticChainForNode(chain *ast.Diagnostic, node *ast.Node, message *diagnostics.Message, args ...any) *ast.Diagnostic

func NewDiagnosticForNode

func NewDiagnosticForNode(node *ast.Node, message *diagnostics.Message, args ...any) *ast.Diagnostic

func SkipAlias

func SkipAlias(symbol *ast.Symbol, checker *Checker) *ast.Symbol

func SkipTypeChecking

func SkipTypeChecking(sourceFile *ast.SourceFile, options *core.CompilerOptions, host Program, ignoreNoCheck bool) bool

func TryGetModuleSpecifierFromDeclaration

func TryGetModuleSpecifierFromDeclaration(node *ast.Node) *ast.Node

func ValueToString

func ValueToString(value any) string

Types

type AccessFlags

type AccessFlags uint32
const (
	AccessFlagsNone                       AccessFlags = 0
	AccessFlagsIncludeUndefined           AccessFlags = 1 << 0
	AccessFlagsNoIndexSignatures          AccessFlags = 1 << 1
	AccessFlagsWriting                    AccessFlags = 1 << 2
	AccessFlagsCacheSymbol                AccessFlags = 1 << 3
	AccessFlagsAllowMissing               AccessFlags = 1 << 4
	AccessFlagsExpressionPosition         AccessFlags = 1 << 5
	AccessFlagsReportDeprecated           AccessFlags = 1 << 6
	AccessFlagsSuppressNoImplicitAnyError AccessFlags = 1 << 7
	AccessFlagsContextual                 AccessFlags = 1 << 8
	AccessFlagsPersistent                             = AccessFlagsIncludeUndefined
)

type AccessKind

type AccessKind int32
const (
	AccessKindRead      AccessKind = iota // Only reads from a variable
	AccessKindWrite                       // Only writes to a variable without ever reading it. E.g.: `x=1;`.
	AccessKindReadWrite                   // Reads from and writes to a variable. E.g.: `f(x++);`, `x/=1`.
)
type AliasSymbolLinks struct {
	// contains filtered or unexported fields
}
type ArrayLiteralLinks struct {
	// contains filtered or unexported fields
}

type ArrayToSingleTypeMapper

type ArrayToSingleTypeMapper struct {
	TypeMapperBase
	// contains filtered or unexported fields
}

func (*ArrayToSingleTypeMapper) Map

func (m *ArrayToSingleTypeMapper) Map(t *Type) *Type

type ArrayTypeMapper

type ArrayTypeMapper struct {
	TypeMapperBase
	// contains filtered or unexported fields
}

func (*ArrayTypeMapper) Kind

func (m *ArrayTypeMapper) Kind() TypeMapperKind

func (*ArrayTypeMapper) Map

func (m *ArrayTypeMapper) Map(t *Type) *Type
type AssertionLinks struct {
	// contains filtered or unexported fields
}

type AssignmentKind

type AssignmentKind int32
const (
	AssignmentKindNone AssignmentKind = iota
	AssignmentKindDefinite
	AssignmentKindCompound
)

type AssignmentReducedKey

type AssignmentReducedKey struct {
	// contains filtered or unexported fields
}

type AssignmentTarget

type AssignmentTarget = ast.Node // BinaryExpression | PrefixUnaryExpression | PostfixUnaryExpression | ForInOrOfStatement

type CachedSignatureKey

type CachedSignatureKey struct {
	// contains filtered or unexported fields
}

type CachedTypeKey

type CachedTypeKey struct {
	// contains filtered or unexported fields
}

type CachedTypeKind

type CachedTypeKind int32
const (
	CachedTypeKindLiteralUnionBaseType CachedTypeKind = iota
	CachedTypeKindIndexType
	CachedTypeKindStringIndexType
	CachedTypeKindEquivalentBaseType
	CachedTypeKindApparentType
	CachedTypeKindAwaitedType
	CachedTypeKindEvolvingArrayType
	CachedTypeKindArrayLiteralType
	CachedTypeKindPermissiveInstantiation
	CachedTypeKindRestrictiveInstantiation
	CachedTypeKindRestrictiveTypeParameter
	CachedTypeKindIndexedAccessForReading
	CachedTypeKindIndexedAccessForWriting
	CachedTypeKindWidened
	CachedTypeKindRegularObjectLiteral
	CachedTypeKindPromisedTypeOfPromise
	CachedTypeKindDefaultOnlyType
	CachedTypeKindSyntheticType
	CachedTypeKindDecoratorContext
	CachedTypeKindDecoratorContextStatic
	CachedTypeKindDecoratorContextPrivate
	CachedTypeKindDecoratorContextPrivateStatic
)

type CallState

type CallState struct {
	// contains filtered or unexported fields
}

type CheckMode

type CheckMode uint32
const (
	CheckModeNormal               CheckMode = 0      // Normal type checking
	CheckModeContextual           CheckMode = 1 << 0 // Explicitly assigned contextual type, therefore not cacheable
	CheckModeInferential          CheckMode = 1 << 1 // Inferential typing
	CheckModeSkipContextSensitive CheckMode = 1 << 2 // Skip context sensitive function expressions
	CheckModeSkipGenericFunctions CheckMode = 1 << 3 // Skip single signature generic functions
	CheckModeIsForSignatureHelp   CheckMode = 1 << 4 // Call resolution for purposes of signature help
	CheckModeRestBindingElement   CheckMode = 1 << 5 // Checking a type that is going to be used to determine the type of a rest binding element
	//   e.g. in `const { a, ...rest } = foo`, when checking the type of `foo` to determine the type of `rest`,
	//   we need to preserve generic types instead of substituting them for constraints
	CheckModeTypeOnly   CheckMode = 1 << 6 // Called from getTypeOfExpression, diagnostics may be omitted
	CheckModeForceTuple CheckMode = 1 << 7
)

type Checker

type Checker struct {
	TypeCount               uint32
	SymbolCount             uint32
	TotalInstantiationCount uint32

	ReverseMappedSymbolLinks core.LinkStore[*ast.Symbol, ReverseMappedSymbolLinks]
	// contains filtered or unexported fields
}

func NewChecker

func NewChecker(program Program) *Checker

func (*Checker) CheckSourceFile

func (c *Checker) CheckSourceFile(ctx context.Context, sourceFile *ast.SourceFile)

func (*Checker) ForEachExportAndPropertyOfModule

func (c *Checker) ForEachExportAndPropertyOfModule(moduleSymbol *ast.Symbol, cb func(*ast.Symbol, string))

func (*Checker) GetAccessibleSymbolChain

func (ch *Checker) GetAccessibleSymbolChain(
	symbol *ast.Symbol,
	enclosingDeclaration *ast.Node,
	meaning ast.SymbolFlags,
	useOnlyExternalAliasing bool,
) []*ast.Symbol

func (*Checker) GetAliasedSymbol

func (c *Checker) GetAliasedSymbol(symbol *ast.Symbol) *ast.Symbol

func (*Checker) GetAllPossiblePropertiesOfTypes

func (c *Checker) GetAllPossiblePropertiesOfTypes(types []*Type) []*ast.Symbol

func (*Checker) GetAmbientModules

func (c *Checker) GetAmbientModules() []*ast.Symbol

func (*Checker) GetApparentProperties

func (c *Checker) GetApparentProperties(t *Type) []*ast.Symbol

func (*Checker) GetBaseConstraintOfType

func (c *Checker) GetBaseConstraintOfType(t *Type) *Type

func (*Checker) GetCallSignatures

func (c *Checker) GetCallSignatures(t *Type) []*Signature

func (*Checker) GetCandidateSignaturesForStringLiteralCompletions

func (c *Checker) GetCandidateSignaturesForStringLiteralCompletions(call *ast.CallLikeExpression, editingArgument *ast.Node) []*Signature

func (*Checker) GetConstantValue

func (c *Checker) GetConstantValue(node *ast.Node) any

func (*Checker) GetConstraintOfTypeParameter

func (c *Checker) GetConstraintOfTypeParameter(typeParameter *Type) *Type

func (*Checker) GetConstructSignatures

func (c *Checker) GetConstructSignatures(t *Type) []*Signature

func (*Checker) GetContextualDeclarationsForObjectLiteralElement

func (c *Checker) GetContextualDeclarationsForObjectLiteralElement(objectLiteral *ast.Node, name string) []*ast.Node

func (*Checker) GetContextualType

func (c *Checker) GetContextualType(node *ast.Expression, contextFlags ContextFlags) *Type

func (*Checker) GetContextualTypeForArgumentAtIndex

func (c *Checker) GetContextualTypeForArgumentAtIndex(node *ast.Node, argIndex int) *Type

func (*Checker) GetContextualTypeForJsxAttribute

func (c *Checker) GetContextualTypeForJsxAttribute(attribute *ast.JsxAttributeLike) *Type

func (*Checker) GetContextualTypeForObjectLiteralElement

func (c *Checker) GetContextualTypeForObjectLiteralElement(element *ast.Node, contextFlags ContextFlags) *Type

func (*Checker) GetDeclaredTypeOfSymbol

func (c *Checker) GetDeclaredTypeOfSymbol(symbol *ast.Symbol) *Type

func (*Checker) GetDiagnostics

func (c *Checker) GetDiagnostics(ctx context.Context, sourceFile *ast.SourceFile) []*ast.Diagnostic

func (*Checker) GetDiagnosticsWithoutCheck

func (c *Checker) GetDiagnosticsWithoutCheck(sourceFile *ast.SourceFile) []*ast.Diagnostic

func (*Checker) GetEffectiveDeclarationFlags

func (c *Checker) GetEffectiveDeclarationFlags(n *ast.Node, flagsToCheck ast.ModifierFlags) ast.ModifierFlags

func (*Checker) GetEmitResolver

func (c *Checker) GetEmitResolver() *emitResolver

func (*Checker) GetExpandedParameters

func (c *Checker) GetExpandedParameters(signature *Signature, skipUnionExpanding bool) [][]*ast.Symbol

func (*Checker) GetExportSpecifierLocalTargetSymbol

func (c *Checker) GetExportSpecifierLocalTargetSymbol(node *ast.Node) *ast.Symbol

func (*Checker) GetExportSymbolOfSymbol

func (c *Checker) GetExportSymbolOfSymbol(symbol *ast.Symbol) *ast.Symbol

func (*Checker) GetExportsAndPropertiesOfModule

func (c *Checker) GetExportsAndPropertiesOfModule(moduleSymbol *ast.Symbol) []*ast.Symbol

Unlike `getExportsOfModule`, this includes properties of an `export =` value.

func (*Checker) GetExportsOfModule

func (c *Checker) GetExportsOfModule(symbol *ast.Symbol) []*ast.Symbol

func (*Checker) GetFirstTypeArgumentFromKnownType

func (c *Checker) GetFirstTypeArgumentFromKnownType(t *Type) *Type

func (*Checker) GetGlobalDiagnostics

func (c *Checker) GetGlobalDiagnostics() []*ast.Diagnostic

func (*Checker) GetGlobalSymbol

func (c *Checker) GetGlobalSymbol(name string, meaning ast.SymbolFlags, diagnostic *diagnostics.Message) *ast.Symbol

func (*Checker) GetImmediateAliasedSymbol

func (c *Checker) GetImmediateAliasedSymbol(symbol *ast.Symbol) *ast.Symbol

func (*Checker) GetIndexSignaturesAtLocation

func (c *Checker) GetIndexSignaturesAtLocation(node *ast.Node) []*ast.Node

func (*Checker) GetJsxIntrinsicTagNamesAt

func (c *Checker) GetJsxIntrinsicTagNamesAt(location *ast.Node) []*ast.Symbol

Returns all the properties of the Jsx.IntrinsicElements interface.

func (*Checker) GetLocalTypeParametersOfClassOrInterfaceOrTypeAlias

func (c *Checker) GetLocalTypeParametersOfClassOrInterfaceOrTypeAlias(symbol *ast.Symbol) []*Type

func (*Checker) GetMergedSymbol

func (c *Checker) GetMergedSymbol(symbol *ast.Symbol) *ast.Symbol

func (*Checker) GetNonNullableType

func (c *Checker) GetNonNullableType(t *Type) *Type

func (*Checker) GetNonOptionalType

func (c *Checker) GetNonOptionalType(t *Type) *Type

Originally from services.ts

func (*Checker) GetNumberIndexType

func (c *Checker) GetNumberIndexType(t *Type) *Type

func (*Checker) GetPromisedTypeOfPromise

func (c *Checker) GetPromisedTypeOfPromise(t *Type) *Type

func (*Checker) GetPropertiesOfType

func (c *Checker) GetPropertiesOfType(t *Type) []*ast.Symbol

func (*Checker) GetPropertyOfType

func (c *Checker) GetPropertyOfType(t *Type, name string) *ast.Symbol

func (*Checker) GetPropertySymbolOfDestructuringAssignment

func (c *Checker) GetPropertySymbolOfDestructuringAssignment(location *ast.Node) *ast.Symbol

Gets the property symbol corresponding to the property in destructuring assignment 'property1' from

for ( { property1: a } of elems) {
}

'property1' at location 'a' from:

[a] = [ property1, property2 ]

func (*Checker) GetPropertySymbolsFromContextualType

func (c *Checker) GetPropertySymbolsFromContextualType(node *ast.Node, contextualType *Type, unionSymbolOk bool) []*ast.Symbol

Gets all symbols for one property. Does not get symbols for every property.

func (*Checker) GetResolutionModeOverride

func (c *Checker) GetResolutionModeOverride(node *ast.ImportAttributes, reportErrors bool) core.ResolutionMode

func (*Checker) GetResolvedSignature

func (c *Checker) GetResolvedSignature(node *ast.Node) *Signature

func (*Checker) GetResolvedSymbol

func (c *Checker) GetResolvedSymbol(node *ast.Node) *ast.Symbol

func (*Checker) GetReturnTypeOfSignature

func (c *Checker) GetReturnTypeOfSignature(sig *Signature) *Type

func (*Checker) GetRootSymbols

func (c *Checker) GetRootSymbols(symbol *ast.Symbol) []*ast.Symbol

func (*Checker) GetShorthandAssignmentValueSymbol

func (c *Checker) GetShorthandAssignmentValueSymbol(location *ast.Node) *ast.Symbol

func (*Checker) GetSignaturesOfType

func (c *Checker) GetSignaturesOfType(t *Type, kind SignatureKind) []*Signature

func (*Checker) GetStringIndexType

func (c *Checker) GetStringIndexType(t *Type) *Type

func (*Checker) GetStringType

func (c *Checker) GetStringType() *Type

func (*Checker) GetSuggestionDiagnostics

func (c *Checker) GetSuggestionDiagnostics(ctx context.Context, sourceFile *ast.SourceFile) []*ast.Diagnostic

func (*Checker) GetSymbolAtLocation

func (c *Checker) GetSymbolAtLocation(node *ast.Node) *ast.Symbol

func (*Checker) GetSymbolsInScope

func (c *Checker) GetSymbolsInScope(location *ast.Node, meaning ast.SymbolFlags) []*ast.Symbol

func (*Checker) GetSymbolsOfParameterPropertyDeclaration

func (c *Checker) GetSymbolsOfParameterPropertyDeclaration(parameter *ast.Node, parameterName string) (*ast.Symbol, *ast.Symbol)

* * Get symbols that represent parameter-property-declaration as parameter and as property declaration * @param parameter a parameterDeclaration node * @param parameterName a name of the parameter to get the symbols for. * @return a tuple of two symbols

func (*Checker) GetTypeAliasTypeParameters

func (c *Checker) GetTypeAliasTypeParameters(symbol *ast.Symbol) []*Type

func (*Checker) GetTypeArgumentConstraint

func (c *Checker) GetTypeArgumentConstraint(node *ast.Node) *Type

func (*Checker) GetTypeAtLocation

func (c *Checker) GetTypeAtLocation(node *ast.Node) *Type

func (*Checker) GetTypeFromTypeNode

func (c *Checker) GetTypeFromTypeNode(node *ast.Node) *Type

func (*Checker) GetTypeOfPropertyOfContextualType

func (c *Checker) GetTypeOfPropertyOfContextualType(t *Type, name string) *Type

func (*Checker) GetTypeOfPropertyOfType

func (c *Checker) GetTypeOfPropertyOfType(t *Type, name string) *Type

Return the type of the given property in the given type, or nil if no such property exists

func (*Checker) GetTypeOfSymbol

func (c *Checker) GetTypeOfSymbol(symbol *ast.Symbol) *Type

func (*Checker) GetTypeOfSymbolAtLocation

func (c *Checker) GetTypeOfSymbolAtLocation(symbol *ast.Symbol, location *ast.Node) *Type

func (*Checker) GetTypeOnlyAliasDeclaration

func (c *Checker) GetTypeOnlyAliasDeclaration(symbol *ast.Symbol) *ast.Node

func (*Checker) GetTypeParameterAtPosition

func (c *Checker) GetTypeParameterAtPosition(s *Signature, pos int) *Type

func (*Checker) GetTypePredicateOfSignature

func (c *Checker) GetTypePredicateOfSignature(sig *Signature) *TypePredicate

func (*Checker) GetUnionType

func (c *Checker) GetUnionType(types []*Type) *Type

func (*Checker) GetUnknownSymbol

func (c *Checker) GetUnknownSymbol() *ast.Symbol

func (*Checker) HasEffectiveRestParameter

func (c *Checker) HasEffectiveRestParameter(signature *Signature) bool

func (*Checker) IsAnySymbolAccessible

func (ch *Checker) IsAnySymbolAccessible(symbols []*ast.Symbol, enclosingDeclaration *ast.Node, initialSymbol *ast.Symbol, meaning ast.SymbolFlags, shouldComputeAliasesToMakeVisible bool, allowModules bool) *printer.SymbolAccessibilityResult

func (*Checker) IsArgumentsSymbol

func (c *Checker) IsArgumentsSymbol(symbol *ast.Symbol) bool

func (*Checker) IsArrayLikeType

func (c *Checker) IsArrayLikeType(t *Type) bool

func (*Checker) IsDeprecatedDeclaration

func (c *Checker) IsDeprecatedDeclaration(declaration *ast.Node) bool

func (*Checker) IsEmptyAnonymousObjectType

func (c *Checker) IsEmptyAnonymousObjectType(t *Type) bool

func (*Checker) IsNullableType

func (c *Checker) IsNullableType(t *Type) bool

func (*Checker) IsPropertyAccessible

func (c *Checker) IsPropertyAccessible(node *ast.Node, isSuper bool, isWrite bool, containingType *Type, property *ast.Symbol) bool

Checks if a property can be accessed in a location. The location is given by the `node` parameter. The node does not need to be a property access. @param node location where to check property accessibility @param isSuper whether to consider this a `super` property access, e.g. `super.foo`. @param isWrite whether this is a write access, e.g. `++foo.x`. @param containingType type where the property comes from. @param property property symbol.

func (*Checker) IsSymbolAccessible

func (c *Checker) IsSymbolAccessible(symbol *ast.Symbol, enclosingDeclaration *ast.Node, meaning ast.SymbolFlags, shouldComputeAliasesToMakeVisible bool) printer.SymbolAccessibilityResult

func (*Checker) IsSymbolAccessibleByFlags

func (ch *Checker) IsSymbolAccessibleByFlags(symbol *ast.Symbol, enclosingDeclaration *ast.Node, flags ast.SymbolFlags) bool

func (*Checker) IsTypeInvalidDueToUnionDiscriminant

func (c *Checker) IsTypeInvalidDueToUnionDiscriminant(contextualType *Type, obj *ast.Node) bool

func (*Checker) IsTypeSymbolAccessible

func (ch *Checker) IsTypeSymbolAccessible(typeSymbol *ast.Symbol, enclosingDeclaration *ast.Node) bool

func (*Checker) IsUndefinedSymbol

func (c *Checker) IsUndefinedSymbol(symbol *ast.Symbol) bool

func (*Checker) IsUnknownSymbol

func (c *Checker) IsUnknownSymbol(symbol *ast.Symbol) bool

func (*Checker) IsValidPropertyAccess

func (c *Checker) IsValidPropertyAccess(node *ast.Node, propertyName string) bool

func (*Checker) IsValidPropertyAccessForCompletions

func (c *Checker) IsValidPropertyAccessForCompletions(node *ast.Node, t *Type, property *ast.Symbol) bool

Checks if an existing property access is valid for completions purposes. node: a property access-like node where we want to check if we can access a property. This node does not need to be an access of the property we are checking. e.g. in completions, this node will often be an incomplete property access node, as in `foo.`. Besides providing a location (i.e. scope) used to check property accessibility, we use this node for computing whether this is a `super` property access. type: the type whose property we are checking. property: the accessed property's symbol.

func (*Checker) IsValueSymbolAccessible

func (ch *Checker) IsValueSymbolAccessible(symbol *ast.Symbol, enclosingDeclaration *ast.Node) bool

func (*Checker) ResolveAlias

func (c *Checker) ResolveAlias(symbol *ast.Symbol) (*ast.Symbol, bool)

func (*Checker) ResolveExternalModuleName

func (c *Checker) ResolveExternalModuleName(moduleSpecifier *ast.Node) *ast.Symbol

func (*Checker) ResolveExternalModuleSymbol

func (c *Checker) ResolveExternalModuleSymbol(moduleSymbol *ast.Symbol) *ast.Symbol

func (*Checker) SignatureToStringEx

func (c *Checker) SignatureToStringEx(signature *Signature, enclosingDeclaration *ast.Node, flags TypeFormatFlags) string

func (*Checker) SkipAlias

func (c *Checker) SkipAlias(symbol *ast.Symbol) *ast.Symbol

func (*Checker) SymbolToString

func (c *Checker) SymbolToString(s *ast.Symbol) string

func (*Checker) SymbolToStringEx

func (c *Checker) SymbolToStringEx(symbol *ast.Symbol, enclosingDeclaration *ast.Node, meaning ast.SymbolFlags, flags SymbolFormatFlags) string

func (*Checker) TryFindAmbientModule

func (c *Checker) TryFindAmbientModule(moduleName string) *ast.Symbol

func (*Checker) TryGetMemberInModuleExports

func (c *Checker) TryGetMemberInModuleExports(memberName string, moduleSymbol *ast.Symbol) *ast.Symbol

func (*Checker) TryGetMemberInModuleExportsAndProperties

func (c *Checker) TryGetMemberInModuleExportsAndProperties(memberName string, moduleSymbol *ast.Symbol) *ast.Symbol

func (*Checker) TryGetThisTypeAtEx

func (c *Checker) TryGetThisTypeAtEx(node *ast.Node, includeGlobalThis bool, container *ast.Node) *Type

func (*Checker) TypeHasCallOrConstructSignatures

func (c *Checker) TypeHasCallOrConstructSignatures(t *Type) bool

func (*Checker) TypePredicateToString

func (c *Checker) TypePredicateToString(t *TypePredicate) string

func (*Checker) TypeToString

func (c *Checker) TypeToString(t *Type) string

func (*Checker) TypeToStringEx

func (c *Checker) TypeToStringEx(t *Type, enclosingDeclaration *ast.Node, flags TypeFormatFlags) string

func (*Checker) TypeToTypeNode

func (c *Checker) TypeToTypeNode(t *Type, enclosingDeclaration *ast.Node, flags nodebuilder.Flags) *ast.TypeNode

func (*Checker) UnionTypes

func (c *Checker) UnionTypes() iter.Seq[*Type]

func (*Checker) WasCanceled

func (c *Checker) WasCanceled() bool

type CompositeSignature

type CompositeSignature struct {
	// contains filtered or unexported fields
}

type CompositeSymbolIdentity

type CompositeSymbolIdentity struct {
	// contains filtered or unexported fields
}

type CompositeTypeCacheIdentity

type CompositeTypeCacheIdentity struct {
	// contains filtered or unexported fields
}

type CompositeTypeMapper

type CompositeTypeMapper struct {
	TypeMapperBase
	// contains filtered or unexported fields
}

func (*CompositeTypeMapper) Map

func (m *CompositeTypeMapper) Map(t *Type) *Type

type ConditionalRoot

type ConditionalRoot struct {
	// contains filtered or unexported fields
}

type ConditionalType

type ConditionalType struct {
	ConstrainedType
	// contains filtered or unexported fields
}

type ConstrainedType

type ConstrainedType struct {
	TypeBase
	// contains filtered or unexported fields
}

func (*ConstrainedType) AsConstrainedType

func (t *ConstrainedType) AsConstrainedType() *ConstrainedType
type ContainingSymbolLinks struct {
	// contains filtered or unexported fields
}

type ContextFlags

type ContextFlags uint32
const (
	ContextFlagsNone                ContextFlags = 0
	ContextFlagsSignature           ContextFlags = 1 << 0 // Obtaining contextual signature
	ContextFlagsNoConstraints       ContextFlags = 1 << 1 // Don't obtain type variable constraints
	ContextFlagsCompletions         ContextFlags = 1 << 2 // Ignore inference to current node and parent nodes out to the containing call for completions
	ContextFlagsSkipBindingPatterns ContextFlags = 1 << 3 // Ignore contextual types applied by binding patterns
)

type ContextualInfo

type ContextualInfo struct {
	// contains filtered or unexported fields
}
type DeclarationFileLinks struct {
	// contains filtered or unexported fields
}
type DeclarationLinks struct {
	// contains filtered or unexported fields
}

type DeclarationMeaning

type DeclarationMeaning uint32
const (
	DeclarationMeaningGetAccessor DeclarationMeaning = 1 << iota
	DeclarationMeaningSetAccessor
	DeclarationMeaningPropertyAssignment
	DeclarationMeaningMethod
	DeclarationMeaningPrivateStatic
	DeclarationMeaningGetOrSetAccessor           = DeclarationMeaningGetAccessor | DeclarationMeaningSetAccessor
	DeclarationMeaningPropertyAssignmentOrMethod = DeclarationMeaningPropertyAssignment | DeclarationMeaningMethod
)

type DeclarationSpaces

type DeclarationSpaces int32
const (
	DeclarationSpacesNone            DeclarationSpaces = 0
	DeclarationSpacesExportValue     DeclarationSpaces = 1 << 0
	DeclarationSpacesExportType      DeclarationSpaces = 1 << 1
	DeclarationSpacesExportNamespace DeclarationSpaces = 1 << 2
)
type DeclaredTypeLinks struct {
	// contains filtered or unexported fields
}
type DeferredSymbolLinks struct {
	// contains filtered or unexported fields
}

type DeferredTypeMapper

type DeferredTypeMapper struct {
	TypeMapperBase
	// contains filtered or unexported fields
}

func (*DeferredTypeMapper) Map

func (m *DeferredTypeMapper) Map(t *Type) *Type

type DiagnosticAndArguments

type DiagnosticAndArguments struct {
	// contains filtered or unexported fields
}

type DiscriminatedContextualTypeKey

type DiscriminatedContextualTypeKey struct {
	// contains filtered or unexported fields
}

type Discriminator

type Discriminator interface {
	// contains filtered or unexported methods
}

type ElementFlags

type ElementFlags uint32

type EnumLiteralKey

type EnumLiteralKey struct {
	// contains filtered or unexported fields
}
type EnumMemberLinks struct {
	// contains filtered or unexported fields
}

type EnumRelationKey

type EnumRelationKey struct {
	// contains filtered or unexported fields
}

type ErrorChain

type ErrorChain struct {
	// contains filtered or unexported fields
}

type ErrorOutputContainer

type ErrorOutputContainer struct {
	// contains filtered or unexported fields
}

type ErrorReporter

type ErrorReporter func(message *diagnostics.Message, args ...any)

type EvolvingArrayType

type EvolvingArrayType struct {
	ObjectType
	// contains filtered or unexported fields
}

type ExhaustiveState

type ExhaustiveState byte
const (
	ExhaustiveStateUnknown   ExhaustiveState = iota // Exhaustive state not computed
	ExhaustiveStateComputing                        // Exhaustive state computation in progress
	ExhaustiveStateFalse                            // Switch statement is not exhaustive
	ExhaustiveStateTrue                             // Switch statement is exhaustive
)

type ExpandingFlags

type ExpandingFlags uint8
const (
	ExpandingFlagsNone   ExpandingFlags = 0
	ExpandingFlagsSource ExpandingFlags = 1 << 0
	ExpandingFlagsTarget ExpandingFlags = 1 << 1
	ExpandingFlagsBoth                  = ExpandingFlagsSource | ExpandingFlagsTarget
)

type ExportCollision

type ExportCollision struct {
	// contains filtered or unexported fields
}

type ExportCollisionTable

type ExportCollisionTable = map[string]*ExportCollision
type ExportTypeLinks struct {
	// contains filtered or unexported fields
}

type FeatureMapEntry

type FeatureMapEntry struct {
	// contains filtered or unexported fields
}

type FlowLoopInfo

type FlowLoopInfo struct {
	// contains filtered or unexported fields
}

type FlowLoopKey

type FlowLoopKey struct {
	// contains filtered or unexported fields
}

type FlowState

type FlowState struct {
	// contains filtered or unexported fields
}

type FlowType

type FlowType struct {
	// contains filtered or unexported fields
}

type FunctionFlags

type FunctionFlags uint32
const (
	FunctionFlagsNormal         FunctionFlags = 0
	FunctionFlagsGenerator      FunctionFlags = 1 << 0
	FunctionFlagsAsync          FunctionFlags = 1 << 1
	FunctionFlagsInvalid        FunctionFlags = 1 << 2
	FunctionFlagsAsyncGenerator FunctionFlags = FunctionFlagsAsync | FunctionFlagsGenerator
)

type FunctionTypeMapper

type FunctionTypeMapper struct {
	TypeMapperBase
	// contains filtered or unexported fields
}

func (*FunctionTypeMapper) Map

func (m *FunctionTypeMapper) Map(t *Type) *Type

type Host

type IndexFlags

type IndexFlags uint32
const (
	IndexFlagsNone              IndexFlags = 0
	IndexFlagsStringsOnly       IndexFlags = 1 << 0
	IndexFlagsNoIndexSignatures IndexFlags = 1 << 1
	IndexFlagsNoReducibleCheck  IndexFlags = 1 << 2
)

type IndexInfo

type IndexInfo struct {
	// contains filtered or unexported fields
}
type IndexSymbolLinks struct {
	// contains filtered or unexported fields
}

type IndexType

type IndexType struct {
	ConstrainedType
	// contains filtered or unexported fields
}

type IndexedAccessType

type IndexedAccessType struct {
	ConstrainedType
	// contains filtered or unexported fields
}

type InferenceContext

type InferenceContext struct {
	// contains filtered or unexported fields
}

type InferenceContextInfo

type InferenceContextInfo struct {
	// contains filtered or unexported fields
}

type InferenceFlags

type InferenceFlags uint32
const (
	InferenceFlagsNone                   InferenceFlags = 0      // No special inference behaviors
	InferenceFlagsNoDefault              InferenceFlags = 1 << 0 // Infer silentNeverType for no inferences (otherwise anyType or unknownType)
	InferenceFlagsAnyDefault             InferenceFlags = 1 << 1 // Infer anyType (in JS files) for no inferences (otherwise unknownType)
	InferenceFlagsSkippedGenericFunction InferenceFlags = 1 << 2 // A generic function was skipped during inference
)

type InferenceInfo

type InferenceInfo struct {
	// contains filtered or unexported fields
}

type InferenceKey

type InferenceKey struct {
	// contains filtered or unexported fields
}

type InferencePriority

type InferencePriority int32
const (
	InferencePriorityNone                         InferencePriority = 0
	InferencePriorityNakedTypeVariable            InferencePriority = 1 << 0  // Naked type variable in union or intersection type
	InferencePrioritySpeculativeTuple             InferencePriority = 1 << 1  // Speculative tuple inference
	InferencePrioritySubstituteSource             InferencePriority = 1 << 2  // Source of inference originated within a substitution type's substitute
	InferencePriorityHomomorphicMappedType        InferencePriority = 1 << 3  // Reverse inference for homomorphic mapped type
	InferencePriorityPartialHomomorphicMappedType InferencePriority = 1 << 4  // Partial reverse inference for homomorphic mapped type
	InferencePriorityMappedTypeConstraint         InferencePriority = 1 << 5  // Reverse inference for mapped type
	InferencePriorityContravariantConditional     InferencePriority = 1 << 6  // Conditional type in contravariant position
	InferencePriorityReturnType                   InferencePriority = 1 << 7  // Inference made from return type of generic function
	InferencePriorityLiteralKeyof                 InferencePriority = 1 << 8  // Inference made from a string literal to a keyof T
	InferencePriorityNoConstraints                InferencePriority = 1 << 9  // Don't infer from constraints of instantiable types
	InferencePriorityAlwaysStrict                 InferencePriority = 1 << 10 // Always use strict rules for contravariant inferences
	InferencePriorityMaxValue                     InferencePriority = 1 << 11 // Seed for inference priority tracking
	InferencePriorityCircularity                  InferencePriority = -1      // Inference circularity (value less than all other priorities)

	InferencePriorityPriorityImpliesCombination = InferencePriorityReturnType | InferencePriorityMappedTypeConstraint | InferencePriorityLiteralKeyof // These priorities imply that the resulting type should be a combination of all candidates
)

type InferenceState

type InferenceState struct {
	// contains filtered or unexported fields
}

type InferenceTypeMapper

type InferenceTypeMapper struct {
	TypeMapperBase
	// contains filtered or unexported fields
}

func (*InferenceTypeMapper) Map

func (m *InferenceTypeMapper) Map(t *Type) *Type

type InheritanceInfo

type InheritanceInfo struct {
	// contains filtered or unexported fields
}

type InstantiationExpressionKey

type InstantiationExpressionKey struct {
	// contains filtered or unexported fields
}

type InstantiationExpressionType

type InstantiationExpressionType struct {
	ObjectType
	// contains filtered or unexported fields
}

type InterfaceType

type InterfaceType struct {
	TypeReference
	// contains filtered or unexported fields
}

func (*InterfaceType) AsInterfaceType

func (t *InterfaceType) AsInterfaceType() *InterfaceType

func (*InterfaceType) LocalTypeParameters

func (t *InterfaceType) LocalTypeParameters() []*Type

func (*InterfaceType) OuterTypeParameters

func (t *InterfaceType) OuterTypeParameters() []*Type

func (*InterfaceType) TypeParameters

func (t *InterfaceType) TypeParameters() []*Type

type IntersectionFlags

type IntersectionFlags uint32
const (
	IntersectionFlagsNone                  IntersectionFlags = 0
	IntersectionFlagsNoSupertypeReduction  IntersectionFlags = 1 << 0
	IntersectionFlagsNoConstraintReduction IntersectionFlags = 1 << 1
)

type IntersectionState

type IntersectionState uint32
const (
	IntersectionStateNone   IntersectionState = 0
	IntersectionStateSource IntersectionState = 1 << 0 // Source type is a constituent of an outer intersection
	IntersectionStateTarget IntersectionState = 1 << 1 // Target type is a constituent of an outer intersection
)

type IntersectionType

type IntersectionType struct {
	UnionOrIntersectionType
	// contains filtered or unexported fields
}

type IntraExpressionInferenceSite

type IntraExpressionInferenceSite struct {
	// contains filtered or unexported fields
}

type IntrinsicType

type IntrinsicType struct {
	TypeBase
	// contains filtered or unexported fields
}

func (*IntrinsicType) IntrinsicName

func (t *IntrinsicType) IntrinsicName() string

type IntrinsicTypeKind

type IntrinsicTypeKind int32
const (
	IntrinsicTypeKindUnknown IntrinsicTypeKind = iota
	IntrinsicTypeKindUppercase
	IntrinsicTypeKindLowercase
	IntrinsicTypeKindCapitalize
	IntrinsicTypeKindUncapitalize
	IntrinsicTypeKindNoInfer
)

type IterationTypeKind

type IterationTypeKind int32
const (
	IterationTypeKindYield IterationTypeKind = iota
	IterationTypeKindReturn
	IterationTypeKindNext
)

type IterationTypes

type IterationTypes struct {
	// contains filtered or unexported fields
}

type IterationTypesKey

type IterationTypesKey struct {
	// contains filtered or unexported fields
}

type IterationTypesResolver

type IterationTypesResolver struct {
	// contains filtered or unexported fields
}

type IterationUse

type IterationUse uint32
type JSXLinks struct {
	// contains filtered or unexported fields
}

Links for jsx

type JsxElaborationElement

type JsxElaborationElement struct {
	// contains filtered or unexported fields
}
type JsxElementLinks struct {
	// contains filtered or unexported fields
}

type JsxFlags

type JsxFlags uint32
const (
	JsxFlagsNone                    JsxFlags = 0
	JsxFlagsIntrinsicNamedElement   JsxFlags = 1 << 0 // An element from a named property of the JSX.IntrinsicElements interface
	JsxFlagsIntrinsicIndexedElement JsxFlags = 1 << 1 // An element inferred from the string index signature of the JSX.IntrinsicElements interface
	JsxFlagsIntrinsicElement        JsxFlags = JsxFlagsIntrinsicNamedElement | JsxFlagsIntrinsicIndexedElement
)

type JsxReferenceKind

type JsxReferenceKind int32
const (
	JsxReferenceKindComponent JsxReferenceKind = iota
	JsxReferenceKindFunction
	JsxReferenceKindMixed
)

type KeyBuilder

type KeyBuilder struct {
	strings.Builder
}

func (*KeyBuilder) WriteAlias

func (b *KeyBuilder) WriteAlias(alias *TypeAlias)

func (*KeyBuilder) WriteGenericTypeReferences

func (b *KeyBuilder) WriteGenericTypeReferences(source *Type, target *Type, ignoreConstraints bool) bool

func (*KeyBuilder) WriteInt

func (b *KeyBuilder) WriteInt(value int)

func (*KeyBuilder) WriteNode

func (b *KeyBuilder) WriteNode(node *ast.Node)

func (*KeyBuilder) WriteNodeId

func (b *KeyBuilder) WriteNodeId(id ast.NodeId)

func (*KeyBuilder) WriteSymbol

func (b *KeyBuilder) WriteSymbol(s *ast.Symbol)

func (*KeyBuilder) WriteSymbolId

func (b *KeyBuilder) WriteSymbolId(id ast.SymbolId)

func (*KeyBuilder) WriteType

func (b *KeyBuilder) WriteType(t *Type)

func (*KeyBuilder) WriteTypeId

func (b *KeyBuilder) WriteTypeId(id TypeId)

func (*KeyBuilder) WriteTypes

func (b *KeyBuilder) WriteTypes(types []*Type)

func (*KeyBuilder) WriteUint64

func (b *KeyBuilder) WriteUint64(value uint64)

type LanguageFeatureMinimumTargetMap

type LanguageFeatureMinimumTargetMap struct {
	Classes                           core.ScriptTarget
	ForOf                             core.ScriptTarget
	Generators                        core.ScriptTarget
	Iteration                         core.ScriptTarget
	SpreadElements                    core.ScriptTarget
	RestElements                      core.ScriptTarget
	TaggedTemplates                   core.ScriptTarget
	DestructuringAssignment           core.ScriptTarget
	BindingPatterns                   core.ScriptTarget
	ArrowFunctions                    core.ScriptTarget
	BlockScopedVariables              core.ScriptTarget
	ObjectAssign                      core.ScriptTarget
	RegularExpressionFlagsUnicode     core.ScriptTarget
	RegularExpressionFlagsSticky      core.ScriptTarget
	Exponentiation                    core.ScriptTarget
	AsyncFunctions                    core.ScriptTarget
	ForAwaitOf                        core.ScriptTarget
	AsyncGenerators                   core.ScriptTarget
	AsyncIteration                    core.ScriptTarget
	ObjectSpreadRest                  core.ScriptTarget
	RegularExpressionFlagsDotAll      core.ScriptTarget
	BindinglessCatch                  core.ScriptTarget
	BigInt                            core.ScriptTarget
	NullishCoalesce                   core.ScriptTarget
	OptionalChaining                  core.ScriptTarget
	LogicalAssignment                 core.ScriptTarget
	TopLevelAwait                     core.ScriptTarget
	ClassFields                       core.ScriptTarget
	PrivateNamesAndClassStaticBlocks  core.ScriptTarget
	RegularExpressionFlagsHasIndices  core.ScriptTarget
	ShebangComments                   core.ScriptTarget
	UsingAndAwaitUsing                core.ScriptTarget
	ClassAndClassElementDecorators    core.ScriptTarget
	RegularExpressionFlagsUnicodeSets core.ScriptTarget
}
type LateBoundLinks struct {
	// contains filtered or unexported fields
}

type LiteralType

type LiteralType struct {
	TypeBase
	// contains filtered or unexported fields
}

func (*LiteralType) String

func (t *LiteralType) String() string

func (*LiteralType) Value

func (t *LiteralType) Value() any
type MappedSymbolLinks struct {
	// contains filtered or unexported fields
}

type MappedType

type MappedType struct {
	ObjectType
	// contains filtered or unexported fields
}

type MappedTypeModifiers

type MappedTypeModifiers uint32
const (
	MappedTypeModifiersIncludeReadonly MappedTypeModifiers = 1 << 0
	MappedTypeModifiersExcludeReadonly MappedTypeModifiers = 1 << 1
	MappedTypeModifiersIncludeOptional MappedTypeModifiers = 1 << 2
	MappedTypeModifiersExcludeOptional MappedTypeModifiers = 1 << 3
)

type MappedTypeNameTypeKind

type MappedTypeNameTypeKind int32
const (
	MappedTypeNameTypeKindNone MappedTypeNameTypeKind = iota
	MappedTypeNameTypeKindFiltering
	MappedTypeNameTypeKindRemapping
)
type MarkedAssignmentSymbolLinks struct {
	// contains filtered or unexported fields
}
type MembersAndExportsLinks [2]ast.SymbolTable // Indexed by MembersOrExportsResolutionKind

type MembersOrExportsResolutionKind

type MembersOrExportsResolutionKind int
const (
	MembersOrExportsResolutionKindResolvedExports MembersOrExportsResolutionKind = 0
	MembersOrExportsResolutionKindResolvedMembers MembersOrExportsResolutionKind = 1
)

type MergedTypeMapper

type MergedTypeMapper struct {
	TypeMapperBase
	// contains filtered or unexported fields
}

func (*MergedTypeMapper) Kind

func (m *MergedTypeMapper) Kind() TypeMapperKind

func (*MergedTypeMapper) Map

func (m *MergedTypeMapper) Map(t *Type) *Type

type MinArgumentCountFlags

type MinArgumentCountFlags uint32
const (
	MinArgumentCountFlagsNone                    MinArgumentCountFlags = 0
	MinArgumentCountFlagsStrongArityForUntypedJS MinArgumentCountFlags = 1 << 0
	MinArgumentCountFlagsVoidIsNonOptional       MinArgumentCountFlags = 1 << 1
)
type ModuleSymbolLinks struct {
	// contains filtered or unexported fields
}

type NarrowedTypeKey

type NarrowedTypeKey struct {
	// contains filtered or unexported fields
}

type NodeBuilder

type NodeBuilder struct {
	// contains filtered or unexported fields
}

func NewNodeBuilder

func NewNodeBuilder(ch *Checker, e *printer.EmitContext) *NodeBuilder

func (*NodeBuilder) EmitContext

func (b *NodeBuilder) EmitContext() *printer.EmitContext

EmitContext implements NodeBuilderInterface.

func (*NodeBuilder) IndexInfoToIndexSignatureDeclaration

func (b *NodeBuilder) IndexInfoToIndexSignatureDeclaration(info *IndexInfo, enclosingDeclaration *ast.Node, flags nodebuilder.Flags, internalFlags nodebuilder.InternalFlags, tracker nodebuilder.SymbolTracker) *ast.Node

IndexInfoToIndexSignatureDeclaration implements NodeBuilderInterface.

func (*NodeBuilder) SerializeReturnTypeForSignature

func (b *NodeBuilder) SerializeReturnTypeForSignature(signatureDeclaration *ast.Node, enclosingDeclaration *ast.Node, flags nodebuilder.Flags, internalFlags nodebuilder.InternalFlags, tracker nodebuilder.SymbolTracker) *ast.Node

SerializeReturnTypeForSignature implements NodeBuilderInterface.

func (*NodeBuilder) SerializeTypeForDeclaration

func (b *NodeBuilder) SerializeTypeForDeclaration(declaration *ast.Node, symbol *ast.Symbol, enclosingDeclaration *ast.Node, flags nodebuilder.Flags, internalFlags nodebuilder.InternalFlags, tracker nodebuilder.SymbolTracker) *ast.Node

SerializeTypeForDeclaration implements NodeBuilderInterface.

func (*NodeBuilder) SerializeTypeForExpression

func (b *NodeBuilder) SerializeTypeForExpression(expr *ast.Node, enclosingDeclaration *ast.Node, flags nodebuilder.Flags, internalFlags nodebuilder.InternalFlags, tracker nodebuilder.SymbolTracker) *ast.Node

SerializeTypeForExpression implements NodeBuilderInterface.

func (*NodeBuilder) SerializeTypeParametersForSignature

func (b *NodeBuilder) SerializeTypeParametersForSignature(signatureDeclaration *ast.Node, enclosingDeclaration *ast.Node, flags nodebuilder.Flags, internalFlags nodebuilder.InternalFlags, tracker nodebuilder.SymbolTracker) []*ast.Node

func (*NodeBuilder) SignatureToSignatureDeclaration

func (b *NodeBuilder) SignatureToSignatureDeclaration(signature *Signature, kind ast.Kind, enclosingDeclaration *ast.Node, flags nodebuilder.Flags, internalFlags nodebuilder.InternalFlags, tracker nodebuilder.SymbolTracker) *ast.Node

SignatureToSignatureDeclaration implements NodeBuilderInterface.

func (*NodeBuilder) SymbolTableToDeclarationStatements

func (b *NodeBuilder) SymbolTableToDeclarationStatements(symbolTable *ast.SymbolTable, enclosingDeclaration *ast.Node, flags nodebuilder.Flags, internalFlags nodebuilder.InternalFlags, tracker nodebuilder.SymbolTracker) []*ast.Node

SymbolTableToDeclarationStatements implements NodeBuilderInterface.

func (*NodeBuilder) SymbolToEntityName

func (b *NodeBuilder) SymbolToEntityName(symbol *ast.Symbol, meaning ast.SymbolFlags, enclosingDeclaration *ast.Node, flags nodebuilder.Flags, internalFlags nodebuilder.InternalFlags, tracker nodebuilder.SymbolTracker) *ast.Node

SymbolToEntityName implements NodeBuilderInterface.

func (*NodeBuilder) SymbolToExpression

func (b *NodeBuilder) SymbolToExpression(symbol *ast.Symbol, meaning ast.SymbolFlags, enclosingDeclaration *ast.Node, flags nodebuilder.Flags, internalFlags nodebuilder.InternalFlags, tracker nodebuilder.SymbolTracker) *ast.Node

SymbolToExpression implements NodeBuilderInterface.

func (*NodeBuilder) SymbolToNode

func (b *NodeBuilder) SymbolToNode(symbol *ast.Symbol, meaning ast.SymbolFlags, enclosingDeclaration *ast.Node, flags nodebuilder.Flags, internalFlags nodebuilder.InternalFlags, tracker nodebuilder.SymbolTracker) *ast.Node

SymbolToNode implements NodeBuilderInterface.

func (NodeBuilder) SymbolToParameterDeclaration

func (b NodeBuilder) SymbolToParameterDeclaration(symbol *ast.Symbol, enclosingDeclaration *ast.Node, flags nodebuilder.Flags, internalFlags nodebuilder.InternalFlags, tracker nodebuilder.SymbolTracker) *ast.Node

SymbolToParameterDeclaration implements NodeBuilderInterface.

func (*NodeBuilder) SymbolToTypeParameterDeclarations

func (b *NodeBuilder) SymbolToTypeParameterDeclarations(symbol *ast.Symbol, enclosingDeclaration *ast.Node, flags nodebuilder.Flags, internalFlags nodebuilder.InternalFlags, tracker nodebuilder.SymbolTracker) []*ast.Node

SymbolToTypeParameterDeclarations implements NodeBuilderInterface.

func (*NodeBuilder) TypeParameterToDeclaration

func (b *NodeBuilder) TypeParameterToDeclaration(parameter *Type, enclosingDeclaration *ast.Node, flags nodebuilder.Flags, internalFlags nodebuilder.InternalFlags, tracker nodebuilder.SymbolTracker) *ast.Node

TypeParameterToDeclaration implements NodeBuilderInterface.

func (*NodeBuilder) TypePredicateToTypePredicateNode

func (b *NodeBuilder) TypePredicateToTypePredicateNode(predicate *TypePredicate, enclosingDeclaration *ast.Node, flags nodebuilder.Flags, internalFlags nodebuilder.InternalFlags, tracker nodebuilder.SymbolTracker) *ast.Node

TypePredicateToTypePredicateNode implements NodeBuilderInterface.

func (*NodeBuilder) TypeToTypeNode

func (b *NodeBuilder) TypeToTypeNode(typ *Type, enclosingDeclaration *ast.Node, flags nodebuilder.Flags, internalFlags nodebuilder.InternalFlags, tracker nodebuilder.SymbolTracker) *ast.Node

TypeToTypeNode implements NodeBuilderInterface.

type NodeBuilderContext

type NodeBuilderContext struct {
	// contains filtered or unexported fields
}
type NodeBuilderLinks struct {
	// contains filtered or unexported fields
}
type NodeBuilderSymbolLinks struct {
	// contains filtered or unexported fields
}

type NodeCheckFlags

type NodeCheckFlags uint32
const (
	NodeCheckFlagsNone                                     NodeCheckFlags = 0
	NodeCheckFlagsTypeChecked                              NodeCheckFlags = 1 << 0  // Node has been type checked
	NodeCheckFlagsLexicalThis                              NodeCheckFlags = 1 << 1  // Lexical 'this' reference
	NodeCheckFlagsCaptureThis                              NodeCheckFlags = 1 << 2  // Lexical 'this' used in body
	NodeCheckFlagsCaptureNewTarget                         NodeCheckFlags = 1 << 3  // Lexical 'new.target' used in body
	NodeCheckFlagsSuperInstance                            NodeCheckFlags = 1 << 4  // Instance 'super' reference
	NodeCheckFlagsSuperStatic                              NodeCheckFlags = 1 << 5  // Static 'super' reference
	NodeCheckFlagsContextChecked                           NodeCheckFlags = 1 << 6  // Contextual types have been assigned
	NodeCheckFlagsMethodWithSuperPropertyAccessInAsync     NodeCheckFlags = 1 << 7  // A method that contains a SuperProperty access in an async context.
	NodeCheckFlagsMethodWithSuperPropertyAssignmentInAsync NodeCheckFlags = 1 << 8  // A method that contains a SuperProperty assignment in an async context.
	NodeCheckFlagsCaptureArguments                         NodeCheckFlags = 1 << 9  // Lexical 'arguments' used in body
	NodeCheckFlagsEnumValuesComputed                       NodeCheckFlags = 1 << 10 // Values for enum members have been computed, and any errors have been reported for them.
	NodeCheckFlagsLoopWithCapturedBlockScopedBinding       NodeCheckFlags = 1 << 12 // Loop that contains block scoped variable captured in closure
	NodeCheckFlagsContainsCapturedBlockScopeBinding        NodeCheckFlags = 1 << 13 // Part of a loop that contains block scoped variable captured in closure
	NodeCheckFlagsCapturedBlockScopedBinding               NodeCheckFlags = 1 << 14 // Block-scoped binding that is captured in some function
	NodeCheckFlagsBlockScopedBindingInLoop                 NodeCheckFlags = 1 << 15 // Block-scoped binding with declaration nested inside iteration statement
	NodeCheckFlagsNeedsLoopOutParameter                    NodeCheckFlags = 1 << 16 // Block scoped binding whose value should be explicitly copied outside of the converted loop
	NodeCheckFlagsAssignmentsMarked                        NodeCheckFlags = 1 << 17 // Parameter assignments have been marked
	NodeCheckFlagsContainsConstructorReference             NodeCheckFlags = 1 << 18 // Class or class element that contains a binding that references the class constructor.
	NodeCheckFlagsConstructorReference                     NodeCheckFlags = 1 << 29 // Binding to a class constructor inside of the class's body.
	NodeCheckFlagsContainsClassWithPrivateIdentifiers      NodeCheckFlags = 1 << 20 // Marked on all block-scoped containers containing a class with private identifiers.
	NodeCheckFlagsContainsSuperPropertyInStaticInitializer NodeCheckFlags = 1 << 21 // Marked on all block-scoped containers containing a static initializer with 'super.x' or 'super[x]'.
	NodeCheckFlagsInCheckIdentifier                        NodeCheckFlags = 1 << 22
	NodeCheckFlagsPartiallyTypeChecked                     NodeCheckFlags = 1 << 23 // Node has been partially type checked
	NodeCheckFlagsInitializerIsUndefined                   NodeCheckFlags = 1 << 24
	NodeCheckFlagsInitializerIsUndefinedComputed           NodeCheckFlags = 1 << 25
)
type NodeLinks struct {
	// contains filtered or unexported fields
}

type ObjectFlags

type ObjectFlags uint32

type ObjectLiteralDiscriminator

type ObjectLiteralDiscriminator struct {
	// contains filtered or unexported fields
}

type ObjectType

type ObjectType struct {
	StructuredType
	// contains filtered or unexported fields
}

func (*ObjectType) AsObjectType

func (t *ObjectType) AsObjectType() *ObjectType

type ParseFlags

type ParseFlags uint32
const (
	ParseFlagsNone                   ParseFlags = 0
	ParseFlagsYield                  ParseFlags = 1 << 0
	ParseFlagsAwait                  ParseFlags = 1 << 1
	ParseFlagsType                   ParseFlags = 1 << 2
	ParseFlagsIgnoreMissingOpenBrace ParseFlags = 1 << 4
	ParseFlagsJSDoc                  ParseFlags = 1 << 5
)

type PredicateSemantics

type PredicateSemantics uint32
const (
	PredicateSemanticsNone      PredicateSemantics = 0
	PredicateSemanticsAlways    PredicateSemantics = 1 << 0
	PredicateSemanticsNever     PredicateSemantics = 1 << 1
	PredicateSemanticsSometimes                    = PredicateSemanticsAlways | PredicateSemanticsNever
)

type Program

type Program interface {
	Host
	Options() *core.CompilerOptions
	SourceFiles() []*ast.SourceFile
	BindSourceFiles()
	FileExists(fileName string) bool
	GetSourceFile(fileName string) *ast.SourceFile
	GetSourceFileForResolvedModule(fileName string) *ast.SourceFile
	GetEmitModuleFormatOfFile(sourceFile ast.HasFileName) core.ModuleKind
	GetEmitSyntaxForUsageLocation(sourceFile ast.HasFileName, usageLocation *ast.StringLiteralLike) core.ResolutionMode
	GetImpliedNodeFormatForEmit(sourceFile ast.HasFileName) core.ModuleKind
	GetResolvedModule(currentSourceFile ast.HasFileName, moduleReference string, mode core.ResolutionMode) *module.ResolvedModule
	GetResolvedModules() map[tspath.Path]module.ModeAwareCache[*module.ResolvedModule]
	GetSourceFileMetaData(path tspath.Path) ast.SourceFileMetaData
	GetJSXRuntimeImportSpecifier(path tspath.Path) (moduleReference string, specifier *ast.Node)
	GetImportHelpersImportSpecifier(path tspath.Path) *ast.Node
	SourceFileMayBeEmitted(sourceFile *ast.SourceFile, forceDtsEmit bool) bool
	IsSourceFromProjectReference(path tspath.Path) bool
	IsSourceFileDefaultLibrary(path tspath.Path) bool
	GetProjectReferenceFromOutputDts(path tspath.Path) *tsoptions.SourceOutputAndProjectReference
	GetRedirectForResolution(file ast.HasFileName) *tsoptions.ParsedCommandLine
	CommonSourceDirectory() string
}

type RecursionFlags

type RecursionFlags uint32
const (
	RecursionFlagsNone   RecursionFlags = 0
	RecursionFlagsSource RecursionFlags = 1 << 0
	RecursionFlagsTarget RecursionFlags = 1 << 1
	RecursionFlagsBoth                  = RecursionFlagsSource | RecursionFlagsTarget
)

type RecursionId

type RecursionId struct {
	// contains filtered or unexported fields
}

type ReferenceHint

type ReferenceHint int32
const (
	ReferenceHintUnspecified ReferenceHint = iota
	ReferenceHintIdentifier
	ReferenceHintProperty
	ReferenceHintExportAssignment
	ReferenceHintJsx
	ReferenceHintExportImportEquals
	ReferenceHintExportSpecifier
	ReferenceHintDecorator
)

type Relater

type Relater struct {
	// contains filtered or unexported fields
}

type Relation

type Relation struct {
	// contains filtered or unexported fields
}

type RelationComparisonResult

type RelationComparisonResult uint32
const (
	RelationComparisonResultNone                RelationComparisonResult = 0
	RelationComparisonResultSucceeded           RelationComparisonResult = 1 << 0
	RelationComparisonResultFailed              RelationComparisonResult = 1 << 1
	RelationComparisonResultReportsUnmeasurable RelationComparisonResult = 1 << 3
	RelationComparisonResultReportsUnreliable   RelationComparisonResult = 1 << 4
	RelationComparisonResultComplexityOverflow  RelationComparisonResult = 1 << 5
	RelationComparisonResultStackDepthOverflow  RelationComparisonResult = 1 << 6
	RelationComparisonResultReportsMask                                  = RelationComparisonResultReportsUnmeasurable | RelationComparisonResultReportsUnreliable
	RelationComparisonResultOverflow                                     = RelationComparisonResultComplexityOverflow | RelationComparisonResultStackDepthOverflow
)
type ReverseMappedSymbolLinks struct {
	// contains filtered or unexported fields
}

type ReverseMappedType

type ReverseMappedType struct {
	ObjectType
	// contains filtered or unexported fields
}

type ReverseMappedTypeKey

type ReverseMappedTypeKey struct {
	// contains filtered or unexported fields
}

type SerializedTypeEntry

type SerializedTypeEntry struct {
	// contains filtered or unexported fields
}

type SharedFlow

type SharedFlow struct {
	// contains filtered or unexported fields
}

type Signature

type Signature struct {
	// contains filtered or unexported fields
}

func (*Signature) Declaration

func (s *Signature) Declaration() *ast.Node

func (*Signature) HasRestParameter

func (s *Signature) HasRestParameter() bool

func (*Signature) Parameters

func (s *Signature) Parameters() []*ast.Symbol

func (*Signature) Target

func (s *Signature) Target() *Signature

func (*Signature) ThisParameter

func (s *Signature) ThisParameter() *ast.Symbol

func (*Signature) TypeParameters

func (s *Signature) TypeParameters() []*Type

type SignatureCheckMode

type SignatureCheckMode uint32
const (
	SignatureCheckModeNone               SignatureCheckMode = 0
	SignatureCheckModeBivariantCallback  SignatureCheckMode = 1 << 0
	SignatureCheckModeStrictCallback     SignatureCheckMode = 1 << 1
	SignatureCheckModeIgnoreReturnTypes  SignatureCheckMode = 1 << 2
	SignatureCheckModeStrictArity        SignatureCheckMode = 1 << 3
	SignatureCheckModeStrictTopSignature SignatureCheckMode = 1 << 4
	SignatureCheckModeCallback           SignatureCheckMode = SignatureCheckModeBivariantCallback | SignatureCheckModeStrictCallback
)

type SignatureFlags

type SignatureFlags uint32
const (
	SignatureFlagsNone SignatureFlags = 0
	// Propagating flags
	SignatureFlagsHasRestParameter SignatureFlags = 1 << 0 // Indicates last parameter is rest parameter
	SignatureFlagsHasLiteralTypes  SignatureFlags = 1 << 1 // Indicates signature is specialized
	SignatureFlagsConstruct        SignatureFlags = 1 << 2 // Indicates signature is a construct signature
	SignatureFlagsAbstract         SignatureFlags = 1 << 3 // Indicates signature comes from an abstract class, abstract construct signature, or abstract constructor type
	// Non-propagating flags
	SignatureFlagsIsInnerCallChain                       SignatureFlags = 1 << 4 // Indicates signature comes from a CallChain nested in an outer OptionalChain
	SignatureFlagsIsOuterCallChain                       SignatureFlags = 1 << 5 // Indicates signature comes from a CallChain that is the outermost chain of an optional expression
	SignatureFlagsIsUntypedSignatureInJSFile             SignatureFlags = 1 << 6 // Indicates signature is from a js file and has no types
	SignatureFlagsIsNonInferrable                        SignatureFlags = 1 << 7 // Indicates signature comes from a non-inferrable type
	SignatureFlagsIsSignatureCandidateForOverloadFailure SignatureFlags = 1 << 8
	// We do not propagate `IsInnerCallChain` or `IsOuterCallChain` to instantiated signatures, as that would result in us
	// attempting to add `| undefined` on each recursive call to `getReturnTypeOfSignature` when
	// instantiating the return type.
	SignatureFlagsPropagatingFlags = SignatureFlagsHasRestParameter | SignatureFlagsHasLiteralTypes | SignatureFlagsConstruct | SignatureFlagsAbstract | SignatureFlagsIsUntypedSignatureInJSFile | SignatureFlagsIsSignatureCandidateForOverloadFailure
	SignatureFlagsCallChainFlags   = SignatureFlagsIsInnerCallChain | SignatureFlagsIsOuterCallChain
)

type SignatureKind

type SignatureKind int32
const (
	SignatureKindCall SignatureKind = iota
	SignatureKindConstruct
)

func (SignatureKind) String

func (i SignatureKind) String() string
type SignatureLinks struct {
	// contains filtered or unexported fields
}

type SignatureToSignatureDeclarationOptions

type SignatureToSignatureDeclarationOptions struct {
	// contains filtered or unexported fields
}

type SimpleTypeMapper

type SimpleTypeMapper struct {
	TypeMapperBase
	// contains filtered or unexported fields
}

func (*SimpleTypeMapper) Kind

func (m *SimpleTypeMapper) Kind() TypeMapperKind

func (*SimpleTypeMapper) Map

func (m *SimpleTypeMapper) Map(t *Type) *Type

type SingleSignatureType

type SingleSignatureType struct {
	ObjectType
	// contains filtered or unexported fields
}
type SourceFileLinks struct {
	// contains filtered or unexported fields
}
type SpreadLinks struct {
	// contains filtered or unexported fields
}

type StringLiteralType

type StringLiteralType = Type

Aliases for types

type StringMappingKey

type StringMappingKey struct {
	// contains filtered or unexported fields
}

type StringMappingType

type StringMappingType struct {
	ConstrainedType
	// contains filtered or unexported fields
}

type StructuredType

type StructuredType struct {
	ConstrainedType
	// contains filtered or unexported fields
}

func (*StructuredType) AsStructuredType

func (t *StructuredType) AsStructuredType() *StructuredType

func (*StructuredType) CallSignatures

func (t *StructuredType) CallSignatures() []*Signature

func (*StructuredType) ConstructSignatures

func (t *StructuredType) ConstructSignatures() []*Signature

func (*StructuredType) Properties

func (t *StructuredType) Properties() []*ast.Symbol

type SubstitutionType

type SubstitutionType struct {
	ConstrainedType
	// contains filtered or unexported fields
}

type SubstitutionTypeKey

type SubstitutionTypeKey struct {
	// contains filtered or unexported fields
}
type SwitchStatementLinks struct {
	// contains filtered or unexported fields
}

type SymbolFormatFlags

type SymbolFormatFlags int32
const (
	SymbolFormatFlagsNone SymbolFormatFlags = 0
	// Write symbols's type argument if it is instantiated symbol
	// eg. class C<T> { p: T }   <-- Show p as C<T>.p here
	//     var a: C<number>;
	//     var p = a.p; <--- Here p is property of C<number> so show it as C<number>.p instead of just C.p
	SymbolFormatFlagsWriteTypeParametersOrArguments SymbolFormatFlags = 1 << 0
	// Use only external alias information to get the symbol name in the given context
	// eg.  module m { export class c { } } import x = m.c;
	// When this flag is specified m.c will be used to refer to the class instead of alias symbol x
	SymbolFormatFlagsUseOnlyExternalAliasing SymbolFormatFlags = 1 << 1
	// Build symbol name using any nodes needed, instead of just components of an entity name
	SymbolFormatFlagsAllowAnyNodeKind SymbolFormatFlags = 1 << 2
	// Prefer aliases which are not directly visible
	SymbolFormatFlagsUseAliasDefinedOutsideCurrentScope SymbolFormatFlags = 1 << 3
	// { [E.A]: 1 }
	/** @internal */
	SymbolFormatFlagsWriteComputedProps SymbolFormatFlags = 1 << 4
	// Skip building an accessible symbol chain
	/** @internal */
	SymbolFormatFlagsDoNotIncludeSymbolChain SymbolFormatFlags = 1 << 5
)
type SymbolNodeLinks struct {
	// contains filtered or unexported fields
}
type SymbolReferenceLinks struct {
	// contains filtered or unexported fields
}

type SymbolTrackerImpl

type SymbolTrackerImpl struct {
	DisableTrackSymbol bool
	// contains filtered or unexported fields
}

func NewSymbolTrackerImpl

func NewSymbolTrackerImpl(context *NodeBuilderContext, tracker nodebuilder.SymbolTracker, tchost Host) *SymbolTrackerImpl

func (*SymbolTrackerImpl) GetModuleSpecifierGenerationHost

func (this *SymbolTrackerImpl) GetModuleSpecifierGenerationHost() modulespecifiers.ModuleSpecifierGenerationHost

func (*SymbolTrackerImpl) PopErrorFallbackNode

func (this *SymbolTrackerImpl) PopErrorFallbackNode()

func (*SymbolTrackerImpl) PushErrorFallbackNode

func (this *SymbolTrackerImpl) PushErrorFallbackNode(node *ast.Node)

func (*SymbolTrackerImpl) ReportCyclicStructureError

func (this *SymbolTrackerImpl) ReportCyclicStructureError()

func (*SymbolTrackerImpl) ReportInaccessibleThisError

func (this *SymbolTrackerImpl) ReportInaccessibleThisError()

func (*SymbolTrackerImpl) ReportInaccessibleUniqueSymbolError

func (this *SymbolTrackerImpl) ReportInaccessibleUniqueSymbolError()

func (*SymbolTrackerImpl) ReportInferenceFallback

func (this *SymbolTrackerImpl) ReportInferenceFallback(node *ast.Node)

func (*SymbolTrackerImpl) ReportLikelyUnsafeImportRequiredError

func (this *SymbolTrackerImpl) ReportLikelyUnsafeImportRequiredError(specifier string)

func (*SymbolTrackerImpl) ReportNonSerializableProperty

func (this *SymbolTrackerImpl) ReportNonSerializableProperty(propertyName string)

func (*SymbolTrackerImpl) ReportNonlocalAugmentation

func (this *SymbolTrackerImpl) ReportNonlocalAugmentation(containingFile *ast.SourceFile, parentSymbol *ast.Symbol, augmentingSymbol *ast.Symbol)

func (*SymbolTrackerImpl) ReportPrivateInBaseOfClassExpression

func (this *SymbolTrackerImpl) ReportPrivateInBaseOfClassExpression(propertyName string)

func (*SymbolTrackerImpl) ReportTruncationError

func (this *SymbolTrackerImpl) ReportTruncationError()

func (*SymbolTrackerImpl) TrackSymbol

func (this *SymbolTrackerImpl) TrackSymbol(symbol *ast.Symbol, enclosingDeclaration *ast.Node, meaning ast.SymbolFlags) bool

type TemplateLiteralType

type TemplateLiteralType struct {
	ConstrainedType
	// contains filtered or unexported fields
}

type Ternary

type Ternary int8

*

  • Ternary values are defined such that
  • x & y picks the lesser in the order False < Unknown < Maybe < True, and
  • x | y picks the greater in the order False < Unknown < Maybe < True.
  • Generally, Ternary.Maybe is used as the result of a relation that depends on itself, and
  • Ternary.Unknown is used as the result of a variance check that depends on itself. We make
  • a distinction because we don't want to cache circular variance check results.
const (
	TernaryFalse   Ternary = 0
	TernaryUnknown Ternary = 1
	TernaryMaybe   Ternary = 3
	TernaryTrue    Ternary = -1
)

type TrackedSymbolArgs

type TrackedSymbolArgs struct {
	// contains filtered or unexported fields
}

type TupleElementInfo

type TupleElementInfo struct {
	// contains filtered or unexported fields
}

func (*TupleElementInfo) TupleElementFlags

func (t *TupleElementInfo) TupleElementFlags() ElementFlags

type TupleNormalizer

type TupleNormalizer struct {
	// contains filtered or unexported fields
}

type TupleType

type TupleType struct {
	InterfaceType
	// contains filtered or unexported fields
}

func (*TupleType) ElementFlags

func (t *TupleType) ElementFlags() []ElementFlags

func (*TupleType) FixedLength

func (t *TupleType) FixedLength() int

type Type

type Type struct {
	// contains filtered or unexported fields
}

func (*Type) AsConditionalType

func (t *Type) AsConditionalType() *ConditionalType

func (*Type) AsConstrainedType

func (t *Type) AsConstrainedType() *ConstrainedType

func (*Type) AsEvolvingArrayType

func (t *Type) AsEvolvingArrayType() *EvolvingArrayType

func (*Type) AsIndexType

func (t *Type) AsIndexType() *IndexType

func (*Type) AsIndexedAccessType

func (t *Type) AsIndexedAccessType() *IndexedAccessType

func (*Type) AsInstantiationExpressionType

func (t *Type) AsInstantiationExpressionType() *InstantiationExpressionType

func (*Type) AsInterfaceType

func (t *Type) AsInterfaceType() *InterfaceType

func (*Type) AsIntersectionType

func (t *Type) AsIntersectionType() *IntersectionType

func (*Type) AsIntrinsicType

func (t *Type) AsIntrinsicType() *IntrinsicType

func (*Type) AsLiteralType

func (t *Type) AsLiteralType() *LiteralType

func (*Type) AsMappedType

func (t *Type) AsMappedType() *MappedType

func (*Type) AsObjectType

func (t *Type) AsObjectType() *ObjectType

func (*Type) AsReverseMappedType

func (t *Type) AsReverseMappedType() *ReverseMappedType

func (*Type) AsSingleSignatureType

func (t *Type) AsSingleSignatureType() *SingleSignatureType

func (*Type) AsStringMappingType

func (t *Type) AsStringMappingType() *StringMappingType

func (*Type) AsStructuredType

func (t *Type) AsStructuredType() *StructuredType

func (*Type) AsSubstitutionType

func (t *Type) AsSubstitutionType() *SubstitutionType

func (*Type) AsTemplateLiteralType

func (t *Type) AsTemplateLiteralType() *TemplateLiteralType

func (*Type) AsTupleType

func (t *Type) AsTupleType() *TupleType

func (*Type) AsTypeParameter

func (t *Type) AsTypeParameter() *TypeParameter

func (*Type) AsTypeReference

func (t *Type) AsTypeReference() *TypeReference

func (*Type) AsUnionOrIntersectionType

func (t *Type) AsUnionOrIntersectionType() *UnionOrIntersectionType

func (*Type) AsUnionType

func (t *Type) AsUnionType() *UnionType

func (*Type) AsUniqueESSymbolType

func (t *Type) AsUniqueESSymbolType() *UniqueESSymbolType

func (*Type) Distributed

func (t *Type) Distributed() []*Type

func (*Type) Flags

func (t *Type) Flags() TypeFlags

func (*Type) Id

func (t *Type) Id() TypeId

func (*Type) IsBigIntLiteral

func (t *Type) IsBigIntLiteral() bool

func (*Type) IsBooleanLike

func (t *Type) IsBooleanLike() bool

func (*Type) IsClass

func (t *Type) IsClass() bool

func (*Type) IsEnumLiteral

func (t *Type) IsEnumLiteral() bool

func (*Type) IsIndex

func (t *Type) IsIndex() bool

func (*Type) IsIntersection

func (t *Type) IsIntersection() bool

func (*Type) IsNumberLiteral

func (t *Type) IsNumberLiteral() bool

func (*Type) IsString

func (t *Type) IsString() bool

func (*Type) IsStringLike

func (t *Type) IsStringLike() bool

func (*Type) IsStringLiteral

func (t *Type) IsStringLiteral() bool

func (*Type) IsTypeParameter

func (t *Type) IsTypeParameter() bool

func (*Type) IsUnion

func (t *Type) IsUnion() bool

func (*Type) Mapper

func (t *Type) Mapper() *TypeMapper

func (*Type) ObjectFlags

func (t *Type) ObjectFlags() ObjectFlags

func (*Type) Symbol

func (t *Type) Symbol() *ast.Symbol

func (*Type) Target

func (t *Type) Target() *Type

func (*Type) TargetInterfaceType

func (t *Type) TargetInterfaceType() *InterfaceType

func (*Type) TargetTupleType

func (t *Type) TargetTupleType() *TupleType

func (*Type) Types

func (t *Type) Types() []*Type

type TypeAlias

type TypeAlias struct {
	// contains filtered or unexported fields
}

func (*TypeAlias) Symbol

func (a *TypeAlias) Symbol() *ast.Symbol

func (*TypeAlias) ToTypeReferenceNode

func (t *TypeAlias) ToTypeReferenceNode(b *nodeBuilderImpl) *ast.Node

func (*TypeAlias) TypeArguments

func (a *TypeAlias) TypeArguments() []*Type
type TypeAliasLinks struct {
	// contains filtered or unexported fields
}

type TypeBase

type TypeBase struct {
	Type
}

func (*TypeBase) AsConstrainedType

func (t *TypeBase) AsConstrainedType() *ConstrainedType

func (*TypeBase) AsInterfaceType

func (t *TypeBase) AsInterfaceType() *InterfaceType

func (*TypeBase) AsObjectType

func (t *TypeBase) AsObjectType() *ObjectType

func (*TypeBase) AsStructuredType

func (t *TypeBase) AsStructuredType() *StructuredType

func (*TypeBase) AsType

func (t *TypeBase) AsType() *Type

func (*TypeBase) AsTypeReference

func (t *TypeBase) AsTypeReference() *TypeReference

func (*TypeBase) AsUnionOrIntersectionType

func (t *TypeBase) AsUnionOrIntersectionType() *UnionOrIntersectionType

type TypeComparer

type TypeComparer func(s *Type, t *Type, reportErrors bool) Ternary

type TypeData

type TypeData interface {
	AsType() *Type
	AsConstrainedType() *ConstrainedType
	AsStructuredType() *StructuredType
	AsObjectType() *ObjectType
	AsTypeReference() *TypeReference
	AsInterfaceType() *InterfaceType
	AsUnionOrIntersectionType() *UnionOrIntersectionType
}

type TypeDiscriminator

type TypeDiscriminator struct {
	// contains filtered or unexported fields
}

type TypeFacts

type TypeFacts uint32
const (
	TypeFactsNone               TypeFacts = 0
	TypeFactsTypeofEQString     TypeFacts = 1 << 0
	TypeFactsTypeofEQNumber     TypeFacts = 1 << 1
	TypeFactsTypeofEQBigInt     TypeFacts = 1 << 2
	TypeFactsTypeofEQBoolean    TypeFacts = 1 << 3
	TypeFactsTypeofEQSymbol     TypeFacts = 1 << 4
	TypeFactsTypeofEQObject     TypeFacts = 1 << 5
	TypeFactsTypeofEQFunction   TypeFacts = 1 << 6
	TypeFactsTypeofEQHostObject TypeFacts = 1 << 7
	TypeFactsTypeofNEString     TypeFacts = 1 << 8
	TypeFactsTypeofNENumber     TypeFacts = 1 << 9
	TypeFactsTypeofNEBigInt     TypeFacts = 1 << 10
	TypeFactsTypeofNEBoolean    TypeFacts = 1 << 11
	TypeFactsTypeofNESymbol     TypeFacts = 1 << 12
	TypeFactsTypeofNEObject     TypeFacts = 1 << 13
	TypeFactsTypeofNEFunction   TypeFacts = 1 << 14
	TypeFactsTypeofNEHostObject TypeFacts = 1 << 15
	TypeFactsEQUndefined        TypeFacts = 1 << 16
	TypeFactsEQNull             TypeFacts = 1 << 17
	TypeFactsEQUndefinedOrNull  TypeFacts = 1 << 18
	TypeFactsNEUndefined        TypeFacts = 1 << 19
	TypeFactsNENull             TypeFacts = 1 << 20
	TypeFactsNEUndefinedOrNull  TypeFacts = 1 << 21
	TypeFactsTruthy             TypeFacts = 1 << 22
	TypeFactsFalsy              TypeFacts = 1 << 23
	TypeFactsIsUndefined        TypeFacts = 1 << 24
	TypeFactsIsNull             TypeFacts = 1 << 25
	TypeFactsIsUndefinedOrNull  TypeFacts = TypeFactsIsUndefined | TypeFactsIsNull
	TypeFactsAll                TypeFacts = (1 << 27) - 1
	// The following members encode facts about particular kinds of types for use in the getTypeFacts function.
	// The presence of a particular fact means that the given test is true for some (and possibly all) values
	// of that kind of type.
	TypeFactsBaseStringStrictFacts     TypeFacts = TypeFactsTypeofEQString | TypeFactsTypeofNENumber | TypeFactsTypeofNEBigInt | TypeFactsTypeofNEBoolean | TypeFactsTypeofNESymbol | TypeFactsTypeofNEObject | TypeFactsTypeofNEFunction | TypeFactsTypeofNEHostObject | TypeFactsNEUndefined | TypeFactsNENull | TypeFactsNEUndefinedOrNull
	TypeFactsBaseStringFacts           TypeFacts = TypeFactsBaseStringStrictFacts | TypeFactsEQUndefined | TypeFactsEQNull | TypeFactsEQUndefinedOrNull | TypeFactsFalsy
	TypeFactsStringStrictFacts         TypeFacts = TypeFactsBaseStringStrictFacts | TypeFactsTruthy | TypeFactsFalsy
	TypeFactsStringFacts               TypeFacts = TypeFactsBaseStringFacts | TypeFactsTruthy
	TypeFactsEmptyStringStrictFacts    TypeFacts = TypeFactsBaseStringStrictFacts | TypeFactsFalsy
	TypeFactsEmptyStringFacts          TypeFacts = TypeFactsBaseStringFacts
	TypeFactsNonEmptyStringStrictFacts TypeFacts = TypeFactsBaseStringStrictFacts | TypeFactsTruthy
	TypeFactsNonEmptyStringFacts       TypeFacts = TypeFactsBaseStringFacts | TypeFactsTruthy
	TypeFactsBaseNumberStrictFacts     TypeFacts = TypeFactsTypeofEQNumber | TypeFactsTypeofNEString | TypeFactsTypeofNEBigInt | TypeFactsTypeofNEBoolean | TypeFactsTypeofNESymbol | TypeFactsTypeofNEObject | TypeFactsTypeofNEFunction | TypeFactsTypeofNEHostObject | TypeFactsNEUndefined | TypeFactsNENull | TypeFactsNEUndefinedOrNull
	TypeFactsBaseNumberFacts           TypeFacts = TypeFactsBaseNumberStrictFacts | TypeFactsEQUndefined | TypeFactsEQNull | TypeFactsEQUndefinedOrNull | TypeFactsFalsy
	TypeFactsNumberStrictFacts         TypeFacts = TypeFactsBaseNumberStrictFacts | TypeFactsTruthy | TypeFactsFalsy
	TypeFactsNumberFacts               TypeFacts = TypeFactsBaseNumberFacts | TypeFactsTruthy
	TypeFactsZeroNumberStrictFacts     TypeFacts = TypeFactsBaseNumberStrictFacts | TypeFactsFalsy
	TypeFactsZeroNumberFacts           TypeFacts = TypeFactsBaseNumberFacts
	TypeFactsNonZeroNumberStrictFacts  TypeFacts = TypeFactsBaseNumberStrictFacts | TypeFactsTruthy
	TypeFactsNonZeroNumberFacts        TypeFacts = TypeFactsBaseNumberFacts | TypeFactsTruthy
	TypeFactsBaseBigIntStrictFacts     TypeFacts = TypeFactsTypeofEQBigInt | TypeFactsTypeofNEString | TypeFactsTypeofNENumber | TypeFactsTypeofNEBoolean | TypeFactsTypeofNESymbol | TypeFactsTypeofNEObject | TypeFactsTypeofNEFunction | TypeFactsTypeofNEHostObject | TypeFactsNEUndefined | TypeFactsNENull | TypeFactsNEUndefinedOrNull
	TypeFactsBaseBigIntFacts           TypeFacts = TypeFactsBaseBigIntStrictFacts | TypeFactsEQUndefined | TypeFactsEQNull | TypeFactsEQUndefinedOrNull | TypeFactsFalsy
	TypeFactsBigIntStrictFacts         TypeFacts = TypeFactsBaseBigIntStrictFacts | TypeFactsTruthy | TypeFactsFalsy
	TypeFactsBigIntFacts               TypeFacts = TypeFactsBaseBigIntFacts | TypeFactsTruthy
	TypeFactsZeroBigIntStrictFacts     TypeFacts = TypeFactsBaseBigIntStrictFacts | TypeFactsFalsy
	TypeFactsZeroBigIntFacts           TypeFacts = TypeFactsBaseBigIntFacts
	TypeFactsNonZeroBigIntStrictFacts  TypeFacts = TypeFactsBaseBigIntStrictFacts | TypeFactsTruthy
	TypeFactsNonZeroBigIntFacts        TypeFacts = TypeFactsBaseBigIntFacts | TypeFactsTruthy
	TypeFactsBaseBooleanStrictFacts    TypeFacts = TypeFactsTypeofEQBoolean | TypeFactsTypeofNEString | TypeFactsTypeofNENumber | TypeFactsTypeofNEBigInt | TypeFactsTypeofNESymbol | TypeFactsTypeofNEObject | TypeFactsTypeofNEFunction | TypeFactsTypeofNEHostObject | TypeFactsNEUndefined | TypeFactsNENull | TypeFactsNEUndefinedOrNull
	TypeFactsBaseBooleanFacts          TypeFacts = TypeFactsBaseBooleanStrictFacts | TypeFactsEQUndefined | TypeFactsEQNull | TypeFactsEQUndefinedOrNull | TypeFactsFalsy
	TypeFactsBooleanStrictFacts        TypeFacts = TypeFactsBaseBooleanStrictFacts | TypeFactsTruthy | TypeFactsFalsy
	TypeFactsBooleanFacts              TypeFacts = TypeFactsBaseBooleanFacts | TypeFactsTruthy
	TypeFactsFalseStrictFacts          TypeFacts = TypeFactsBaseBooleanStrictFacts | TypeFactsFalsy
	TypeFactsFalseFacts                TypeFacts = TypeFactsBaseBooleanFacts
	TypeFactsTrueStrictFacts           TypeFacts = TypeFactsBaseBooleanStrictFacts | TypeFactsTruthy
	TypeFactsTrueFacts                 TypeFacts = TypeFactsBaseBooleanFacts | TypeFactsTruthy
	TypeFactsSymbolStrictFacts         TypeFacts = TypeFactsTypeofEQSymbol | TypeFactsTypeofNEString | TypeFactsTypeofNENumber | TypeFactsTypeofNEBigInt | TypeFactsTypeofNEBoolean | TypeFactsTypeofNEObject | TypeFactsTypeofNEFunction | TypeFactsTypeofNEHostObject | TypeFactsNEUndefined | TypeFactsNENull | TypeFactsNEUndefinedOrNull | TypeFactsTruthy
	TypeFactsSymbolFacts               TypeFacts = TypeFactsSymbolStrictFacts | TypeFactsEQUndefined | TypeFactsEQNull | TypeFactsEQUndefinedOrNull | TypeFactsFalsy
	TypeFactsObjectStrictFacts         TypeFacts = TypeFactsTypeofEQObject | TypeFactsTypeofEQHostObject | TypeFactsTypeofNEString | TypeFactsTypeofNENumber | TypeFactsTypeofNEBigInt | TypeFactsTypeofNEBoolean | TypeFactsTypeofNESymbol | TypeFactsTypeofNEFunction | TypeFactsNEUndefined | TypeFactsNENull | TypeFactsNEUndefinedOrNull | TypeFactsTruthy
	TypeFactsObjectFacts               TypeFacts = TypeFactsObjectStrictFacts | TypeFactsEQUndefined | TypeFactsEQNull | TypeFactsEQUndefinedOrNull | TypeFactsFalsy
	TypeFactsFunctionStrictFacts       TypeFacts = TypeFactsTypeofEQFunction | TypeFactsTypeofEQHostObject | TypeFactsTypeofNEString | TypeFactsTypeofNENumber | TypeFactsTypeofNEBigInt | TypeFactsTypeofNEBoolean | TypeFactsTypeofNESymbol | TypeFactsTypeofNEObject | TypeFactsNEUndefined | TypeFactsNENull | TypeFactsNEUndefinedOrNull | TypeFactsTruthy
	TypeFactsFunctionFacts             TypeFacts = TypeFactsFunctionStrictFacts | TypeFactsEQUndefined | TypeFactsEQNull | TypeFactsEQUndefinedOrNull | TypeFactsFalsy
	TypeFactsVoidFacts                 TypeFacts = TypeFactsTypeofNEString | TypeFactsTypeofNENumber | TypeFactsTypeofNEBigInt | TypeFactsTypeofNEBoolean | TypeFactsTypeofNESymbol | TypeFactsTypeofNEObject | TypeFactsTypeofNEFunction | TypeFactsTypeofNEHostObject | TypeFactsEQUndefined | TypeFactsEQUndefinedOrNull | TypeFactsNENull | TypeFactsFalsy
	TypeFactsUndefinedFacts            TypeFacts = TypeFactsTypeofNEString | TypeFactsTypeofNENumber | TypeFactsTypeofNEBigInt | TypeFactsTypeofNEBoolean | TypeFactsTypeofNESymbol | TypeFactsTypeofNEObject | TypeFactsTypeofNEFunction | TypeFactsTypeofNEHostObject | TypeFactsEQUndefined | TypeFactsEQUndefinedOrNull | TypeFactsNENull | TypeFactsFalsy | TypeFactsIsUndefined
	TypeFactsNullFacts                 TypeFacts = TypeFactsTypeofEQObject | TypeFactsTypeofNEString | TypeFactsTypeofNENumber | TypeFactsTypeofNEBigInt | TypeFactsTypeofNEBoolean | TypeFactsTypeofNESymbol | TypeFactsTypeofNEFunction | TypeFactsTypeofNEHostObject | TypeFactsEQNull | TypeFactsEQUndefinedOrNull | TypeFactsNEUndefined | TypeFactsFalsy | TypeFactsIsNull
	TypeFactsEmptyObjectStrictFacts    TypeFacts = TypeFactsAll & ^(TypeFactsEQUndefined | TypeFactsEQNull | TypeFactsEQUndefinedOrNull | TypeFactsIsUndefinedOrNull)
	TypeFactsEmptyObjectFacts          TypeFacts = TypeFactsAll & ^TypeFactsIsUndefinedOrNull
	TypeFactsUnknownFacts              TypeFacts = TypeFactsAll & ^TypeFactsIsUndefinedOrNull
	TypeFactsAllTypeofNE               TypeFacts = TypeFactsTypeofNEString | TypeFactsTypeofNENumber | TypeFactsTypeofNEBigInt | TypeFactsTypeofNEBoolean | TypeFactsTypeofNESymbol | TypeFactsTypeofNEObject | TypeFactsTypeofNEFunction | TypeFactsNEUndefined
	// Masks
	TypeFactsOrFactsMask  TypeFacts = TypeFactsTypeofEQFunction | TypeFactsTypeofNEObject
	TypeFactsAndFactsMask TypeFacts = TypeFactsAll & ^TypeFactsOrFactsMask
)

type TypeFlags

type TypeFlags uint32

type TypeFormatFlags

type TypeFormatFlags uint32
const (
	TypeFormatFlagsNone                               TypeFormatFlags = 0
	TypeFormatFlagsNoTruncation                       TypeFormatFlags = 1 << 0 // Don't truncate typeToString result
	TypeFormatFlagsWriteArrayAsGenericType            TypeFormatFlags = 1 << 1 // Write Array<T> instead T[]
	TypeFormatFlagsGenerateNamesForShadowedTypeParams TypeFormatFlags = 1 << 2 // When a type parameter T is shadowing another T, generate a name for it so it can still be referenced
	TypeFormatFlagsUseStructuralFallback              TypeFormatFlags = 1 << 3 // When an alias cannot be named by its symbol, rather than report an error, fallback to a structural printout if possible
	// hole because there's a hole in node builder flags
	TypeFormatFlagsWriteTypeArgumentsOfSignature TypeFormatFlags = 1 << 5 // Write the type arguments instead of type parameters of the signature
	TypeFormatFlagsUseFullyQualifiedType         TypeFormatFlags = 1 << 6 // Write out the fully qualified type name (eg. Module.Type, instead of Type)
	// hole because `UseOnlyExternalAliasing` is here in node builder flags, but functions which take old flags use `SymbolFormatFlags` instead
	TypeFormatFlagsSuppressAnyReturnType TypeFormatFlags = 1 << 8 // If the return type is any-like, don't offer a return type.
	// hole because `WriteTypeParametersInQualifiedName` is here in node builder flags, but functions which take old flags use `SymbolFormatFlags` for this instead
	TypeFormatFlagsMultilineObjectLiterals             TypeFormatFlags = 1 << 10 // Always print object literals across multiple lines (only used to map into node builder flags)
	TypeFormatFlagsWriteClassExpressionAsTypeLiteral   TypeFormatFlags = 1 << 11 // Write a type literal instead of (Anonymous class)
	TypeFormatFlagsUseTypeOfFunction                   TypeFormatFlags = 1 << 12 // Write typeof instead of function type literal
	TypeFormatFlagsOmitParameterModifiers              TypeFormatFlags = 1 << 13 // Omit modifiers on parameters
	TypeFormatFlagsUseAliasDefinedOutsideCurrentScope  TypeFormatFlags = 1 << 14 // For a `type T = ... ` defined in a different file, write `T` instead of its value, even though `T` can't be accessed in the current scope.
	TypeFormatFlagsUseSingleQuotesForStringLiteralType TypeFormatFlags = 1 << 28 // Use single quotes for string literal type
	TypeFormatFlagsNoTypeReduction                     TypeFormatFlags = 1 << 29 // Don't call getReducedType
	TypeFormatFlagsOmitThisParameter                   TypeFormatFlags = 1 << 25
	TypeFormatFlagsWriteCallStyleSignature             TypeFormatFlags = 1 << 27 // Write construct signatures as call style signatures
	// Error Handling
	TypeFormatFlagsAllowUniqueESSymbolType TypeFormatFlags = 1 << 20 // This is bit 20 to align with the same bit in `NodeBuilderFlags`
	// TypeFormatFlags exclusive
	TypeFormatFlagsAddUndefined             TypeFormatFlags = 1 << 17 // Add undefined to types of initialized, non-optional parameters
	TypeFormatFlagsWriteArrowStyleSignature TypeFormatFlags = 1 << 18 // Write arrow style signature
	// State
	TypeFormatFlagsInArrayType         TypeFormatFlags = 1 << 19 // Writing an array element type
	TypeFormatFlagsInElementType       TypeFormatFlags = 1 << 21 // Writing an array or union element type
	TypeFormatFlagsInFirstTypeArgument TypeFormatFlags = 1 << 22 // Writing first type argument of the instantiated type
	TypeFormatFlagsInTypeAlias         TypeFormatFlags = 1 << 23 // Writing type in type alias declaration
)

type TypeId

type TypeId uint32

type TypeMapper

type TypeMapper struct {
	// contains filtered or unexported fields
}

func (*TypeMapper) Kind

func (m *TypeMapper) Kind() TypeMapperKind

func (*TypeMapper) Map

func (m *TypeMapper) Map(t *Type) *Type

type TypeMapperBase

type TypeMapperBase struct {
	TypeMapper
}

func (*TypeMapperBase) Kind

func (m *TypeMapperBase) Kind() TypeMapperKind

func (*TypeMapperBase) Map

func (m *TypeMapperBase) Map(t *Type) *Type

type TypeMapperData

type TypeMapperData interface {
	Map(t *Type) *Type
	Kind() TypeMapperKind
}

type TypeMapperKind

type TypeMapperKind int32
const (
	TypeMapperKindUnknown TypeMapperKind = iota
	TypeMapperKindSimple
	TypeMapperKindArray
	TypeMapperKindMerged
)
type TypeNodeLinks struct {
	// contains filtered or unexported fields
}

type TypeParameter

type TypeParameter struct {
	ConstrainedType
	// contains filtered or unexported fields
}

type TypePredicate

type TypePredicate struct {
	// contains filtered or unexported fields
}

type TypePredicateKind

type TypePredicateKind int32
const (
	TypePredicateKindThis TypePredicateKind = iota
	TypePredicateKindIdentifier
	TypePredicateKindAssertsThis
	TypePredicateKindAssertsIdentifier
)

type TypeReference

type TypeReference struct {
	ObjectType
	// contains filtered or unexported fields
}

func (*TypeReference) AsTypeReference

func (t *TypeReference) AsTypeReference() *TypeReference

type TypeResolution

type TypeResolution struct {
	// contains filtered or unexported fields
}

type TypeSystemEntity

type TypeSystemEntity any

type TypeSystemPropertyName

type TypeSystemPropertyName int32
const (
	TypeSystemPropertyNameType TypeSystemPropertyName = iota
	TypeSystemPropertyNameResolvedBaseConstructorType
	TypeSystemPropertyNameDeclaredType
	TypeSystemPropertyNameResolvedReturnType
	TypeSystemPropertyNameResolvedBaseConstraint
	TypeSystemPropertyNameResolvedTypeArguments
	TypeSystemPropertyNameResolvedBaseTypes
	TypeSystemPropertyNameWriteType
	TypeSystemPropertyNameInitializerIsUndefined
)

type UnionOfUnionKey

type UnionOfUnionKey struct {
	// contains filtered or unexported fields
}

type UnionOrIntersectionType

type UnionOrIntersectionType struct {
	StructuredType
	// contains filtered or unexported fields
}

func (*UnionOrIntersectionType) AsUnionOrIntersectionType

func (t *UnionOrIntersectionType) AsUnionOrIntersectionType() *UnionOrIntersectionType

type UnionReduction

type UnionReduction int32
const (
	UnionReductionNone UnionReduction = iota
	UnionReductionLiteral
	UnionReductionSubtype
)

type UnionType

type UnionType struct {
	UnionOrIntersectionType
	// contains filtered or unexported fields
}

type UniqueESSymbolType

type UniqueESSymbolType struct {
	TypeBase
	// contains filtered or unexported fields
}

type UnusedKind

type UnusedKind int32
const (
	UnusedKindLocal UnusedKind = iota
	UnusedKindParameter
)
type ValueSymbolLinks struct {
	// contains filtered or unexported fields
}

type VarianceFlags

type VarianceFlags uint32
const (
	VarianceFlagsInvariant                VarianceFlags = 0                                                                                                       // Neither covariant nor contravariant
	VarianceFlagsCovariant                VarianceFlags = 1 << 0                                                                                                  // Covariant
	VarianceFlagsContravariant            VarianceFlags = 1 << 1                                                                                                  // Contravariant
	VarianceFlagsBivariant                VarianceFlags = VarianceFlagsCovariant | VarianceFlagsContravariant                                                     // Both covariant and contravariant
	VarianceFlagsIndependent              VarianceFlags = 1 << 2                                                                                                  // Unwitnessed type parameter
	VarianceFlagsVarianceMask             VarianceFlags = VarianceFlagsInvariant | VarianceFlagsCovariant | VarianceFlagsContravariant | VarianceFlagsIndependent // Mask containing all measured variances without the unmeasurable flag
	VarianceFlagsUnmeasurable             VarianceFlags = 1 << 3                                                                                                  // Variance result is unusable - relationship relies on structural comparisons which are not reflected in generic relationships
	VarianceFlagsUnreliable               VarianceFlags = 1 << 4                                                                                                  // Variance result is unreliable - checking may produce false negatives, but not false positives
	VarianceFlagsAllowsStructuralFallback               = VarianceFlagsUnmeasurable | VarianceFlagsUnreliable
)
type VarianceLinks struct {
	// contains filtered or unexported fields
}

type WideningContext

type WideningContext struct {
	// contains filtered or unexported fields
}

type WideningKind

type WideningKind int32
const (
	WideningKindNormal WideningKind = iota
	WideningKindFunctionReturn
	WideningKindGeneratorNext
	WideningKindGeneratorYield
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL