@artel/artc 0.6.25191

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 (281) hide show
  1. package/build/Cli.js +20 -0
  2. package/build/api/Api.js +664 -0
  3. package/build/api/ApiNodeJS.js +20 -0
  4. package/build/api/ApiServices.js +12847 -0
  5. package/build/chunk-BQHCAH6D.js +588 -0
  6. package/build/chunk-O2JKESUU.js +63219 -0
  7. package/build/chunk-QRBDQKYM.js +94 -0
  8. package/build/types/Cli.d.ts +3 -0
  9. package/build/types/analysis/AccessedMethod.d.ts +53 -0
  10. package/build/types/analysis/AnalyzedTranslationPackage.d.ts +191 -0
  11. package/build/types/analysis/Analyzer.d.ts +665 -0
  12. package/build/types/analysis/AutotypeCallExpressionMeaning.d.ts +25 -0
  13. package/build/types/analysis/BaseExpressionMeaning.d.ts +47 -0
  14. package/build/types/analysis/BuiltInOperators.d.ts +14 -0
  15. package/build/types/analysis/CallArgumentToParameterMatchResult.d.ts +30 -0
  16. package/build/types/analysis/CallArgumentsToParametersMatcher.d.ts +44 -0
  17. package/build/types/analysis/CallExpressionMeaning.d.ts +39 -0
  18. package/build/types/analysis/ConstructorOverloadResolver.d.ts +34 -0
  19. package/build/types/analysis/DeclarationsUsageCounter.d.ts +18 -0
  20. package/build/types/analysis/DereferenceExpressionMeaning.d.ts +23 -0
  21. package/build/types/analysis/DiagnosticCollector.d.ts +68 -0
  22. package/build/types/analysis/EntityLocalizationHelper.d.ts +15 -0
  23. package/build/types/analysis/FindModifier.d.ts +4 -0
  24. package/build/types/analysis/FoundDeclaration.d.ts +19 -0
  25. package/build/types/analysis/IdentifierExpressionMeaning.d.ts +98 -0
  26. package/build/types/analysis/ImportedPackageNameTree.d.ts +22 -0
  27. package/build/types/analysis/IndexedAccessExpressionMeaning.d.ts +26 -0
  28. package/build/types/analysis/IndexerAccess.d.ts +10 -0
  29. package/build/types/analysis/Localization.d.ts +54 -0
  30. package/build/types/analysis/LocalizationContext.d.ts +15 -0
  31. package/build/types/analysis/Lookup.d.ts +23 -0
  32. package/build/types/analysis/NamedTypeResolver.d.ts +42 -0
  33. package/build/types/analysis/NamedTypeSpecifierResolver.d.ts +20 -0
  34. package/build/types/analysis/NodeTypeUtils.d.ts +28 -0
  35. package/build/types/analysis/ObjectExpressionMeaning.d.ts +38 -0
  36. package/build/types/analysis/OperationOverloadResolver.d.ts +19 -0
  37. package/build/types/analysis/OverloadResolver.d.ts +12 -0
  38. package/build/types/analysis/PackageMemberLookup.d.ts +15 -0
  39. package/build/types/analysis/PrefixUnaryOperatorResolver.d.ts +27 -0
  40. package/build/types/analysis/PropertyAccessExpressionMeaning.d.ts +100 -0
  41. package/build/types/analysis/Scope.d.ts +309 -0
  42. package/build/types/analysis/SemanticContext.d.ts +320 -0
  43. package/build/types/analysis/SemanticContextBuilder.d.ts +54 -0
  44. package/build/types/analysis/SourceFileMembers.d.ts +92 -0
  45. package/build/types/analysis/SourcePackageDependencyGraph.d.ts +41 -0
  46. package/build/types/analysis/SourcePackageMembersCreator.d.ts +6 -0
  47. package/build/types/analysis/StatementBlockScopeBuilder.d.ts +22 -0
  48. package/build/types/analysis/SubstitutedMethod.d.ts +49 -0
  49. package/build/types/analysis/TagMeaning.d.ts +26 -0
  50. package/build/types/analysis/Tags.d.ts +29 -0
  51. package/build/types/analysis/TargetTypeHint.d.ts +5 -0
  52. package/build/types/analysis/TypeInferrer.d.ts +9 -0
  53. package/build/types/analysis/TypeMemberLookup.d.ts +27 -0
  54. package/build/types/analysis/TypeOverloadResolver.d.ts +7 -0
  55. package/build/types/analysis/UserDefinableBinaryOperatorResolver.d.ts +37 -0
  56. package/build/types/analysis/Utils.d.ts +17 -0
  57. package/build/types/analysis/VariableAccess.d.ts +10 -0
  58. package/build/types/analysis/VariantLookup.d.ts +20 -0
  59. package/build/types/analysis/Visitor.d.ts +7 -0
  60. package/build/types/analysis/WellKnownDeclarations.d.ts +34 -0
  61. package/build/types/analysis/index.d.ts +8 -0
  62. package/build/types/api/Api.d.ts +59 -0
  63. package/build/types/api/ApiNodeJS.d.ts +5 -0
  64. package/build/types/api/ApiServices.d.ts +3 -0
  65. package/build/types/common/AccessKind.d.ts +4 -0
  66. package/build/types/common/ArtelFileCheck.d.ts +2 -0
  67. package/build/types/common/Cached.d.ts +6 -0
  68. package/build/types/common/CancellationToken.d.ts +13 -0
  69. package/build/types/common/Constants.d.ts +19 -0
  70. package/build/types/common/Debug.d.ts +10 -0
  71. package/build/types/common/Delayed.d.ts +7 -0
  72. package/build/types/common/ErrorHandlingStrategy.d.ts +3 -0
  73. package/build/types/common/FormatString.d.ts +5 -0
  74. package/build/types/common/HelperPhrases.d.ts +11 -0
  75. package/build/types/common/Interner.d.ts +4 -0
  76. package/build/types/common/L10nConfig.d.ts +1 -0
  77. package/build/types/common/Lazy.d.ts +9 -0
  78. package/build/types/common/LocalizationHelper.d.ts +10 -0
  79. package/build/types/common/Logger.d.ts +10 -0
  80. package/build/types/common/Name.d.ts +83 -0
  81. package/build/types/common/NameFormatConversion.d.ts +12 -0
  82. package/build/types/common/NonEmptyArray.d.ts +8 -0
  83. package/build/types/common/Option.d.ts +28 -0
  84. package/build/types/common/PackageDialect.d.ts +5 -0
  85. package/build/types/common/PackageLocale.d.ts +15 -0
  86. package/build/types/common/PackageLocaleGuard.d.ts +1 -0
  87. package/build/types/common/Path.d.ts +8 -0
  88. package/build/types/common/PerformanceMeasurement.d.ts +20 -0
  89. package/build/types/common/Query.d.ts +39 -0
  90. package/build/types/common/Range.d.ts +10 -0
  91. package/build/types/common/Result.d.ts +13 -0
  92. package/build/types/common/SearchName.d.ts +13 -0
  93. package/build/types/common/ThrottledCancellationToken.d.ts +17 -0
  94. package/build/types/common/TreeQuery.d.ts +53 -0
  95. package/build/types/common/TreeTraversal.d.ts +13 -0
  96. package/build/types/common/Uri.d.ts +28 -0
  97. package/build/types/common/UriTree.d.ts +41 -0
  98. package/build/types/common/UserLocale.d.ts +2 -0
  99. package/build/types/common/WithDiagnostics.d.ts +19 -0
  100. package/build/types/common/YieldExecution.d.ts +1 -0
  101. package/build/types/common/index.d.ts +32 -0
  102. package/build/types/diagnostic/Diagnostic.d.ts +21 -0
  103. package/build/types/diagnostic/DiagnosticCode.d.ts +146 -0
  104. package/build/types/diagnostic/DiagnosticData.d.ts +20 -0
  105. package/build/types/diagnostic/DiagnosticFormatter.d.ts +8 -0
  106. package/build/types/diagnostic/RangeDiagnostic.d.ts +19 -0
  107. package/build/types/emitter/BlockStatementTransformationResult.d.ts +10 -0
  108. package/build/types/emitter/CustomModuleLoader.d.ts +1 -0
  109. package/build/types/emitter/DebugStack.d.ts +10 -0
  110. package/build/types/emitter/Emitter.d.ts +61 -0
  111. package/build/types/emitter/EmitterContext.d.ts +342 -0
  112. package/build/types/emitter/EmitterGeneratedDeclarationKind.d.ts +36 -0
  113. package/build/types/emitter/EmitterPackage.d.ts +60 -0
  114. package/build/types/emitter/EntityNameProviders.d.ts +33 -0
  115. package/build/types/emitter/ExpressionTransformationResult.d.ts +17 -0
  116. package/build/types/emitter/GeneralLowering.d.ts +72 -0
  117. package/build/types/emitter/Internal.d.ts +10 -0
  118. package/build/types/emitter/IntrinsicEntities.d.ts +118 -0
  119. package/build/types/emitter/IrBuilder.d.ts +108 -0
  120. package/build/types/emitter/IrToJs.d.ts +113 -0
  121. package/build/types/emitter/JavaScriptName.d.ts +1 -0
  122. package/build/types/emitter/PackageMemberDeclarationTransformationResult.d.ts +17 -0
  123. package/build/types/emitter/SimpleTransformationResult.d.ts +14 -0
  124. package/build/types/emitter/StatementTransformationResult.d.ts +16 -0
  125. package/build/types/emitter/StructuredTypeMemberDeclarationTransformationResult.d.ts +13 -0
  126. package/build/types/emitter/TransformationContinuationAction.d.ts +4 -0
  127. package/build/types/emitter/Transformer.d.ts +282 -0
  128. package/build/types/emitter/TypeAccessExpressionTransformationResult.d.ts +12 -0
  129. package/build/types/emitter/error-boundary.d.ts +10 -0
  130. package/build/types/emitter/index.d.ts +1 -0
  131. package/build/types/emitter/ir/AccessedEntities.d.ts +19 -0
  132. package/build/types/emitter/ir/LoweringOptions.d.ts +34 -0
  133. package/build/types/emitter/ir/Nodes.d.ts +1585 -0
  134. package/build/types/emitter/ir/SourceLocation.d.ts +10 -0
  135. package/build/types/emitter/ir/index.d.ts +5 -0
  136. package/build/types/emitter/ir/types.d.ts +10 -0
  137. package/build/types/entities/AliasTypeEntity.d.ts +84 -0
  138. package/build/types/entities/BinaryOperatorEntity.d.ts +48 -0
  139. package/build/types/entities/ConstructorEntity.d.ts +99 -0
  140. package/build/types/entities/DereferenceOperatorEntity.d.ts +40 -0
  141. package/build/types/entities/DestructorEntity.d.ts +31 -0
  142. package/build/types/entities/EntityHiding.d.ts +27 -0
  143. package/build/types/entities/EntityNaming.d.ts +12 -0
  144. package/build/types/entities/GetterEntity.d.ts +86 -0
  145. package/build/types/entities/IndexerEntity.d.ts +51 -0
  146. package/build/types/entities/MethodEntity.d.ts +174 -0
  147. package/build/types/entities/MethodTypeEntity.d.ts +98 -0
  148. package/build/types/entities/PackageAliasEntity.d.ts +30 -0
  149. package/build/types/entities/PackageEntity.d.ts +56 -0
  150. package/build/types/entities/PackageMembers.d.ts +98 -0
  151. package/build/types/entities/SetterEntity.d.ts +78 -0
  152. package/build/types/entities/StructuredTypeEntity.d.ts +199 -0
  153. package/build/types/entities/SubstitutionApplicationMode.d.ts +4 -0
  154. package/build/types/entities/TypeEntityMembers.d.ts +36 -0
  155. package/build/types/entities/TypeExtensionEntity.d.ts +33 -0
  156. package/build/types/entities/TypeMemberContainer.d.ts +23 -0
  157. package/build/types/entities/TypeParameterEntity.d.ts +94 -0
  158. package/build/types/entities/UnaryOperatorEntity.d.ts +33 -0
  159. package/build/types/entities/VariableEntity.d.ts +423 -0
  160. package/build/types/entities/VariantEntity.d.ts +31 -0
  161. package/build/types/entities/VariantTypeEntity.d.ts +83 -0
  162. package/build/types/entities/Variants.d.ts +10 -0
  163. package/build/types/entities/index.d.ts +87 -0
  164. package/build/types/executor/CommandLineCompiler.d.ts +8 -0
  165. package/build/types/executor/Compiler.d.ts +15 -0
  166. package/build/types/executor/FileSystemUri.d.ts +5 -0
  167. package/build/types/executor/NodeCompiler.d.ts +39 -0
  168. package/build/types/executor/PhysicalFileSystem.d.ts +12 -0
  169. package/build/types/executor/PhysicalTypeScriptLibrariesProvider.d.ts +12 -0
  170. package/build/types/generated/BuiltInSystemPackages.d.ts +3 -0
  171. package/build/types/old/Executor.d.ts +14 -0
  172. package/build/types/old/JavaScriptEmitter.d.ts +1 -0
  173. package/build/types/old/JavaScriptEmittingVisitor.d.ts +1 -0
  174. package/build/types/old/NzonParser.d.ts +1 -0
  175. package/build/types/old/NzonScanner.d.ts +1 -0
  176. package/build/types/old/NzonSyntax.d.ts +1 -0
  177. package/build/types/old/RemoteWorkspaceFileSystem.d.ts +1 -0
  178. package/build/types/parser/CharacterCodes.d.ts +21 -0
  179. package/build/types/parser/ConvertTokenKind.d.ts +3 -0
  180. package/build/types/parser/KeywordDictionary.d.ts +12 -0
  181. package/build/types/parser/ParseNumber.d.ts +5 -0
  182. package/build/types/parser/Parser.d.ts +7 -0
  183. package/build/types/parser/ParserDiagnostic.d.ts +7 -0
  184. package/build/types/parser/ReservedIdentifierDictionary.d.ts +12 -0
  185. package/build/types/parser/Scanner.d.ts +60 -0
  186. package/build/types/parser/TokenKind.d.ts +73 -0
  187. package/build/types/parser/UnescapeText.d.ts +2 -0
  188. package/build/types/project/Compilation.d.ts +21 -0
  189. package/build/types/project/CompilationLoader.d.ts +104 -0
  190. package/build/types/project/FileSystemTree.d.ts +70 -0
  191. package/build/types/project/PackageConfigurationSerializer.d.ts +1 -0
  192. package/build/types/project/Position.d.ts +5 -0
  193. package/build/types/project/SourceFile.d.ts +21 -0
  194. package/build/types/project/SourcePackage.d.ts +151 -0
  195. package/build/types/project/TextFile.d.ts +11 -0
  196. package/build/types/project/configuration/BuildPackageApi.d.ts +75 -0
  197. package/build/types/project/configuration/ConfigurationConverter.d.ts +25 -0
  198. package/build/types/project/configuration/ConfigurationFileParser.d.ts +26 -0
  199. package/build/types/project/configuration/PackageConfigurationInterpreter.d.ts +27 -0
  200. package/build/types/project/configuration/types/PackageConfigurationEn.d.ts +90 -0
  201. package/build/types/project/configuration/types/PackageConfigurationRu.d.ts +91 -0
  202. package/build/types/project/index.d.ts +12 -0
  203. package/build/types/services/AddPropertyAssignmentService.d.ts +15 -0
  204. package/build/types/services/CompletionService.d.ts +95 -0
  205. package/build/types/services/CustomCommand.d.ts +120 -0
  206. package/build/types/services/DefinitionService.d.ts +19 -0
  207. package/build/types/services/DisplayService.d.ts +830 -0
  208. package/build/types/services/DocumentHighlightsService.d.ts +18 -0
  209. package/build/types/services/EvaluatableExpressionService.d.ts +15 -0
  210. package/build/types/services/FileSystemTreeDisplayService.d.ts +7 -0
  211. package/build/types/services/HoverService.d.ts +17 -0
  212. package/build/types/services/LanguageServer.d.ts +125 -0
  213. package/build/types/services/NodeSemanticInfo.d.ts +132 -0
  214. package/build/types/services/ProjectItemsService.d.ts +6 -0
  215. package/build/types/services/ReferencesService.d.ts +30 -0
  216. package/build/types/services/RenameService.d.ts +16 -0
  217. package/build/types/services/SelectionRangeService.d.ts +12 -0
  218. package/build/types/services/SemanticTokensService.d.ts +40 -0
  219. package/build/types/services/SourceFileItemsService.d.ts +42 -0
  220. package/build/types/services/TranslationService.d.ts +23 -0
  221. package/build/types/services/TreeUtils.d.ts +58 -0
  222. package/build/types/services/TypeDefinitionService.d.ts +9 -0
  223. package/build/types/services/Types.d.ts +22 -0
  224. package/build/types/services/Utils.d.ts +5 -0
  225. package/build/types/services/signature-help/SignatureHelpService.d.ts +17 -0
  226. package/build/types/services/signature-help/SignatureWithValueParameters.d.ts +114 -0
  227. package/build/types/services/signature-help/TypeParameterSignatureHelpProvider.d.ts +20 -0
  228. package/build/types/services/signature-help/ValueParametersSignatureHelpProvider.d.ts +15 -0
  229. package/build/types/services/signature-help/utils.d.ts +9 -0
  230. package/build/types/services/source-generation/EntityToSyntax.d.ts +47 -0
  231. package/build/types/services/source-generation/SourceGenerationService.d.ts +22 -0
  232. package/build/types/services/workspace/ClientTrackedSourceFiles.d.ts +41 -0
  233. package/build/types/services/workspace/CompilationController.d.ts +108 -0
  234. package/build/types/services/workspace/FileSystemTreeProviderBasedOnWatchedFileSystem.d.ts +61 -0
  235. package/build/types/services/workspace/ManuallyUpdatedFileSystemTreeProvider.d.ts +21 -0
  236. package/build/types/services/workspace/Workspace.d.ts +59 -0
  237. package/build/types/services/workspace/WorkspaceFileSystem.d.ts +5 -0
  238. package/build/types/services/workspace/WorkspaceFiles.d.ts +35 -0
  239. package/build/types/services/workspace/index.d.ts +7 -0
  240. package/build/types/tree/KeywordKind.d.ts +64 -0
  241. package/build/types/tree/NodeKind.d.ts +163 -0
  242. package/build/types/tree/TokenKind.d.ts +132 -0
  243. package/build/types/tree/TriviaKind.d.ts +7 -0
  244. package/build/types/tree/green/BaseNode.d.ts +12 -0
  245. package/build/types/tree/green/Nodes.d.ts +2235 -0
  246. package/build/types/tree/green/SyntaxFactory.d.ts +67 -0
  247. package/build/types/tree/green/SyntaxToCode.d.ts +116 -0
  248. package/build/types/tree/green/Token.d.ts +37 -0
  249. package/build/types/tree/green/Utils.d.ts +2 -0
  250. package/build/types/tree/green/index.d.ts +7 -0
  251. package/build/types/tree/index.d.ts +4 -0
  252. package/build/types/tree/red/BaseNode.d.ts +15 -0
  253. package/build/types/tree/red/Internal.d.ts +2 -0
  254. package/build/types/tree/red/NodePath.d.ts +10 -0
  255. package/build/types/tree/red/Nodes.d.ts +2237 -0
  256. package/build/types/tree/red/Token.d.ts +29 -0
  257. package/build/types/tree/red/Utils.d.ts +6 -0
  258. package/build/types/tree/red/index.d.ts +6 -0
  259. package/build/types/ts-interop/Entities.d.ts +634 -0
  260. package/build/types/ts-interop/TsInteropContext.d.ts +179 -0
  261. package/build/types/ts-interop/TsLibrariesProvider.d.ts +12 -0
  262. package/build/types/ts-interop/TsPackageContents.d.ts +64 -0
  263. package/build/types/ts-interop/TsPackageMembersCreator.d.ts +69 -0
  264. package/build/types/ts-interop/TsProgramLoader.d.ts +38 -0
  265. package/build/types/ts-interop/TsTypeMembersCreator.d.ts +45 -0
  266. package/build/types/ts-interop/Utils.d.ts +43 -0
  267. package/build/types/types/AliasType.d.ts +20 -0
  268. package/build/types/types/Internal.d.ts +1 -0
  269. package/build/types/types/MethodType.d.ts +23 -0
  270. package/build/types/types/ParameterType.d.ts +19 -0
  271. package/build/types/types/StandardTypes.d.ts +42 -0
  272. package/build/types/types/StructuredType.d.ts +25 -0
  273. package/build/types/types/Substitutions.d.ts +18 -0
  274. package/build/types/types/Type.d.ts +16 -0
  275. package/build/types/types/TypeFactory.d.ts +15 -0
  276. package/build/types/types/TypeMembers.d.ts +134 -0
  277. package/build/types/types/UnionType.d.ts +20 -0
  278. package/build/types/types/UnresolvedType.d.ts +16 -0
  279. package/build/types/types/VariantType.d.ts +19 -0
  280. package/build/types/types/index.d.ts +12 -0
  281. package/package.json +73 -0
