checker

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2025 License: Apache-2.0 Imports: 21 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
	IterationUseReportError              IterationUse = 1 << 8
	// 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 | IterationUseReportError
)
View Source
const (
	AssignmentDeclarationKindNone = AssignmentDeclarationKind(iota)
	/// exports.name = expr
	/// module.exports.name = expr
	AssignmentDeclarationKindExportsProperty
	/// module.exports = expr
	AssignmentDeclarationKindModuleExports
	/// className.prototype.name = expr
	AssignmentDeclarationKindPrototypeProperty
	/// this.name = expr
	AssignmentDeclarationKindThisProperty
	// F.name = expr
	AssignmentDeclarationKindProperty
	// F.prototype = { ... }
	AssignmentDeclarationKindPrototype
	// Object.defineProperty(x, 'name', { value: any, writable?: boolean (false by default) });
	// Object.defineProperty(x, 'name', { get: Function, set: Function });
	// Object.defineProperty(x, 'name', { get: Function });
	// Object.defineProperty(x, 'name', { set: Function });
	AssignmentDeclarationKindObjectDefinePropertyValue
	// Object.defineProperty(exports || module.exports, 'name', ...);
	AssignmentDeclarationKindObjectDefinePropertyExports
	// Object.defineProperty(Foo.prototype, 'name', ...);
	AssignmentDeclarationKindObjectDefinePrototypeProperty
)
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)
	TypeFlagsNever           TypeFlags = 1 << 17 // Never type
	TypeFlagsTypeParameter   TypeFlags = 1 << 18 // Type parameter
	TypeFlagsObject          TypeFlags = 1 << 19 // Object type
	TypeFlagsUnion           TypeFlags = 1 << 20 // Union (T | U)
	TypeFlagsIntersection    TypeFlags = 1 << 21 // Intersection (T & U)
	TypeFlagsIndex           TypeFlags = 1 << 22 // keyof T
	TypeFlagsIndexedAccess   TypeFlags = 1 << 23 // T[K]
	TypeFlagsConditional     TypeFlags = 1 << 24 // T extends U ? X : Y
	TypeFlagsSubstitution    TypeFlags = 1 << 25 // Type parameter substitution
	TypeFlagsNonPrimitive    TypeFlags = 1 << 26 // intrinsic object type
	TypeFlagsTemplateLiteral TypeFlags = 1 << 27 // Template literal type
	TypeFlagsStringMapping   TypeFlags = 1 << 28 // Uppercase/Lowercase type
	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. dprint-ignore

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
)

Variables

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,
}

Functions

func IsIntrinsicJsxName

func IsIntrinsicJsxName(name string) 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

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 AssignmentDeclarationKind

type AssignmentDeclarationKind = int32

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

	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(sourceFile *ast.SourceFile)

func (*Checker) GetDiagnostics

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

func (*Checker) GetDiagnosticsWithoutCheck

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

func (*Checker) GetEmitResolver

func (c *Checker) GetEmitResolver(file *ast.SourceFile, skipDiagnostics bool) printer.EmitResolver

func (*Checker) GetGlobalDiagnostics

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

func (*Checker) GetSymbolAtLocation

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

func (*Checker) GetTypeAtLocation

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

func (*Checker) GetTypeOfSymbolAtLocation

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

func (*Checker) ResolveAlias

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

func (*Checker) SourceFileWithTypes

func (c *Checker) SourceFileWithTypes(sourceFile *ast.SourceFile) string

func (*Checker) SymbolToString

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

func (*Checker) TypeToString

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

type CompositeSignature

type CompositeSignature 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 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 DeclarationMeaning

type DeclarationMeaning uint32
const (
	DeclarationMeaningGetAccessor DeclarationMeaning = 1 << iota
	DeclarationMeaningSetAccessor
	DeclarationMeaningPropertyAssignment
	DeclarationMeaningMethod
	DeclarationMeaningPrivateStatic
	DeclarationMeaningGetOrSetAccessor           = DeclarationMeaningGetAccessor | DeclarationMeaningSetAccessor
	DeclarationMeaningPropertyAssignmentOrMethod = DeclarationMeaningPropertyAssignment | DeclarationMeaningMethod
)
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 Host interface{}

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 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
}
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 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 Printer

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

type Program

type Program interface {
	Options() *core.CompilerOptions
	SourceFiles() []*ast.SourceFile
	BindSourceFiles()
	GetEmitModuleFormatOfFile(sourceFile *ast.SourceFile) core.ModuleKind
	GetImpliedNodeFormatForEmit(sourceFile *ast.SourceFile) core.ModuleKind
	GetResolvedModule(currentSourceFile *ast.SourceFile, moduleReference string) *ast.SourceFile
}

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 RecursionIdKind

type RecursionIdKind uint32
const (
	RecursionIdKindNode RecursionIdKind = iota
	RecursionIdKindSymbol
	RecursionIdKindType
)

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 SharedFlow

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

type Signature

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

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 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 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

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 SymbolReferenceLinks struct {
	// contains filtered or unexported fields
}

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 TupleElementInfo

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

type TupleNormalizer

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

type TupleType

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

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) Mapper

func (t *Type) Mapper() *TypeMapper

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) 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
	// 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