@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.
Files changed (211) hide show
  1. package/dist/analyzer/analyzerNodeInfo.js +2 -2
  2. package/dist/analyzer/analyzerNodeInfo.js.map +1 -1
  3. package/dist/analyzer/binder.js +8 -8
  4. package/dist/analyzer/binder.js.map +1 -1
  5. package/dist/analyzer/cacheManager.js +3 -0
  6. package/dist/analyzer/cacheManager.js.map +1 -1
  7. package/dist/analyzer/checker.d.ts +3 -2
  8. package/dist/analyzer/checker.js +115 -122
  9. package/dist/analyzer/checker.js.map +1 -1
  10. package/dist/analyzer/codeFlowEngine.d.ts +2 -2
  11. package/dist/analyzer/codeFlowEngine.js +49 -42
  12. package/dist/analyzer/codeFlowEngine.js.map +1 -1
  13. package/dist/analyzer/codeFlowTypes.js +1 -1
  14. package/dist/analyzer/codeFlowTypes.js.map +1 -1
  15. package/dist/analyzer/constraintSolver.d.ts +2 -2
  16. package/dist/analyzer/constraintSolver.js +164 -204
  17. package/dist/analyzer/constraintSolver.js.map +1 -1
  18. package/dist/analyzer/constructorTransform.d.ts +2 -2
  19. package/dist/analyzer/constructorTransform.js +15 -15
  20. package/dist/analyzer/constructorTransform.js.map +1 -1
  21. package/dist/analyzer/constructors.d.ts +2 -2
  22. package/dist/analyzer/constructors.js +28 -33
  23. package/dist/analyzer/constructors.js.map +1 -1
  24. package/dist/analyzer/dataClasses.d.ts +2 -2
  25. package/dist/analyzer/dataClasses.js +59 -36
  26. package/dist/analyzer/dataClasses.js.map +1 -1
  27. package/dist/analyzer/declaration.d.ts +9 -9
  28. package/dist/analyzer/declaration.js +9 -9
  29. package/dist/analyzer/declaration.js.map +1 -1
  30. package/dist/analyzer/declarationUtils.d.ts +1 -1
  31. package/dist/analyzer/declarationUtils.js +6 -6
  32. package/dist/analyzer/declarationUtils.js.map +1 -1
  33. package/dist/analyzer/decorators.js +4 -4
  34. package/dist/analyzer/decorators.js.map +1 -1
  35. package/dist/analyzer/docStringConversion.js +2 -2
  36. package/dist/analyzer/docStringConversion.js.map +1 -1
  37. package/dist/analyzer/enums.d.ts +2 -2
  38. package/dist/analyzer/enums.js +6 -6
  39. package/dist/analyzer/enums.js.map +1 -1
  40. package/dist/analyzer/functionTransform.d.ts +2 -2
  41. package/dist/analyzer/functionTransform.js +4 -4
  42. package/dist/analyzer/functionTransform.js.map +1 -1
  43. package/dist/analyzer/importResolver.js +5 -3
  44. package/dist/analyzer/importResolver.js.map +1 -1
  45. package/dist/analyzer/namedTuples.d.ts +3 -3
  46. package/dist/analyzer/namedTuples.js +21 -22
  47. package/dist/analyzer/namedTuples.js.map +1 -1
  48. package/dist/analyzer/operations.js +10 -10
  49. package/dist/analyzer/operations.js.map +1 -1
  50. package/dist/analyzer/packageTypeVerifier.js +8 -8
  51. package/dist/analyzer/packageTypeVerifier.js.map +1 -1
  52. package/dist/analyzer/parameterUtils.d.ts +10 -10
  53. package/dist/analyzer/parameterUtils.js +58 -58
  54. package/dist/analyzer/parameterUtils.js.map +1 -1
  55. package/dist/analyzer/parseTreeUtils.d.ts +6 -6
  56. package/dist/analyzer/parseTreeUtils.js +22 -22
  57. package/dist/analyzer/parseTreeUtils.js.map +1 -1
  58. package/dist/analyzer/patternMatching.js +108 -89
  59. package/dist/analyzer/patternMatching.js.map +1 -1
  60. package/dist/analyzer/program.js +11 -4
  61. package/dist/analyzer/program.js.map +1 -1
  62. package/dist/analyzer/properties.js +19 -19
  63. package/dist/analyzer/properties.js.map +1 -1
  64. package/dist/analyzer/protocols.js +14 -15
  65. package/dist/analyzer/protocols.js.map +1 -1
  66. package/dist/analyzer/pythonPathUtils.js +1 -1
  67. package/dist/analyzer/pythonPathUtils.js.map +1 -1
  68. package/dist/analyzer/service.d.ts +3 -7
  69. package/dist/analyzer/service.js +28 -30
  70. package/dist/analyzer/service.js.map +1 -1
  71. package/dist/analyzer/serviceUtils.d.ts +8 -0
  72. package/dist/analyzer/serviceUtils.js +31 -0
  73. package/dist/analyzer/serviceUtils.js.map +1 -0
  74. package/dist/analyzer/sourceFile.js +5 -19
  75. package/dist/analyzer/sourceFile.js.map +1 -1
  76. package/dist/analyzer/sourceMapper.d.ts +1 -1
  77. package/dist/analyzer/sourceMapper.js +4 -4
  78. package/dist/analyzer/sourceMapper.js.map +1 -1
  79. package/dist/analyzer/staticExpressions.js +1 -1
  80. package/dist/analyzer/staticExpressions.js.map +1 -1
  81. package/dist/analyzer/tracePrinter.js +4 -4
  82. package/dist/analyzer/tracePrinter.js.map +1 -1
  83. package/dist/analyzer/tuples.d.ts +9 -0
  84. package/dist/analyzer/tuples.js +252 -0
  85. package/dist/analyzer/tuples.js.map +1 -0
  86. package/dist/analyzer/typeComplexity.d.ts +2 -0
  87. package/dist/analyzer/typeComplexity.js +86 -0
  88. package/dist/analyzer/typeComplexity.js.map +1 -0
  89. package/dist/analyzer/typeEvaluator.js +1062 -1311
  90. package/dist/analyzer/typeEvaluator.js.map +1 -1
  91. package/dist/analyzer/typeEvaluatorTypes.d.ts +44 -40
  92. package/dist/analyzer/typeEvaluatorTypes.js +7 -1
  93. package/dist/analyzer/typeEvaluatorTypes.js.map +1 -1
  94. package/dist/analyzer/typeGuards.js +114 -85
  95. package/dist/analyzer/typeGuards.js.map +1 -1
  96. package/dist/analyzer/typePrinter.d.ts +1 -1
  97. package/dist/analyzer/typePrinter.js +54 -53
  98. package/dist/analyzer/typePrinter.js.map +1 -1
  99. package/dist/analyzer/typeStubWriter.d.ts +3 -3
  100. package/dist/analyzer/typeStubWriter.js +15 -15
  101. package/dist/analyzer/typeStubWriter.js.map +1 -1
  102. package/dist/analyzer/typeUtils.d.ts +20 -18
  103. package/dist/analyzer/typeUtils.js +316 -321
  104. package/dist/analyzer/typeUtils.js.map +1 -1
  105. package/dist/analyzer/typeVarContext.d.ts +24 -36
  106. package/dist/analyzer/typeVarContext.js +89 -193
  107. package/dist/analyzer/typeVarContext.js.map +1 -1
  108. package/dist/analyzer/typeWalker.js +4 -4
  109. package/dist/analyzer/typeWalker.js.map +1 -1
  110. package/dist/analyzer/typedDicts.d.ts +2 -2
  111. package/dist/analyzer/typedDicts.js +48 -52
  112. package/dist/analyzer/typedDicts.js.map +1 -1
  113. package/dist/analyzer/types.d.ts +79 -57
  114. package/dist/analyzer/types.js +125 -113
  115. package/dist/analyzer/types.js.map +1 -1
  116. package/dist/commands/dumpFileDebugInfoCommand.js +11 -11
  117. package/dist/commands/dumpFileDebugInfoCommand.js.map +1 -1
  118. package/dist/common/configOptions.d.ts +1 -0
  119. package/dist/common/configOptions.js +5 -0
  120. package/dist/common/configOptions.js.map +1 -1
  121. package/dist/common/diagnosticRules.d.ts +1 -0
  122. package/dist/common/diagnosticRules.js +1 -0
  123. package/dist/common/diagnosticRules.js.map +1 -1
  124. package/dist/common/fileSystem.d.ts +0 -1
  125. package/dist/common/fileSystem.js.map +1 -1
  126. package/dist/common/languageServerInterface.d.ts +13 -0
  127. package/dist/common/languageServerInterface.js +15 -1
  128. package/dist/common/languageServerInterface.js.map +1 -1
  129. package/dist/common/lspUtils.js +2 -2
  130. package/dist/common/memUtils.d.ts +4 -0
  131. package/dist/common/memUtils.js +33 -2
  132. package/dist/common/memUtils.js.map +1 -1
  133. package/dist/common/serviceKeys.d.ts +3 -0
  134. package/dist/common/serviceKeys.js +2 -0
  135. package/dist/common/serviceKeys.js.map +1 -1
  136. package/dist/common/serviceProviderExtensions.js +7 -0
  137. package/dist/common/serviceProviderExtensions.js.map +1 -1
  138. package/dist/languageServerBase.d.ts +4 -3
  139. package/dist/languageServerBase.js +14 -10
  140. package/dist/languageServerBase.js.map +1 -1
  141. package/dist/languageService/autoImporter.d.ts +3 -2
  142. package/dist/languageService/autoImporter.js +5 -1
  143. package/dist/languageService/autoImporter.js.map +1 -1
  144. package/dist/languageService/completionProvider.d.ts +5 -3
  145. package/dist/languageService/completionProvider.js +38 -37
  146. package/dist/languageService/completionProvider.js.map +1 -1
  147. package/dist/languageService/completionProviderUtils.d.ts +1 -1
  148. package/dist/languageService/completionProviderUtils.js +3 -3
  149. package/dist/languageService/completionProviderUtils.js.map +1 -1
  150. package/dist/languageService/fileWatcherDynamicFeature.js +2 -2
  151. package/dist/languageService/fileWatcherDynamicFeature.js.map +1 -1
  152. package/dist/languageService/hoverProvider.js +3 -3
  153. package/dist/languageService/hoverProvider.js.map +1 -1
  154. package/dist/languageService/referencesProvider.js +2 -2
  155. package/dist/languageService/signatureHelpProvider.js +1 -1
  156. package/dist/languageService/signatureHelpProvider.js.map +1 -1
  157. package/dist/languageService/tooltipUtils.js +3 -3
  158. package/dist/languageService/tooltipUtils.js.map +1 -1
  159. package/dist/localization/localize.d.ts +5 -0
  160. package/dist/localization/localize.js +6 -0
  161. package/dist/localization/localize.js.map +1 -1
  162. package/dist/localization/package.nls.cs.json +5 -1
  163. package/dist/localization/package.nls.de.json +5 -1
  164. package/dist/localization/package.nls.en-us.json +5 -0
  165. package/dist/localization/package.nls.es.json +5 -1
  166. package/dist/localization/package.nls.fr.json +5 -1
  167. package/dist/localization/package.nls.it.json +5 -1
  168. package/dist/localization/package.nls.ja.json +5 -1
  169. package/dist/localization/package.nls.ko.json +5 -1
  170. package/dist/localization/package.nls.pl.json +5 -1
  171. package/dist/localization/package.nls.pt-br.json +5 -1
  172. package/dist/localization/package.nls.qps-ploc.json +5 -1
  173. package/dist/localization/package.nls.ru.json +5 -1
  174. package/dist/localization/package.nls.tr.json +5 -1
  175. package/dist/localization/package.nls.zh-cn.json +5 -1
  176. package/dist/localization/package.nls.zh-tw.json +5 -1
  177. package/dist/parser/parseNodes.d.ts +9 -9
  178. package/dist/parser/parseNodes.js +20 -20
  179. package/dist/parser/parseNodes.js.map +1 -1
  180. package/dist/parser/parser.js +30 -30
  181. package/dist/parser/parser.js.map +1 -1
  182. package/dist/tests/checker.test.js +2 -2
  183. package/dist/tests/fourslash/signature.builtinDocstrings.fourslash.js +4 -21
  184. package/dist/tests/fourslash/signature.builtinDocstrings.fourslash.js.map +1 -1
  185. package/dist/tests/fourslash/signature.complicated.fourslash.js +1 -1
  186. package/dist/tests/fourslash/signature.complicated.fourslash.js.map +1 -1
  187. package/dist/tests/harness/fourslash/fourSlashParser.js +1 -1
  188. package/dist/tests/harness/fourslash/fourSlashParser.js.map +1 -1
  189. package/dist/tests/harness/fourslash/testStateUtils.js +2 -2
  190. package/dist/tests/harness/fourslash/testStateUtils.js.map +1 -1
  191. package/dist/tests/harness/vfs/filesystem.d.ts +0 -1
  192. package/dist/tests/harness/vfs/filesystem.js +0 -4
  193. package/dist/tests/harness/vfs/filesystem.js.map +1 -1
  194. package/dist/tests/importResolver.test.js +62 -15
  195. package/dist/tests/importResolver.test.js.map +1 -1
  196. package/dist/tests/lsp/languageServerTestUtils.js +1 -1
  197. package/dist/tests/lsp/languageServerTestUtils.js.map +1 -1
  198. package/dist/tests/typeEvaluator3.test.js +1 -1
  199. package/dist/tests/typeEvaluator4.test.js +9 -1
  200. package/dist/tests/typeEvaluator4.test.js.map +1 -1
  201. package/dist/tests/typeEvaluator5.test.js +8 -2
  202. package/dist/tests/typeEvaluator5.test.js.map +1 -1
  203. package/dist/tests/typeEvaluator6.test.js +72 -60
  204. package/dist/tests/typeEvaluator6.test.js.map +1 -1
  205. package/dist/tests/typeEvaluator7.test.js +2 -2
  206. package/dist/tests/typePrinter.test.js +13 -18
  207. package/dist/tests/typePrinter.test.js.map +1 -1
  208. package/dist/workspaceFactory.d.ts +3 -2
  209. package/dist/workspaceFactory.js +15 -2
  210. package/dist/workspaceFactory.js.map +1 -1
  211. package/package.json +1 -1
