@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,27 @@
1
+ import { PackageLocale, Query, SearchName } from '../common/index.js';
2
+ import { BinaryOperatorKind, IEntityHidingMatcher, TypeEntity, UnaryOperatorKind } from '../entities/index.js';
3
+ import * as types from '../types/index.js';
4
+ import { Analyzer } from './Analyzer.js';
5
+ import { FoundAnonymousDeclaration, FoundNamedDeclaration } from './FoundDeclaration.js';
6
+ import { LocalizationContext } from './LocalizationContext.js';
7
+ import { Lookup } from './Lookup.js';
8
+ export declare class TypeMemberLookup {
9
+ private readonly _analyzer;
10
+ private readonly _type;
11
+ private readonly _localizationContext;
12
+ private readonly _searchLocale;
13
+ /**
14
+ * Язык, на котором будет осуществляться поиск членов типа.
15
+ */
16
+ get searchLocale(): PackageLocale;
17
+ constructor(_analyzer: Analyzer, _type: types.Type, _localizationContext: LocalizationContext | undefined);
18
+ static ofTypeEntity(analyzer: Analyzer, entity: TypeEntity, localizationContext: LocalizationContext | undefined): TypeMemberLookup;
19
+ getNamedMembers(hidingMatcher?: IEntityHidingMatcher, typeExtensionsLookup?: Lookup): Query<FoundNamedDeclaration<types.NamedTypeMember>>;
20
+ getNamedMembersByName(name: SearchName, hidingMatcher?: IEntityHidingMatcher, typeExtensionsLookup?: Lookup): Query<FoundNamedDeclaration<types.NamedTypeMember>>;
21
+ getConstructors(hidingMatcher?: IEntityHidingMatcher, typeExtensionsLookup?: Lookup): Query<FoundAnonymousDeclaration<types.Constructor>>;
22
+ getIndexers(hidingMatcher?: IEntityHidingMatcher, typeExtensionsLookup?: Lookup): Query<FoundAnonymousDeclaration<types.Indexer>>;
23
+ getDereferenceOperators(hidingMatcher?: IEntityHidingMatcher, typeExtensionsLookup?: Lookup): Query<FoundAnonymousDeclaration<types.DereferenceOperator>>;
24
+ getBinaryOperators(kind: BinaryOperatorKind, hidingMatcher?: IEntityHidingMatcher, typeExtensionsLookup?: Lookup): Query<FoundAnonymousDeclaration<types.BinaryOperator>>;
25
+ getUnaryOperators(kind: UnaryOperatorKind, hidingMatcher?: IEntityHidingMatcher, typeExtensionsLookup?: Lookup): Query<FoundAnonymousDeclaration<types.UnaryOperator>>;
26
+ private getLocaleOfTypeEntity;
27
+ }
@@ -0,0 +1,7 @@
1
+ export declare class Resolver<TCandidate extends ICandidate> {
2
+ resolveByArgumentCount(candidates: Iterable<TCandidate>, argumentCount: number): Iterable<TCandidate>;
3
+ }
4
+ export interface ICandidate {
5
+ getParameterCount(): number;
6
+ getRequiredParameterCount(): number;
7
+ }
@@ -0,0 +1,37 @@
1
+ import { WithDiagnostics } from '../common/index.js';
2
+ import { BinaryOperatorKind } from '../entities/index.js';
3
+ import { Expression, Node } from '../tree/index.js';
4
+ import * as types from '../types/index.js';
5
+ import { FoundAnonymousDeclaration } from './FoundDeclaration.js';
6
+ import { Analyzer } from './index.js';
7
+ /**
8
+ * Определяет подходящую двухместную операцию, определённую пользователем (+, *, == и др.).
9
+ *
10
+ * Алгоритм:
11
+ *
12
+ * 1. Определить тип левого выражение (targetType = undefined).
13
+ * 2. Найти в типе операторы необходимого вида.
14
+ * 3. Если операторы найдены:
15
+ * 1. Если найден один оператор - проверить, совместимы ли типы выражений с типами операндов.
16
+ * 2. Если найдено несколько операторов - решить перегрузку, представив двоичное выражение как операцию с
17
+ * двумя параметрами.
18
+ * 3. Если остался один подходящий оператор - алгоритм завершается. Если подошло несколько операторов -
19
+ * ошибка неоднозначного доступа. Если не подошёл ни один - алгоритм продолжается.
20
+ * 4. Определить тип правого выражения (targetType = undefined) и найти операторы в нём. Если операторы найдены -
21
+ * выполнить пункт 3.
22
+ * 5. Если ни один оператор не подошёл - алгоритм завершается с соответствующим сообщением об ошибке.
23
+ */
24
+ export declare class UserDefinableBinaryOperatorResolver {
25
+ private readonly _analyzer;
26
+ private readonly _left;
27
+ private readonly _right;
28
+ private readonly _operatorKind;
29
+ private readonly _operatorNodeForDiagnostic;
30
+ private readonly _leftType;
31
+ private readonly _rightType;
32
+ private get leftType();
33
+ private get rightType();
34
+ constructor(_analyzer: Analyzer, _left: Expression, _right: Expression, _operatorKind: BinaryOperatorKind, _operatorNodeForDiagnostic: Node);
35
+ resolve(): WithDiagnostics<FoundAnonymousDeclaration<types.BinaryOperator>>;
36
+ private chooseSuitableOperators;
37
+ }
@@ -0,0 +1,17 @@
1
+ import { Entity, PackageEntity, StructuredTypeEntity, TypeParameterEntity, VariableEntity } from '../entities/index.js';
2
+ import * as tree from '../tree/index.js';
3
+ import * as types from '../types/index.js';
4
+ import { Tag } from './Tags.js';
5
+ type StringToken = tree.Token<tree.TokenKind.TextLiteral> | tree.Token<tree.TokenKind.TextTemplateHead> | tree.Token<tree.TokenKind.TextTemplatePart> | tree.Token<tree.TokenKind.TextTemplateTail>;
6
+ export declare function getUnescapedTextFromStringToken(token: StringToken): string;
7
+ export declare function unwrapParenthesizedExpressions(expression: tree.Expression): tree.Expression;
8
+ export declare function getParentSkippingParenthesizedExpressions(expression: tree.Expression): tree.ExpressionParent;
9
+ export declare function unaliasType(type: types.Type): types.Type;
10
+ export declare function unaliasType(type: types.Type | undefined): types.Type | undefined;
11
+ export declare function getPackageContainingEntity(entity: Entity): PackageEntity;
12
+ export declare function findTag(tagTypeEntity: StructuredTypeEntity, tags: readonly Tag[]): Tag | undefined;
13
+ export declare function getRequiredTypeParameterCount(typeParameters: readonly TypeParameterEntity[]): number;
14
+ export declare function flattenPackageMemberDeclarationList(list: tree.PackageMemberDeclarationList): Iterable<Exclude<tree.PackageMemberDeclaration, tree.PackageMemberGroupDeclaration>>;
15
+ export declare function flattenTypeMemberDeclarationList(list: tree.TypeMemberDeclarationList): Iterable<Exclude<tree.TypeMemberDeclaration, tree.TypeMemberGroupDeclaration>>;
16
+ export declare function isComputedVariableEntity(entity: VariableEntity): boolean;
17
+ export {};
@@ -0,0 +1,10 @@
1
+ import { AccessKind } from '../common/index.js';
2
+ import { GetterEntity, SetterEntity, VariableEntity } from '../entities/index.js';
3
+ export type VariableAccess = {
4
+ kind: AccessKind.Get;
5
+ accessorEntity: GetterEntity | undefined;
6
+ } | {
7
+ kind: AccessKind.Set;
8
+ accessorEntity: SetterEntity | undefined;
9
+ };
10
+ export declare function create(entity: VariableEntity, accessKind: AccessKind): VariableAccess;
@@ -0,0 +1,20 @@
1
+ import { PackageLocale, Query, SearchName } from '../common/index.js';
2
+ import { VariantEntity } from '../entities/VariantEntity.js';
3
+ import { VariantTypeEntity } from '../entities/VariantTypeEntity.js';
4
+ import { FoundNamedDeclaration } from './FoundDeclaration.js';
5
+ import { LocalizationContext } from './LocalizationContext.js';
6
+ export declare class VariantLookup {
7
+ private readonly _variantTypeEntity;
8
+ private readonly _localizationContext;
9
+ private readonly _searchLocale;
10
+ private _translatedVariants;
11
+ /**
12
+ * Язык, на котором будет осуществляться поиск вариантов.
13
+ */
14
+ get searchLocale(): PackageLocale;
15
+ private get translatedVariants();
16
+ constructor(_variantTypeEntity: VariantTypeEntity, _localizationContext: LocalizationContext | undefined);
17
+ get(): Query<FoundNamedDeclaration<VariantEntity>>;
18
+ getByName(name: SearchName): Query<FoundNamedDeclaration<VariantEntity>>;
19
+ private getLocaleOfTypeEntity;
20
+ }
@@ -0,0 +1,7 @@
1
+ import { Node, SourceFile } from '../tree/index.js';
2
+ type ChildNodeVisitor = (syntaxNode: VisitedChildNode) => void;
3
+ export type VisitedNode = Node;
4
+ export type VisitedChildNode = Exclude<Node, SourceFile>;
5
+ export declare function visitChildren(node: VisitedNode, visitChildCb: ChildNodeVisitor): void;
6
+ export declare function visitChildrenRecursively(node: VisitedNode, visitChildCb: ChildNodeVisitor): void;
7
+ export {};
@@ -0,0 +1,34 @@
1
+ import { Diagnostic } from '../diagnostic/Diagnostic.js';
2
+ import { AliasTypeEntity, StructuredTypeEntity, VariantTypeEntity } from '../entities/index.js';
3
+ export declare class WellKnownDeclarationsLoadError extends Error {
4
+ readonly diagnostic: Diagnostic;
5
+ constructor(diagnostic: Diagnostic);
6
+ }
7
+ export declare class WellKnownDeclarations {
8
+ refObject: StructuredTypeEntity;
9
+ plainObject: StructuredTypeEntity;
10
+ number: StructuredTypeEntity;
11
+ integer: StructuredTypeEntity;
12
+ text: StructuredTypeEntity;
13
+ textTemplate: StructuredTypeEntity;
14
+ char: StructuredTypeEntity;
15
+ yesNo: VariantTypeEntity;
16
+ none: StructuredTypeEntity;
17
+ enumerable: StructuredTypeEntity;
18
+ enumerator: StructuredTypeEntity;
19
+ array: StructuredTypeEntity;
20
+ readonlyArray: StructuredTypeEntity;
21
+ map: StructuredTypeEntity;
22
+ readonlyMap: StructuredTypeEntity;
23
+ set: StructuredTypeEntity;
24
+ readonlySet: StructuredTypeEntity;
25
+ measure: StructuredTypeEntity;
26
+ reference: StructuredTypeEntity;
27
+ task: StructuredTypeEntity;
28
+ error: StructuredTypeEntity;
29
+ method: StructuredTypeEntity;
30
+ parameterArray: AliasTypeEntity;
31
+ defaultImport: StructuredTypeEntity;
32
+ realName: StructuredTypeEntity;
33
+ typeVariableProxy: StructuredTypeEntity;
34
+ }
@@ -0,0 +1,8 @@
1
+ export * from './CallArgumentsToParametersMatcher.js';
2
+ export * from './Analyzer.js';
3
+ export * from './FindModifier.js';
4
+ export * from './OverloadResolver.js';
5
+ export * from './DiagnosticCollector.js';
6
+ export * from './TargetTypeHint.js';
7
+ export * from './Visitor.js';
8
+ export * from './WellKnownDeclarations.js';
@@ -0,0 +1,59 @@
1
+ export * from '../analysis/AccessedMethod.js';
2
+ export * from '../analysis/AnalyzedTranslationPackage.js';
3
+ export * from '../analysis/Analyzer.js';
4
+ export type { Meaning as AutotypeCallExpressionMeaning } from '../analysis/AutotypeCallExpressionMeaning.js';
5
+ export type { Meaning as BaseExpressionMeaning } from '../analysis/BaseExpressionMeaning.js';
6
+ export { MatchResult, MatchResultValueParameter } from '../analysis/CallArgumentToParameterMatchResult.js';
7
+ export type { Meaning as CallExpressionMeaning } from '../analysis/CallExpressionMeaning.js';
8
+ export type { Meaning as DereferenceExpressionMeaning } from '../analysis/DereferenceExpressionMeaning.js';
9
+ export * from '../analysis/DiagnosticCollector.js';
10
+ export * from '../analysis/EntityLocalizationHelper.js';
11
+ export * from '../analysis/FindModifier.js';
12
+ export * from '../analysis/FoundDeclaration.js';
13
+ export type { Meaning as IdentifierExpressionMeaning, ResolutionResult as IdentifierExpressionResolutionResult } from '../analysis/IdentifierExpressionMeaning.js';
14
+ export * from '../analysis/ImportedPackageNameTree.js';
15
+ export type { Meaning as IndexedAccessExpressionMeaning } from '../analysis/IndexedAccessExpressionMeaning.js';
16
+ export * as indexerAccess from '../analysis/IndexerAccess.js';
17
+ export * from '../analysis/Localization.js';
18
+ export * from '../analysis/LocalizationContext.js';
19
+ export * from '../analysis/Lookup.js';
20
+ export * from '../analysis/NodeTypeUtils.js';
21
+ export type { Meaning as ObjectExpressionMeaning } from '../analysis/ObjectExpressionMeaning.js';
22
+ export * from '../analysis/PackageMemberLookup.js';
23
+ export type { Meaning as PropertyAccessExpressionMeaning, ResolutionResult as PropertyAccessExpressionResolutionResult } from '../analysis/PropertyAccessExpressionMeaning.js';
24
+ export type { IScope, NamedDeclaration, TypeDeclaration, TypeOrContainerWithTypes } from '../analysis/Scope.js';
25
+ export * from '../analysis/SemanticContext.js';
26
+ export * from '../analysis/SourceFileMembers.js';
27
+ export * from '../analysis/SourcePackageDependencyGraph.js';
28
+ export * from '../analysis/SubstitutedMethod.js';
29
+ export type { Meaning as TagMeaning } from '../analysis/TagMeaning.js';
30
+ export * from '../analysis/Tags.js';
31
+ export * from '../analysis/TargetTypeHint.js';
32
+ export * from '../analysis/TypeMemberLookup.js';
33
+ export * from '../analysis/Utils.js';
34
+ export * as variableAccess from '../analysis/VariableAccess.js';
35
+ export * from '../analysis/VariantLookup.js';
36
+ export * from '../analysis/Visitor.js';
37
+ export * from '../analysis/WellKnownDeclarations.js';
38
+ export * from '../common/index.js';
39
+ export * from '../diagnostic/Diagnostic.js';
40
+ export * from '../diagnostic/DiagnosticCode.js';
41
+ export * from '../diagnostic/DiagnosticData.js';
42
+ export * from '../emitter/Emitter.js';
43
+ export * from '../entities/index.js';
44
+ export * from '../executor/Compiler.js';
45
+ export * from '../generated/BuiltInSystemPackages.js';
46
+ export * from '../parser/CharacterCodes.js';
47
+ export * from '../parser/KeywordDictionary.js';
48
+ export * from '../parser/ParseNumber.js';
49
+ export * from '../parser/Parser.js';
50
+ export * from '../parser/ReservedIdentifierDictionary.js';
51
+ export * from '../parser/Scanner.js';
52
+ export { TokenKind as ScannerTokenKind } from '../parser/TokenKind.js';
53
+ export * from '../parser/UnescapeText.js';
54
+ export * from '../project/index.js';
55
+ export * as green from '../tree/green/index.js';
56
+ export * as tree from '../tree/index.js';
57
+ export * from '../ts-interop/TsLibrariesProvider.js';
58
+ export * from '../ts-interop/Utils.js';
59
+ export * as type from '../types/index.js';
@@ -0,0 +1,5 @@
1
+ export * from '../executor/CommandLineCompiler.js';
2
+ export * from '../executor/FileSystemUri.js';
3
+ export * from '../executor/NodeCompiler.js';
4
+ export * from '../executor/PhysicalFileSystem.js';
5
+ export * from '../executor/PhysicalTypeScriptLibrariesProvider.js';
@@ -0,0 +1,3 @@
1
+ export * from '../services/CustomCommand.js';
2
+ export * from '../services/LanguageServer.js';
3
+ export * from '../services/workspace/WorkspaceFileSystem.js';
@@ -0,0 +1,4 @@
1
+ export declare const enum AccessKind {
2
+ Get = 0,
3
+ Set = 1
4
+ }
@@ -0,0 +1,2 @@
1
+ import { Uri } from './Uri.js';
2
+ export declare function isSourceOrConfigurationFileName(nameOrUri: string | Uri): boolean;
@@ -0,0 +1,6 @@
1
+ export declare class Cached<T> {
2
+ private _hasValue;
3
+ private _value?;
4
+ getOrInsertWith(fn: () => T): T;
5
+ clear(): void;
6
+ }
@@ -0,0 +1,13 @@
1
+ export interface CancellationToken {
2
+ readonly isCancellationRequested: boolean;
3
+ throwIfCancellationRequested(): void;
4
+ }
5
+ export declare class CancelledError extends Error {
6
+ constructor(message?: string);
7
+ }
8
+ export declare class GenericCancellationToken implements CancellationToken {
9
+ private readonly _isCancellationRequested;
10
+ get isCancellationRequested(): boolean;
11
+ constructor(_isCancellationRequested: () => boolean);
12
+ throwIfCancellationRequested(): void;
13
+ }
@@ -0,0 +1,19 @@
1
+ import { PackageDialect } from './PackageDialect.js';
2
+ import { PackageLocale } from './PackageLocale.js';
3
+ export declare const ArtelVersion: string;
4
+ export declare const ArtelSourceFileExtensions: string[];
5
+ export declare const ArtelSourceFileExtensionSet: Set<string>;
6
+ export declare const ArtelSourceAndConfigurationFileExtensionSet: Set<string>;
7
+ export declare const ConfigurationDirectoryNamesByLocale: Map<PackageLocale, string[]>;
8
+ export declare const ConfigurationDirectoryNameSet: Set<string>;
9
+ export declare const LocaleByConfigurationDirectoryName: Map<string, PackageLocale>;
10
+ export declare const JsonConfigurationFileNamesByLocale: Map<PackageLocale, string[]>;
11
+ export declare const JsonConfigurationFileNameSet: Set<string>;
12
+ export declare const LocaleByJsonConfigurationFileName: Map<string, PackageLocale>;
13
+ export declare const BuiltInSystemPackagesScheme = "artel-builtin";
14
+ export declare const GeneratedSourceFileScheme = "artel-gen";
15
+ export declare const DefaultTsLibDeclarationsFileName = "lib.es2023.d.ts";
16
+ export declare const DefaultLocale = PackageLocale.Ru;
17
+ export declare const DefaultDialect = PackageDialect.Mixed;
18
+ export declare const DefaultNamesOfDirectoriesToIgnore: string[];
19
+ export declare const NodeModulesDirectoryName = "node_modules";
@@ -0,0 +1,10 @@
1
+ export declare class Debug {
2
+ static assertNotNull<T>(value: T | null | undefined, message?: string): asserts value is T;
3
+ static assert(value: boolean, message?: string): asserts value;
4
+ static unreachable(message?: string): never;
5
+ static notImplemented(): never;
6
+ static never(value: never): never;
7
+ static typeIsAssignableTo<Target, _Source extends Target>(): void;
8
+ static cast<T>(_value: unknown): asserts _value is T;
9
+ static internalError(message?: string): never;
10
+ }
@@ -0,0 +1,7 @@
1
+ export declare class Delayed<T> {
2
+ private _hasValue;
3
+ private _value?;
4
+ get hasValue(): boolean;
5
+ get value(): T;
6
+ set value(value: T);
7
+ }
@@ -0,0 +1,3 @@
1
+ export declare class ErrorHandlingStrategy {
2
+ static throwErrors: boolean;
3
+ }
@@ -0,0 +1,5 @@
1
+ /**
2
+ * @example
3
+ * "Сообщение: {0} Экранирование: \{0}", ["Привет!"] -> "Сообщение: Привет! Экранирование: {0}"
4
+ */
5
+ export declare function formatString(text: string, ...formatArguments: readonly string[]): string;
@@ -0,0 +1,11 @@
1
+ import { PackageLocale } from './PackageLocale.js';
2
+ export declare const enum HelperPhraseKind {
3
+ Unresolved = 0,
4
+ Invalid = 1,
5
+ TypeParameter = 2,
6
+ Package = 3,
7
+ PackageAlias = 4,
8
+ Variable = 5,
9
+ Overloads = 6
10
+ }
11
+ export declare function getHelperPhrase(kind: HelperPhraseKind, locale: PackageLocale): string;
@@ -0,0 +1,4 @@
1
+ export declare class Interner<TKey, TValue> {
2
+ private readonly _values;
3
+ intern(key: TKey, value: TValue): TValue;
4
+ }
@@ -0,0 +1 @@
1
+ export declare function configureL10n(locale?: string): void;
@@ -0,0 +1,9 @@
1
+ export declare class Lazy<T> {
2
+ private _factory;
3
+ private _isEvaluating;
4
+ private _value?;
5
+ constructor(factory: () => T);
6
+ static immediate<T>(value: T): Lazy<T>;
7
+ get value(): T;
8
+ getCachedValue(): T | undefined;
9
+ }
@@ -0,0 +1,10 @@
1
+ import { ReservedIdentifierKind } from '../parser/ReservedIdentifierDictionary.js';
2
+ import * as tree from '../tree/index.js';
3
+ import { HelperPhraseKind } from './HelperPhrases.js';
4
+ import { PackageDialect, PackageLocale } from './index.js';
5
+ export declare class LocalizationHelper {
6
+ static localizeKeyword(kind: tree.KeywordKind, locale: PackageLocale, dialect: PackageDialect): readonly string[];
7
+ static localizeKeywordAndTakeFirst(kind: tree.KeywordKind, locale: PackageLocale, dialect: PackageDialect): string;
8
+ static localizeReservedIdentifier(kind: ReservedIdentifierKind, locale: PackageLocale): string;
9
+ static localizeHelperPhrase(kind: HelperPhraseKind, locale: PackageLocale): string;
10
+ }
@@ -0,0 +1,10 @@
1
+ import { EmitterError } from '../emitter/error-boundary.js';
2
+ import { Node } from '../tree/index.js';
3
+ export declare class Logger {
4
+ static info(message: string): void;
5
+ static error(message: string): void;
6
+ static error(error: Error | unknown): void;
7
+ static errorAtNode(message: string, node: Node): void;
8
+ static errorWithStackTrace(message: string): void;
9
+ static emitterError(error: EmitterError): void;
10
+ }
@@ -0,0 +1,83 @@
1
+ export declare const enum NameFlags {
2
+ /**
3
+ * Обычное имя, например: имя, имя-первое, имяПервое, имя-1, имя_первое.
4
+ */
5
+ None = 0,
6
+ /**
7
+ * Имя на языке оригинала, начинается со знака тильды, например: ~имя, ~'имя с пробелами'
8
+ */
9
+ OriginalName = 2,
10
+ /**
11
+ * Имя в одиночных кавычках, например: 'имя', 'имя с пробелами', '+'.
12
+ */
13
+ QuotedName = 4,
14
+ /**
15
+ * Имя не может быть отображено без кавычек, например: 'имя с пробелами', '+'.
16
+ */
17
+ RequiresQuotes = 8,
18
+ /**
19
+ * Имя с обратным апострофом для превращения служебного слова в обычное имя, например: тип\`, объект\`.
20
+ */
21
+ EscapedKeyword = 16,
22
+ /**
23
+ * Имя с обратным апострофом для избежания конфликта между параметром метода и свойством объекта,
24
+ * например: имя\`, 'имя с пробелами'\`.
25
+ */
26
+ ConflictResolvingParameterName = 32,
27
+ /**
28
+ * Имя с двойным обратным апострофом для избежания конфликта между вычисляемым свойством и скрытой
29
+ * хранимой переменной объекта, например: длина\`\`, 'имя с пробелами'\`\`.
30
+ */
31
+ BackingVariableName = 64,
32
+ /**
33
+ * Имя операции, написанное как знак или служебное слово в одиночных кавычках, например: '+', 'как'.
34
+ */
35
+ OperatorSignOrName = 128
36
+ }
37
+ export declare class Name {
38
+ /**
39
+ * Исходное имя без символов '~' в начале, символов '\`' в конце и без одиночных кавычек.
40
+ */
41
+ readonly originalWithoutQuotes: string;
42
+ /**
43
+ * Флаги, указывающие на наличии у имени символов '~', '\`', одиночных кавычек и их смысл.
44
+ */
45
+ readonly flags: NameFlags;
46
+ /**
47
+ * Предпочтительное для использования исходное имя. Эквивалентно при сравнении по ключу исходному имени
48
+ * (`original`). Может отличаться от исходного в случае, если получено путём эквивалентного преобразования
49
+ * из исходного, например, из формата camelCase в формат kebab-case при загрузке объявлений из d.ts-файла.
50
+ */
51
+ readonly preferredOriginal: string;
52
+ /**
53
+ * Ключ, используемый для сравнения имён на эквивалентность без учёта флагов, а также для генерации кода.
54
+ * Получается из исходного имени путём:
55
+ * 1. удаления символов '~' из начала, символов '`' из конца имени и удаления одиночных кавычек из остатка;
56
+ * 2. удаления символов '-' и замены первых следующих за ними букв на заглавные.
57
+ */
58
+ readonly keyWithoutBackQuotes: string;
59
+ /**
60
+ * Исходное имя, при необходимости взятое в одиночные кавычки и содержащее обратные кавычки согласно флагам.
61
+ * Не содержит символ '~'.
62
+ */
63
+ get original(): string;
64
+ /**
65
+ * Ключ, используемый для сравнения имён на эквивалентность с учётом флагов. Получается из
66
+ * `keyWithoutBackQuotes` путём добавления символов '`' `meaningfulBackQuoteCount` число раз.
67
+ */
68
+ get key(): string;
69
+ /**
70
+ * Количество значащих символов '`', соответствующих флагам.
71
+ */
72
+ get meaningfulBackQuoteCount(): number;
73
+ /**
74
+ * @param original Имя в том виде, в котором оно записано в исходном коде.
75
+ * @param flags Дополнительные флаги имени. `NameFlags.None` по умолчанию.
76
+ * @param preferredOriginal Имя, предпочтительное для использования. Принимается `original` по умолчанию.
77
+ */
78
+ constructor(original: string, flags?: NameFlags, preferredOriginal?: string);
79
+ considerEqual(other: Name, considerBackQuotes?: boolean): boolean;
80
+ toString(): string;
81
+ private static parse;
82
+ private static toOriginal;
83
+ }
@@ -0,0 +1,12 @@
1
+ export declare function kebabCaseToCamelCase(s: string): string;
2
+ /**
3
+ * Преобразует имя в формат kebab-case таким образом, чтобы при сравнении полученного имени
4
+ * с исходным метод `Name.universallyEquals` вернул `true`.
5
+ *
6
+ * @example
7
+ * myIdentifier -> my-identifier
8
+ * MyIdentifier -> My-identifier
9
+ * MY_NAME -> MY_NAME
10
+ * decodeURIComponent -> decode-URI-component
11
+ */
12
+ export declare function convertNameToKebabCasePreservingUniversalEquality(name: string): string;
@@ -0,0 +1,8 @@
1
+ export type NonEmptyArray<T> = [T, ...T[]];
2
+ export type ReadonlyNonEmptyArray<T> = readonly [T, ...T[]];
3
+ export declare function createNonEmptyArray<T>(array: T[]): NonEmptyArray<T>;
4
+ export declare function createNonEmptyArray<T>(array: readonly T[]): ReadonlyNonEmptyArray<T>;
5
+ export declare function createNonEmptyArray<T>(array: T[] | undefined): NonEmptyArray<T> | undefined;
6
+ export declare function createNonEmptyArray<T>(array: readonly T[] | undefined): ReadonlyNonEmptyArray<T> | undefined;
7
+ export declare function isNonEmptyArray<T>(array: T[] | undefined): array is NonEmptyArray<T>;
8
+ export declare function isNonEmptyArray<T>(array: readonly T[] | undefined): array is ReadonlyNonEmptyArray<T>;
@@ -0,0 +1,28 @@
1
+ export declare class Option<T> {
2
+ private readonly _isSome;
3
+ private readonly _value?;
4
+ private constructor();
5
+ static some<T>(value: T): Option<T>;
6
+ static none<T>(): Option<T>;
7
+ static fromNullable<T>(value: T | undefined): Option<T>;
8
+ toNullable(): T | undefined;
9
+ isSome(): boolean;
10
+ isSomeAnd(fn: (arg: T) => boolean): boolean;
11
+ isNone(): boolean;
12
+ unwrap(): T;
13
+ unwrapOr<K>(defaultValue: K): T | K;
14
+ unwrapOrWith(f: () => T): T;
15
+ map<K>(fn: (arg: T) => K): Option<K>;
16
+ mapOr<K>(fn: (arg: T) => K, defaultValue: K): K;
17
+ flatten(): FlatOption<T>;
18
+ flatMap<K>(fn: (arg: T) => K): FlatOption<K>;
19
+ expect(message: string): T;
20
+ filterMap<K>(fn: (arg: T) => Option<K>): Option<K>;
21
+ zip<K>(other: Option<K>): Option<[T, K]>;
22
+ filter(f: (arg: T) => boolean): Option<T>;
23
+ or(other: Option<T>): Option<T>;
24
+ orWith(f: () => Option<T>): Option<T>;
25
+ and(other: Option<T>): Option<T>;
26
+ }
27
+ type FlatOption<T> = T extends Option<unknown> ? T : Option<T>;
28
+ export {};
@@ -0,0 +1,5 @@
1
+ export declare enum PackageDialect {
2
+ Mixed = 0,
3
+ Usual = 1,
4
+ Special = 2
5
+ }
@@ -0,0 +1,15 @@
1
+ export declare enum PackageLocale {
2
+ En = 0,
3
+ Ru = 1
4
+ }
5
+ export declare const locales: readonly [{
6
+ readonly locale: PackageLocale.En;
7
+ readonly code: "en";
8
+ readonly names: ["english", "английский"];
9
+ }, {
10
+ readonly locale: PackageLocale.Ru;
11
+ readonly code: "ru";
12
+ readonly names: ["руc", "русский", "rus", "russian"];
13
+ }];
14
+ export declare function localeToString(locale: PackageLocale): string;
15
+ export declare function tryParseLocale(locale: string): PackageLocale | undefined;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Возвращает расширение, включая точку.
3
+ * @example
4
+ * 'Файл.арт' -> '.арт'
5
+ * 'Файл.тест.арт' -> '.арт'
6
+ * '.артель' -> ''
7
+ */
8
+ export declare function getFileExtension(nameOrPath: string): string;
@@ -0,0 +1,20 @@
1
+ export declare class PerformanceMeasurement {
2
+ static isEnabled: boolean;
3
+ private static readonly _durations;
4
+ private static readonly _measureInfoStack;
5
+ static markStart(label: string | number): void;
6
+ static markEnd(): void;
7
+ static getDurationMs(label: string | number): number;
8
+ static reset(): void;
9
+ private static nowMs;
10
+ }
11
+ export declare const enum PerformanceMeasurementStage {
12
+ Parsing = 0,
13
+ Analyzing = 1,
14
+ Emitting = 2,
15
+ IO = 3
16
+ }
17
+ export declare const performanceMeasurementStages: readonly [PerformanceMeasurementStage.Parsing, PerformanceMeasurementStage.Analyzing, PerformanceMeasurementStage.Emitting, PerformanceMeasurementStage.IO];
18
+ export declare const performanceMeasurementStageNames: {
19
+ [S in PerformanceMeasurementStage]: string;
20
+ };
@@ -0,0 +1,39 @@
1
+ export declare abstract class Query<T> implements Iterable<T> {
2
+ static from<T>(source: Iterable<T>): Query<T>;
3
+ static fromNullable<T>(source: Iterable<T> | undefined): Query<T>;
4
+ static empty<T>(): Query<T>;
5
+ static ofSuccessors<T>(first: T, next: (t: T) => T | undefined): Query<T>;
6
+ abstract [Symbol.iterator](): Iterator<T, void, undefined>;
7
+ map<K>(fn: (t: T) => K): Query<K>;
8
+ forEach(fn: (t: T) => void): void;
9
+ exhaust(): void;
10
+ last(): T | undefined;
11
+ first(): T | undefined;
12
+ first<K extends T>(fn: (t: T) => t is K): K | undefined;
13
+ first(fn: (t: T) => boolean): T | undefined;
14
+ toMap<K, V>(keySelector: (t: T) => K, valueSelector: (t: T) => V): Map<K, V>;
15
+ flatMap<K>(fn: (t: T) => Iterable<K>): Query<K>;
16
+ toArray(): T[];
17
+ count(): number;
18
+ chain(other: Iterable<T>): Query<T>;
19
+ filter<K extends T>(fn: (t: T) => t is K): Query<K>;
20
+ filter(fn: (t: T) => boolean): Query<T>;
21
+ mapAndFilter<K>(fn: (t: T) => K | undefined): Query<K>;
22
+ zip<TRight, TResult>(other: Iterable<TRight>, fn: (left: T, right: TRight) => TResult): Query<TResult>;
23
+ zipLongest<TRight, TResult>(other: Iterable<TRight>, fn: (left: T | undefined, right: TRight | undefined) => TResult): Query<TResult>;
24
+ unzip(): T extends readonly [infer TLeft, infer TRight] ? [TLeft[], TRight[]] : never;
25
+ toNullable(): ([T] extends [(infer K) | undefined] ? K[] : never) | undefined;
26
+ all(fn: (t: T) => boolean): boolean;
27
+ any(fn: (t: T) => boolean): boolean;
28
+ skipWhile(fn: (t: T) => boolean): Query<T>;
29
+ takeWhile(fn: (t: T) => boolean): Query<T>;
30
+ scan<TState, K>(initial: TState, fn: (state: TState, t: T) => K | undefined): Query<K>;
31
+ reduce<K>(initial: K, fn: (state: K, t: T) => K): K;
32
+ join(separator: string): string;
33
+ groupBy<K>(keySelector: (t: T) => K): Query<[K, T[]]>;
34
+ groupByToMap<K>(keySelector: (t: T) => K): Map<K, T[]>;
35
+ groupByToMap<K, V>(keySelector: (t: T) => K, mapFn: (t: T) => V): Map<K, V[]>;
36
+ unique(keySelector?: (t: T) => any): Query<T>;
37
+ uniqueToSet(): Set<T>;
38
+ maxByValue(valueSelector: (t: T) => number): T | undefined;
39
+ }