import { ConstraintSolution } from './constraintSolution'; import { Symbol, SymbolTable } from './symbol'; import { AnyType, ClassType, ClassTypeFlags, FunctionType, ModuleType, OverloadedType, ParamSpecType, SignatureWithOffsets, TupleTypeArg, Type, TypeBase, TypeCondition, TypeSameOptions, TypeVarScopeId, TypeVarTupleType, TypeVarType, UnknownType, Variance } from './types'; export interface ClassMember { symbol: Symbol; classType: ClassType | UnknownType | AnyType; unspecializedClassType: ClassType | UnknownType | AnyType; isInstanceMember: boolean; isClassMember: boolean; isSlotsMember: boolean; isClassVar: boolean; isReadOnly: boolean; isTypeDeclared: boolean; skippedUndeclaredType: boolean; } export declare const enum MemberAccessFlags { Default = 0, SkipOriginalClass = 1, SkipBaseClasses = 2, SkipObjectBaseClass = 4, SkipTypeBaseClass = 8, SkipInstanceMembers = 16, SkipClassMembers = 32, DeclaredTypesOnly = 64, DisallowClassVarWrites = 128, TreatConstructorAsClassMethod = 256, SkipAttributeAccessOverride = 512, DisallowGenericInstanceVariableAccess = 1024, TypeExpression = 2048, SkipTypedDictEntries = 4096 } export declare const enum ClassIteratorFlags { Default = 0, SkipBaseClasses = 1, SkipObjectBaseClass = 2, SkipTypeBaseClass = 4 } export interface InferenceContext { expectedType: Type; isTypeIncomplete?: boolean; returnTypeOverride?: Type; } export interface RequiresSpecializationOptions { ignorePseudoGeneric?: boolean; ignoreSelf?: boolean; ignoreImplicitTypeArgs?: boolean; } export interface IsInstantiableOptions { honorTypeVarBounds?: boolean; } export interface SelfSpecializeOptions { overrideTypeArgs?: boolean; useBoundTypeVars?: boolean; } export interface ApplyTypeVarOptions { typeClassType?: ClassType; replaceUnsolved?: { scopeIds: TypeVarScopeId[]; tupleClassType: ClassType | undefined; unsolvedExemptTypeVars?: TypeVarType[]; useUnknown?: boolean; eliminateUnsolvedInUnions?: boolean; }; } export interface AddConditionOptions { skipSelfCondition?: boolean; skipBoundTypeVars?: boolean; } export declare class UniqueSignatureTracker { private _trackedSignatures; constructor(); getTrackedSignatures(): SignatureWithOffsets[]; addTrackedSignatures(signatures: SignatureWithOffsets[]): void; findSignature(signature: FunctionType | OverloadedType): SignatureWithOffsets | undefined; addSignature(signature: FunctionType | OverloadedType, offset: number): void; } export declare function isOptionalType(type: Type): boolean; export declare function isNoneInstance(type: Type): boolean; export declare function isNoneTypeClass(type: Type): boolean; export declare function removeNoneFromUnion(type: Type): Type; export declare function isIncompleteUnknown(type: Type): boolean; export declare function isTypeVarSame(type1: TypeVarType, type2: Type): boolean; export declare function makeInferenceContext(expectedType: undefined, isTypeIncomplete?: boolean, returnTypeOverride?: Type | undefined): undefined; export declare function makeInferenceContext(expectedType: Type, isTypeIncomplete?: boolean, returnTypeOverride?: Type | undefined): InferenceContext; export declare function makeInferenceContext(expectedType?: Type, isTypeIncomplete?: boolean, returnTypeOverride?: Type | undefined): InferenceContext | undefined; export interface MapSubtypesOptions { sortSubtypes?: boolean; skipElideRedundantLiterals?: boolean; retainTypeAlias?: boolean; } export declare function mapSubtypes(type: Type, callback: (type: Type) => Type | undefined, options?: MapSubtypesOptions): Type; export declare function mapSignatures(type: FunctionType | OverloadedType, callback: (type: FunctionType) => FunctionType | undefined): OverloadedType | FunctionType | undefined; export declare function cleanIncompleteUnknown(type: Type, recursionCount?: number): Type; export declare function sortTypes(types: Type[]): Type[]; export declare function doForEachSubtype(type: Type, callback: (type: Type, index: number, allSubtypes: Type[]) => void, sortSubtypes?: boolean): void; export declare function someSubtypes(type: Type, callback: (type: Type) => boolean): boolean; export declare function allSubtypes(type: Type, callback: (type: Type) => boolean): boolean; export declare function doForEachSignature(type: FunctionType | OverloadedType, callback: (type: FunctionType, index: number) => void): void; export declare function areTypesSame(types: Type[], options: TypeSameOptions): boolean; export declare function preserveUnknown(type1: Type, type2: Type): AnyType | UnknownType; export declare function isUnionableType(subtypes: Type[]): boolean; export declare function derivesFromAnyOrUnknown(type: Type): boolean; export declare function getFullNameOfType(type: Type): string | undefined; export declare function addConditionToType(type: T, condition: TypeCondition[] | undefined, options?: AddConditionOptions): T; export declare function getTypeCondition(type: Type): TypeCondition[] | undefined; export declare function isTypeAliasPlaceholder(type: Type): boolean; export declare function isTypeAliasRecursive(typeAliasPlaceholder: TypeVarType, type: Type): boolean | undefined; export declare function transformPossibleRecursiveTypeAlias(type: Type, recursionCount?: number): Type; export declare function transformPossibleRecursiveTypeAlias(type: Type | undefined, recursionCount?: number): Type | undefined; export declare function getTypeVarScopeId(type: Type): TypeVarScopeId | undefined; export declare function getTypeVarScopeIds(type: Type): TypeVarScopeId[]; export declare function specializeWithUnknownTypeArgs(type: ClassType, tupleClassType?: ClassType): ClassType; export declare function getUnknownForTypeVar(typeVar: TypeVarType, tupleClassType?: ClassType): Type; export declare function getUnknownForTypeVarTuple(tupleClassType: ClassType): Type; export declare function getUnknownTypeForCallable(): FunctionType; export declare function selfSpecializeClass(type: ClassType, options?: SelfSpecializeOptions): ClassType; export declare function getSpecializedTupleType(type: Type): ClassType | undefined; export declare function isLiteralType(type: ClassType): boolean; export declare function isLiteralTypeOrUnion(type: Type, allowNone?: boolean): boolean; export declare function isLiteralLikeType(type: ClassType): boolean; export declare function isSentinelLiteral(type: Type): boolean; export declare function containsLiteralType(type: Type, includeTypeArgs?: boolean): boolean; export declare function getLiteralTypeClassName(type: Type): string | undefined; export declare function stripTypeForm(type: Type): Type; export declare function stripTypeFormRecursive(type: Type, recursionCount?: number): Type; export declare function getUnionSubtypeCount(type: Type): number; export declare function isEllipsisType(type: Type): boolean; export declare function isProperty(type: Type): boolean; export declare function isCallableType(type: Type): boolean; export declare function isDescriptorInstance(type: Type, requireSetter?: boolean): boolean; export declare function isMaybeDescriptorInstance(type: Type, requireSetter?: boolean): boolean; export declare function isTupleGradualForm(type: Type): boolean | undefined; export declare function isTupleClass(type: ClassType): boolean; export declare function isUnboundedTupleClass(type: ClassType): boolean | undefined; export declare function isTupleIndexUnambiguous(type: ClassType, index: number): boolean; export declare function partiallySpecializeType(type: Type, contextClassType: ClassType, typeClassType: ClassType | undefined, selfClass?: ClassType | TypeVarType): Type; export declare function addSolutionForSelfType(solution: ConstraintSolution, contextClassType: ClassType, selfClass: ClassType | TypeVarType): void; export declare function ensureSignaturesAreUnique(type: T, signatureTracker: UniqueSignatureTracker, expressionOffset: number): T; export declare function makeFunctionTypeVarsBound(type: FunctionType | OverloadedType): FunctionType | OverloadedType; export declare function makeTypeVarsBound>(type: T, scopeIds: TypeVarScopeId[] | undefined): T; export declare function makeTypeVarsFree>(type: T, scopeIds: TypeVarScopeId[]): T; export declare function applySolvedTypeVars(type: Type, solution: ConstraintSolution, options?: ApplyTypeVarOptions): Type; export declare function validateTypeVarDefault(typeVar: TypeVarType, liveTypeParams: TypeVarType[], invalidTypeVars: Set): void; export declare function transformExpectedType(expectedType: Type, liveTypeVarScopes: TypeVarScopeId[], usageOffset: number | undefined): Type; export declare function getProtocolSymbols(classType: ClassType): Map; export declare function getProtocolSymbolsRecursive(classType: ClassType, symbolMap: Map, classFlags?: ClassTypeFlags, recursionCount?: number): void; export declare function getContainerDepth(type: Type, recursionCount?: number): number; export declare function lookUpObjectMember(objectType: ClassType, memberName: string, flags?: MemberAccessFlags, skipMroClass?: ClassType | undefined): ClassMember | undefined; export declare function lookUpClassMember(classType: ClassType, memberName: string, flags?: MemberAccessFlags, skipMroClass?: ClassType | undefined): ClassMember | undefined; export declare function getClassMemberIterator(classType: ClassType | AnyType | UnknownType, memberName: string, flags?: MemberAccessFlags, skipMroClass?: ClassType | undefined): Generator; export declare function isMemberReadOnly(classType: ClassType, name: string): boolean; export declare function getClassIterator(classType: Type, flags?: ClassIteratorFlags, skipMroClass?: ClassType): Generator; export declare function getClassFieldsRecursive(classType: ClassType): Map; export declare function addTypeVarsToListIfUnique(list1: TypeVarType[], list2: TypeVarType[], typeVarScopeId?: TypeVarScopeId): void; export declare function getTypeVarArgsRecursive(type: Type, recursionCount?: number): TypeVarType[]; export declare function specializeWithDefaultTypeArgs(type: ClassType): ClassType; export declare function buildSolutionFromSpecializedClass(classType: ClassType): ConstraintSolution; export declare function buildSolution(typeParams: TypeVarType[], typeArgs: Type[] | undefined): ConstraintSolution; export declare function specializeForBaseClass(srcType: ClassType, baseClass: ClassType): ClassType; export declare function derivesFromStdlibClass(classType: ClassType, className: string): boolean; export declare function derivesFromClassRecursive(classType: ClassType, baseClassToFind: ClassType, ignoreUnknown: boolean): boolean; export declare function synthesizeTypeVarForSelfCls(classType: ClassType, isClsParam: boolean): TypeVarType; export declare function getDeclaredGeneratorReturnType(functionType: FunctionType): Type | undefined; export declare function getGeneratorYieldType(declaredReturnType: Type, isAsync: boolean): Type | undefined; export declare function isInstantiableMetaclass(type: Type): boolean; export declare function isMetaclassInstance(type: Type): boolean; export declare function isEffectivelyInstantiable(type: Type, options?: IsInstantiableOptions, recursionCount?: number): boolean; export declare function convertToInstance(type: ParamSpecType, includeSubclasses?: boolean): ParamSpecType; export declare function convertToInstance(type: TypeVarTupleType, includeSubclasses?: boolean): TypeVarTupleType; export declare function convertToInstance(type: TypeVarType, includeSubclasses?: boolean): TypeVarType; export declare function convertToInstance(type: Type, includeSubclasses?: boolean): Type; export declare function convertToInstantiable(type: Type, includeSubclasses?: boolean): Type; export declare function getMembersForClass(classType: ClassType, symbolTable: SymbolTable, includeInstanceVars: boolean): void; export declare function getMembersForModule(moduleType: ModuleType, symbolTable: SymbolTable): void; export declare function containsAnyRecursive(type: Type, includeUnknown?: boolean): boolean; export declare function containsAnyOrUnknown(type: Type, recurse: boolean): AnyType | UnknownType | undefined; export declare function isPartlyUnknown(type: Type, recursionCount?: number): boolean; export declare function explodeGenericClass(classType: ClassType): Type; export declare function combineSameSizedTuples(type: Type, tupleType: Type | undefined): Type; export declare function combineTupleTypeArgs(typeArgs: TupleTypeArg[]): Type; export declare function specializeTupleClass(classType: ClassType, typeArgs: TupleTypeArg[], isTypeArgExplicit?: boolean, isUnpacked?: boolean): ClassType; export declare function makePacked(type: Type): Type; export declare function makeUnpacked(type: Type): Type; export declare function getGeneratorTypeArgs(returnType: Type): Type[] | undefined; export declare function requiresTypeArgs(classType: ClassType): boolean; export declare function requiresSpecialization(type: Type, options?: RequiresSpecializationOptions, recursionCount?: number): boolean; export declare function invertVariance(variance: Variance): Variance; export declare function combineVariances(variance1: Variance, variance2: Variance): Variance; export declare function isVarianceOfTypeArgCompatible(type: Type, typeParamVariance: Variance): boolean; export declare function computeMroLinearization(classType: ClassType): boolean; export declare function getDeclaringModulesForType(type: Type): string[]; export declare function convertTypeToParamSpecValue(type: Type): FunctionType; export declare function simplifyFunctionToParamSpec(type: FunctionType): FunctionType | ParamSpecType; export declare class TypeVarTransformer { private _pendingTypeVarTransformations; private _pendingFunctionTransformations; get pendingTypeVarTransformations(): Set; apply(type: Type, recursionCount: number): Type; canSkipTransform(type: Type): boolean; transformTypeVar(typeVar: TypeVarType, recursionCount: number): Type | undefined; transformTupleTypeVar(paramSpec: TypeVarType, recursionCount: number): TupleTypeArg[] | undefined; transformUnionSubtype(preTransform: Type, postTransform: Type, recursionCount: number): Type | undefined; doForEachConstraintSet(callback: () => FunctionType): FunctionType | OverloadedType; transformGenericTypeAlias(type: Type, recursionCount: number): Type; transformConditionalType(type: Type, recursionCount: number): Type; transformTypeVarsInClassType(classType: ClassType, recursionCount: number): Type; transformTypeVarsInFunctionType(sourceType: FunctionType, recursionCount: number): FunctionType | OverloadedType; private _isTypeVarScopePending; }