@@ -1,5 +1,5 @@
1
1
  import { Uri } from '../common/uri/uri';
2
- import { ArgumentNode, NameNode, ParameterCategory } from '../parser/parseNodes';
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
- typeParameters: TypeVarType[] | undefined;
54
+ typeParams: TypeVarType[] | undefined;
55
55
  usageVariance: Variance[] | undefined;
56
- typeArguments: Type[] | undefined;
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 UnknownTypeDetailsPriv {
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: UnknownTypeDetailsPriv;
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 ModuleTypeDetailsPriv {
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: ModuleTypeDetailsPriv;
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
- typeParameters: TypeVarType[];
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 TupleTypeArgument {
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
- typeArguments?: Type[] | undefined;
230
- typeGuardType?: Type | undefined;
231
- isStrictTypeGuard?: boolean;
229
+ typeArgs?: Type[] | undefined;
232
230
  isEmptyContainer?: boolean | undefined;
233
- tupleTypeArguments?: TupleTypeArgument[] | undefined;
231
+ tupleTypeArgs?: TupleTypeArg[] | undefined;
234
232
  isUnpacked?: boolean | undefined;
235
- isTypeArgumentExplicit?: boolean | undefined;
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 cloneForSpecialization(classType: ClassType, typeArguments: Type[] | undefined, isTypeArgumentExplicit: boolean, includeSubclasses?: boolean, tupleTypeArguments?: TupleTypeArgument[], isEmptyContainer?: boolean): ClassType;
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 getTypeParameters(classType: ClassType): TypeVarType[];
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: ParameterCategory;
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: ParameterCategory, type: Type, flags?: FunctionParamFlags, name?: string, defaultType?: Type): FunctionParam;
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
- typeParameters: TypeVarType[];
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 cloneForSpecialization(type: FunctionType, specializedTypes: SpecializedFunctionTypes, specializedInferredReturnType: Type | undefined): FunctionType;
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, typeParameters: TypeVarType[]): FunctionType;
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): TypeVarType | undefined;
419
- function addParamSpecVariadics(type: FunctionType, paramSpec: TypeVarType): void;
420
- function addDefaultParameters(type: FunctionType, useUnknown?: boolean): void;
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 getDefaultParameters(useUnknown?: boolean): FunctionParam[];
423
- function hasDefaultParameters(functionType: FunctionType): boolean;
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 isDefaultParameterCheckDisabled(type: FunctionType): boolean;
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 getEffectiveParameterType(type: FunctionType, index: number): Type;
445
- function getEffectiveParameterDefaultArgType(type: FunctionType, index: number): Type | undefined;
446
- function addParameter(type: FunctionType, param: FunctionParam): void;
447
- function addPositionOnlyParameterSeparator(type: FunctionType): void;
448
- function addKeywordOnlyParameterSeparator(type: FunctionType): void;
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 OverloadedFunctionTypeDetailsPriv {
448
+ export interface OverloadedFunctionDetailsPriv {
452
449
  overloads: FunctionType[];
453
450
  }
454
451
  export interface OverloadedFunctionType extends TypeBase<TypeCategory.OverloadedFunction> {
455
- priv: OverloadedFunctionTypeDetailsPriv;
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 NeverTypeDetailsPriv {
460
+ export interface NeverDetailsPriv {
464
461
  isNoReturn: boolean;
465
462
  }
466
463
  export interface NeverType extends TypeBase<TypeCategory.Never> {
467
- priv: NeverTypeDetailsPriv;
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 AnyTypeDetailsPriv {
471
+ export interface AnyDetailsPriv {
475
472
  isEllipsis: boolean;
476
473
  }
477
474
  export interface AnyType extends TypeBase<TypeCategory.Any> {
478
- priv: AnyTypeDetailsPriv;
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 UnionTypeDetailsPriv {
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: UnionTypeDetailsPriv;
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
- typeParameters: TypeVarType[] | undefined;
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 TypeVarTypeDetailsPriv {
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: TypeVarTypeDetailsPriv;
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, isParamSpec?: boolean): TypeVarType;
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: TypeVarType, isInUnion?: boolean): TypeVarType;
576
- function cloneForPacked(type: TypeVarType): 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: TypeVarType, access: ParamSpecAccess | undefined): TypeVarType;
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 isVariadicTypeVar(type: Type): type is TypeVarType;
605
- export declare function isUnpackedVariadicTypeVar(type: Type): boolean;
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;