import { Uri } from '../common/uri/uri'; import { ArgumentNode, ExpressionNode, NameNode, ParamCategory, TypeAnnotationNode } from '../parser/parseNodes'; import { ClassDeclaration, FunctionDeclaration, SpecialBuiltInClassDeclaration } from './declaration'; import { Symbol, SymbolTable } from './symbol'; export declare const enum TypeCategory { Unbound = 0, Unknown = 1, Any = 2, Never = 3, Function = 4, Overloaded = 5, Class = 6, Module = 7, Union = 8, TypeVar = 9 } export declare const enum TypeFlags { None = 0, Instantiable = 1, Instance = 2, Ambiguous = 4, TypeCompatibilityMask = 3 } export type UnionableType = UnboundType | UnknownType | AnyType | FunctionType | OverloadedType | ClassType | ModuleType | TypeVarType; export type Type = UnionableType | NeverType | UnionType; export type TypeVarScopeId = string; export declare const UnificationScopeId: TypeVarScopeId; export declare class EnumLiteral { classFullName: string; className: string; itemName: string; itemType: Type; isReprEnum: boolean; constructor(classFullName: string, className: string, itemName: string, itemType: Type, isReprEnum: boolean); getName(): string; } export declare class SentinelLiteral { classFullName: string; className: string; constructor(classFullName: string, className: string); getName(): string; } export type LiteralValue = number | bigint | boolean | string | EnumLiteral | SentinelLiteral; export type TypeSourceId = number; export declare const maxTypeRecursionCount = 20; export type InheritanceChain = (ClassType | UnknownType)[]; export interface TypeSameOptions { ignorePseudoGeneric?: boolean; ignoreTypeFlags?: boolean; ignoreConditions?: boolean; ignoreTypedDictNarrowEntries?: boolean; honorTypeForm?: boolean; honorIsTypeArgExplicit?: boolean; treatAnySameAsUnknown?: boolean; } export interface TypeAliasSharedInfo { name: string; fullName: string; moduleName: string; fileUri: Uri; typeVarScopeId: TypeVarScopeId; isTypeAliasType: boolean; typeParams: TypeVarType[] | undefined; computedVariance: Variance[] | undefined; } export interface TypeAliasInfo { shared: TypeAliasSharedInfo; typeArgs: Type[] | undefined; } interface CachedTypeInfo { instantiableType?: Type; instanceType?: Type; typeBaseInstantiableType?: Type; typeBaseInstanceType?: Type; requiresSpecialization?: boolean; } export interface TypeBaseProps { instantiableDepth: number | undefined; specialForm: ClassType | undefined; typeForm: Type | undefined; typeAliasInfo: TypeAliasInfo | undefined; condition: TypeCondition[] | undefined; } export interface TypeBase { category: T; flags: TypeFlags; props: TypeBaseProps | undefined; cached: CachedTypeInfo | undefined; shared: object | undefined; priv: object | undefined; } export declare namespace TypeBase { function isInstantiable(type: TypeBase): boolean; function isInstance(type: TypeBase): boolean; function isAmbiguous(type: TypeBase): boolean; function addProps(type: TypeBase): TypeBaseProps; function getInstantiableDepth(type: TypeBase): number; function setSpecialForm(type: TypeBase, specialForm: ClassType | undefined): void; function setInstantiableDepth(type: TypeBase, depth: number | undefined): void; function setTypeAliasInfo(type: TypeBase, typeAliasInfo: TypeAliasInfo | undefined): void; function setTypeForm(type: TypeBase, typeForm: Type | undefined): void; function setCondition(type: TypeBase, condition: TypeCondition[] | undefined): void; function cloneType>(type: T): T; function cloneAsSpecialForm>(type: T, specialForm: ClassType | undefined): T; function cloneTypeAsInstance(type: T, cache: boolean): T; function cloneTypeAsInstantiable(type: T, cache: boolean): T; function cloneForTypeAlias(type: T, aliasInfo: TypeAliasInfo): T; function cloneWithTypeForm(type: T, typeForm: Type | undefined): T; function cloneForCondition(type: T, condition: TypeCondition[] | undefined): T; function cloneForAmbiguousType(type: Type): Type; } export interface UnboundType extends TypeBase { } export declare namespace UnboundType { function create(): UnboundType; function convertToInstance(type: UnboundType): UnboundType; } export interface UnknownDetailsPriv { isIncomplete: boolean; possibleType: Type | undefined; } export interface UnknownType extends TypeBase { priv: UnknownDetailsPriv; } export declare namespace UnknownType { function create(isIncomplete?: boolean): UnknownType; function createPossibleType(possibleType: Type, isIncomplete: boolean): UnknownType; function convertToInstance(type: UnknownType): UnknownType; } export interface ModuleDetailsPriv { fields: SymbolTable; docString: string | undefined; notPresentFieldType: AnyType | UnknownType | undefined; loaderFields: SymbolTable; moduleName: string; fileUri: Uri; } export interface ModuleType extends TypeBase { priv: ModuleDetailsPriv; } export declare namespace ModuleType { function create(moduleName: string, fileUri: Uri, symbolTable?: SymbolTable): ModuleType; function getField(moduleType: ModuleType, name: string): Symbol | undefined; } export interface DataClassEntry { name: string; classType: ClassType; mroClass?: ClassType; isClassVar: boolean; isKeywordOnly: boolean; alias?: string | undefined; hasDefault?: boolean | undefined; isDefaultFactory?: boolean | undefined; nameNode: NameNode | undefined; typeAnnotationNode: TypeAnnotationNode | undefined; defaultExpr?: ExpressionNode | undefined; includeInInit: boolean; type: Type; converter?: ArgumentNode | undefined; } export interface TypedDictEntry { valueType: Type; isRequired: boolean; isReadOnly: boolean; isProvided: boolean; } export interface TypedDictEntries { knownItems: Map; extraItems?: TypedDictEntry | undefined; } export declare const enum ClassTypeFlags { None = 0, BuiltIn = 1, SpecialBuiltIn = 2, TypedDictClass = 4, TypedDictMarkedClosed = 8, TypedDictEffectivelyClosed = 16, CanOmitDictValues = 32, SupportsAbstractMethods = 64, PropertyClass = 128, Final = 256, ProtocolClass = 512, PseudoGenericClass = 1024, RuntimeCheckable = 2048, TypingExtensionClass = 4096, PartiallyEvaluated = 8192, HasCustomClassGetItem = 16384, TupleClass = 32768, EnumClass = 65536, ClassProperty = 131072, DefinedInStub = 262144, TypeCheckOnly = 1048576, NewTypeClass = 2097152, ValidTypeAliasClass = 4194304, SpecialFormClass = 8388608, IllegalIsinstanceClass = 16777216 } export interface DataClassBehaviors { skipGenerateInit?: boolean; skipGenerateEq?: boolean; generateOrder?: boolean; generateSlots?: boolean; generateHash?: boolean; matchArgs?: boolean; keywordOnly?: boolean; frozen?: boolean; frozenDefault?: boolean; fieldDescriptorNames: string[]; } interface ClassDetailsShared { name: string; fullName: string; moduleName: string; fileUri: Uri; flags: ClassTypeFlags; typeSourceId: TypeSourceId; baseClasses: Type[]; mro: (ClassType | AnyType | UnknownType)[]; declaration?: ClassDeclaration | SpecialBuiltInClassDeclaration | undefined; declaredMetaclass?: ClassType | UnknownType | undefined; effectiveMetaclass?: ClassType | UnknownType | undefined; fields: SymbolTable; typeParams: TypeVarType[]; typeVarScopeId?: TypeVarScopeId | undefined; docString?: string | undefined; dataClassEntries?: DataClassEntry[] | undefined; dataClassBehaviors?: DataClassBehaviors | undefined; namedTupleEntries?: Set | undefined; typedDictEntries?: TypedDictEntries | undefined; typedDictExtraItemsExpr?: ExpressionNode | undefined; localSlotsNames?: string[]; deprecatedMessage?: string | undefined; protocolCompatibility?: object; classDataClassTransform?: DataClassBehaviors | undefined; requiresVarianceInference?: boolean; isInstanceHashable?: boolean; synthesizeMethodsDeferred?: () => void; calculateInheritedSlotsNamesDeferred?: () => void; inheritedSlotsNamesCached?: string[]; } export interface TupleTypeArg { type: Type; isUnbounded: boolean; isOptional?: boolean; } export interface PropertyMethodInfo { methodType: FunctionType; classType: ClassType | undefined; } export interface ClassDetailsPriv { typeArgs?: Type[] | undefined; isEmptyContainer?: boolean | undefined; tupleTypeArgs?: TupleTypeArg[] | undefined; isUnpacked?: boolean | undefined; isTypeArgExplicit?: boolean | undefined; includeSubclasses?: boolean; includePromotions?: boolean; literalValue?: LiteralValue | undefined; aliasName?: string | undefined; typedDictNarrowedEntries?: Map | undefined; isTypedDictPartial?: boolean; isAsymmetricDescriptor?: boolean; isAsymmetricAttributeAccessor?: boolean; fgetInfo?: PropertyMethodInfo | undefined; fsetInfo?: PropertyMethodInfo | undefined; fdelInfo?: PropertyMethodInfo | undefined; deprecatedInstanceMessage?: string | undefined; partialCallType?: Type | undefined; } export interface ClassType extends TypeBase { shared: ClassDetailsShared; priv: ClassDetailsPriv; } export declare namespace ClassType { function createInstantiable(name: string, fullName: string, moduleName: string, fileUri: Uri, flags: ClassTypeFlags, typeSourceId: TypeSourceId, declaredMetaclass: ClassType | UnknownType | undefined, effectiveMetaclass: ClassType | UnknownType | undefined, docString?: string): ClassType; function cloneAsInstance(type: ClassType, includeSubclasses?: boolean): ClassType; function cloneAsInstantiable(type: ClassType, includeSubclasses?: boolean): ClassType; function specialize(classType: ClassType, typeArgs: Type[] | undefined, isTypeArgExplicit?: boolean, includeSubclasses?: boolean, tupleTypeArgs?: TupleTypeArg[], isEmptyContainer?: boolean): ClassType; function cloneIncludeSubclasses(classType: ClassType, includeSubclasses?: boolean): ClassType; function cloneWithLiteral(classType: ClassType, value: LiteralValue | undefined): ClassType; function cloneForDeprecatedInstance(type: ClassType, deprecatedMessage?: string): ClassType; function cloneForTypingAlias(classType: ClassType, aliasName: string): ClassType; function cloneForNarrowedTypedDictEntries(classType: ClassType, narrowedEntries?: Map): ClassType; function cloneForPartialTypedDict(classType: ClassType): ClassType; function cloneRemoveTypePromotions(classType: ClassType): ClassType; function cloneForPartial(classType: ClassType, partialCallType: Type): ClassType; function cloneForUnpacked(classType: ClassType): ClassType; function cloneForPacked(classType: ClassType): ClassType; function cloneWithNewFlags(classType: ClassType, newFlags: ClassTypeFlags): ClassType; function isLiteralValueSame(type1: ClassType, type2: ClassType): boolean; function isTypedDictNarrowedEntriesSame(type1: ClassType, type2: ClassType): boolean; function isTypedDictNarrower(type1: ClassType, type2: ClassType): boolean; function isUnspecialized(classType: ClassType): boolean; function isSpecialBuiltIn(classType: ClassType, className?: string): boolean; function isBuiltIn(classType: ClassType, className?: string | string[]): boolean; function supportsAbstractMethods(classType: ClassType): boolean; function isDataClass(classType: ClassType): boolean; function isDataClassSkipGenerateInit(classType: ClassType): boolean; function isDataClassSkipGenerateEq(classType: ClassType): boolean; function isDataClassFrozen(classType: ClassType): boolean; function isDataClassGenerateOrder(classType: ClassType): boolean; function isDataClassKeywordOnly(classType: ClassType): boolean; function isDataClassGenerateSlots(classType: ClassType): boolean; function isDataClassGenerateHash(classType: ClassType): boolean; function isTypeCheckOnly(classType: ClassType): boolean; function isNewTypeClass(classType: ClassType): boolean; function isValidTypeAliasClass(classType: ClassType): boolean; function isSpecialFormClass(classType: ClassType): boolean; function isIllegalIsinstanceClass(classType: ClassType): boolean; function isTypedDictClass(classType: ClassType): boolean; function isCanOmitDictValues(classType: ClassType): boolean; function isTypedDictMarkedClosed(classType: ClassType): boolean; function isTypedDictEffectivelyClosed(classType: ClassType): boolean; function isEnumClass(classType: ClassType): boolean; function isPropertyClass(classType: ClassType): boolean; function isClassProperty(classType: ClassType): boolean; function isFinal(classType: ClassType): boolean; function isProtocolClass(classType: ClassType): boolean; function isDefinedInStub(classType: ClassType): boolean; function isPseudoGenericClass(classType: ClassType): boolean; function getDataClassEntries(classType: ClassType): DataClassEntry[]; function isRuntimeCheckable(classType: ClassType): boolean; function isTypingExtensionClass(classType: ClassType): boolean; function isPartiallyEvaluated(classType: ClassType): boolean; function hasCustomClassGetItem(classType: ClassType): boolean; function isTupleClass(classType: ClassType): boolean; function getTypeParams(classType: ClassType): TypeVarType[]; function derivesFromAnyOrUnknown(classType: ClassType): boolean; function getSymbolTable(classType: ClassType): SymbolTable; function getInheritedSlotsNames(classType: ClassType): string[] | undefined; function isHierarchyPartiallyEvaluated(classType: ClassType): boolean; function hasNamedTupleEntry(classType: ClassType, name: string): boolean; function isSameGenericClass(classType: ClassType, type2: ClassType, recursionCount?: number): boolean; function isDerivedFrom(subclassType: ClassType, parentClassType: ClassType, inheritanceChain?: InheritanceChain): boolean; function getReverseMro(classType: ClassType): (ClassType | UnknownType | AnyType)[]; } export declare enum FunctionParamFlags { None = 0, NameSynthesized = 1, TypeDeclared = 2, TypeInferred = 4 } export interface FunctionParam { category: ParamCategory; flags: FunctionParamFlags; name: string | undefined; _type: Type; _defaultType: Type | undefined; defaultExpr: ExpressionNode | undefined; } export declare namespace FunctionParam { function create(category: ParamCategory, type: Type, flags?: FunctionParamFlags, name?: string, defaultType?: Type, defaultExpr?: ExpressionNode): FunctionParam; function isNameSynthesized(param: FunctionParam): boolean; function isTypeDeclared(param: FunctionParam): boolean; function isTypeInferred(param: FunctionParam): boolean; } export declare function isPositionOnlySeparator(param: FunctionParam): boolean; export declare function isKeywordOnlySeparator(param: FunctionParam): boolean; export declare const enum FunctionTypeFlags { None = 0, ConstructorMethod = 1, ClassMethod = 2, StaticMethod = 4, AbstractMethod = 8, Generator = 16, DisableDefaultChecks = 32, SynthesizedMethod = 64, TypeCheckOnly = 128, Overloaded = 256, Async = 512, StubDefinition = 2048, PyTypedDefinition = 4096, Final = 8192, UnannotatedParams = 16384, GradualCallableForm = 32768, ParamSpecValue = 65536, PartiallyEvaluated = 131072, Overridden = 262144, NoTypeCheck = 524288, BuiltIn = 1048576 } interface FunctionDetailsShared { name: string; fullName: string; moduleName: string; flags: FunctionTypeFlags; typeParams: TypeVarType[]; parameters: FunctionParam[]; declaredReturnType: Type | undefined; declaration: FunctionDeclaration | undefined; typeVarScopeId: TypeVarScopeId | undefined; docString: string | undefined; deprecatedMessage: string | undefined; methodClass: ClassType | undefined; decoratorDataClassBehaviors: DataClassBehaviors | undefined; inferredReturnType?: { type: Type; isIncomplete?: boolean; evaluationCount?: number; }; } export interface SpecializedFunctionTypes { parameterTypes: Type[]; parameterDefaultTypes: (Type | undefined)[] | undefined; returnType: Type | undefined; } export interface CallSiteInferenceTypeCacheEntry { paramTypes: Type[]; returnType: Type; } export interface SignatureWithOffsets { type: FunctionType | OverloadedType; expressionOffsets: number[]; } export interface FunctionDetailsPriv { constructorTypeVarScopeId?: TypeVarScopeId | undefined; specializedTypes?: SpecializedFunctionTypes | undefined; callSiteReturnTypeCache?: CallSiteInferenceTypeCacheEntry[]; strippedFirstParamType?: Type | undefined; boundToType?: ClassType | undefined; preBoundFlags?: FunctionTypeFlags; overloaded?: OverloadedType; isCallableWithTypeArgs?: boolean; } export interface FunctionType extends TypeBase { shared: FunctionDetailsShared; priv: FunctionDetailsPriv; } export declare namespace FunctionType { function createInstance(name: string, fullName: string, moduleName: string, functionFlags: FunctionTypeFlags, docString?: string): FunctionType; function createInstantiable(functionFlags: FunctionTypeFlags, docString?: string): FunctionType; function createSynthesizedInstance(name: string, additionalFlags?: FunctionTypeFlags): FunctionType; function clone(type: FunctionType, stripFirstParam?: boolean, boundToType?: ClassType): FunctionType; function cloneAsInstance(type: FunctionType): FunctionType; function cloneAsInstantiable(type: FunctionType): FunctionType; function specialize(type: FunctionType, specializedTypes: SpecializedFunctionTypes): FunctionType; function applyParamSpecValue(type: FunctionType, paramSpecValue: FunctionType): FunctionType; function cloneWithNewFlags(type: FunctionType, flags: FunctionTypeFlags): FunctionType; function cloneWithNewTypeVarScopeId(type: FunctionType, newScopeId: TypeVarScopeId | undefined, newConstructorScopeId: TypeVarScopeId | undefined, typeParams: TypeVarType[]): FunctionType; function cloneWithDocString(type: FunctionType, docString?: string): FunctionType; function cloneWithDeprecatedMessage(type: FunctionType, deprecatedMessage?: string): FunctionType; function cloneRemoveParamSpecArgsKwargs(type: FunctionType, stripPositionOnlySeparator?: boolean): FunctionType; function getParamSpecFromArgsKwargs(type: FunctionType): ParamSpecType | undefined; function addParamSpecVariadics(type: FunctionType, paramSpec: ParamSpecType): void; function addDefaultParams(type: FunctionType, useUnknown?: boolean): void; function getDefaultParams(useUnknown?: boolean): FunctionParam[]; function hasDefaultParams(functionType: FunctionType): boolean; function isInstanceMethod(type: FunctionType): boolean; function isConstructorMethod(type: FunctionType): boolean; function isStaticMethod(type: FunctionType): boolean; function isClassMethod(type: FunctionType): boolean; function isAbstractMethod(type: FunctionType): boolean; function isGenerator(type: FunctionType): boolean; function isSynthesizedMethod(type: FunctionType): boolean; function isTypeCheckOnly(type: FunctionType): boolean; function isOverloaded(type: FunctionType): boolean; function isDefaultParamCheckDisabled(type: FunctionType): boolean; function isAsync(type: FunctionType): boolean; function isStubDefinition(type: FunctionType): boolean; function isPyTypedDefinition(type: FunctionType): boolean; function isFinal(type: FunctionType): boolean; function hasUnannotatedParams(type: FunctionType): boolean; function isGradualCallableForm(type: FunctionType): boolean; function isParamSpecValue(type: FunctionType): boolean; function isPartiallyEvaluated(type: FunctionType): boolean; function isOverridden(type: FunctionType): boolean; function isBuiltIn(type: FunctionType, name?: string | string[]): boolean; function getDeclaredParamType(type: FunctionType, index: number): Type; function getParamType(type: FunctionType, index: number): Type; function getParamDefaultType(type: FunctionType, index: number): Type | undefined; function addParam(type: FunctionType, param: FunctionParam): void; function addPositionOnlyParamSeparator(type: FunctionType): void; function addKeywordOnlyParamSeparator(type: FunctionType): void; function getEffectiveReturnType(type: FunctionType, includeInferred?: boolean): Type | undefined; } export interface OverloadedDetailsPriv { _overloads: FunctionType[]; _implementation: Type | undefined; } export interface OverloadedType extends TypeBase { priv: OverloadedDetailsPriv; } export declare namespace OverloadedType { function create(overloads: FunctionType[], implementation?: Type): OverloadedType; function addOverload(type: OverloadedType, functionType: FunctionType): void; function getOverloads(type: OverloadedType): FunctionType[]; function getImplementation(type: OverloadedType): Type | undefined; } export interface NeverDetailsPriv { isNoReturn: boolean; } export interface NeverType extends TypeBase { priv: NeverDetailsPriv; } export declare namespace NeverType { function createNever(): NeverType; function createNoReturn(): NeverType; function convertToInstance(type: NeverType): NeverType; } export interface AnyDetailsPriv { isEllipsis: boolean; } export interface AnyType extends TypeBase { priv: AnyDetailsPriv; } export declare namespace AnyType { function create(isEllipsis?: boolean): AnyType; function createSpecialForm(): AnyType; } export declare namespace AnyType { function convertToInstance(type: AnyType): AnyType; } export interface TypeCondition { typeVar: TypeVarType; constraintIndex: number; } export declare namespace TypeCondition { function combine(conditions1: TypeCondition[] | undefined, conditions2: TypeCondition[] | undefined): TypeCondition[] | undefined; function isSame(conditions1: TypeCondition[] | undefined, conditions2: TypeCondition[] | undefined): boolean; function isCompatible(conditions1: TypeCondition[] | undefined, conditions2: TypeCondition[] | undefined): boolean; } export interface LiteralTypes { literalStrMap: Map | undefined; literalIntMap: Map | undefined; literalEnumMap: Map | undefined; } export interface UnionDetailsPriv { subtypes: UnionableType[]; literalInstances: LiteralTypes; literalClasses: LiteralTypes; typeAliasSources: Set | undefined; includesRecursiveTypeAlias: boolean; } export interface UnionType extends TypeBase { priv: UnionDetailsPriv; } export declare namespace UnionType { function create(): UnionType; function addType(unionType: UnionType, newType: UnionableType): void; function containsType(unionType: UnionType, subtype: Type, options?: TypeSameOptions, exclusionSet?: Set, recursionCount?: number): boolean; function addTypeAliasSource(unionType: UnionType, typeAliasSource: Type): void; } export declare const enum Variance { Auto = 0, Unknown = 1, Invariant = 2, Covariant = 3, Contravariant = 4 } export interface RecursiveAliasInfo { name: string; scopeId: TypeVarScopeId; isPep695Syntax: boolean; typeParams: TypeVarType[] | undefined; } export declare enum TypeVarKind { TypeVar = 0, TypeVarTuple = 1, ParamSpec = 2 } export interface TypeVarDetailsShared { kind: TypeVarKind; name: string; constraints: Type[]; boundType: Type | undefined; isDefaultExplicit: boolean; defaultType: Type; declaredVariance: Variance; isSynthesized: boolean; isSynthesizedSelf: boolean; synthesizedIndex: number | undefined; isExemptFromBoundCheck: boolean; isTypeParamSyntax: boolean; recursiveAlias: TypeAliasSharedInfo | undefined; } export type ParamSpecAccess = 'args' | 'kwargs'; export declare const enum TypeVarScopeType { Class = 0, Function = 1, TypeAlias = 2 } export interface TypeVarDetailsPriv { scopeId?: TypeVarScopeId | undefined; scopeName?: string | undefined; scopeType?: TypeVarScopeType; nameWithScope?: string | undefined; computedVariance?: Variance; isUnificationVar?: boolean; freeTypeVar?: TypeVarType | undefined; isUnpacked?: boolean | undefined; } export interface TypeVarType extends TypeBase { shared: TypeVarDetailsShared; priv: TypeVarDetailsPriv; } export interface ParamSpecDetailsPriv extends TypeVarDetailsPriv { paramSpecAccess?: ParamSpecAccess; freeTypeVar?: ParamSpecType | undefined; } export interface ParamSpecType extends TypeVarType { shared: TypeVarDetailsShared & { kind: TypeVarKind.ParamSpec; }; priv: ParamSpecDetailsPriv; } export declare namespace ParamSpecType { function getUnknown(): FunctionType; } export interface TypeVarTupleDetailsPriv extends TypeVarDetailsPriv { isInUnion?: boolean | undefined; freeTypeVar?: TypeVarTupleType | undefined; } export interface TypeVarTupleType extends TypeVarType { shared: TypeVarDetailsShared & { kind: TypeVarKind.TypeVarTuple; }; priv: TypeVarTupleDetailsPriv; } export declare namespace TypeVarType { function createInstance(name: string, kind?: TypeVarKind): TypeVarType; function createInstantiable(name: string, kind?: TypeVarKind): TypeVarType; function cloneAsInstance(type: TypeVarType): TypeVarType; function cloneAsInstantiable(type: TypeVarType): TypeVarType; function cloneForNewName(type: TypeVarType, name: string): TypeVarType; function cloneForScopeId(type: TypeVarType, scopeId: string, scopeName: string | undefined, scopeType: TypeVarScopeType | undefined): TypeVarType; function cloneForUnpacked(type: TypeVarType, isInUnion?: boolean): TypeVarType; function cloneForPacked(type: TypeVarType): TypeVarType; function cloneAsInvariant(type: TypeVarType): TypeVarType; function cloneForParamSpecAccess(type: ParamSpecType, access: ParamSpecAccess | undefined): ParamSpecType; function cloneAsSpecializedSelf(type: TypeVarType, specializedBoundType: Type): TypeVarType; function cloneAsUnificationVar(type: TypeVarType, usageOffset?: number): TypeVarType; function cloneWithComputedVariance(type: TypeVarType, computedVariance: Variance): TypeVarType; function makeNameWithScope(name: string, scopeId: string, scopeName: string): string; function makeBoundScopeId(scopeId: TypeVarScopeId): TypeVarScopeId; function makeBoundScopeId(scopeId: TypeVarScopeId | undefined): TypeVarScopeId | undefined; function cloneAsBound(type: TypeVarType): TypeVarType; function isBound(type: TypeVarType): boolean; function isUnification(type: TypeVarType): boolean | undefined; function addConstraint(type: TypeVarType, constraintType: Type): void; function getNameWithScope(typeVarType: TypeVarType): string; function getReadableName(type: TypeVarType, includeScope?: boolean): string; function getVariance(type: TypeVarType): Variance.Invariant | Variance.Covariant | Variance.Contravariant; function isTypeAliasPlaceholder(type: TypeVarType): boolean; function isSelf(type: TypeVarType): boolean; function hasConstraints(type: TypeVarType): boolean; function hasBound(type: TypeVarType): boolean; } export declare function isNever(type: Type): type is NeverType; export declare function isAny(type: Type): type is AnyType; export declare function isUnknown(type: Type): type is UnknownType; export declare function isAnyOrUnknown(type: Type): type is AnyType | UnknownType; export declare function isUnbound(type: Type): type is UnboundType; export declare function isUnion(type: Type): type is UnionType; export declare function isPossiblyUnbound(type: Type): boolean; export declare function isClass(type: Type): type is ClassType; export declare function isInstantiableClass(type: Type): type is ClassType; export declare function isClassInstance(type: Type): type is ClassType; export declare function isModule(type: Type): type is ModuleType; export declare function isTypeVar(type: Type): type is TypeVarType; export declare function isParamSpec(type: Type): type is ParamSpecType; export declare function isTypeVarTuple(type: Type): type is TypeVarTupleType; export declare function isUnpackedTypeVarTuple(type: Type): type is TypeVarTupleType; export declare function isUnpackedTypeVar(type: Type): type is TypeVarTupleType; export declare function isUnpackedClass(type: Type): type is ClassType; export declare function isUnpacked(type: Type): boolean; export declare function isFunction(type: Type): type is FunctionType; export declare function isOverloaded(type: Type): type is OverloadedType; export declare function isFunctionOrOverloaded(type: Type): type is FunctionType | OverloadedType; export declare function isMethodType(type: FunctionType | OverloadedType): boolean; export declare function getTypeAliasInfo(type: Type): TypeAliasInfo | undefined; export declare function isTypeSame(type1: Type, type2: Type, options?: TypeSameOptions, recursionCount?: number): boolean; export declare function removeUnknownFromUnion(type: Type): Type; export declare function removeUnbound(type: Type): Type; export declare function removeFromUnion(type: Type, removeFilter: (type: Type) => boolean): Type; export declare function findSubtype(type: Type, filter: (type: UnionableType | NeverType) => boolean): UnionableType | NeverType | undefined; export interface CombineTypesOptions { skipElideRedundantLiterals?: boolean; maxSubtypeCount?: number; } export declare function combineTypes(subtypes: Type[], options?: CombineTypesOptions): Type; export declare function isSameWithoutLiteralValue(destType: Type, srcType: Type): boolean; export {};