@@ -0,0 +1,179 @@
1
+ import ts from 'typescript';
2
+ import { Analyzer } from '../analysis/index.js';
3
+ import { Name, PackageLocale } from '../common/index.js';
4
+ import { EntityHidingLevel, EntityKind, InterfacePackageEntityInfo, TypeEntity, TypeEntityWithMembers } from '../entities/index.js';
5
+ import { PackageEntity, PackageEntityDefinition } from '../entities/PackageEntity.js';
6
+ import { OriginalPackageMembers } from '../entities/PackageMembers.js';
7
+ import * as types from '../types/index.js';
8
+ import { SourcePackageLoadedFromDtsEntity, TsPackageEntity } from './Entities.js';
9
+ import { TsPackageContents } from './TsPackageContents.js';
10
+ import { TsPackageMembersCreationResult } from './TsPackageMembersCreator.js';
11
+ import { TsTypeMembersCreationResult } from './TsTypeMembersCreator.js';
12
+ import { RequiredJsLibraryConfig } from './Utils.js';
13
+ import { Tag } from '../analysis/Tags.js';
14
+ import { JavaScriptImplementationConfig, PackageName, PlatformKind, ProgramPackage } from '../project/index.js';
15
+ export declare class TsInteropContext {
16
+ readonly analyzer: Analyzer;
17
+ readonly tsProgramState: TsProgramState;
18
+ readonly type: TypeContext;
19
+ readonly packageForSymbolsWithUnknownOrigin: TsPackageEntityForSymbolsWithUnknownOrigin;
20
+ private readonly _config;
21
+ private readonly _packagesCreationResult;
22
+ private readonly _defaultExportTag;
23
+ get tsProgram(): ts.Program;
24
+ get tsChecker(): ts.TypeChecker;
25
+ get packageContentsByEntity(): ReadonlyMap<PackageEntity, TsPackageContents>;
26
+ constructor(analyzer: Analyzer, config: TsInteropConfig);
27
+ getPackageEntities(): readonly TsPackageEntity[];
28
+ getEntityOfSourcePackageLoadedFromDts(sourcePackage: ProgramPackage): SourcePackageLoadedFromDtsEntity | undefined;
29
+ isSignatureAsync(node: ts.SignatureDeclaration): boolean;
30
+ getSignatureReturnType(node: ts.SignatureDeclaration, replaceWithPromisedTypeIfPromise: boolean): types.Type;
31
+ getTypeMemberHiding(node: ts.Declaration | undefined, containingType: TypeEntity): EntityHidingLevel | undefined;
32
+ onPackageMembersCreated(pkg: PackageEntity, creationResult: TsPackageMembersCreationResult): void;
33
+ onTypeMembersCreated(type: TypeEntityWithMembers, creationResult: TsTypeMembersCreationResult): void;
34
+ ifTypeCanBeExpressedByMethodTypeThenCallSignature(symbol: ts.Symbol): ts.Symbol | undefined;
35
+ getName(original: string, ownerKind: 'type' | 'variable' | 'method'): Name;
36
+ createDefaultExportTag(): Tag;
37
+ private getPackagesCreationResult;
38
+ private createPackages;
39
+ private collectSubModulesInFilesRecursively;
40
+ private collectSubModulesOfModuleRecursively;
41
+ private collectGlobalLibraryFiles;
42
+ private collectReferencedFilePathsRecursively;
43
+ }
44
+ export declare class TsInteropConfig {
45
+ readonly programState: TsProgramState;
46
+ readonly implementationByConfig: ReadonlyMap<RequiredJsLibraryConfig, ResolvedJavaScriptImplementation>;
47
+ readonly namespacesOrSubModulesByOwningImplementation: ReadonlyMap<ResolvedJavaScriptImplementation, readonly NamespaceOrSubmodulePackageInfo[]>;
48
+ constructor(programState: TsProgramState, implementationByConfig: ReadonlyMap<RequiredJsLibraryConfig, ResolvedJavaScriptImplementation>, namespacesOrSubModulesByOwningImplementation: ReadonlyMap<ResolvedJavaScriptImplementation, readonly NamespaceOrSubmodulePackageInfo[]>);
49
+ }
50
+ export interface NamespaceOrSubmodulePackageInfo {
51
+ implementationConfig: JavaScriptImplementationConfig.NamespaceOfSubModule;
52
+ requiredLibraryConfig: RequiredJsLibraryConfig;
53
+ }
54
+ export type ResolvedJavaScriptImplementation = ResolvedJavaScriptImplementation.Globals | ResolvedJavaScriptImplementation.Module;
55
+ export declare namespace ResolvedJavaScriptImplementation {
56
+ class Globals {
57
+ readonly rootFiles: readonly ts.SourceFile[];
58
+ readonly isStandardLibrary: boolean;
59
+ readonly kind = "globals";
60
+ constructor(rootFiles: readonly ts.SourceFile[], isStandardLibrary: boolean);
61
+ }
62
+ class Module {
63
+ /**
64
+ * (moduleSymbol.flags & ts.SymbolFlags.ValueModule) !== 0
65
+ */
66
+ readonly moduleSymbol: ts.Symbol;
67
+ readonly kind = "module";
68
+ constructor(
69
+ /**
70
+ * (moduleSymbol.flags & ts.SymbolFlags.ValueModule) !== 0
71
+ */
72
+ moduleSymbol: ts.Symbol);
73
+ }
74
+ }
75
+ /**
76
+ * Данный класс написан исходя из того, что сущности для символов типа всегда будут
77
+ * получаться после того, как были получены сущности, в которых они объявлены.
78
+ * Например, для класса `class MyClass<T> { }` запрос на получение сущности для параметра типа `T` не будет
79
+ * предшествовать запросу на получение сущности для класса `MyClass`.
80
+ *
81
+ * Такое предположение необходимо, поскольку сущности параметра типа требуют информацию о
82
+ * сущности, в которой они объявлены (containingEntity), а API компилятора TS не позволяет получить
83
+ * родительский символ. Поэтому параметры создаются не лениво, а в момент создания содержащий их сущностей.
84
+ */
85
+ declare class TypeContext {
86
+ private readonly _tsctx;
87
+ private readonly _typeEntities;
88
+ private readonly _packagesWithCreatedMembers;
89
+ private readonly _esSymbolType;
90
+ private get checker();
91
+ private get standardTypes();
92
+ private get refObjectOrNone();
93
+ private get esSymbolType();
94
+ private get analyzer();
95
+ constructor(tsctx: TsInteropContext);
96
+ ofTypeNode(node: ts.TypeNode | undefined): types.Type;
97
+ ofTsType(type: ts.Type, ignoreAlias?: boolean): types.Type;
98
+ getUnderlyingTypeOfEnum(symbol: ts.Symbol): types.Type;
99
+ onPackageMembersCreated(_pkg: PackageEntity, creationResult: TsPackageMembersCreationResult): void;
100
+ onTypeMembersCreated(_type: TypeEntityWithMembers, creationResult: TsTypeMembersCreationResult): void;
101
+ private ofEnumType;
102
+ private ofEnumLiteralType;
103
+ private ofTypeAlias;
104
+ private ofObjectType;
105
+ private ofUnionType;
106
+ private ofTypeParameter;
107
+ private createTypeArguments;
108
+ private createTypeFromEntity;
109
+ /**
110
+ * @param symbol (symbol.flags & ts.SymbolFlags.Type) !== 0
111
+ */
112
+ private getEntityOfTypeSymbol;
113
+ private isSymbolSourceFileOrModuleChild;
114
+ /**
115
+ * Данный метод не нужно вызывать напрямую. Вместо этого необходимо вызвать метод `getEntityOfTypeSymbol`.
116
+ *
117
+ * @param symbol Символ, объявленный в корне исходного файла или в модуле.
118
+ */
119
+ private getEntityOfGlobalTypeSymbol;
120
+ private ensurePackageMembersAreCreated;
121
+ private addEntitiesFromPackageMembersCreationResult;
122
+ /**
123
+ * Данный метод не нужно вызывать напрямую. Вместо этого необходимо вызвать метод `getEntityOfTypeSymbol`.
124
+ *
125
+ * @param symbol (symbol.flags & ts.SymbolFlags.TypeLiteral) !== 0
126
+ */
127
+ private getEntityOfTypeLiteralSymbol;
128
+ private getContainingPackage;
129
+ private getContainingGlobalDeclaration;
130
+ }
131
+ export declare class TsUtils {
132
+ static isClassOrInterfaceType(type: ts.Type): type is ts.InterfaceType;
133
+ static isObjectType(type: ts.Type): type is ts.ObjectType;
134
+ static isTypeReference(type: ts.Type): type is ts.TypeReference;
135
+ static isSourceFileOrModuleDeclaration(node: ts.Node): node is ts.SourceFile | ts.ModuleDeclaration;
136
+ static isClassOrInterfaceDeclaration(node: ts.Node): node is ts.ClassDeclaration | ts.InterfaceDeclaration;
137
+ static isInterfaceAndVariableMergeSymbol(symbol: ts.Symbol): boolean;
138
+ static isNamespaceDeclaration(node: ts.Node): boolean;
139
+ }
140
+ export declare class TsProgramState {
141
+ readonly program: ts.Program;
142
+ readonly arraySymbol: ts.Symbol | undefined;
143
+ readonly readonlyArraySymbol: ts.Symbol | undefined;
144
+ readonly mapSymbol: ts.Symbol | undefined;
145
+ readonly readonlyMapSymbol: ts.Symbol | undefined;
146
+ readonly setSymbol: ts.Symbol | undefined;
147
+ readonly readonlySetSymbol: ts.Symbol | undefined;
148
+ readonly esSymbolSymbol: ts.Symbol | undefined;
149
+ private readonly _referencedFilesByFileWithReference;
150
+ get referencedFilesByFileWithReference(): ReadonlyMap<ts.Path, readonly TsFileReferenceInfo[]>;
151
+ constructor(program: ts.Program);
152
+ private createReferencedFilesByFileWithReference;
153
+ }
154
+ type TsFileReferenceInfo = {
155
+ path: ts.Path;
156
+ referenceKind: TsFileReferenceKind;
157
+ };
158
+ type TsFileReferenceKind = 'lib' | 'path-or-type';
159
+ /**
160
+ * Данный пакет устанавливается в качестве `containingPackage` для сущностей, созданных из символов,
161
+ * для которых не удалось определить, в каком пакете они находятся.
162
+ *
163
+ * Такое может произойти в следующих случаях:
164
+ * - объявление не экспортируется, но используется в другом экспортируемом объявлении
165
+ * (напр. не экспортируемый тип указан как тип параметра экспортируемой функции.)
166
+ * - объявление экспортируется, используется в другом экспортируемом объявлении,
167
+ * но не содержится в таблице экспорта ни одного загруженного модуля TS
168
+ */
169
+ declare class TsPackageEntityForSymbolsWithUnknownOrigin implements PackageEntity {
170
+ readonly kind = EntityKind.Package;
171
+ getName(): PackageName;
172
+ getLocale(): PackageLocale;
173
+ getMembers(): OriginalPackageMembers;
174
+ isInterface(): InterfacePackageEntityInfo | undefined;
175
+ getImplementedInterfacePackage(): PackageEntity | undefined;
176
+ getSupportedPlatforms(): readonly PlatformKind[];
177
+ getDefinition(): PackageEntityDefinition;
178
+ }
179
+ export {};
@@ -0,0 +1,12 @@
1
+ import { Uri } from '../common/index.js';
2
+ export interface TypeScriptLibrariesProvider {
3
+ /**
4
+ * Возвращает uri папки, содержащей файлы стандартной библиотеки TypeScript (файл `lib.es2023.d.ts` и др.).
5
+ * Обычно располагается в папке `node_modules/typescript/lib`.
6
+ */
7
+ getStandardLibraryUri(): Uri;
8
+ readFileSync(uri: Uri): string | undefined;
9
+ fileExistsSync(uri: Uri): boolean;
10
+ directoryExistsSync(uri: Uri): boolean;
11
+ isCaseSensitive(): boolean;
12
+ }
@@ -0,0 +1,64 @@
1
+ import ts from 'typescript';
2
+ import { OriginalPackageMembers } from '../entities/PackageMembers.js';
3
+ import { PackageEntity } from '../entities/index.js';
4
+ import { ProgramPackage } from '../project/SourcePackage.js';
5
+ import { TsInteropContext } from './TsInteropContext.js';
6
+ import { TsPackageMembersCreationResult } from './TsPackageMembersCreator.js';
7
+ export declare class TsPackageContents {
8
+ private readonly _tsctx;
9
+ private readonly _symbols;
10
+ private readonly _packageEntity;
11
+ private readonly _sourcePackageToMergeWith;
12
+ readonly kind = "module";
13
+ private readonly _membersCreationResult;
14
+ private readonly _tsSymbols;
15
+ constructor(_tsctx: TsInteropContext, _symbols: TsPackageSymbols, _packageEntity: PackageEntity, _sourcePackageToMergeWith: ProgramPackage | undefined);
16
+ getMembers(): OriginalPackageMembers;
17
+ containsGlobalSymbol(symbol: ts.Symbol): boolean;
18
+ getMembersCreationResult(): TsPackageMembersCreationResult;
19
+ }
20
+ export type TsPackageSymbols = TsPackageSymbols.Module | TsPackageSymbols.GlobalLibrary;
21
+ export declare namespace TsPackageSymbols {
22
+ /**
23
+ * Модулем является исходный файл, содержащий директивы экспорта, или объявление модуля (declare module 'module-name').
24
+ * https://www.typescriptlang.org/docs/handbook/declaration-files/library-structures.html#modular-libraries
25
+ */
26
+ export class Module implements ITsPackageSymbols {
27
+ private readonly _tsctx;
28
+ /**
29
+ * (symbol.flags & ts.SymbolFlags.ValueModule) !== 0
30
+ */
31
+ private readonly _symbol;
32
+ readonly kind = "module";
33
+ private readonly _items;
34
+ constructor(_tsctx: TsInteropContext,
35
+ /**
36
+ * (symbol.flags & ts.SymbolFlags.ValueModule) !== 0
37
+ */
38
+ _symbol: ts.Symbol);
39
+ getItems(): readonly SymbolFromTs[];
40
+ }
41
+ /**
42
+ * Библиотека, представленная одним или несколькими исходными файлами, содержащими объявления, доступные в глобальной
43
+ * области видимости. В TS такие библиотеки не нужно подключать с помощью директивы импорта.
44
+ * Все стандартные библиотеки TS (ES, DOM и др.) представлены такими библиотеками.
45
+ * https://www.typescriptlang.org/docs/handbook/declaration-files/library-structures.html#global-libraries
46
+ */
47
+ export class GlobalLibrary implements ITsPackageSymbols {
48
+ private readonly _tsctx;
49
+ private readonly _sourceFiles;
50
+ readonly kind = "global-library";
51
+ private readonly _items;
52
+ constructor(_tsctx: TsInteropContext, _sourceFiles: readonly ts.SourceFile[]);
53
+ getItems(): readonly SymbolFromTs[];
54
+ }
55
+ interface ITsPackageSymbols {
56
+ getItems(): readonly SymbolFromTs[];
57
+ }
58
+ export {};
59
+ }
60
+ export declare class SymbolFromTs {
61
+ readonly value: ts.Symbol;
62
+ readonly isDefaultExport: boolean;
63
+ constructor(value: ts.Symbol, isDefaultExport: boolean);
64
+ }
@@ -0,0 +1,69 @@
1
+ import ts from 'typescript';
2
+ import { OriginalPackageMembers } from '../entities/PackageMembers.js';
3
+ import { PackageEntity, PackageMemberEntity, TypeEntity } from '../entities/index.js';
4
+ import { SourcePackage } from '../project/index.js';
5
+ import * as tree from '../tree/index.js';
6
+ import { TsInteropContext } from './TsInteropContext.js';
7
+ import { SymbolFromTs } from './TsPackageContents.js';
8
+ export declare class TsPackageMembersCreator {
9
+ private readonly _tsctx;
10
+ private readonly _symbols;
11
+ private readonly _packageEntity;
12
+ private readonly _sourcePackageToMergeWith;
13
+ private readonly _forceMembersAreHiddenInPackage;
14
+ private readonly _typeEntityBySymbol;
15
+ private readonly _owningNamedSymbolByTypeLiteralSymbol;
16
+ private readonly _namedDeclarationsByName;
17
+ private readonly _packageMemberEntityByNode;
18
+ constructor(_tsctx: TsInteropContext, _symbols: Iterable<SymbolFromTs>, _packageEntity: PackageEntity, _sourcePackageToMergeWith: SourcePackage | undefined, _forceMembersAreHiddenInPackage?: boolean);
19
+ create(): TsPackageMembersCreationResult;
20
+ private createAndRegisterPackageMemberEntity;
21
+ /**
22
+ * @param symbol (symbol.flags & (ts.SymbolFlags.Interface | ts.SymbolFlags.Class)) !== 0
23
+ */
24
+ private createClassOrInterface;
25
+ private createNamedFunctionTypeEntity;
26
+ private createGlobalClassOrInterfaceEntity;
27
+ /**
28
+ * Тип переменной может содержать объявления сигнатур конструктора, которые содержат параметры типа.
29
+ * Такие параметры типа заменяются на параметры типа соответствующего интерфейса.
30
+ *
31
+ * @example
32
+ * interface MyType<T1> {}
33
+ * var MyType: { new<T2>(): MyType }
34
+ *
35
+ * Параметр типа T2 будет заменён на Т1.
36
+ */
37
+ private registerTypeParametersOfSymbolWithImplicitStaticMembersConstructors;
38
+ /**
39
+ * @param symbol (symbol.flags & ts.SymbolFlags.TypeAlias) !== 0
40
+ */
41
+ private createTypeAlias;
42
+ private createNamedTypeLiteralEntity;
43
+ private createTypeAliasEntity;
44
+ /**
45
+ * @param symbol (symbol.flags & ts.SymbolFlags.Enum) !== 0
46
+ */
47
+ private createEnumEntity;
48
+ /**
49
+ * @param symbol (symbol.flags & ts.SymbolFlags.Variable) !== 0
50
+ */
51
+ private createVariableEntity;
52
+ /**
53
+ * @param symbol (symbol.flags & ts.SymbolFlags.Function) !== 0
54
+ */
55
+ private createFunctionEntities;
56
+ private createFunctionEntityNoReplacement;
57
+ private registerTypeParameters;
58
+ private getTypeDeclarationsToMergeWith;
59
+ private convertPackageMemberEntityToPackageMember;
60
+ private createReplacementSourceEntities;
61
+ private getSourceEntity;
62
+ }
63
+ export type NamedPackageMemberDeclaration = tree.PackageAliasTypeDeclaration | tree.PackageMethodDeclaration | tree.PackageMethodTypeDeclaration | tree.PackageStructuredTypeDeclaration | tree.PackageVariableDeclaration | tree.PackageVariableGetterDeclaration | tree.PackageVariableSetterDeclaration | tree.PackageVariantTypeDeclaration;
64
+ export declare class TsPackageMembersCreationResult {
65
+ readonly members: OriginalPackageMembers;
66
+ readonly typeEntityBySymbol: ReadonlyMap<ts.Symbol, TypeEntity>;
67
+ readonly packageMemberEntityByNode: ReadonlyMap<tree.Node, PackageMemberEntity>;
68
+ constructor(members: OriginalPackageMembers, typeEntityBySymbol: ReadonlyMap<ts.Symbol, TypeEntity>, packageMemberEntityByNode: ReadonlyMap<tree.Node, PackageMemberEntity>);
69
+ }
@@ -0,0 +1,38 @@
1
+ import ts from 'typescript';
2
+ import { Uri } from '../common/index.js';
3
+ import { TypeScriptLibrariesProvider } from './TsLibrariesProvider.js';
4
+ export declare class TsProgramLoader {
5
+ private readonly _librariesProvider;
6
+ private readonly _rootDirectoryUri;
7
+ private readonly _standardLibraryFileNames;
8
+ private readonly _npmPackageNames;
9
+ private readonly _moduleNames;
10
+ private readonly _oldProgram?;
11
+ constructor(_librariesProvider: TypeScriptLibrariesProvider, _rootDirectoryUri: Uri, _standardLibraryFileNames: readonly string[], _npmPackageNames: readonly string[], _moduleNames: readonly string[], _oldProgram?: ts.Program | undefined);
12
+ load(): TsProgramLoadResult;
13
+ private createFileWithLibraryImportsText;
14
+ private createCompilerHost;
15
+ private getStandardLibraries;
16
+ private getUserLibraries;
17
+ }
18
+ export declare enum StandardTsLibraryKind {
19
+ JavaScript = 0,
20
+ Browser = 1,
21
+ WebWorker = 2,
22
+ ScriptHost = 3
23
+ }
24
+ export declare class TsProgramLoadResult {
25
+ readonly program: ts.Program;
26
+ readonly standardLibraryFileByName: ReadonlyMap<string, ts.SourceFile>;
27
+ readonly rootFileByGlobalLibraryName: ReadonlyMap<string, ts.SourceFile>;
28
+ readonly moduleSymbolByName: ReadonlyMap<string, ts.Symbol>;
29
+ readonly unresolvedStandardLibraryFileNames: readonly string[];
30
+ readonly unresolvedUserLibraryNames: readonly string[];
31
+ constructor(program: ts.Program, standardLibraryFileByName: ReadonlyMap<string, ts.SourceFile>, rootFileByGlobalLibraryName: ReadonlyMap<string, ts.SourceFile>, moduleSymbolByName: ReadonlyMap<string, ts.Symbol>, unresolvedStandardLibraryFileNames: readonly string[], unresolvedUserLibraryNames: readonly string[]);
32
+ }
33
+ export declare class TsUriExt {
34
+ static readonly scheme = "ts";
35
+ static readonly separator = "/";
36
+ static uriToPath(uri: Uri): string;
37
+ static pathToUri(path: string): Uri;
38
+ }
@@ -0,0 +1,45 @@
1
+ import ts from 'typescript';
2
+ import { TypeEntityWithMembers, TypeParameterEntity } from '../entities/index.js';
3
+ import { OriginalTypeEntityMembers } from '../entities/TypeEntityMembers.js';
4
+ import { TsInteropContext } from './TsInteropContext.js';
5
+ export declare class TsTypeMembersCreator {
6
+ private readonly _tsctx;
7
+ private readonly _symbols;
8
+ private readonly _symbolsToForceStatic;
9
+ private readonly _typeSymbolDeclarations;
10
+ private readonly _typeEntity;
11
+ private readonly _symbolToTakeDefaultClassConstructorsFrom;
12
+ private readonly _membersOfTypeToMergeWith;
13
+ private readonly _typeParameterBySymbol;
14
+ constructor(_tsctx: TsInteropContext, _symbols: Iterable<ts.Symbol>, _symbolsToForceStatic: Iterable<ts.Symbol> | undefined, _typeSymbolDeclarations: readonly ts.Declaration[] | undefined, _typeEntity: TypeEntityWithMembers, _symbolToTakeDefaultClassConstructorsFrom: ts.Symbol | undefined, _membersOfTypeToMergeWith: OriginalTypeEntityMembers | undefined);
15
+ create(): TsTypeMembersCreationResult;
16
+ private createTypeMemberEntity;
17
+ /**
18
+ * @param symbol (symbol.flags & ts.SymbolFlags.Property) !== 0
19
+ */
20
+ private createProperty;
21
+ /**
22
+ * @param symbol (symbol.flags & ts.SymbolFlags.Accessor) !== 0
23
+ */
24
+ private createAccessor;
25
+ /**
26
+ * @returns Возвращает true, если symbol - это метод с именем [Symbol.iterator]
27
+ */
28
+ private isProbablyIteratorMethodSymbol;
29
+ /**
30
+ * @param symbol (symbol.flags & ts.SymbolFlags.Method) !== 0
31
+ */
32
+ private createMethods;
33
+ private createMethodEntityNoReplacement;
34
+ private createConstructors;
35
+ private createIndexerSignatures;
36
+ private registerTypeParameters;
37
+ private createEnumeratorMethodIfIteratorMethodExists;
38
+ private getNamedMembersFromTypeToMergeWith;
39
+ private createDefaultConstructorsFromSignatures;
40
+ }
41
+ export declare class TsTypeMembersCreationResult {
42
+ readonly members: OriginalTypeEntityMembers;
43
+ readonly typeParameterBySymbol: ReadonlyMap<ts.Symbol, TypeParameterEntity>;
44
+ constructor(members: OriginalTypeEntityMembers, typeParameterBySymbol: ReadonlyMap<ts.Symbol, TypeParameterEntity>);
45
+ }
@@ -0,0 +1,43 @@
1
+ import { TsInteropInputs } from '../analysis/index.js';
2
+ import { Compilation, JavaScriptImplementationConfig, JavaScriptInterfacePackageImplementationConfig, JavaScriptModuleFormat, PackageFromDtsConfig, ProgramPackage } from '../project/index.js';
3
+ import { TypeScriptLibrariesProvider } from './TsLibrariesProvider.js';
4
+ export declare function createTsInteropInputsForCompilation(compilation: Compilation, librariesProvider: TypeScriptLibrariesProvider): TsInteropInputs;
5
+ export declare function collectRequiredJsLibraryConfigs(compilation: Compilation): RequiredJsLibraryConfigs;
6
+ export declare class RequiredJsLibraryConfigs {
7
+ readonly values: readonly RequiredJsLibraryConfig[];
8
+ constructor(values: readonly RequiredJsLibraryConfig[]);
9
+ getJsModuleConfigs(): readonly JsModuleConfig[];
10
+ getStandardLibraryFileNames(): string[];
11
+ getNamesOfNpmPackagesToLoadFromDts(): string[];
12
+ getNamesOfModulesToLoadFromDts(): string[];
13
+ }
14
+ export type RequiredJsLibraryConfig = RequiredJsLibraryConfig.ExternalImplementation | RequiredJsLibraryConfig.PackageFromDts;
15
+ export declare namespace RequiredJsLibraryConfig {
16
+ export class ExternalImplementation implements IRequiredJsLibraryConfig {
17
+ readonly pkg: ProgramPackage;
18
+ readonly value: JavaScriptInterfacePackageImplementationConfig;
19
+ readonly kind = "external-implementation";
20
+ get implementationConfig(): JavaScriptImplementationConfig;
21
+ get loadFromDts(): boolean;
22
+ constructor(pkg: ProgramPackage, value: JavaScriptInterfacePackageImplementationConfig);
23
+ }
24
+ export class PackageFromDts {
25
+ readonly value: PackageFromDtsConfig;
26
+ readonly kind = "package-from-dts";
27
+ get implementationConfig(): JavaScriptImplementationConfig;
28
+ get loadFromDts(): boolean;
29
+ constructor(value: PackageFromDtsConfig);
30
+ }
31
+ interface IRequiredJsLibraryConfig {
32
+ implementationConfig: JavaScriptImplementationConfig;
33
+ loadFromDts: boolean;
34
+ }
35
+ export {};
36
+ }
37
+ export declare class JsModuleConfig {
38
+ readonly name: string;
39
+ readonly format: JavaScriptModuleFormat;
40
+ readonly packageName: string;
41
+ readonly loadFromDts: boolean;
42
+ constructor(name: string, format: JavaScriptModuleFormat, packageName: string, loadFromDts: boolean);
43
+ }
@@ -0,0 +1,20 @@
1
+ import { Analyzer } from '../analysis/index.js';
2
+ import { AliasTypeEntity, TypeParameterEntity } from '../entities/index.js';
3
+ import { IType, SubstitutionMap, Substitutions, Type } from './index.js';
4
+ export declare class AliasType implements IType {
5
+ private readonly _analyzer;
6
+ private readonly _entity;
7
+ private readonly _substitutions;
8
+ readonly kind = "alias";
9
+ private readonly _aliasedType;
10
+ get debuggerDisplay(): string;
11
+ constructor(_analyzer: Analyzer, _entity: AliasTypeEntity, _substitutions: Substitutions);
12
+ getAliasedType(): Type;
13
+ getTypeParameters(): readonly TypeParameterEntity[];
14
+ getSubstitutions(): Substitutions;
15
+ applySubstitutions(map: SubstitutionMap): Type;
16
+ equals(other: Type): boolean;
17
+ getEntity(): AliasTypeEntity;
18
+ getBaseObjectTypeOrAliasedType(): Type | undefined;
19
+ toString(): string;
20
+ }
@@ -0,0 +1 @@
1
+ export * from './StandardTypes.js';
@@ -0,0 +1,23 @@
1
+ import { Analyzer } from '../analysis/index.js';
2
+ import { MethodTypeEntity, TypeParameterEntity } from '../entities/index.js';
3
+ import { IType, StructuredType, SubstitutionMap, Substitutions, Type, ValueParameter } from './index.js';
4
+ export declare class MethodType implements IType {
5
+ private readonly _analyzer;
6
+ private readonly _entity;
7
+ private readonly _substitutions;
8
+ readonly kind = "method";
9
+ private readonly _valueParameters;
10
+ get debuggerDisplay(): string;
11
+ constructor(_analyzer: Analyzer, _entity: MethodTypeEntity, _substitutions: Substitutions);
12
+ getTypeParameters(): readonly TypeParameterEntity[];
13
+ getSubstitutions(): Substitutions;
14
+ applySubstitutions(map: SubstitutionMap): MethodType;
15
+ equals(other: Type): boolean;
16
+ getEntity(): MethodTypeEntity;
17
+ isAsync(): boolean;
18
+ getReturnType(): Type;
19
+ getValueParameters(): readonly ValueParameter[];
20
+ getBaseType(): StructuredType;
21
+ getBaseObjectTypeOrAliasedType(): Type | undefined;
22
+ toString(): string;
23
+ }
@@ -0,0 +1,19 @@
1
+ import { Analyzer } from '../analysis/index.js';
2
+ import { TypeParameterEntity } from '../entities/index.js';
3
+ import { IType, SubstitutionMap, Substitutions, Type } from './index.js';
4
+ export declare class ParameterType implements IType {
5
+ private readonly _analyzer;
6
+ private readonly _entity;
7
+ private readonly _excludeNone;
8
+ readonly kind = "parameter";
9
+ get isNoneExcluded(): boolean;
10
+ get constraint(): Type | undefined;
11
+ get debuggerDisplay(): string;
12
+ constructor(_analyzer: Analyzer, _entity: TypeParameterEntity, _excludeNone: boolean);
13
+ getSubstitutions(): Substitutions;
14
+ getEntity(): TypeParameterEntity;
15
+ applySubstitutions(map: SubstitutionMap): Type;
16
+ equals(other: Type): boolean;
17
+ getBaseObjectTypeOrAliasedType(): Type | undefined;
18
+ toString(): string;
19
+ }
@@ -0,0 +1,42 @@
1
+ import { Analyzer } from '../analysis/index.js';
2
+ import { StructuredType, UnresolvedType, VariantType } from './index.js';
3
+ export declare class StandardTypes {
4
+ private readonly _analyzer;
5
+ private _refObject;
6
+ private _plainObject;
7
+ private _number;
8
+ private _integer;
9
+ private _text;
10
+ private _textTemplate;
11
+ private _char;
12
+ private _unresolved;
13
+ private _yesNo;
14
+ private _none;
15
+ private _measure;
16
+ private _enumerator;
17
+ private _enumerable;
18
+ private _array;
19
+ private _reference;
20
+ private _task;
21
+ private _error;
22
+ private _method;
23
+ constructor(_analyzer: Analyzer);
24
+ get refObject(): StructuredType;
25
+ get plainObject(): StructuredType;
26
+ get number(): StructuredType;
27
+ get integer(): StructuredType;
28
+ get text(): StructuredType;
29
+ get textTemplate(): StructuredType;
30
+ get char(): StructuredType;
31
+ get unresolved(): UnresolvedType;
32
+ get yesNo(): VariantType;
33
+ get none(): StructuredType;
34
+ get measure(): StructuredType;
35
+ get enumerator(): StructuredType;
36
+ get enumerable(): StructuredType;
37
+ get array(): StructuredType;
38
+ get reference(): StructuredType;
39
+ get task(): StructuredType;
40
+ get error(): StructuredType;
41
+ get method(): StructuredType;
42
+ }
@@ -0,0 +1,25 @@
1
+ import { Analyzer } from '../analysis/index.js';
2
+ import { StructuredTypeEntity, TypeParameterEntity } from '../entities/index.js';
3
+ import { IType, SubstitutionMap, Substitutions, Type } from './index.js';
4
+ export declare class StructuredType implements IType {
5
+ private readonly _analyzer;
6
+ private readonly _entity;
7
+ private readonly _substitutions;
8
+ readonly kind = "structured";
9
+ private readonly _baseObjectType;
10
+ private readonly _baseAspectTypes;
11
+ get debuggerDisplay(): string;
12
+ constructor(_analyzer: Analyzer, _entity: StructuredTypeEntity, _substitutions: Substitutions);
13
+ getSubstitutions(): Substitutions;
14
+ getTypeParameters(): readonly TypeParameterEntity[];
15
+ applySubstitutions(map: SubstitutionMap): StructuredType;
16
+ isAspect(): boolean;
17
+ isRefObject(): boolean;
18
+ isPlainObject(): boolean;
19
+ equals(other: Type): boolean;
20
+ getEntity(): StructuredTypeEntity;
21
+ getBaseObjectType(): Type | undefined;
22
+ getBaseAspectTypes(): readonly Type[];
23
+ getBaseObjectTypeOrAliasedType(): Type | undefined;
24
+ toString(): string;
25
+ }
@@ -0,0 +1,18 @@
1
+ import { Analyzer } from '../analysis/index.js';
2
+ import { TypeParameterEntity } from '../entities/index.js';
3
+ import { Type } from './index.js';
4
+ export declare class Substitutions {
5
+ readonly map: SubstitutionMap;
6
+ private readonly _analyzer;
7
+ get size(): number;
8
+ constructor(analyzer: Analyzer, parameters: readonly TypeParameterEntity[], types: readonly Type[]);
9
+ constructor(analyzer: Analyzer, map: SubstitutionMap);
10
+ static identity(analyzer: Analyzer, parameters: readonly TypeParameterEntity[]): Substitutions;
11
+ static empty(analyzer: Analyzer): Substitutions;
12
+ getParameters(): Iterable<TypeParameterEntity>;
13
+ getTypes(): Iterable<Type>;
14
+ substituteTypes(map: SubstitutionMap): Substitutions;
15
+ substituteTypesAndMerge(map: SubstitutionMap): Substitutions;
16
+ equals(other: Substitutions): boolean;
17
+ }
18
+ export type SubstitutionMap = ReadonlyMap<TypeParameterEntity, Type>;
@@ -0,0 +1,16 @@
1
+ import { TypeEntity } from '../entities/index.js';
2
+ import { AliasType } from './AliasType.js';
3
+ import { MethodType } from './MethodType.js';
4
+ import { ParameterType } from './ParameterType.js';
5
+ import { StructuredType } from './StructuredType.js';
6
+ import { UnresolvedType } from './UnresolvedType.js';
7
+ import { VariantType } from './VariantType.js';
8
+ import { SubstitutionMap, Substitutions, UnionType } from './index.js';
9
+ export type Type = StructuredType | VariantType | MethodType | AliasType | UnresolvedType | ParameterType | UnionType;
10
+ export interface IType {
11
+ getSubstitutions(): Substitutions;
12
+ applySubstitutions(map: SubstitutionMap): Type;
13
+ equals(other: Type): boolean;
14
+ getEntity(): TypeEntity | undefined;
15
+ getBaseObjectTypeOrAliasedType(): Type | undefined;
16
+ }
@@ -0,0 +1,15 @@
1
+ import { Analyzer } from '../analysis/index.js';
2
+ import { AliasTypeEntity, MethodTypeEntity, StructuredTypeEntity, TypeParameterEntity, VariantTypeEntity } from '../entities/index.js';
3
+ import { AliasType, MethodType, ParameterType, StructuredType, Substitutions, Type, UnresolvedType, VariantType } from './index.js';
4
+ export declare class TypeFactory {
5
+ readonly analyzer: Analyzer;
6
+ constructor(analyzer: Analyzer);
7
+ getStructuredType(entity: StructuredTypeEntity, substitutions: Substitutions): StructuredType;
8
+ getParameterType(entity: TypeParameterEntity, excludeNone: boolean): ParameterType;
9
+ getVariantType(entity: VariantTypeEntity, substitutions: Substitutions): VariantType;
10
+ getMethodType(entity: MethodTypeEntity, substitutions: Substitutions): MethodType;
11
+ getAliasType(entity: AliasTypeEntity, substitutions: Substitutions): AliasType;
12
+ getUnionType(types: readonly Type[]): Type;
13
+ getUnresolvedType(): UnresolvedType;
14
+ private getUniqueFlattenedConstituentTypes;
15
+ }