@zzzen/pyright-internal 1.2.0-dev.20240714 → 1.2.0-dev.20240728
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/analyzer/analyzerNodeInfo.js +2 -2
- package/dist/analyzer/analyzerNodeInfo.js.map +1 -1
- package/dist/analyzer/binder.js +8 -8
- package/dist/analyzer/binder.js.map +1 -1
- package/dist/analyzer/cacheManager.js +3 -0
- package/dist/analyzer/cacheManager.js.map +1 -1
- package/dist/analyzer/checker.d.ts +3 -2
- package/dist/analyzer/checker.js +137 -142
- package/dist/analyzer/checker.js.map +1 -1
- package/dist/analyzer/codeFlowEngine.d.ts +2 -2
- package/dist/analyzer/codeFlowEngine.js +74 -44
- package/dist/analyzer/codeFlowEngine.js.map +1 -1
- package/dist/analyzer/codeFlowTypes.js +1 -1
- package/dist/analyzer/codeFlowTypes.js.map +1 -1
- package/dist/analyzer/constraintSolver.d.ts +2 -2
- package/dist/analyzer/constraintSolver.js +166 -206
- package/dist/analyzer/constraintSolver.js.map +1 -1
- package/dist/analyzer/constructorTransform.d.ts +2 -3
- package/dist/analyzer/constructorTransform.js +18 -19
- package/dist/analyzer/constructorTransform.js.map +1 -1
- package/dist/analyzer/constructors.d.ts +3 -3
- package/dist/analyzer/constructors.js +72 -175
- package/dist/analyzer/constructors.js.map +1 -1
- package/dist/analyzer/dataClasses.d.ts +2 -2
- package/dist/analyzer/dataClasses.js +60 -40
- package/dist/analyzer/dataClasses.js.map +1 -1
- package/dist/analyzer/declaration.d.ts +9 -9
- package/dist/analyzer/declaration.js +9 -9
- package/dist/analyzer/declaration.js.map +1 -1
- package/dist/analyzer/declarationUtils.d.ts +1 -1
- package/dist/analyzer/declarationUtils.js +6 -6
- package/dist/analyzer/declarationUtils.js.map +1 -1
- package/dist/analyzer/decorators.js +5 -6
- package/dist/analyzer/decorators.js.map +1 -1
- package/dist/analyzer/docStringConversion.js +2 -2
- package/dist/analyzer/docStringConversion.js.map +1 -1
- package/dist/analyzer/enums.d.ts +2 -2
- package/dist/analyzer/enums.js +6 -6
- package/dist/analyzer/enums.js.map +1 -1
- package/dist/analyzer/functionTransform.d.ts +2 -2
- package/dist/analyzer/functionTransform.js +4 -4
- package/dist/analyzer/functionTransform.js.map +1 -1
- package/dist/analyzer/importResolver.js +5 -3
- package/dist/analyzer/importResolver.js.map +1 -1
- package/dist/analyzer/namedTuples.d.ts +3 -3
- package/dist/analyzer/namedTuples.js +21 -22
- package/dist/analyzer/namedTuples.js.map +1 -1
- package/dist/analyzer/operations.js +145 -96
- package/dist/analyzer/operations.js.map +1 -1
- package/dist/analyzer/packageTypeVerifier.js +8 -8
- package/dist/analyzer/packageTypeVerifier.js.map +1 -1
- package/dist/analyzer/parameterUtils.d.ts +10 -10
- package/dist/analyzer/parameterUtils.js +60 -59
- package/dist/analyzer/parameterUtils.js.map +1 -1
- package/dist/analyzer/parseTreeUtils.d.ts +7 -6
- package/dist/analyzer/parseTreeUtils.js +47 -24
- package/dist/analyzer/parseTreeUtils.js.map +1 -1
- package/dist/analyzer/patternMatching.js +109 -90
- package/dist/analyzer/patternMatching.js.map +1 -1
- package/dist/analyzer/program.js +11 -4
- package/dist/analyzer/program.js.map +1 -1
- package/dist/analyzer/properties.js +23 -19
- package/dist/analyzer/properties.js.map +1 -1
- package/dist/analyzer/protocols.js +23 -20
- package/dist/analyzer/protocols.js.map +1 -1
- package/dist/analyzer/pythonPathUtils.js +1 -1
- package/dist/analyzer/pythonPathUtils.js.map +1 -1
- package/dist/analyzer/service.d.ts +3 -7
- package/dist/analyzer/service.js +28 -30
- package/dist/analyzer/service.js.map +1 -1
- package/dist/analyzer/serviceUtils.d.ts +8 -0
- package/dist/analyzer/serviceUtils.js +31 -0
- package/dist/analyzer/serviceUtils.js.map +1 -0
- package/dist/analyzer/sourceFile.js +5 -19
- package/dist/analyzer/sourceFile.js.map +1 -1
- package/dist/analyzer/sourceMapper.d.ts +1 -1
- package/dist/analyzer/sourceMapper.js +4 -4
- package/dist/analyzer/sourceMapper.js.map +1 -1
- package/dist/analyzer/staticExpressions.js +1 -1
- package/dist/analyzer/staticExpressions.js.map +1 -1
- package/dist/analyzer/testWalker.js +13 -1
- package/dist/analyzer/testWalker.js.map +1 -1
- package/dist/analyzer/tracePrinter.js +4 -4
- package/dist/analyzer/tracePrinter.js.map +1 -1
- package/dist/analyzer/tuples.d.ts +9 -0
- package/dist/analyzer/tuples.js +252 -0
- package/dist/analyzer/tuples.js.map +1 -0
- package/dist/analyzer/typeComplexity.d.ts +2 -0
- package/dist/analyzer/typeComplexity.js +86 -0
- package/dist/analyzer/typeComplexity.js.map +1 -0
- package/dist/analyzer/typeEvaluator.js +1721 -1824
- package/dist/analyzer/typeEvaluator.js.map +1 -1
- package/dist/analyzer/typeEvaluatorTypes.d.ts +47 -40
- package/dist/analyzer/typeEvaluatorTypes.js +10 -1
- package/dist/analyzer/typeEvaluatorTypes.js.map +1 -1
- package/dist/analyzer/typeGuards.js +116 -90
- package/dist/analyzer/typeGuards.js.map +1 -1
- package/dist/analyzer/typePrinter.d.ts +1 -1
- package/dist/analyzer/typePrinter.js +54 -53
- package/dist/analyzer/typePrinter.js.map +1 -1
- package/dist/analyzer/typeStubWriter.d.ts +3 -3
- package/dist/analyzer/typeStubWriter.js +15 -15
- package/dist/analyzer/typeStubWriter.js.map +1 -1
- package/dist/analyzer/typeUtils.d.ts +35 -29
- package/dist/analyzer/typeUtils.js +420 -357
- package/dist/analyzer/typeUtils.js.map +1 -1
- package/dist/analyzer/typeVarContext.d.ts +24 -36
- package/dist/analyzer/typeVarContext.js +89 -193
- package/dist/analyzer/typeVarContext.js.map +1 -1
- package/dist/analyzer/typeWalker.js +4 -4
- package/dist/analyzer/typeWalker.js.map +1 -1
- package/dist/analyzer/typedDicts.d.ts +2 -2
- package/dist/analyzer/typedDicts.js +49 -53
- package/dist/analyzer/typedDicts.js.map +1 -1
- package/dist/analyzer/types.d.ts +89 -63
- package/dist/analyzer/types.js +163 -120
- package/dist/analyzer/types.js.map +1 -1
- package/dist/commands/dumpFileDebugInfoCommand.js +12 -12
- package/dist/commands/dumpFileDebugInfoCommand.js.map +1 -1
- package/dist/common/configOptions.d.ts +1 -0
- package/dist/common/configOptions.js +5 -0
- package/dist/common/configOptions.js.map +1 -1
- package/dist/common/diagnosticRules.d.ts +1 -0
- package/dist/common/diagnosticRules.js +1 -0
- package/dist/common/diagnosticRules.js.map +1 -1
- package/dist/common/fileSystem.d.ts +0 -1
- package/dist/common/fileSystem.js.map +1 -1
- package/dist/common/languageServerInterface.d.ts +13 -0
- package/dist/common/languageServerInterface.js +15 -1
- package/dist/common/languageServerInterface.js.map +1 -1
- package/dist/common/lspUtils.js +2 -2
- package/dist/common/memUtils.d.ts +4 -0
- package/dist/common/memUtils.js +33 -2
- package/dist/common/memUtils.js.map +1 -1
- package/dist/common/serviceKeys.d.ts +3 -0
- package/dist/common/serviceKeys.js +2 -0
- package/dist/common/serviceKeys.js.map +1 -1
- package/dist/common/serviceProviderExtensions.js +7 -0
- package/dist/common/serviceProviderExtensions.js.map +1 -1
- package/dist/languageServerBase.d.ts +4 -3
- package/dist/languageServerBase.js +14 -10
- package/dist/languageServerBase.js.map +1 -1
- package/dist/languageService/autoImporter.d.ts +3 -2
- package/dist/languageService/autoImporter.js +5 -1
- package/dist/languageService/autoImporter.js.map +1 -1
- package/dist/languageService/completionProvider.d.ts +5 -3
- package/dist/languageService/completionProvider.js +38 -37
- package/dist/languageService/completionProvider.js.map +1 -1
- package/dist/languageService/completionProviderUtils.d.ts +1 -1
- package/dist/languageService/completionProviderUtils.js +3 -3
- package/dist/languageService/completionProviderUtils.js.map +1 -1
- package/dist/languageService/fileWatcherDynamicFeature.js +2 -2
- package/dist/languageService/fileWatcherDynamicFeature.js.map +1 -1
- package/dist/languageService/hoverProvider.js +14 -6
- package/dist/languageService/hoverProvider.js.map +1 -1
- package/dist/languageService/referencesProvider.d.ts +10 -4
- package/dist/languageService/referencesProvider.js +24 -12
- package/dist/languageService/referencesProvider.js.map +1 -1
- package/dist/languageService/renameProvider.js +21 -4
- package/dist/languageService/renameProvider.js.map +1 -1
- package/dist/languageService/signatureHelpProvider.js +1 -1
- package/dist/languageService/signatureHelpProvider.js.map +1 -1
- package/dist/languageService/tooltipUtils.js +3 -3
- package/dist/languageService/tooltipUtils.js.map +1 -1
- package/dist/localization/localize.d.ts +9 -3
- package/dist/localization/localize.js +8 -1
- package/dist/localization/localize.js.map +1 -1
- package/dist/localization/package.nls.cs.json +5 -2
- package/dist/localization/package.nls.de.json +5 -2
- package/dist/localization/package.nls.en-us.json +7 -1
- package/dist/localization/package.nls.es.json +5 -2
- package/dist/localization/package.nls.fr.json +5 -2
- package/dist/localization/package.nls.it.json +5 -2
- package/dist/localization/package.nls.ja.json +5 -2
- package/dist/localization/package.nls.ko.json +5 -2
- package/dist/localization/package.nls.pl.json +5 -2
- package/dist/localization/package.nls.pt-br.json +5 -2
- package/dist/localization/package.nls.qps-ploc.json +5 -2
- package/dist/localization/package.nls.ru.json +5 -2
- package/dist/localization/package.nls.tr.json +5 -2
- package/dist/localization/package.nls.zh-cn.json +5 -2
- package/dist/localization/package.nls.zh-tw.json +5 -2
- package/dist/parser/parseNodes.d.ts +12 -10
- package/dist/parser/parseNodes.js +23 -21
- package/dist/parser/parseNodes.js.map +1 -1
- package/dist/parser/parser.js +66 -43
- package/dist/parser/parser.js.map +1 -1
- package/dist/tests/checker.test.js +2 -2
- package/dist/tests/fourslash/rename.args.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/rename.args.fourslash.js +71 -0
- package/dist/tests/fourslash/rename.args.fourslash.js.map +1 -0
- package/dist/tests/fourslash/signature.builtinDocstrings.fourslash.js +4 -21
- package/dist/tests/fourslash/signature.builtinDocstrings.fourslash.js.map +1 -1
- package/dist/tests/fourslash/signature.complicated.fourslash.js +1 -1
- package/dist/tests/fourslash/signature.complicated.fourslash.js.map +1 -1
- package/dist/tests/harness/fourslash/fourSlashParser.js +1 -1
- package/dist/tests/harness/fourslash/fourSlashParser.js.map +1 -1
- package/dist/tests/harness/fourslash/testStateUtils.js +2 -2
- package/dist/tests/harness/fourslash/testStateUtils.js.map +1 -1
- package/dist/tests/harness/vfs/filesystem.d.ts +0 -1
- package/dist/tests/harness/vfs/filesystem.js +0 -4
- package/dist/tests/harness/vfs/filesystem.js.map +1 -1
- package/dist/tests/importResolver.test.js +62 -15
- package/dist/tests/importResolver.test.js.map +1 -1
- package/dist/tests/lsp/languageServerTestUtils.js +1 -1
- package/dist/tests/lsp/languageServerTestUtils.js.map +1 -1
- package/dist/tests/typeEvaluator1.test.js +17 -0
- package/dist/tests/typeEvaluator1.test.js.map +1 -1
- package/dist/tests/typeEvaluator2.test.js +4 -0
- package/dist/tests/typeEvaluator2.test.js.map +1 -1
- package/dist/tests/typeEvaluator3.test.js +1 -1
- package/dist/tests/typeEvaluator4.test.js +19 -7
- package/dist/tests/typeEvaluator4.test.js.map +1 -1
- package/dist/tests/typeEvaluator5.test.js +8 -2
- package/dist/tests/typeEvaluator5.test.js.map +1 -1
- package/dist/tests/typeEvaluator6.test.js +76 -60
- package/dist/tests/typeEvaluator6.test.js.map +1 -1
- package/dist/tests/typeEvaluator7.test.js +5 -1
- package/dist/tests/typeEvaluator7.test.js.map +1 -1
- package/dist/tests/typePrinter.test.js +13 -18
- package/dist/tests/typePrinter.test.js.map +1 -1
- package/dist/workspaceFactory.d.ts +3 -2
- package/dist/workspaceFactory.js +15 -2
- package/dist/workspaceFactory.js.map +1 -1
- package/package.json +1 -1
package/dist/analyzer/types.d.ts
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
import { Uri } from '../common/uri/uri';
|
2
|
-
import { ArgumentNode, NameNode,
|
2
|
+
import { ArgumentNode, NameNode, ParamCategory } from '../parser/parseNodes';
|
3
3
|
import { ClassDeclaration, FunctionDeclaration, SpecialBuiltInClassDeclaration } from './declaration';
|
4
4
|
import { Symbol, SymbolTable } from './symbol';
|
5
5
|
export declare const enum TypeCategory {
|
@@ -51,9 +51,9 @@ export interface TypeAliasInfo {
|
|
51
51
|
fileUri: Uri;
|
52
52
|
typeVarScopeId: TypeVarScopeId;
|
53
53
|
isPep695Syntax: boolean;
|
54
|
-
|
54
|
+
typeParams: TypeVarType[] | undefined;
|
55
55
|
usageVariance: Variance[] | undefined;
|
56
|
-
|
56
|
+
typeArgs: Type[] | undefined;
|
57
57
|
}
|
58
58
|
interface CachedTypeInfo {
|
59
59
|
instantiableType?: Type;
|
@@ -62,13 +62,13 @@ interface CachedTypeInfo {
|
|
62
62
|
typeBaseInstanceType?: Type;
|
63
63
|
requiresSpecialization?: boolean;
|
64
64
|
}
|
65
|
-
interface TypeBaseProps {
|
65
|
+
export interface TypeBaseProps {
|
66
66
|
instantiableDepth: number | undefined;
|
67
67
|
specialForm: ClassType | undefined;
|
68
68
|
typeAliasInfo: TypeAliasInfo | undefined;
|
69
69
|
condition: TypeCondition[] | undefined;
|
70
70
|
}
|
71
|
-
interface TypeBase<T extends TypeCategory> {
|
71
|
+
export interface TypeBase<T extends TypeCategory> {
|
72
72
|
category: T;
|
73
73
|
flags: TypeFlags;
|
74
74
|
props: TypeBaseProps | undefined;
|
@@ -99,19 +99,19 @@ export declare namespace UnboundType {
|
|
99
99
|
function create(): UnboundType;
|
100
100
|
function convertToInstance(type: UnboundType): UnboundType;
|
101
101
|
}
|
102
|
-
export interface
|
102
|
+
export interface UnknownDetailsPriv {
|
103
103
|
isIncomplete: boolean;
|
104
104
|
possibleType: Type | undefined;
|
105
105
|
}
|
106
106
|
export interface UnknownType extends TypeBase<TypeCategory.Unknown> {
|
107
|
-
priv:
|
107
|
+
priv: UnknownDetailsPriv;
|
108
108
|
}
|
109
109
|
export declare namespace UnknownType {
|
110
110
|
function create(isIncomplete?: boolean): UnknownType;
|
111
111
|
function createPossibleType(possibleType: Type, isIncomplete: boolean): UnknownType;
|
112
112
|
function convertToInstance(type: UnknownType): UnknownType;
|
113
113
|
}
|
114
|
-
export interface
|
114
|
+
export interface ModuleDetailsPriv {
|
115
115
|
fields: SymbolTable;
|
116
116
|
docString: string | undefined;
|
117
117
|
notPresentFieldType: AnyType | UnknownType | undefined;
|
@@ -120,7 +120,7 @@ export interface ModuleTypeDetailsPriv {
|
|
120
120
|
fileUri: Uri;
|
121
121
|
}
|
122
122
|
export interface ModuleType extends TypeBase<TypeCategory.Module> {
|
123
|
-
priv:
|
123
|
+
priv: ModuleDetailsPriv;
|
124
124
|
}
|
125
125
|
export declare namespace ModuleType {
|
126
126
|
function create(moduleName: string, fileUri: Uri, symbolTable?: SymbolTable): ModuleType;
|
@@ -200,7 +200,7 @@ interface ClassDetailsShared {
|
|
200
200
|
declaredMetaclass?: ClassType | UnknownType | undefined;
|
201
201
|
effectiveMetaclass?: ClassType | UnknownType | undefined;
|
202
202
|
fields: SymbolTable;
|
203
|
-
|
203
|
+
typeParams: TypeVarType[];
|
204
204
|
typeVarScopeId?: TypeVarScopeId | undefined;
|
205
205
|
docString?: string | undefined;
|
206
206
|
dataClassEntries?: DataClassEntry[] | undefined;
|
@@ -216,7 +216,7 @@ interface ClassDetailsShared {
|
|
216
216
|
calculateInheritedSlotsNamesDeferred?: () => void;
|
217
217
|
inheritedSlotsNamesCached?: string[];
|
218
218
|
}
|
219
|
-
export interface
|
219
|
+
export interface TupleTypeArg {
|
220
220
|
type: Type;
|
221
221
|
isUnbounded: boolean;
|
222
222
|
isOptional?: boolean;
|
@@ -226,13 +226,11 @@ export interface PropertyMethodInfo {
|
|
226
226
|
classType: ClassType | undefined;
|
227
227
|
}
|
228
228
|
export interface ClassDetailsPriv {
|
229
|
-
|
230
|
-
typeGuardType?: Type | undefined;
|
231
|
-
isStrictTypeGuard?: boolean;
|
229
|
+
typeArgs?: Type[] | undefined;
|
232
230
|
isEmptyContainer?: boolean | undefined;
|
233
|
-
|
231
|
+
tupleTypeArgs?: TupleTypeArg[] | undefined;
|
234
232
|
isUnpacked?: boolean | undefined;
|
235
|
-
|
233
|
+
isTypeArgExplicit?: boolean | undefined;
|
236
234
|
includeSubclasses?: boolean;
|
237
235
|
includePromotions?: boolean;
|
238
236
|
literalValue?: LiteralValue | undefined;
|
@@ -254,7 +252,7 @@ export declare namespace ClassType {
|
|
254
252
|
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;
|
255
253
|
function cloneAsInstance(type: ClassType, includeSubclasses?: boolean): ClassType;
|
256
254
|
function cloneAsInstantiable(type: ClassType, includeSubclasses?: boolean): ClassType;
|
257
|
-
function
|
255
|
+
function specialize(classType: ClassType, typeArgs: Type[] | undefined, isTypeArgExplicit?: boolean, includeSubclasses?: boolean, tupleTypeArgs?: TupleTypeArg[], isEmptyContainer?: boolean): ClassType;
|
258
256
|
function cloneIncludeSubclasses(classType: ClassType, includeSubclasses?: boolean): ClassType;
|
259
257
|
function cloneWithLiteral(classType: ClassType, value: LiteralValue | undefined): ClassType;
|
260
258
|
function cloneForDeprecatedInstance(type: ClassType, deprecatedMessage?: string): ClassType;
|
@@ -262,7 +260,6 @@ export declare namespace ClassType {
|
|
262
260
|
function cloneForNarrowedTypedDictEntries(classType: ClassType, narrowedEntries?: Map<string, TypedDictEntry>): ClassType;
|
263
261
|
function cloneForPartialTypedDict(classType: ClassType): ClassType;
|
264
262
|
function cloneRemoveTypePromotions(classType: ClassType): ClassType;
|
265
|
-
function cloneForTypeGuard(classType: ClassType, typeGuardType: Type, isStrictTypeGuard: boolean): ClassType;
|
266
263
|
function cloneForSymbolTableUpdate(classType: ClassType): ClassType;
|
267
264
|
function cloneForUnpacked(classType: ClassType, isUnpacked?: boolean): ClassType;
|
268
265
|
function cloneWithNewFlags(classType: ClassType, newFlags: ClassTypeFlags): ClassType;
|
@@ -304,7 +301,7 @@ export declare namespace ClassType {
|
|
304
301
|
function hasCustomClassGetItem(classType: ClassType): boolean;
|
305
302
|
function isTupleClass(classType: ClassType): boolean;
|
306
303
|
function isReadOnlyInstanceVariables(classType: ClassType): boolean;
|
307
|
-
function
|
304
|
+
function getTypeParams(classType: ClassType): TypeVarType[];
|
308
305
|
function derivesFromAnyOrUnknown(classType: ClassType): boolean;
|
309
306
|
function getSymbolTable(classType: ClassType): SymbolTable;
|
310
307
|
function getInheritedSlotsNames(classType: ClassType): string[] | undefined;
|
@@ -320,14 +317,14 @@ export declare enum FunctionParamFlags {
|
|
320
317
|
TypeInferred = 4
|
321
318
|
}
|
322
319
|
export interface FunctionParam {
|
323
|
-
category:
|
320
|
+
category: ParamCategory;
|
324
321
|
type: Type;
|
325
322
|
flags: FunctionParamFlags;
|
326
323
|
name: string | undefined;
|
327
324
|
defaultType: Type | undefined;
|
328
325
|
}
|
329
326
|
export declare namespace FunctionParam {
|
330
|
-
function create(category:
|
327
|
+
function create(category: ParamCategory, type: Type, flags?: FunctionParamFlags, name?: string, defaultType?: Type): FunctionParam;
|
331
328
|
function isNameSynthesized(param: FunctionParam): boolean;
|
332
329
|
function isTypeDeclared(param: FunctionParam): boolean;
|
333
330
|
function isTypeInferred(param: FunctionParam): boolean;
|
@@ -362,7 +359,7 @@ interface FunctionDetailsShared {
|
|
362
359
|
fullName: string;
|
363
360
|
moduleName: string;
|
364
361
|
flags: FunctionTypeFlags;
|
365
|
-
|
362
|
+
typeParams: TypeVarType[];
|
366
363
|
parameters: FunctionParam[];
|
367
364
|
declaredReturnType: Type | undefined;
|
368
365
|
declaration: FunctionDeclaration | undefined;
|
@@ -395,7 +392,6 @@ export interface FunctionDetailsPriv {
|
|
395
392
|
boundToType?: ClassType | undefined;
|
396
393
|
preBoundFlags?: FunctionTypeFlags;
|
397
394
|
overloaded?: OverloadedFunctionType;
|
398
|
-
trackedSignatures?: SignatureWithOffsets[];
|
399
395
|
isCallableWithTypeArgs?: boolean;
|
400
396
|
}
|
401
397
|
export interface FunctionType extends TypeBase<TypeCategory.Function> {
|
@@ -409,19 +405,19 @@ export declare namespace FunctionType {
|
|
409
405
|
function clone(type: FunctionType, stripFirstParam?: boolean, boundToType?: ClassType, boundTypeVarScopeId?: TypeVarScopeId): FunctionType;
|
410
406
|
function cloneAsInstance(type: FunctionType): FunctionType;
|
411
407
|
function cloneAsInstantiable(type: FunctionType): FunctionType;
|
412
|
-
function
|
408
|
+
function specialize(type: FunctionType, specializedTypes: SpecializedFunctionTypes, specializedInferredReturnType: Type | undefined): FunctionType;
|
413
409
|
function applyParamSpecValue(type: FunctionType, paramSpecValue: FunctionType): FunctionType;
|
414
410
|
function cloneWithNewFlags(type: FunctionType, flags: FunctionTypeFlags): FunctionType;
|
415
|
-
function cloneWithNewTypeVarScopeId(type: FunctionType, newScopeId: TypeVarScopeId, newConstructorScopeId: TypeVarScopeId | undefined,
|
411
|
+
function cloneWithNewTypeVarScopeId(type: FunctionType, newScopeId: TypeVarScopeId | undefined, newConstructorScopeId: TypeVarScopeId | undefined, typeParams: TypeVarType[]): FunctionType;
|
416
412
|
function cloneWithDocString(type: FunctionType, docString?: string): FunctionType;
|
417
413
|
function cloneWithDeprecatedMessage(type: FunctionType, deprecatedMessage?: string): FunctionType;
|
418
414
|
function cloneRemoveParamSpecArgsKwargs(type: FunctionType, stripPositionOnlySeparator?: boolean): FunctionType;
|
419
|
-
function getParamSpecFromArgsKwargs(type: FunctionType):
|
420
|
-
function addParamSpecVariadics(type: FunctionType, paramSpec:
|
421
|
-
function
|
415
|
+
function getParamSpecFromArgsKwargs(type: FunctionType): ParamSpecType | undefined;
|
416
|
+
function addParamSpecVariadics(type: FunctionType, paramSpec: ParamSpecType): void;
|
417
|
+
function addDefaultParams(type: FunctionType, useUnknown?: boolean): void;
|
422
418
|
function addHigherOrderTypeVarScopeIds(functionType: FunctionType, scopeIds: (TypeVarScopeId | undefined)[] | TypeVarScopeId | undefined): void;
|
423
|
-
function
|
424
|
-
function
|
419
|
+
function getDefaultParams(useUnknown?: boolean): FunctionParam[];
|
420
|
+
function hasDefaultParams(functionType: FunctionType): boolean;
|
425
421
|
function isInstanceMethod(type: FunctionType): boolean;
|
426
422
|
function isConstructorMethod(type: FunctionType): boolean;
|
427
423
|
function isStaticMethod(type: FunctionType): boolean;
|
@@ -431,7 +427,7 @@ export declare namespace FunctionType {
|
|
431
427
|
function isSynthesizedMethod(type: FunctionType): boolean;
|
432
428
|
function isTypeCheckOnly(type: FunctionType): boolean;
|
433
429
|
function isOverloaded(type: FunctionType): boolean;
|
434
|
-
function
|
430
|
+
function isDefaultParamCheckDisabled(type: FunctionType): boolean;
|
435
431
|
function isAsync(type: FunctionType): boolean;
|
436
432
|
function isStubDefinition(type: FunctionType): boolean;
|
437
433
|
function isPyTypedDefinition(type: FunctionType): boolean;
|
@@ -442,18 +438,18 @@ export declare namespace FunctionType {
|
|
442
438
|
function isPartiallyEvaluated(type: FunctionType): boolean;
|
443
439
|
function isOverridden(type: FunctionType): boolean;
|
444
440
|
function isBuiltIn(type: FunctionType, name?: string | string[]): boolean;
|
445
|
-
function
|
446
|
-
function
|
447
|
-
function
|
448
|
-
function
|
449
|
-
function
|
441
|
+
function getEffectiveParamType(type: FunctionType, index: number): Type;
|
442
|
+
function getEffectiveParamDefaultArgType(type: FunctionType, index: number): Type | undefined;
|
443
|
+
function addParam(type: FunctionType, param: FunctionParam): void;
|
444
|
+
function addPositionOnlyParamSeparator(type: FunctionType): void;
|
445
|
+
function addKeywordOnlyParamSeparator(type: FunctionType): void;
|
450
446
|
function getEffectiveReturnType(type: FunctionType, includeInferred?: boolean): Type | undefined;
|
451
447
|
}
|
452
|
-
export interface
|
448
|
+
export interface OverloadedFunctionDetailsPriv {
|
453
449
|
overloads: FunctionType[];
|
454
450
|
}
|
455
451
|
export interface OverloadedFunctionType extends TypeBase<TypeCategory.OverloadedFunction> {
|
456
|
-
priv:
|
452
|
+
priv: OverloadedFunctionDetailsPriv;
|
457
453
|
}
|
458
454
|
export declare namespace OverloadedFunctionType {
|
459
455
|
function create(overloads: FunctionType[]): OverloadedFunctionType;
|
@@ -461,22 +457,22 @@ export declare namespace OverloadedFunctionType {
|
|
461
457
|
function getOverloads(type: OverloadedFunctionType): FunctionType[];
|
462
458
|
function getImplementation(type: OverloadedFunctionType): FunctionType | undefined;
|
463
459
|
}
|
464
|
-
export interface
|
460
|
+
export interface NeverDetailsPriv {
|
465
461
|
isNoReturn: boolean;
|
466
462
|
}
|
467
463
|
export interface NeverType extends TypeBase<TypeCategory.Never> {
|
468
|
-
priv:
|
464
|
+
priv: NeverDetailsPriv;
|
469
465
|
}
|
470
466
|
export declare namespace NeverType {
|
471
467
|
function createNever(): NeverType;
|
472
468
|
function createNoReturn(): NeverType;
|
473
469
|
function convertToInstance(type: NeverType): NeverType;
|
474
470
|
}
|
475
|
-
export interface
|
471
|
+
export interface AnyDetailsPriv {
|
476
472
|
isEllipsis: boolean;
|
477
473
|
}
|
478
474
|
export interface AnyType extends TypeBase<TypeCategory.Any> {
|
479
|
-
priv:
|
475
|
+
priv: AnyDetailsPriv;
|
480
476
|
}
|
481
477
|
export declare namespace AnyType {
|
482
478
|
function create(isEllipsis?: boolean): AnyType;
|
@@ -499,7 +495,7 @@ export interface LiteralTypes {
|
|
499
495
|
literalIntMap: Map<bigint | number, UnionableType> | undefined;
|
500
496
|
literalEnumMap: Map<string, UnionableType> | undefined;
|
501
497
|
}
|
502
|
-
export interface
|
498
|
+
export interface UnionDetailsPriv {
|
503
499
|
subtypes: UnionableType[];
|
504
500
|
literalInstances: LiteralTypes;
|
505
501
|
literalClasses: LiteralTypes;
|
@@ -507,7 +503,7 @@ export interface UnionTypeDetailsPriv {
|
|
507
503
|
includesRecursiveTypeAlias: boolean;
|
508
504
|
}
|
509
505
|
export interface UnionType extends TypeBase<TypeCategory.Union> {
|
510
|
-
priv:
|
506
|
+
priv: UnionDetailsPriv;
|
511
507
|
}
|
512
508
|
export declare namespace UnionType {
|
513
509
|
function create(): UnionType;
|
@@ -526,16 +522,20 @@ export interface RecursiveAliasInfo {
|
|
526
522
|
name: string;
|
527
523
|
scopeId: TypeVarScopeId;
|
528
524
|
isPep695Syntax: boolean;
|
529
|
-
|
525
|
+
typeParams: TypeVarType[] | undefined;
|
526
|
+
}
|
527
|
+
export declare enum TypeVarKind {
|
528
|
+
TypeVar = 0,
|
529
|
+
TypeVarTuple = 1,
|
530
|
+
ParamSpec = 2
|
530
531
|
}
|
531
532
|
export interface TypeVarDetailsShared {
|
533
|
+
kind: TypeVarKind;
|
532
534
|
name: string;
|
533
535
|
constraints: Type[];
|
534
536
|
boundType: Type | undefined;
|
535
537
|
isDefaultExplicit: boolean;
|
536
538
|
defaultType: Type;
|
537
|
-
isParamSpec: boolean;
|
538
|
-
isVariadic: boolean;
|
539
539
|
declaredVariance: Variance;
|
540
540
|
isSynthesized: boolean;
|
541
541
|
isSynthesizedSelf: boolean;
|
@@ -550,38 +550,64 @@ export declare const enum TypeVarScopeType {
|
|
550
550
|
Function = 1,
|
551
551
|
TypeAlias = 2
|
552
552
|
}
|
553
|
-
export interface
|
553
|
+
export interface TypeVarDetailsPriv {
|
554
554
|
scopeId?: TypeVarScopeId | undefined;
|
555
555
|
scopeName?: string | undefined;
|
556
556
|
scopeType?: TypeVarScopeType;
|
557
557
|
nameWithScope?: string | undefined;
|
558
|
-
isVariadicUnpacked?: boolean | undefined;
|
559
|
-
isVariadicInUnion?: boolean | undefined;
|
560
|
-
paramSpecAccess?: ParamSpecAccess;
|
561
558
|
computedVariance?: Variance;
|
562
559
|
isInScopePlaceholder?: boolean;
|
560
|
+
externalTypeVar?: TypeVarType | undefined;
|
563
561
|
}
|
564
562
|
export interface TypeVarType extends TypeBase<TypeCategory.TypeVar> {
|
565
563
|
shared: TypeVarDetailsShared;
|
566
|
-
priv:
|
564
|
+
priv: TypeVarDetailsPriv;
|
565
|
+
}
|
566
|
+
export interface ParamSpecDetailsPriv extends TypeVarDetailsPriv {
|
567
|
+
paramSpecAccess?: ParamSpecAccess;
|
568
|
+
externalTypeVar?: ParamSpecType | undefined;
|
569
|
+
}
|
570
|
+
export interface ParamSpecType extends TypeVarType {
|
571
|
+
shared: TypeVarDetailsShared & {
|
572
|
+
kind: TypeVarKind.ParamSpec;
|
573
|
+
};
|
574
|
+
priv: ParamSpecDetailsPriv;
|
575
|
+
}
|
576
|
+
export declare namespace ParamSpecType {
|
577
|
+
function getUnknown(): FunctionType;
|
578
|
+
}
|
579
|
+
export interface TypeVarTupleDetailsPriv extends TypeVarDetailsPriv {
|
580
|
+
isVariadicUnpacked?: boolean | undefined;
|
581
|
+
isVariadicInUnion?: boolean | undefined;
|
582
|
+
externalTypeVar?: TypeVarTupleType | undefined;
|
583
|
+
}
|
584
|
+
export interface TypeVarTupleType extends TypeVarType {
|
585
|
+
shared: TypeVarDetailsShared & {
|
586
|
+
kind: TypeVarKind.TypeVarTuple;
|
587
|
+
};
|
588
|
+
priv: TypeVarTupleDetailsPriv;
|
567
589
|
}
|
568
590
|
export declare namespace TypeVarType {
|
569
|
-
function createInstance(name: string): TypeVarType;
|
570
|
-
function createInstantiable(name: string,
|
591
|
+
function createInstance(name: string, kind?: TypeVarKind): TypeVarType;
|
592
|
+
function createInstantiable(name: string, kind?: TypeVarKind): TypeVarType;
|
571
593
|
function cloneAsInstance(type: TypeVarType): TypeVarType;
|
572
594
|
function cloneAsInstantiable(type: TypeVarType): TypeVarType;
|
573
595
|
function cloneForNewName(type: TypeVarType, name: string): TypeVarType;
|
574
|
-
function cloneForScopeId(type: TypeVarType, scopeId: string, scopeName: string, scopeType: TypeVarScopeType): TypeVarType;
|
575
|
-
function cloneForUnpacked(type:
|
576
|
-
function cloneForPacked(type:
|
596
|
+
function cloneForScopeId(type: TypeVarType, scopeId: string, scopeName: string | undefined, scopeType: TypeVarScopeType | undefined): TypeVarType;
|
597
|
+
function cloneForUnpacked(type: TypeVarTupleType, isInUnion?: boolean): TypeVarTupleType;
|
598
|
+
function cloneForPacked(type: TypeVarTupleType): TypeVarTupleType;
|
577
599
|
function cloneAsInvariant(type: TypeVarType): TypeVarType;
|
578
|
-
function cloneForParamSpecAccess(type:
|
600
|
+
function cloneForParamSpecAccess(type: ParamSpecType, access: ParamSpecAccess | undefined): ParamSpecType;
|
579
601
|
function cloneAsSpecializedSelf(type: TypeVarType, specializedBoundType: Type): TypeVarType;
|
580
602
|
function cloneAsInScopePlaceholder(type: TypeVarType, usageOffset?: number): TypeVarType;
|
581
603
|
function makeNameWithScope(name: string, scopeId: string): string;
|
582
|
-
function
|
604
|
+
function makeInternalScopeId(scopeId: TypeVarScopeId): TypeVarScopeId;
|
605
|
+
function makeInternalScopeId(scopeId: TypeVarScopeId | undefined): TypeVarScopeId | undefined;
|
606
|
+
function cloneWithInternalScopeId(type: TypeVarType): TypeVarType;
|
607
|
+
function hasInternalScopeId(type: TypeVarType): boolean;
|
608
|
+
function addConstraint(type: TypeVarType, constraintType: Type): void;
|
583
609
|
function getNameWithScope(typeVarType: TypeVarType): string;
|
584
|
-
function getReadableName(
|
610
|
+
function getReadableName(type: TypeVarType): string;
|
585
611
|
function getVariance(type: TypeVarType): Variance.Invariant | Variance.Covariant | Variance.Contravariant;
|
586
612
|
function isTypeAliasPlaceholder(type: TypeVarType): boolean;
|
587
613
|
}
|
@@ -597,11 +623,11 @@ export declare function isInstantiableClass(type: Type): type is ClassType;
|
|
597
623
|
export declare function isClassInstance(type: Type): type is ClassType;
|
598
624
|
export declare function isModule(type: Type): type is ModuleType;
|
599
625
|
export declare function isTypeVar(type: Type): type is TypeVarType;
|
600
|
-
export declare function
|
601
|
-
export declare function
|
626
|
+
export declare function isParamSpec(type: Type): type is ParamSpecType;
|
627
|
+
export declare function isTypeVarTuple(type: Type): type is TypeVarTupleType;
|
628
|
+
export declare function isUnpackedTypeVarTuple(type: Type): type is TypeVarTupleType;
|
602
629
|
export declare function isUnpackedClass(type: Type): type is ClassType;
|
603
630
|
export declare function isUnpacked(type: Type): boolean;
|
604
|
-
export declare function isParamSpec(type: Type): type is TypeVarType;
|
605
631
|
export declare function isFunction(type: Type): type is FunctionType;
|
606
632
|
export declare function isOverloadedFunction(type: Type): type is OverloadedFunctionType;
|
607
633
|
export declare function getTypeAliasInfo(type: Type): TypeAliasInfo | undefined;
|