@zzzen/pyright-internal 1.2.0-dev.20240721 → 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 +115 -122
- package/dist/analyzer/checker.js.map +1 -1
- package/dist/analyzer/codeFlowEngine.d.ts +2 -2
- package/dist/analyzer/codeFlowEngine.js +49 -42
- 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 +164 -204
- package/dist/analyzer/constraintSolver.js.map +1 -1
- package/dist/analyzer/constructorTransform.d.ts +2 -2
- package/dist/analyzer/constructorTransform.js +15 -15
- package/dist/analyzer/constructorTransform.js.map +1 -1
- package/dist/analyzer/constructors.d.ts +2 -2
- package/dist/analyzer/constructors.js +28 -33
- package/dist/analyzer/constructors.js.map +1 -1
- package/dist/analyzer/dataClasses.d.ts +2 -2
- package/dist/analyzer/dataClasses.js +59 -36
- 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 +4 -4
- 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 +10 -10
- 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 +58 -58
- package/dist/analyzer/parameterUtils.js.map +1 -1
- package/dist/analyzer/parseTreeUtils.d.ts +6 -6
- package/dist/analyzer/parseTreeUtils.js +22 -22
- package/dist/analyzer/parseTreeUtils.js.map +1 -1
- package/dist/analyzer/patternMatching.js +108 -89
- 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 +19 -19
- package/dist/analyzer/properties.js.map +1 -1
- package/dist/analyzer/protocols.js +14 -15
- 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/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 +1062 -1311
- package/dist/analyzer/typeEvaluator.js.map +1 -1
- package/dist/analyzer/typeEvaluatorTypes.d.ts +44 -40
- package/dist/analyzer/typeEvaluatorTypes.js +7 -1
- package/dist/analyzer/typeEvaluatorTypes.js.map +1 -1
- package/dist/analyzer/typeGuards.js +114 -85
- 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 +20 -18
- package/dist/analyzer/typeUtils.js +316 -321
- 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 +48 -52
- package/dist/analyzer/typedDicts.js.map +1 -1
- package/dist/analyzer/types.d.ts +79 -57
- package/dist/analyzer/types.js +125 -113
- package/dist/analyzer/types.js.map +1 -1
- package/dist/commands/dumpFileDebugInfoCommand.js +11 -11
- 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 +3 -3
- package/dist/languageService/hoverProvider.js.map +1 -1
- package/dist/languageService/referencesProvider.js +2 -2
- 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 +5 -0
- package/dist/localization/localize.js +6 -0
- package/dist/localization/localize.js.map +1 -1
- package/dist/localization/package.nls.cs.json +5 -1
- package/dist/localization/package.nls.de.json +5 -1
- package/dist/localization/package.nls.en-us.json +5 -0
- package/dist/localization/package.nls.es.json +5 -1
- package/dist/localization/package.nls.fr.json +5 -1
- package/dist/localization/package.nls.it.json +5 -1
- package/dist/localization/package.nls.ja.json +5 -1
- package/dist/localization/package.nls.ko.json +5 -1
- package/dist/localization/package.nls.pl.json +5 -1
- package/dist/localization/package.nls.pt-br.json +5 -1
- package/dist/localization/package.nls.qps-ploc.json +5 -1
- package/dist/localization/package.nls.ru.json +5 -1
- package/dist/localization/package.nls.tr.json +5 -1
- package/dist/localization/package.nls.zh-cn.json +5 -1
- package/dist/localization/package.nls.zh-tw.json +5 -1
- package/dist/parser/parseNodes.d.ts +9 -9
- package/dist/parser/parseNodes.js +20 -20
- package/dist/parser/parseNodes.js.map +1 -1
- package/dist/parser/parser.js +30 -30
- package/dist/parser/parser.js.map +1 -1
- package/dist/tests/checker.test.js +2 -2
- 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/typeEvaluator3.test.js +1 -1
- package/dist/tests/typeEvaluator4.test.js +9 -1
- 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 +72 -60
- package/dist/tests/typeEvaluator6.test.js.map +1 -1
- package/dist/tests/typeEvaluator7.test.js +2 -2
- 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;
|
@@ -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;
|
@@ -408,19 +405,19 @@ export declare namespace FunctionType {
|
|
408
405
|
function clone(type: FunctionType, stripFirstParam?: boolean, boundToType?: ClassType, boundTypeVarScopeId?: TypeVarScopeId): FunctionType;
|
409
406
|
function cloneAsInstance(type: FunctionType): FunctionType;
|
410
407
|
function cloneAsInstantiable(type: FunctionType): FunctionType;
|
411
|
-
function
|
408
|
+
function specialize(type: FunctionType, specializedTypes: SpecializedFunctionTypes, specializedInferredReturnType: Type | undefined): FunctionType;
|
412
409
|
function applyParamSpecValue(type: FunctionType, paramSpecValue: FunctionType): FunctionType;
|
413
410
|
function cloneWithNewFlags(type: FunctionType, flags: FunctionTypeFlags): FunctionType;
|
414
|
-
function cloneWithNewTypeVarScopeId(type: FunctionType, newScopeId: TypeVarScopeId | undefined, newConstructorScopeId: TypeVarScopeId | undefined,
|
411
|
+
function cloneWithNewTypeVarScopeId(type: FunctionType, newScopeId: TypeVarScopeId | undefined, newConstructorScopeId: TypeVarScopeId | undefined, typeParams: TypeVarType[]): FunctionType;
|
415
412
|
function cloneWithDocString(type: FunctionType, docString?: string): FunctionType;
|
416
413
|
function cloneWithDeprecatedMessage(type: FunctionType, deprecatedMessage?: string): FunctionType;
|
417
414
|
function cloneRemoveParamSpecArgsKwargs(type: FunctionType, stripPositionOnlySeparator?: boolean): FunctionType;
|
418
|
-
function getParamSpecFromArgsKwargs(type: FunctionType):
|
419
|
-
function addParamSpecVariadics(type: FunctionType, paramSpec:
|
420
|
-
function
|
415
|
+
function getParamSpecFromArgsKwargs(type: FunctionType): ParamSpecType | undefined;
|
416
|
+
function addParamSpecVariadics(type: FunctionType, paramSpec: ParamSpecType): void;
|
417
|
+
function addDefaultParams(type: FunctionType, useUnknown?: boolean): void;
|
421
418
|
function addHigherOrderTypeVarScopeIds(functionType: FunctionType, scopeIds: (TypeVarScopeId | undefined)[] | TypeVarScopeId | undefined): void;
|
422
|
-
function
|
423
|
-
function
|
419
|
+
function getDefaultParams(useUnknown?: boolean): FunctionParam[];
|
420
|
+
function hasDefaultParams(functionType: FunctionType): boolean;
|
424
421
|
function isInstanceMethod(type: FunctionType): boolean;
|
425
422
|
function isConstructorMethod(type: FunctionType): boolean;
|
426
423
|
function isStaticMethod(type: FunctionType): boolean;
|
@@ -430,7 +427,7 @@ export declare namespace FunctionType {
|
|
430
427
|
function isSynthesizedMethod(type: FunctionType): boolean;
|
431
428
|
function isTypeCheckOnly(type: FunctionType): boolean;
|
432
429
|
function isOverloaded(type: FunctionType): boolean;
|
433
|
-
function
|
430
|
+
function isDefaultParamCheckDisabled(type: FunctionType): boolean;
|
434
431
|
function isAsync(type: FunctionType): boolean;
|
435
432
|
function isStubDefinition(type: FunctionType): boolean;
|
436
433
|
function isPyTypedDefinition(type: FunctionType): boolean;
|
@@ -441,18 +438,18 @@ export declare namespace FunctionType {
|
|
441
438
|
function isPartiallyEvaluated(type: FunctionType): boolean;
|
442
439
|
function isOverridden(type: FunctionType): boolean;
|
443
440
|
function isBuiltIn(type: FunctionType, name?: string | string[]): boolean;
|
444
|
-
function
|
445
|
-
function
|
446
|
-
function
|
447
|
-
function
|
448
|
-
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;
|
449
446
|
function getEffectiveReturnType(type: FunctionType, includeInferred?: boolean): Type | undefined;
|
450
447
|
}
|
451
|
-
export interface
|
448
|
+
export interface OverloadedFunctionDetailsPriv {
|
452
449
|
overloads: FunctionType[];
|
453
450
|
}
|
454
451
|
export interface OverloadedFunctionType extends TypeBase<TypeCategory.OverloadedFunction> {
|
455
|
-
priv:
|
452
|
+
priv: OverloadedFunctionDetailsPriv;
|
456
453
|
}
|
457
454
|
export declare namespace OverloadedFunctionType {
|
458
455
|
function create(overloads: FunctionType[]): OverloadedFunctionType;
|
@@ -460,22 +457,22 @@ export declare namespace OverloadedFunctionType {
|
|
460
457
|
function getOverloads(type: OverloadedFunctionType): FunctionType[];
|
461
458
|
function getImplementation(type: OverloadedFunctionType): FunctionType | undefined;
|
462
459
|
}
|
463
|
-
export interface
|
460
|
+
export interface NeverDetailsPriv {
|
464
461
|
isNoReturn: boolean;
|
465
462
|
}
|
466
463
|
export interface NeverType extends TypeBase<TypeCategory.Never> {
|
467
|
-
priv:
|
464
|
+
priv: NeverDetailsPriv;
|
468
465
|
}
|
469
466
|
export declare namespace NeverType {
|
470
467
|
function createNever(): NeverType;
|
471
468
|
function createNoReturn(): NeverType;
|
472
469
|
function convertToInstance(type: NeverType): NeverType;
|
473
470
|
}
|
474
|
-
export interface
|
471
|
+
export interface AnyDetailsPriv {
|
475
472
|
isEllipsis: boolean;
|
476
473
|
}
|
477
474
|
export interface AnyType extends TypeBase<TypeCategory.Any> {
|
478
|
-
priv:
|
475
|
+
priv: AnyDetailsPriv;
|
479
476
|
}
|
480
477
|
export declare namespace AnyType {
|
481
478
|
function create(isEllipsis?: boolean): AnyType;
|
@@ -498,7 +495,7 @@ export interface LiteralTypes {
|
|
498
495
|
literalIntMap: Map<bigint | number, UnionableType> | undefined;
|
499
496
|
literalEnumMap: Map<string, UnionableType> | undefined;
|
500
497
|
}
|
501
|
-
export interface
|
498
|
+
export interface UnionDetailsPriv {
|
502
499
|
subtypes: UnionableType[];
|
503
500
|
literalInstances: LiteralTypes;
|
504
501
|
literalClasses: LiteralTypes;
|
@@ -506,7 +503,7 @@ export interface UnionTypeDetailsPriv {
|
|
506
503
|
includesRecursiveTypeAlias: boolean;
|
507
504
|
}
|
508
505
|
export interface UnionType extends TypeBase<TypeCategory.Union> {
|
509
|
-
priv:
|
506
|
+
priv: UnionDetailsPriv;
|
510
507
|
}
|
511
508
|
export declare namespace UnionType {
|
512
509
|
function create(): UnionType;
|
@@ -525,16 +522,20 @@ export interface RecursiveAliasInfo {
|
|
525
522
|
name: string;
|
526
523
|
scopeId: TypeVarScopeId;
|
527
524
|
isPep695Syntax: boolean;
|
528
|
-
|
525
|
+
typeParams: TypeVarType[] | undefined;
|
526
|
+
}
|
527
|
+
export declare enum TypeVarKind {
|
528
|
+
TypeVar = 0,
|
529
|
+
TypeVarTuple = 1,
|
530
|
+
ParamSpec = 2
|
529
531
|
}
|
530
532
|
export interface TypeVarDetailsShared {
|
533
|
+
kind: TypeVarKind;
|
531
534
|
name: string;
|
532
535
|
constraints: Type[];
|
533
536
|
boundType: Type | undefined;
|
534
537
|
isDefaultExplicit: boolean;
|
535
538
|
defaultType: Type;
|
536
|
-
isParamSpec: boolean;
|
537
|
-
isVariadic: boolean;
|
538
539
|
declaredVariance: Variance;
|
539
540
|
isSynthesized: boolean;
|
540
541
|
isSynthesizedSelf: boolean;
|
@@ -549,33 +550,54 @@ export declare const enum TypeVarScopeType {
|
|
549
550
|
Function = 1,
|
550
551
|
TypeAlias = 2
|
551
552
|
}
|
552
|
-
export interface
|
553
|
+
export interface TypeVarDetailsPriv {
|
553
554
|
scopeId?: TypeVarScopeId | undefined;
|
554
555
|
scopeName?: string | undefined;
|
555
556
|
scopeType?: TypeVarScopeType;
|
556
557
|
nameWithScope?: string | undefined;
|
557
|
-
isVariadicUnpacked?: boolean | undefined;
|
558
|
-
isVariadicInUnion?: boolean | undefined;
|
559
|
-
paramSpecAccess?: ParamSpecAccess;
|
560
558
|
computedVariance?: Variance;
|
561
559
|
isInScopePlaceholder?: boolean;
|
562
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
596
|
function cloneForScopeId(type: TypeVarType, scopeId: string, scopeName: string | undefined, scopeType: TypeVarScopeType | undefined): TypeVarType;
|
575
|
-
function cloneForUnpacked(type:
|
576
|
-
function cloneForPacked(type:
|
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;
|
@@ -601,11 +623,11 @@ export declare function isInstantiableClass(type: Type): type is ClassType;
|
|
601
623
|
export declare function isClassInstance(type: Type): type is ClassType;
|
602
624
|
export declare function isModule(type: Type): type is ModuleType;
|
603
625
|
export declare function isTypeVar(type: Type): type is TypeVarType;
|
604
|
-
export declare function
|
605
|
-
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;
|
606
629
|
export declare function isUnpackedClass(type: Type): type is ClassType;
|
607
630
|
export declare function isUnpacked(type: Type): boolean;
|
608
|
-
export declare function isParamSpec(type: Type): type is TypeVarType;
|
609
631
|
export declare function isFunction(type: Type): type is FunctionType;
|
610
632
|
export declare function isOverloadedFunction(type: Type): type is OverloadedFunctionType;
|
611
633
|
export declare function getTypeAliasInfo(type: Type): TypeAliasInfo | undefined;
|