@teambit/typescript 0.0.0-02c0c8ffc2ebaf66ef5cbfc2e31c48e2b4acbfc7

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 (310) hide show
  1. package/cmds/check-types.cmd.ts +76 -0
  2. package/dist/cmds/check-types.cmd.d.ts +34 -0
  3. package/dist/cmds/check-types.cmd.js +101 -0
  4. package/dist/cmds/check-types.cmd.js.map +1 -0
  5. package/dist/compiler-options.d.ts +22 -0
  6. package/dist/compiler-options.js +3 -0
  7. package/dist/compiler-options.js.map +1 -0
  8. package/dist/esm.mjs +21 -0
  9. package/dist/exceptions/index.d.ts +1 -0
  10. package/dist/exceptions/index.js +20 -0
  11. package/dist/exceptions/index.js.map +1 -0
  12. package/dist/exceptions/transformer-not-found.d.ts +8 -0
  13. package/dist/exceptions/transformer-not-found.js +26 -0
  14. package/dist/exceptions/transformer-not-found.js.map +1 -0
  15. package/dist/export-identifier.d.ts +6 -0
  16. package/dist/export-identifier.js +29 -0
  17. package/dist/export-identifier.js.map +1 -0
  18. package/dist/extractor-options.d.ts +26 -0
  19. package/dist/extractor-options.js +3 -0
  20. package/dist/extractor-options.js.map +1 -0
  21. package/dist/identifier-list.d.ts +7 -0
  22. package/dist/identifier-list.js +21 -0
  23. package/dist/identifier-list.js.map +1 -0
  24. package/dist/identifier.d.ts +11 -0
  25. package/dist/identifier.js +45 -0
  26. package/dist/identifier.js.map +1 -0
  27. package/dist/index.d.ts +9 -0
  28. package/dist/index.js +91 -0
  29. package/dist/index.js.map +1 -0
  30. package/dist/preview-1752542268171.js +7 -0
  31. package/dist/remove-types-task.d.ts +12 -0
  32. package/dist/remove-types-task.js +64 -0
  33. package/dist/remove-types-task.js.map +1 -0
  34. package/dist/schema-extractor-context.d.ts +162 -0
  35. package/dist/schema-extractor-context.js +745 -0
  36. package/dist/schema-extractor-context.js.map +1 -0
  37. package/dist/schema-transformer.d.ts +19 -0
  38. package/dist/schema-transformer.js +3 -0
  39. package/dist/schema-transformer.js.map +1 -0
  40. package/dist/schema-transformer.plugin.d.ts +9 -0
  41. package/dist/schema-transformer.plugin.js +22 -0
  42. package/dist/schema-transformer.plugin.js.map +1 -0
  43. package/dist/sourceFileTransformers/class.d.ts +2 -0
  44. package/dist/sourceFileTransformers/class.js +57 -0
  45. package/dist/sourceFileTransformers/class.js.map +1 -0
  46. package/dist/sourceFileTransformers/empty-line-encoder.d.ts +14 -0
  47. package/dist/sourceFileTransformers/empty-line-encoder.js +62 -0
  48. package/dist/sourceFileTransformers/empty-line-encoder.js.map +1 -0
  49. package/dist/sourceFileTransformers/export.d.ts +2 -0
  50. package/dist/sourceFileTransformers/export.js +58 -0
  51. package/dist/sourceFileTransformers/export.js.map +1 -0
  52. package/dist/sourceFileTransformers/expression-statement.d.ts +2 -0
  53. package/dist/sourceFileTransformers/expression-statement.js +58 -0
  54. package/dist/sourceFileTransformers/expression-statement.js.map +1 -0
  55. package/dist/sourceFileTransformers/function.d.ts +2 -0
  56. package/dist/sourceFileTransformers/function.js +119 -0
  57. package/dist/sourceFileTransformers/function.js.map +1 -0
  58. package/dist/sourceFileTransformers/import.d.ts +2 -0
  59. package/dist/sourceFileTransformers/import.js +71 -0
  60. package/dist/sourceFileTransformers/import.js.map +1 -0
  61. package/dist/sourceFileTransformers/index.d.ts +12 -0
  62. package/dist/sourceFileTransformers/index.js +137 -0
  63. package/dist/sourceFileTransformers/index.js.map +1 -0
  64. package/dist/sourceFileTransformers/interface.d.ts +2 -0
  65. package/dist/sourceFileTransformers/interface.js +50 -0
  66. package/dist/sourceFileTransformers/interface.js.map +1 -0
  67. package/dist/sourceFileTransformers/replaceName.d.ts +1 -0
  68. package/dist/sourceFileTransformers/replaceName.js +19 -0
  69. package/dist/sourceFileTransformers/replaceName.js.map +1 -0
  70. package/dist/sourceFileTransformers/transform.d.ts +12 -0
  71. package/dist/sourceFileTransformers/transform.js +76 -0
  72. package/dist/sourceFileTransformers/transform.js.map +1 -0
  73. package/dist/sourceFileTransformers/type-reference.d.ts +2 -0
  74. package/dist/sourceFileTransformers/type-reference.js +38 -0
  75. package/dist/sourceFileTransformers/type-reference.js.map +1 -0
  76. package/dist/sourceFileTransformers/typeAlias.d.ts +2 -0
  77. package/dist/sourceFileTransformers/typeAlias.js +41 -0
  78. package/dist/sourceFileTransformers/typeAlias.js.map +1 -0
  79. package/dist/sourceFileTransformers/variable.d.ts +2 -0
  80. package/dist/sourceFileTransformers/variable.js +41 -0
  81. package/dist/sourceFileTransformers/variable.js.map +1 -0
  82. package/dist/transform-source-file.spec.d.ts +1 -0
  83. package/dist/transform-source-file.spec.js +182 -0
  84. package/dist/transform-source-file.spec.js.map +1 -0
  85. package/dist/transformers/array-literal-expression.d.ts +10 -0
  86. package/dist/transformers/array-literal-expression.js +51 -0
  87. package/dist/transformers/array-literal-expression.js.map +1 -0
  88. package/dist/transformers/array-type.d.ts +10 -0
  89. package/dist/transformers/array-type.js +37 -0
  90. package/dist/transformers/array-type.js.map +1 -0
  91. package/dist/transformers/binding-element.d.ts +17 -0
  92. package/dist/transformers/binding-element.js +63 -0
  93. package/dist/transformers/binding-element.js.map +1 -0
  94. package/dist/transformers/class-declaration.d.ts +12 -0
  95. package/dist/transformers/class-declaration.js +116 -0
  96. package/dist/transformers/class-declaration.js.map +1 -0
  97. package/dist/transformers/conditional-type.d.ts +10 -0
  98. package/dist/transformers/conditional-type.js +38 -0
  99. package/dist/transformers/conditional-type.js.map +1 -0
  100. package/dist/transformers/constructor.d.ts +10 -0
  101. package/dist/transformers/constructor.js +49 -0
  102. package/dist/transformers/constructor.js.map +1 -0
  103. package/dist/transformers/decorator.d.ts +10 -0
  104. package/dist/transformers/decorator.js +54 -0
  105. package/dist/transformers/decorator.js.map +1 -0
  106. package/dist/transformers/enum-declaration.d.ts +10 -0
  107. package/dist/transformers/enum-declaration.js +60 -0
  108. package/dist/transformers/enum-declaration.js.map +1 -0
  109. package/dist/transformers/export-assignment.d.ts +14 -0
  110. package/dist/transformers/export-assignment.js +52 -0
  111. package/dist/transformers/export-assignment.js.map +1 -0
  112. package/dist/transformers/export-declaration.d.ts +10 -0
  113. package/dist/transformers/export-declaration.js +154 -0
  114. package/dist/transformers/export-declaration.js.map +1 -0
  115. package/dist/transformers/expression-statement.d.ts +10 -0
  116. package/dist/transformers/expression-statement.js +36 -0
  117. package/dist/transformers/expression-statement.js.map +1 -0
  118. package/dist/transformers/function-like.d.ts +11 -0
  119. package/dist/transformers/function-like.js +81 -0
  120. package/dist/transformers/function-like.js.map +1 -0
  121. package/dist/transformers/get-accessor.d.ts +10 -0
  122. package/dist/transformers/get-accessor.js +46 -0
  123. package/dist/transformers/get-accessor.js.map +1 -0
  124. package/dist/transformers/import-declaration.d.ts +10 -0
  125. package/dist/transformers/import-declaration.js +72 -0
  126. package/dist/transformers/import-declaration.js.map +1 -0
  127. package/dist/transformers/index-signature.d.ts +10 -0
  128. package/dist/transformers/index-signature.js +41 -0
  129. package/dist/transformers/index-signature.js.map +1 -0
  130. package/dist/transformers/index.d.ts +43 -0
  131. package/dist/transformers/index.js +566 -0
  132. package/dist/transformers/index.js.map +1 -0
  133. package/dist/transformers/indexed-access-type.d.ts +10 -0
  134. package/dist/transformers/indexed-access-type.js +36 -0
  135. package/dist/transformers/indexed-access-type.js.map +1 -0
  136. package/dist/transformers/interface-declaration.d.ts +11 -0
  137. package/dist/transformers/interface-declaration.js +86 -0
  138. package/dist/transformers/interface-declaration.js.map +1 -0
  139. package/dist/transformers/intersection-type.d.ts +10 -0
  140. package/dist/transformers/intersection-type.js +47 -0
  141. package/dist/transformers/intersection-type.js.map +1 -0
  142. package/dist/transformers/keyword-type.d.ts +13 -0
  143. package/dist/transformers/keyword-type.js +54 -0
  144. package/dist/transformers/keyword-type.js.map +1 -0
  145. package/dist/transformers/literal-type.d.ts +13 -0
  146. package/dist/transformers/literal-type.js +39 -0
  147. package/dist/transformers/literal-type.js.map +1 -0
  148. package/dist/transformers/literal-value.d.ts +11 -0
  149. package/dist/transformers/literal-value.js +35 -0
  150. package/dist/transformers/literal-value.js.map +1 -0
  151. package/dist/transformers/module-declaration.d.ts +10 -0
  152. package/dist/transformers/module-declaration.js +36 -0
  153. package/dist/transformers/module-declaration.js.map +1 -0
  154. package/dist/transformers/named-tuple.d.ts +10 -0
  155. package/dist/transformers/named-tuple.js +37 -0
  156. package/dist/transformers/named-tuple.js.map +1 -0
  157. package/dist/transformers/object-literal-expression.d.ts +9 -0
  158. package/dist/transformers/object-literal-expression.js +51 -0
  159. package/dist/transformers/object-literal-expression.js.map +1 -0
  160. package/dist/transformers/parameter.d.ts +13 -0
  161. package/dist/transformers/parameter.js +109 -0
  162. package/dist/transformers/parameter.js.map +1 -0
  163. package/dist/transformers/parenthesized-type.d.ts +10 -0
  164. package/dist/transformers/parenthesized-type.js +35 -0
  165. package/dist/transformers/parenthesized-type.js.map +1 -0
  166. package/dist/transformers/property-assignment.d.ts +9 -0
  167. package/dist/transformers/property-assignment.js +39 -0
  168. package/dist/transformers/property-assignment.js.map +1 -0
  169. package/dist/transformers/property-declaration.d.ts +11 -0
  170. package/dist/transformers/property-declaration.js +56 -0
  171. package/dist/transformers/property-declaration.js.map +1 -0
  172. package/dist/transformers/set-accessor.d.ts +10 -0
  173. package/dist/transformers/set-accessor.js +44 -0
  174. package/dist/transformers/set-accessor.js.map +1 -0
  175. package/dist/transformers/source-file-transformer.d.ts +15 -0
  176. package/dist/transformers/source-file-transformer.js +108 -0
  177. package/dist/transformers/source-file-transformer.js.map +1 -0
  178. package/dist/transformers/template-literal-type-span.d.ts +10 -0
  179. package/dist/transformers/template-literal-type-span.js +36 -0
  180. package/dist/transformers/template-literal-type-span.js.map +1 -0
  181. package/dist/transformers/template-literal-type.d.ts +10 -0
  182. package/dist/transformers/template-literal-type.js +44 -0
  183. package/dist/transformers/template-literal-type.js.map +1 -0
  184. package/dist/transformers/this-type.d.ts +10 -0
  185. package/dist/transformers/this-type.js +34 -0
  186. package/dist/transformers/this-type.js.map +1 -0
  187. package/dist/transformers/tuple-type.d.ts +10 -0
  188. package/dist/transformers/tuple-type.js +46 -0
  189. package/dist/transformers/tuple-type.js.map +1 -0
  190. package/dist/transformers/type-alias.d.ts +11 -0
  191. package/dist/transformers/type-alias.js +48 -0
  192. package/dist/transformers/type-alias.js.map +1 -0
  193. package/dist/transformers/type-literal.d.ts +14 -0
  194. package/dist/transformers/type-literal.js +48 -0
  195. package/dist/transformers/type-literal.js.map +1 -0
  196. package/dist/transformers/type-operator.d.ts +14 -0
  197. package/dist/transformers/type-operator.js +51 -0
  198. package/dist/transformers/type-operator.js.map +1 -0
  199. package/dist/transformers/type-predicate.d.ts +10 -0
  200. package/dist/transformers/type-predicate.js +37 -0
  201. package/dist/transformers/type-predicate.js.map +1 -0
  202. package/dist/transformers/type-query.d.ts +13 -0
  203. package/dist/transformers/type-query.js +41 -0
  204. package/dist/transformers/type-query.js.map +1 -0
  205. package/dist/transformers/type-reference.d.ts +17 -0
  206. package/dist/transformers/type-reference.js +58 -0
  207. package/dist/transformers/type-reference.js.map +1 -0
  208. package/dist/transformers/union-type.d.ts +10 -0
  209. package/dist/transformers/union-type.js +47 -0
  210. package/dist/transformers/union-type.js.map +1 -0
  211. package/dist/transformers/utils/jsdoc-to-doc-schema.d.ts +5 -0
  212. package/dist/transformers/utils/jsdoc-to-doc-schema.js +114 -0
  213. package/dist/transformers/utils/jsdoc-to-doc-schema.js.map +1 -0
  214. package/dist/transformers/utils/parse-type-from-quick-info.d.ts +36 -0
  215. package/dist/transformers/utils/parse-type-from-quick-info.js +111 -0
  216. package/dist/transformers/utils/parse-type-from-quick-info.js.map +1 -0
  217. package/dist/transformers/variable-declaration.d.ts +11 -0
  218. package/dist/transformers/variable-declaration.js +102 -0
  219. package/dist/transformers/variable-declaration.js.map +1 -0
  220. package/dist/transformers/variable-statement.d.ts +14 -0
  221. package/dist/transformers/variable-statement.js +67 -0
  222. package/dist/transformers/variable-statement.js.map +1 -0
  223. package/dist/tsconfig.default.json +25 -0
  224. package/dist/typescript.aspect.d.ts +2 -0
  225. package/dist/typescript.aspect.js +18 -0
  226. package/dist/typescript.aspect.js.map +1 -0
  227. package/dist/typescript.composition.d.ts +1 -0
  228. package/dist/typescript.composition.js +29 -0
  229. package/dist/typescript.composition.js.map +1 -0
  230. package/dist/typescript.docs.mdx +8 -0
  231. package/dist/typescript.extractor.d.ts +51 -0
  232. package/dist/typescript.extractor.js +254 -0
  233. package/dist/typescript.extractor.js.map +1 -0
  234. package/dist/typescript.main.runtime.d.ts +129 -0
  235. package/dist/typescript.main.runtime.js +400 -0
  236. package/dist/typescript.main.runtime.js.map +1 -0
  237. package/dist/typescript.parser.d.ts +12 -0
  238. package/dist/typescript.parser.js +141 -0
  239. package/dist/typescript.parser.js.map +1 -0
  240. package/dist/typescript.parser.spec.d.ts +1 -0
  241. package/dist/typescript.parser.spec.js +189 -0
  242. package/dist/typescript.parser.spec.js.map +1 -0
  243. package/esm.mjs +21 -0
  244. package/exceptions/index.ts +1 -0
  245. package/exceptions/transformer-not-found.ts +19 -0
  246. package/package.json +86 -0
  247. package/sourceFileTransformers/class.ts +73 -0
  248. package/sourceFileTransformers/empty-line-encoder.ts +56 -0
  249. package/sourceFileTransformers/export.ts +65 -0
  250. package/sourceFileTransformers/expression-statement.ts +48 -0
  251. package/sourceFileTransformers/function.ts +170 -0
  252. package/sourceFileTransformers/import.ts +101 -0
  253. package/sourceFileTransformers/index.ts +14 -0
  254. package/sourceFileTransformers/interface.ts +41 -0
  255. package/sourceFileTransformers/replaceName.ts +11 -0
  256. package/sourceFileTransformers/transform.ts +70 -0
  257. package/sourceFileTransformers/type-reference.ts +19 -0
  258. package/sourceFileTransformers/typeAlias.ts +25 -0
  259. package/sourceFileTransformers/variable.ts +25 -0
  260. package/transformers/array-literal-expression.ts +33 -0
  261. package/transformers/array-type.ts +21 -0
  262. package/transformers/binding-element.ts +34 -0
  263. package/transformers/class-declaration.ts +108 -0
  264. package/transformers/conditional-type.ts +23 -0
  265. package/transformers/constructor.ts +40 -0
  266. package/transformers/decorator.ts +28 -0
  267. package/transformers/enum-declaration.ts +31 -0
  268. package/transformers/export-assignment.ts +33 -0
  269. package/transformers/export-declaration.ts +182 -0
  270. package/transformers/expression-statement.ts +20 -0
  271. package/transformers/function-like.ts +70 -0
  272. package/transformers/get-accessor.ts +24 -0
  273. package/transformers/import-declaration.ts +56 -0
  274. package/transformers/index-signature.ts +25 -0
  275. package/transformers/index.ts +43 -0
  276. package/transformers/indexed-access-type.ts +21 -0
  277. package/transformers/interface-declaration.ts +66 -0
  278. package/transformers/intersection-type.ts +25 -0
  279. package/transformers/keyword-type.ts +39 -0
  280. package/transformers/literal-type.ts +23 -0
  281. package/transformers/literal-value.ts +38 -0
  282. package/transformers/module-declaration.ts +20 -0
  283. package/transformers/named-tuple.ts +22 -0
  284. package/transformers/object-literal-expression.ts +28 -0
  285. package/transformers/parameter.ts +122 -0
  286. package/transformers/parenthesized-type.ts +20 -0
  287. package/transformers/property-assignment.ts +23 -0
  288. package/transformers/property-declaration.ts +34 -0
  289. package/transformers/set-accessor.ts +25 -0
  290. package/transformers/source-file-transformer.ts +94 -0
  291. package/transformers/template-literal-type-span.ts +21 -0
  292. package/transformers/template-literal-type.ts +24 -0
  293. package/transformers/this-type.ts +19 -0
  294. package/transformers/tuple-type.ts +24 -0
  295. package/transformers/type-alias.ts +26 -0
  296. package/transformers/type-literal.ts +26 -0
  297. package/transformers/type-operator.ts +37 -0
  298. package/transformers/type-predicate.ts +22 -0
  299. package/transformers/type-query.ts +25 -0
  300. package/transformers/type-reference.ts +36 -0
  301. package/transformers/union-type.ts +25 -0
  302. package/transformers/utils/jsdoc-to-doc-schema.ts +121 -0
  303. package/transformers/utils/parse-type-from-quick-info.ts +99 -0
  304. package/transformers/variable-declaration.ts +111 -0
  305. package/transformers/variable-statement.ts +32 -0
  306. package/tsconfig.default.json +25 -0
  307. package/types/asset.d.ts +41 -0
  308. package/types/style.d.ts +42 -0
  309. package/typescript.composition.tsx +7 -0
  310. package/typescript.docs.mdx +8 -0
@@ -0,0 +1,154 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.ExportDeclarationTransformer = void 0;
7
+ function _semanticsEntities() {
8
+ const data = require("@teambit/semantics.entities.semantic-schema");
9
+ _semanticsEntities = function () {
10
+ return data;
11
+ };
12
+ return data;
13
+ }
14
+ function _typescript() {
15
+ const data = _interopRequireWildcard(require("typescript"));
16
+ _typescript = function () {
17
+ return data;
18
+ };
19
+ return data;
20
+ }
21
+ function _exportIdentifier() {
22
+ const data = require("../export-identifier");
23
+ _exportIdentifier = function () {
24
+ return data;
25
+ };
26
+ return data;
27
+ }
28
+ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
29
+ class ExportDeclarationTransformer {
30
+ predicate(node) {
31
+ return node.kind === _typescript().SyntaxKind.ExportDeclaration;
32
+ }
33
+ async getIdentifiers(exportDec, context) {
34
+ // e.g. `export { button1, button2 } as Composition from './button';
35
+ const rawSourceFilePath = exportDec.moduleSpecifier?.getText();
36
+
37
+ // strip off quotes ''
38
+ const sourceFilePath = rawSourceFilePath && rawSourceFilePath.substring(1, rawSourceFilePath?.length - 1);
39
+ if (exportDec.exportClause?.kind === _typescript().default.SyntaxKind.NamedExports) {
40
+ return exportDec.exportClause.elements.map(elm => {
41
+ const alias = elm.propertyName && elm.name.getText() || undefined;
42
+ const id = elm.propertyName?.getText() || elm.name.getText();
43
+ const fileName = elm.getSourceFile().fileName;
44
+ return new (_exportIdentifier().ExportIdentifier)(id, fileName, alias, sourceFilePath);
45
+ });
46
+ }
47
+
48
+ // e.g. `export * as Composition from './button';
49
+ if (exportDec.exportClause?.kind === _typescript().default.SyntaxKind.NamespaceExport) {
50
+ return [new (_exportIdentifier().ExportIdentifier)(exportDec.exportClause.name.getText(), exportDec.getSourceFile().fileName, undefined, sourceFilePath)];
51
+ }
52
+ if (exportDec.moduleSpecifier) {
53
+ return context.getFileExports(exportDec);
54
+ }
55
+ return [];
56
+ }
57
+ async transform(exportDec, context) {
58
+ const exportClause = exportDec.exportClause;
59
+
60
+ // it's export-all, e.g. `export * from './button'`;
61
+ if (!exportClause) {
62
+ const specifier = exportDec.moduleSpecifier;
63
+ if (!specifier) {
64
+ throw new Error(`fatal: no specifier`);
65
+ }
66
+ const sourceFile = await context.getSourceFileFromNode(specifier);
67
+ // export * from 'webpack', export-all from a package
68
+ if (!sourceFile) {
69
+ return new (_semanticsEntities().UnImplementedSchema)(context.getLocation(exportDec), exportDec.getText(), _typescript().SyntaxKind[_typescript().SyntaxKind.ExportDeclaration]);
70
+ }
71
+ return context.computeSchema(sourceFile);
72
+ }
73
+
74
+ // e.g. `export { button1, button2 } as Composition from './button';
75
+ if (exportClause.kind === _typescript().SyntaxKind.NamedExports) {
76
+ const schemas = await namedExport(exportClause, context);
77
+ return new (_semanticsEntities().ModuleSchema)(context.getLocation(exportDec), schemas, []);
78
+ }
79
+ // e.g. `export * as Composition from './button';
80
+ if (exportClause.kind === _typescript().SyntaxKind.NamespaceExport) {
81
+ return namespaceExport(exportClause, exportDec, context);
82
+ }
83
+
84
+ // should never reach here. exportClause can be either NamespaceExport or NamedExports
85
+ throw new Error(`unrecognized exportClause type`);
86
+ }
87
+ }
88
+ exports.ExportDeclarationTransformer = ExportDeclarationTransformer;
89
+ function isSameNode(nodeA, nodeB) {
90
+ return nodeA.kind === nodeB.kind && nodeA.pos === nodeB.pos && nodeA.end === nodeB.end;
91
+ }
92
+ async function namedExport(exportClause, context) {
93
+ const schemas = await Promise.all(exportClause.elements.map(async element => {
94
+ return exportSpecifierToSchemaNode(element, context);
95
+ }));
96
+ return schemas;
97
+ }
98
+ async function exportSpecifierToSchemaNode(element, context) {
99
+ try {
100
+ const name = element.propertyName?.getText() || element.name.getText();
101
+ const alias = element.propertyName ? element.name.getText() : undefined;
102
+ const location = context.getLocation(element.name);
103
+ const definitionInfo = element.isTypeOnly ? await context.definitionInfo(element.name) : await context.definitionInfo(element);
104
+ if (!definitionInfo) {
105
+ const exportNode = new (_semanticsEntities().UnresolvedSchema)(location, element.name.getText());
106
+ // happens for example when the main index.ts file exports variable from an mdx file.
107
+ // tsserver is unable to get the definition node because it doesn't know to parse mdx files.
108
+ // return new UnresolvedSchema(context.getLocation(element.name), element.name.getText());
109
+ return new (_semanticsEntities().ExportSchema)(location, name, exportNode, alias);
110
+ }
111
+ const definitionNode = await context.definition(definitionInfo);
112
+ if (!definitionNode) {
113
+ const exportNode = await context.resolveType(element, name);
114
+ return new (_semanticsEntities().ExportSchema)(location, name, exportNode, alias);
115
+ }
116
+
117
+ // if it is reexported from another export
118
+ if (isSameNode(element, definitionNode.parent)) {
119
+ // the definition node is the same node as element.name. tsserver wasn't able to find the source for it
120
+ // normally, "bit install" should fix it. another option is to open vscode and look for errors.
121
+ throw new Error(`error: tsserver is unable to locate the identifier "${element.name.getText()}" at ${context.getLocationAsString(element.name)}.
122
+ make sure "bit status" is clean and there are no errors about missing packages/links.
123
+ also, make sure the tsconfig.json in the root has the "jsx" setting defined.`);
124
+ }
125
+ if (definitionNode.parent.kind === _typescript().SyntaxKind.ExportSpecifier) {
126
+ return await exportSpecifierToSchemaNode(definitionNode.parent, context);
127
+ }
128
+ const exportNode = await context.computeSchema(definitionNode.parent);
129
+ return new (_semanticsEntities().ExportSchema)(location, name, exportNode, alias);
130
+ } catch {
131
+ const exportNode = new (_semanticsEntities().UnresolvedSchema)(context.getLocation(element.name), element.name.getText());
132
+ return new (_semanticsEntities().ExportSchema)(context.getLocation(element.name), element.name.getText(), exportNode);
133
+ }
134
+ }
135
+ async function namespaceExport(exportClause, exportDec, context) {
136
+ const namespace = exportClause.name.getText();
137
+ const filePath = await context.getFilePathByNode(exportClause.name);
138
+ if (!filePath) {
139
+ throw new Error(`unable to find the file-path for "${namespace}"`);
140
+ }
141
+ const sourceFile = context.getSourceFileInsideComponent(filePath);
142
+ if (!sourceFile) {
143
+ // it's a namespace from another component or an external package.
144
+ return context.getTypeRefForExternalPath(namespace, filePath, context.getLocation(exportDec));
145
+ }
146
+ const result = await context.computeSchema(sourceFile);
147
+ if (!(result instanceof _semanticsEntities().ModuleSchema)) {
148
+ throw new Error(`expect result to be instance of Module`);
149
+ }
150
+ result.namespace = namespace;
151
+ return result;
152
+ }
153
+
154
+ //# sourceMappingURL=export-declaration.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_semanticsEntities","data","require","_typescript","_interopRequireWildcard","_exportIdentifier","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","ExportDeclarationTransformer","predicate","node","kind","SyntaxKind","ExportDeclaration","getIdentifiers","exportDec","context","rawSourceFilePath","moduleSpecifier","getText","sourceFilePath","substring","length","exportClause","ts","NamedExports","elements","map","elm","alias","propertyName","name","undefined","id","fileName","getSourceFile","ExportIdentifier","NamespaceExport","getFileExports","transform","specifier","Error","sourceFile","getSourceFileFromNode","UnImplementedSchema","getLocation","computeSchema","schemas","namedExport","ModuleSchema","namespaceExport","exports","isSameNode","nodeA","nodeB","pos","end","Promise","all","element","exportSpecifierToSchemaNode","location","definitionInfo","isTypeOnly","exportNode","UnresolvedSchema","ExportSchema","definitionNode","definition","resolveType","parent","getLocationAsString","ExportSpecifier","namespace","filePath","getFilePathByNode","getSourceFileInsideComponent","getTypeRefForExternalPath","result"],"sources":["export-declaration.ts"],"sourcesContent":["import {\n SchemaNode,\n ModuleSchema,\n UnresolvedSchema,\n UnImplementedSchema,\n ExportSchema,\n} from '@teambit/semantics.entities.semantic-schema';\nimport ts, {\n Node,\n SyntaxKind,\n ExportDeclaration as ExportDeclarationNode,\n NamedExports,\n NamespaceExport,\n ExportSpecifier,\n} from 'typescript';\nimport { SchemaExtractorContext } from '../schema-extractor-context';\nimport { SchemaTransformer } from '../schema-transformer';\nimport { ExportIdentifier } from '../export-identifier';\n\nexport class ExportDeclarationTransformer implements SchemaTransformer {\n predicate(node: Node) {\n return node.kind === SyntaxKind.ExportDeclaration;\n }\n\n async getIdentifiers(exportDec: ExportDeclarationNode, context: SchemaExtractorContext) {\n // e.g. `export { button1, button2 } as Composition from './button';\n const rawSourceFilePath = exportDec.moduleSpecifier?.getText();\n\n // strip off quotes ''\n const sourceFilePath = rawSourceFilePath && rawSourceFilePath.substring(1, rawSourceFilePath?.length - 1);\n\n if (exportDec.exportClause?.kind === ts.SyntaxKind.NamedExports) {\n return exportDec.exportClause.elements.map((elm) => {\n const alias = (elm.propertyName && elm.name.getText()) || undefined;\n const id = elm.propertyName?.getText() || elm.name.getText();\n const fileName = elm.getSourceFile().fileName;\n\n return new ExportIdentifier(id, fileName, alias, sourceFilePath);\n });\n }\n\n // e.g. `export * as Composition from './button';\n if (exportDec.exportClause?.kind === ts.SyntaxKind.NamespaceExport) {\n return [\n new ExportIdentifier(\n exportDec.exportClause.name.getText(),\n exportDec.getSourceFile().fileName,\n undefined,\n sourceFilePath\n ),\n ];\n }\n\n if (exportDec.moduleSpecifier) {\n return context.getFileExports(exportDec);\n }\n\n return [];\n }\n\n async transform(exportDec: ExportDeclarationNode, context: SchemaExtractorContext): Promise<SchemaNode> {\n const exportClause = exportDec.exportClause;\n\n // it's export-all, e.g. `export * from './button'`;\n if (!exportClause) {\n const specifier = exportDec.moduleSpecifier;\n if (!specifier) {\n throw new Error(`fatal: no specifier`);\n }\n const sourceFile = await context.getSourceFileFromNode(specifier);\n // export * from 'webpack', export-all from a package\n if (!sourceFile) {\n return new UnImplementedSchema(\n context.getLocation(exportDec),\n exportDec.getText(),\n SyntaxKind[SyntaxKind.ExportDeclaration]\n );\n }\n return context.computeSchema(sourceFile);\n }\n\n // e.g. `export { button1, button2 } as Composition from './button';\n if (exportClause.kind === SyntaxKind.NamedExports) {\n const schemas = await namedExport(exportClause, context);\n return new ModuleSchema(context.getLocation(exportDec), schemas, []);\n }\n // e.g. `export * as Composition from './button';\n if (exportClause.kind === SyntaxKind.NamespaceExport) {\n return namespaceExport(exportClause, exportDec, context);\n }\n\n // should never reach here. exportClause can be either NamespaceExport or NamedExports\n throw new Error(`unrecognized exportClause type`);\n }\n}\n\nfunction isSameNode(nodeA: Node, nodeB: Node): boolean {\n return nodeA.kind === nodeB.kind && nodeA.pos === nodeB.pos && nodeA.end === nodeB.end;\n}\n\nasync function namedExport(exportClause: NamedExports, context: SchemaExtractorContext): Promise<ExportSchema[]> {\n const schemas = await Promise.all(\n exportClause.elements.map(async (element) => {\n return exportSpecifierToSchemaNode(element, context);\n })\n );\n\n return schemas;\n}\n\nasync function exportSpecifierToSchemaNode(\n element: ExportSpecifier,\n context: SchemaExtractorContext\n): Promise<ExportSchema> {\n try {\n const name = element.propertyName?.getText() || element.name.getText();\n const alias = element.propertyName ? element.name.getText() : undefined;\n const location = context.getLocation(element.name);\n const definitionInfo = element.isTypeOnly\n ? await context.definitionInfo(element.name)\n : await context.definitionInfo(element);\n\n if (!definitionInfo) {\n const exportNode = new UnresolvedSchema(location, element.name.getText());\n // happens for example when the main index.ts file exports variable from an mdx file.\n // tsserver is unable to get the definition node because it doesn't know to parse mdx files.\n // return new UnresolvedSchema(context.getLocation(element.name), element.name.getText());\n return new ExportSchema(location, name, exportNode, alias);\n }\n\n const definitionNode = await context.definition(definitionInfo);\n\n if (!definitionNode) {\n const exportNode = await context.resolveType(element, name);\n return new ExportSchema(location, name, exportNode, alias);\n }\n\n // if it is reexported from another export\n if (isSameNode(element, definitionNode.parent)) {\n // the definition node is the same node as element.name. tsserver wasn't able to find the source for it\n // normally, \"bit install\" should fix it. another option is to open vscode and look for errors.\n throw new Error(`error: tsserver is unable to locate the identifier \"${element.name.getText()}\" at ${context.getLocationAsString(\n element.name\n )}.\nmake sure \"bit status\" is clean and there are no errors about missing packages/links.\nalso, make sure the tsconfig.json in the root has the \"jsx\" setting defined.`);\n }\n\n if (definitionNode.parent.kind === SyntaxKind.ExportSpecifier) {\n return await exportSpecifierToSchemaNode(definitionNode.parent as ExportSpecifier, context);\n }\n\n const exportNode = await context.computeSchema(definitionNode.parent);\n return new ExportSchema(location, name, exportNode, alias);\n } catch {\n const exportNode = new UnresolvedSchema(context.getLocation(element.name), element.name.getText());\n return new ExportSchema(context.getLocation(element.name), element.name.getText(), exportNode);\n }\n}\n\nasync function namespaceExport(\n exportClause: NamespaceExport,\n exportDec: ExportDeclarationNode,\n context: SchemaExtractorContext\n) {\n const namespace = exportClause.name.getText();\n const filePath = await context.getFilePathByNode(exportClause.name);\n if (!filePath) {\n throw new Error(`unable to find the file-path for \"${namespace}\"`);\n }\n const sourceFile = context.getSourceFileInsideComponent(filePath);\n if (!sourceFile) {\n // it's a namespace from another component or an external package.\n return context.getTypeRefForExternalPath(namespace, filePath, context.getLocation(exportDec));\n }\n const result = await context.computeSchema(sourceFile);\n if (!(result instanceof ModuleSchema)) {\n throw new Error(`expect result to be instance of Module`);\n }\n result.namespace = namespace;\n return result;\n}\n"],"mappings":";;;;;;AAAA,SAAAA,mBAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,kBAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAOA,SAAAE,YAAA;EAAA,MAAAF,IAAA,GAAAG,uBAAA,CAAAF,OAAA;EAAAC,WAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAUA,SAAAI,kBAAA;EAAA,MAAAJ,IAAA,GAAAC,OAAA;EAAAG,iBAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA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AAY,CAACQ,IAAI,CAACZ,OAAO,CAAC,CAAC;EAC7C,MAAMuD,QAAQ,GAAG,MAAM1D,OAAO,CAAC2D,iBAAiB,CAACpD,YAAY,CAACQ,IAAI,CAAC;EACnE,IAAI,CAAC2C,QAAQ,EAAE;IACb,MAAM,IAAIjC,KAAK,CAAC,qCAAqCgC,SAAS,GAAG,CAAC;EACpE;EACA,MAAM/B,UAAU,GAAG1B,OAAO,CAAC4D,4BAA4B,CAACF,QAAQ,CAAC;EACjE,IAAI,CAAChC,UAAU,EAAE;IACf;IACA,OAAO1B,OAAO,CAAC6D,yBAAyB,CAACJ,SAAS,EAAEC,QAAQ,EAAE1D,OAAO,CAAC6B,WAAW,CAAC9B,SAAS,CAAC,CAAC;EAC/F;EACA,MAAM+D,MAAM,GAAG,MAAM9D,OAAO,CAAC8B,aAAa,CAACJ,UAAU,CAAC;EACtD,IAAI,EAAEoC,MAAM,YAAY7B,iCAAY,CAAC,EAAE;IACrC,MAAM,IAAIR,KAAK,CAAC,wCAAwC,CAAC;EAC3D;EACAqC,MAAM,CAACL,SAAS,GAAGA,SAAS;EAC5B,OAAOK,MAAM;AACf","ignoreList":[]}
@@ -0,0 +1,10 @@
1
+ import { Node, ExpressionStatement } from 'typescript';
2
+ import { UnImplementedSchema } from '@teambit/semantics.entities.semantic-schema';
3
+ import { SchemaTransformer } from '../schema-transformer';
4
+ import { SchemaExtractorContext } from '../schema-extractor-context';
5
+ import { Identifier } from '../identifier';
6
+ export declare class ExpressionStatementTransformer implements SchemaTransformer {
7
+ predicate(node: Node): boolean;
8
+ getIdentifiers(): Promise<Identifier[]>;
9
+ transform(node: ExpressionStatement, context: SchemaExtractorContext): Promise<UnImplementedSchema>;
10
+ }
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.ExpressionStatementTransformer = void 0;
7
+ function _typescript() {
8
+ const data = _interopRequireDefault(require("typescript"));
9
+ _typescript = function () {
10
+ return data;
11
+ };
12
+ return data;
13
+ }
14
+ function _semanticsEntities() {
15
+ const data = require("@teambit/semantics.entities.semantic-schema");
16
+ _semanticsEntities = function () {
17
+ return data;
18
+ };
19
+ return data;
20
+ }
21
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
22
+ class ExpressionStatementTransformer {
23
+ predicate(node) {
24
+ return node.kind === _typescript().default.SyntaxKind.ExpressionStatement;
25
+ }
26
+ async getIdentifiers() {
27
+ return [];
28
+ }
29
+ async transform(node, context) {
30
+ const location = context.getLocation(node);
31
+ return new (_semanticsEntities().UnImplementedSchema)(location, node.getText(), _typescript().default.SyntaxKind[node.kind]);
32
+ }
33
+ }
34
+ exports.ExpressionStatementTransformer = ExpressionStatementTransformer;
35
+
36
+ //# sourceMappingURL=expression-statement.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_typescript","data","_interopRequireDefault","require","_semanticsEntities","e","__esModule","default","ExpressionStatementTransformer","predicate","node","kind","ts","SyntaxKind","ExpressionStatement","getIdentifiers","transform","context","location","getLocation","UnImplementedSchema","getText","exports"],"sources":["expression-statement.ts"],"sourcesContent":["import ts, { Node, ExpressionStatement } from 'typescript';\nimport { UnImplementedSchema } from '@teambit/semantics.entities.semantic-schema';\nimport { SchemaTransformer } from '../schema-transformer';\nimport { SchemaExtractorContext } from '../schema-extractor-context';\nimport { Identifier } from '../identifier';\n\nexport class ExpressionStatementTransformer implements SchemaTransformer {\n predicate(node: Node) {\n return node.kind === ts.SyntaxKind.ExpressionStatement;\n }\n\n async getIdentifiers(): Promise<Identifier[]> {\n return [];\n }\n\n async transform(node: ExpressionStatement, context: SchemaExtractorContext) {\n const location = context.getLocation(node);\n return new UnImplementedSchema(location, node.getText(), ts.SyntaxKind[node.kind]);\n }\n}\n"],"mappings":";;;;;;AAAA,SAAAA,YAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,WAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,mBAAA;EAAA,MAAAH,IAAA,GAAAE,OAAA;EAAAC,kBAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAAkF,SAAAC,uBAAAG,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAK3E,MAAMG,8BAA8B,CAA8B;EACvEC,SAASA,CAACC,IAAU,EAAE;IACpB,OAAOA,IAAI,CAACC,IAAI,KAAKC,qBAAE,CAACC,UAAU,CAACC,mBAAmB;EACxD;EAEA,MAAMC,cAAcA,CAAA,EAA0B;IAC5C,OAAO,EAAE;EACX;EAEA,MAAMC,SAASA,CAACN,IAAyB,EAAEO,OAA+B,EAAE;IAC1E,MAAMC,QAAQ,GAAGD,OAAO,CAACE,WAAW,CAACT,IAAI,CAAC;IAC1C,OAAO,KAAIU,wCAAmB,EAACF,QAAQ,EAAER,IAAI,CAACW,OAAO,CAAC,CAAC,EAAET,qBAAE,CAACC,UAAU,CAACH,IAAI,CAACC,IAAI,CAAC,CAAC;EACpF;AACF;AAACW,OAAA,CAAAd,8BAAA,GAAAA,8BAAA","ignoreList":[]}
@@ -0,0 +1,11 @@
1
+ import { SchemaNode } from '@teambit/semantics.entities.semantic-schema';
2
+ import { Node, SignatureDeclaration } from 'typescript';
3
+ import { SchemaExtractorContext } from '../schema-extractor-context';
4
+ import { SchemaTransformer } from '../schema-transformer';
5
+ import { Identifier } from '../identifier';
6
+ export declare class FunctionLikeTransformer implements SchemaTransformer {
7
+ predicate(node: Node): boolean;
8
+ getIdentifiers(funcDec: SignatureDeclaration): Promise<Identifier[]>;
9
+ private getName;
10
+ transform(node: SignatureDeclaration, context: SchemaExtractorContext): Promise<SchemaNode>;
11
+ }
@@ -0,0 +1,81 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.FunctionLikeTransformer = void 0;
7
+ function _semanticsEntities() {
8
+ const data = require("@teambit/semantics.entities.semantic-schema");
9
+ _semanticsEntities = function () {
10
+ return data;
11
+ };
12
+ return data;
13
+ }
14
+ function _typescript() {
15
+ const data = _interopRequireDefault(require("typescript"));
16
+ _typescript = function () {
17
+ return data;
18
+ };
19
+ return data;
20
+ }
21
+ function _pMapSeries() {
22
+ const data = _interopRequireDefault(require("p-map-series"));
23
+ _pMapSeries = function () {
24
+ return data;
25
+ };
26
+ return data;
27
+ }
28
+ function _parseTypeFromQuickInfo() {
29
+ const data = require("./utils/parse-type-from-quick-info");
30
+ _parseTypeFromQuickInfo = function () {
31
+ return data;
32
+ };
33
+ return data;
34
+ }
35
+ function _identifier() {
36
+ const data = require("../identifier");
37
+ _identifier = function () {
38
+ return data;
39
+ };
40
+ return data;
41
+ }
42
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
43
+ class FunctionLikeTransformer {
44
+ predicate(node) {
45
+ return node.kind === _typescript().default.SyntaxKind.FunctionDeclaration || node.kind === _typescript().default.SyntaxKind.ArrowFunction || node.kind === _typescript().default.SyntaxKind.MethodDeclaration || node.kind === _typescript().default.SyntaxKind.CallSignature || node.kind === _typescript().default.SyntaxKind.ConstructSignature || node.kind === _typescript().default.SyntaxKind.FunctionType || node.kind === _typescript().default.SyntaxKind.MethodSignature;
46
+ }
47
+
48
+ // need to check for anonymous functions assigned for vars, const and let.
49
+ async getIdentifiers(funcDec) {
50
+ return [new (_identifier().Identifier)(this.getName(funcDec), funcDec.getSourceFile().fileName)];
51
+ }
52
+ getName(funcDec) {
53
+ if (funcDec.kind === _typescript().default.SyntaxKind.ConstructSignature) return 'new';
54
+ return funcDec.name?.getText() || '';
55
+ }
56
+ async transform(node, context) {
57
+ const name = this.getName(node);
58
+ const nodeModifiers = _typescript().default.canHaveModifiers(node) ? _typescript().default.getModifiers(node) : undefined;
59
+ const getQuickInfoFromDefaultModifier = async () => {
60
+ const defaultModifier = nodeModifiers?.find(modifier => modifier.kind === _typescript().default.SyntaxKind.DefaultKeyword);
61
+ if (defaultModifier) return context.getQuickInfo(defaultModifier);
62
+ if (node.kind === _typescript().default.SyntaxKind.ArrowFunction) return context.getQuickInfo(node.equalsGreaterThanToken);
63
+ return null;
64
+ };
65
+ const info = node.name ? await context.getQuickInfo(node.name) : await getQuickInfoFromDefaultModifier();
66
+ const returnTypeStr = info ? (0, _parseTypeFromQuickInfo().parseTypeFromQuickInfo)(info) : 'any';
67
+ const displaySig = info?.body?.displayString || '';
68
+ const args = await (0, _pMapSeries().default)(node.parameters, async param => context.computeSchema(param));
69
+ const returnType = await context.resolveType(node, returnTypeStr);
70
+ const modifiers = nodeModifiers?.map(modifier => modifier.getText()) || [];
71
+ const typeParameters = node.typeParameters?.map(typeParam => typeParam.name.getText());
72
+ const location = context.getLocation(node);
73
+ const doc = await context.jsDocToDocSchema(node);
74
+ const nodeDecorators = _typescript().default.canHaveDecorators(node) ? _typescript().default.getDecorators(node) : undefined;
75
+ const decorators = nodeDecorators?.length ? await (0, _pMapSeries().default)(nodeDecorators, decorator => context.computeSchema(decorator)) : undefined;
76
+ return new (_semanticsEntities().FunctionLikeSchema)(location, name, args, returnType, displaySig, modifiers, doc, typeParameters, decorators);
77
+ }
78
+ }
79
+ exports.FunctionLikeTransformer = FunctionLikeTransformer;
80
+
81
+ //# sourceMappingURL=function-like.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_semanticsEntities","data","require","_typescript","_interopRequireDefault","_pMapSeries","_parseTypeFromQuickInfo","_identifier","e","__esModule","default","FunctionLikeTransformer","predicate","node","kind","ts","SyntaxKind","FunctionDeclaration","ArrowFunction","MethodDeclaration","CallSignature","ConstructSignature","FunctionType","MethodSignature","getIdentifiers","funcDec","Identifier","getName","getSourceFile","fileName","name","getText","transform","context","nodeModifiers","canHaveModifiers","getModifiers","undefined","getQuickInfoFromDefaultModifier","defaultModifier","find","modifier","DefaultKeyword","getQuickInfo","equalsGreaterThanToken","info","returnTypeStr","parseTypeFromQuickInfo","displaySig","body","displayString","args","pMapSeries","parameters","param","computeSchema","returnType","resolveType","modifiers","map","typeParameters","typeParam","location","getLocation","doc","jsDocToDocSchema","nodeDecorators","canHaveDecorators","getDecorators","decorators","length","decorator","FunctionLikeSchema","exports"],"sources":["function-like.ts"],"sourcesContent":["import { FunctionLikeSchema, ParameterSchema, SchemaNode, Modifier } from '@teambit/semantics.entities.semantic-schema';\nimport ts, { Node, SignatureDeclaration } from 'typescript';\nimport pMapSeries from 'p-map-series';\nimport { SchemaExtractorContext } from '../schema-extractor-context';\nimport { SchemaTransformer } from '../schema-transformer';\nimport { parseTypeFromQuickInfo } from './utils/parse-type-from-quick-info';\nimport { Identifier } from '../identifier';\n\nexport class FunctionLikeTransformer implements SchemaTransformer {\n predicate(node: Node) {\n return (\n node.kind === ts.SyntaxKind.FunctionDeclaration ||\n node.kind === ts.SyntaxKind.ArrowFunction ||\n node.kind === ts.SyntaxKind.MethodDeclaration ||\n node.kind === ts.SyntaxKind.CallSignature ||\n node.kind === ts.SyntaxKind.ConstructSignature ||\n node.kind === ts.SyntaxKind.FunctionType ||\n node.kind === ts.SyntaxKind.MethodSignature\n );\n }\n\n // need to check for anonymous functions assigned for vars, const and let.\n async getIdentifiers(funcDec: SignatureDeclaration) {\n return [new Identifier(this.getName(funcDec), funcDec.getSourceFile().fileName)];\n }\n\n private getName(funcDec: SignatureDeclaration) {\n if (funcDec.kind === ts.SyntaxKind.ConstructSignature) return 'new';\n return funcDec.name?.getText() || '';\n }\n\n async transform(node: SignatureDeclaration, context: SchemaExtractorContext): Promise<SchemaNode> {\n const name = this.getName(node);\n const nodeModifiers = ts.canHaveModifiers(node) ? ts.getModifiers(node) : undefined;\n const getQuickInfoFromDefaultModifier = async () => {\n const defaultModifier = nodeModifiers?.find((modifier) => modifier.kind === ts.SyntaxKind.DefaultKeyword);\n if (defaultModifier) return context.getQuickInfo(defaultModifier);\n if (node.kind === ts.SyntaxKind.ArrowFunction) return context.getQuickInfo(node.equalsGreaterThanToken);\n return null;\n };\n const info = node.name ? await context.getQuickInfo(node.name) : await getQuickInfoFromDefaultModifier();\n const returnTypeStr = info ? parseTypeFromQuickInfo(info) : 'any';\n const displaySig = info?.body?.displayString || '';\n const args = (await pMapSeries(node.parameters, async (param) =>\n context.computeSchema(param)\n )) as ParameterSchema[];\n\n const returnType = await context.resolveType(node, returnTypeStr);\n const modifiers = nodeModifiers?.map((modifier) => modifier.getText()) || [];\n const typeParameters = node.typeParameters?.map((typeParam) => typeParam.name.getText());\n const location = context.getLocation(node);\n const doc = await context.jsDocToDocSchema(node);\n const nodeDecorators = ts.canHaveDecorators(node) ? ts.getDecorators(node) : undefined;\n const decorators = nodeDecorators?.length\n ? await pMapSeries(nodeDecorators, (decorator) => context.computeSchema(decorator))\n : undefined;\n\n return new FunctionLikeSchema(\n location,\n name,\n args,\n returnType,\n displaySig,\n modifiers as Modifier[],\n doc,\n typeParameters,\n decorators\n );\n }\n}\n"],"mappings":";;;;;;AAAA,SAAAA,mBAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,kBAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,YAAA;EAAA,MAAAF,IAAA,GAAAG,sBAAA,CAAAF,OAAA;EAAAC,WAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,YAAA;EAAA,MAAAJ,IAAA,GAAAG,sBAAA,CAAAF,OAAA;EAAAG,WAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAGA,SAAAK,wBAAA;EAAA,MAAAL,IAAA,GAAAC,OAAA;EAAAI,uBAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAM,YAAA;EAAA,MAAAN,IAAA,GA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,GAAG/C,IAAI,CAAC+C,cAAc,EAAED,GAAG,CAAEE,SAAS,IAAKA,SAAS,CAAC/B,IAAI,CAACC,OAAO,CAAC,CAAC,CAAC;IACxF,MAAM+B,QAAQ,GAAG7B,OAAO,CAAC8B,WAAW,CAAClD,IAAI,CAAC;IAC1C,MAAMmD,GAAG,GAAG,MAAM/B,OAAO,CAACgC,gBAAgB,CAACpD,IAAI,CAAC;IAChD,MAAMqD,cAAc,GAAGnD,qBAAE,CAACoD,iBAAiB,CAACtD,IAAI,CAAC,GAAGE,qBAAE,CAACqD,aAAa,CAACvD,IAAI,CAAC,GAAGwB,SAAS;IACtF,MAAMgC,UAAU,GAAGH,cAAc,EAAEI,MAAM,GACrC,MAAM,IAAAlB,qBAAU,EAACc,cAAc,EAAGK,SAAS,IAAKtC,OAAO,CAACsB,aAAa,CAACgB,SAAS,CAAC,CAAC,GACjFlC,SAAS;IAEb,OAAO,KAAImC,uCAAkB,EAC3BV,QAAQ,EACRhC,IAAI,EACJqB,IAAI,EACJK,UAAU,EACVR,UAAU,EACVU,SAAS,EACTM,GAAG,EACHJ,cAAc,EACdS,UACF,CAAC;EACH;AACF;AAACI,OAAA,CAAA9D,uBAAA,GAAAA,uBAAA","ignoreList":[]}
@@ -0,0 +1,10 @@
1
+ import { Node, GetAccessorDeclaration } from 'typescript';
2
+ import { GetAccessorSchema } from '@teambit/semantics.entities.semantic-schema';
3
+ import { SchemaTransformer } from '../schema-transformer';
4
+ import { SchemaExtractorContext } from '../schema-extractor-context';
5
+ import { Identifier } from '../identifier';
6
+ export declare class GetAccessorTransformer implements SchemaTransformer {
7
+ predicate(node: Node): boolean;
8
+ getIdentifiers(): Promise<Identifier[]>;
9
+ transform(node: GetAccessorDeclaration, context: SchemaExtractorContext): Promise<GetAccessorSchema>;
10
+ }
@@ -0,0 +1,46 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.GetAccessorTransformer = void 0;
7
+ function _typescript() {
8
+ const data = _interopRequireDefault(require("typescript"));
9
+ _typescript = function () {
10
+ return data;
11
+ };
12
+ return data;
13
+ }
14
+ function _semanticsEntities() {
15
+ const data = require("@teambit/semantics.entities.semantic-schema");
16
+ _semanticsEntities = function () {
17
+ return data;
18
+ };
19
+ return data;
20
+ }
21
+ function _parseTypeFromQuickInfo() {
22
+ const data = require("./utils/parse-type-from-quick-info");
23
+ _parseTypeFromQuickInfo = function () {
24
+ return data;
25
+ };
26
+ return data;
27
+ }
28
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
29
+ class GetAccessorTransformer {
30
+ predicate(node) {
31
+ return node.kind === _typescript().default.SyntaxKind.GetAccessor;
32
+ }
33
+ async getIdentifiers() {
34
+ return [];
35
+ }
36
+ async transform(node, context) {
37
+ const info = await context.getQuickInfo(node.name);
38
+ const displaySig = info?.body?.displayString || '';
39
+ const typeStr = (0, _parseTypeFromQuickInfo().parseTypeFromQuickInfo)(info);
40
+ const type = await context.resolveType(node, typeStr);
41
+ return new (_semanticsEntities().GetAccessorSchema)(context.getLocation(node), node.name.getText(), type, displaySig);
42
+ }
43
+ }
44
+ exports.GetAccessorTransformer = GetAccessorTransformer;
45
+
46
+ //# sourceMappingURL=get-accessor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_typescript","data","_interopRequireDefault","require","_semanticsEntities","_parseTypeFromQuickInfo","e","__esModule","default","GetAccessorTransformer","predicate","node","kind","ts","SyntaxKind","GetAccessor","getIdentifiers","transform","context","info","getQuickInfo","name","displaySig","body","displayString","typeStr","parseTypeFromQuickInfo","type","resolveType","GetAccessorSchema","getLocation","getText","exports"],"sources":["get-accessor.ts"],"sourcesContent":["import ts, { Node, GetAccessorDeclaration } from 'typescript';\nimport { GetAccessorSchema } from '@teambit/semantics.entities.semantic-schema';\nimport { SchemaTransformer } from '../schema-transformer';\nimport { SchemaExtractorContext } from '../schema-extractor-context';\nimport { parseTypeFromQuickInfo } from './utils/parse-type-from-quick-info';\nimport { Identifier } from '../identifier';\n\nexport class GetAccessorTransformer implements SchemaTransformer {\n predicate(node: Node) {\n return node.kind === ts.SyntaxKind.GetAccessor;\n }\n\n async getIdentifiers(): Promise<Identifier[]> {\n return [];\n }\n\n async transform(node: GetAccessorDeclaration, context: SchemaExtractorContext) {\n const info = await context.getQuickInfo(node.name);\n const displaySig = info?.body?.displayString || '';\n const typeStr = parseTypeFromQuickInfo(info);\n const type = await context.resolveType(node, typeStr);\n return new GetAccessorSchema(context.getLocation(node), node.name.getText(), type, displaySig);\n }\n}\n"],"mappings":";;;;;;AAAA,SAAAA,YAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,WAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,mBAAA;EAAA,MAAAH,IAAA,GAAAE,OAAA;EAAAC,kBAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAGA,SAAAI,wBAAA;EAAA,MAAAJ,IAAA,GAAAE,OAAA;EAAAE,uBAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAA4E,SAAAC,uBAAAI,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAGrE,MAAMG,sBAAsB,CAA8B;EAC/DC,SAASA,CAACC,IAAU,EAAE;IACpB,OAAOA,IAAI,CAACC,IAAI,KAAKC,qBAAE,CAACC,UAAU,CAACC,WAAW;EAChD;EAEA,MAAMC,cAAcA,CAAA,EAA0B;IAC5C,OAAO,EAAE;EACX;EAEA,MAAMC,SAASA,CAACN,IAA4B,EAAEO,OAA+B,EAAE;IAC7E,MAAMC,IAAI,GAAG,MAAMD,OAAO,CAACE,YAAY,CAACT,IAAI,CAACU,IAAI,CAAC;IAClD,MAAMC,UAAU,GAAGH,IAAI,EAAEI,IAAI,EAAEC,aAAa,IAAI,EAAE;IAClD,MAAMC,OAAO,GAAG,IAAAC,gDAAsB,EAACP,IAAI,CAAC;IAC5C,MAAMQ,IAAI,GAAG,MAAMT,OAAO,CAACU,WAAW,CAACjB,IAAI,EAAEc,OAAO,CAAC;IACrD,OAAO,KAAII,sCAAiB,EAACX,OAAO,CAACY,WAAW,CAACnB,IAAI,CAAC,EAAEA,IAAI,CAACU,IAAI,CAACU,OAAO,CAAC,CAAC,EAAEJ,IAAI,EAAEL,UAAU,CAAC;EAChG;AACF;AAACU,OAAA,CAAAvB,sBAAA,GAAAA,sBAAA","ignoreList":[]}
@@ -0,0 +1,10 @@
1
+ import { ImportDeclaration, Node } from 'typescript';
2
+ import { UnImplementedSchema } from '@teambit/semantics.entities.semantic-schema';
3
+ import { SchemaTransformer } from '../schema-transformer';
4
+ import { SchemaExtractorContext } from '../schema-extractor-context';
5
+ import { Identifier } from '../identifier';
6
+ export declare class ImportDeclarationTransformer implements SchemaTransformer {
7
+ predicate(node: Node): boolean;
8
+ getIdentifiers(importDec: ImportDeclaration): Promise<Identifier[]>;
9
+ transform(node: ImportDeclaration, context: SchemaExtractorContext): Promise<UnImplementedSchema>;
10
+ }
@@ -0,0 +1,72 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.ImportDeclarationTransformer = void 0;
7
+ function _typescript() {
8
+ const data = require("typescript");
9
+ _typescript = function () {
10
+ return data;
11
+ };
12
+ return data;
13
+ }
14
+ function _semanticsEntities() {
15
+ const data = require("@teambit/semantics.entities.semantic-schema");
16
+ _semanticsEntities = function () {
17
+ return data;
18
+ };
19
+ return data;
20
+ }
21
+ function _identifier() {
22
+ const data = require("../identifier");
23
+ _identifier = function () {
24
+ return data;
25
+ };
26
+ return data;
27
+ }
28
+ class ImportDeclarationTransformer {
29
+ predicate(node) {
30
+ return node.kind === _typescript().SyntaxKind.ImportDeclaration;
31
+ }
32
+ async getIdentifiers(importDec) {
33
+ if (!importDec.importClause) return [];
34
+ const sourceFile = importDec.getSourceFile().fileName;
35
+ const rawSourceFilePath = importDec.moduleSpecifier.getText();
36
+ const sourceFilePath = rawSourceFilePath.substring(1, rawSourceFilePath.length - 1);
37
+
38
+ // import A from 'a'
39
+ if (!importDec.importClause.namedBindings) {
40
+ return [new (_identifier().Identifier)(importDec.importClause.getText(), sourceFile, undefined, sourceFilePath)];
41
+ }
42
+
43
+ // import { A } from 'a'
44
+ if (importDec.importClause.namedBindings?.kind === _typescript().SyntaxKind.NamedImports) {
45
+ const {
46
+ elements
47
+ } = importDec.importClause.namedBindings;
48
+ return elements.map(({
49
+ name,
50
+ propertyName
51
+ }) => {
52
+ const id = propertyName?.getText() || name.getText();
53
+ const alias = propertyName && name.getText() || undefined;
54
+ const identifier = new (_identifier().Identifier)(id, sourceFile, alias, sourceFilePath);
55
+ return identifier;
56
+ });
57
+ }
58
+
59
+ // import * as A from 'a';
60
+ if (importDec.importClause.namedBindings.kind === _typescript().SyntaxKind.NamespaceImport) {
61
+ return [new (_identifier().Identifier)(importDec.importClause.namedBindings.name.getText(), sourceFile, undefined, importDec.moduleSpecifier.getText())];
62
+ }
63
+ return [];
64
+ }
65
+ async transform(node, context) {
66
+ const location = context.getLocation(node);
67
+ return new (_semanticsEntities().UnImplementedSchema)(location, node.getText(), node.kind.toString());
68
+ }
69
+ }
70
+ exports.ImportDeclarationTransformer = ImportDeclarationTransformer;
71
+
72
+ //# sourceMappingURL=import-declaration.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_typescript","data","require","_semanticsEntities","_identifier","ImportDeclarationTransformer","predicate","node","kind","SyntaxKind","ImportDeclaration","getIdentifiers","importDec","importClause","sourceFile","getSourceFile","fileName","rawSourceFilePath","moduleSpecifier","getText","sourceFilePath","substring","length","namedBindings","Identifier","undefined","NamedImports","elements","map","name","propertyName","id","alias","identifier","NamespaceImport","transform","context","location","getLocation","UnImplementedSchema","toString","exports"],"sources":["import-declaration.ts"],"sourcesContent":["import { ImportDeclaration, Node, SyntaxKind } from 'typescript';\nimport { UnImplementedSchema } from '@teambit/semantics.entities.semantic-schema';\nimport { SchemaTransformer } from '../schema-transformer';\nimport { SchemaExtractorContext } from '../schema-extractor-context';\nimport { Identifier } from '../identifier';\n\nexport class ImportDeclarationTransformer implements SchemaTransformer {\n predicate(node: Node) {\n return node.kind === SyntaxKind.ImportDeclaration;\n }\n\n async getIdentifiers(importDec: ImportDeclaration): Promise<Identifier[]> {\n if (!importDec.importClause) return [];\n\n const sourceFile = importDec.getSourceFile().fileName;\n const rawSourceFilePath = importDec.moduleSpecifier.getText();\n const sourceFilePath = rawSourceFilePath.substring(1, rawSourceFilePath.length - 1);\n\n // import A from 'a'\n if (!importDec.importClause.namedBindings) {\n return [new Identifier(importDec.importClause.getText(), sourceFile, undefined, sourceFilePath)];\n }\n\n // import { A } from 'a'\n if (importDec.importClause.namedBindings?.kind === SyntaxKind.NamedImports) {\n const { elements } = importDec.importClause.namedBindings;\n\n return elements.map(({ name, propertyName }) => {\n const id = propertyName?.getText() || name.getText();\n const alias = (propertyName && name.getText()) || undefined;\n const identifier = new Identifier(id, sourceFile, alias, sourceFilePath);\n return identifier;\n });\n }\n\n // import * as A from 'a';\n if (importDec.importClause.namedBindings.kind === SyntaxKind.NamespaceImport) {\n return [\n new Identifier(\n importDec.importClause.namedBindings.name.getText(),\n sourceFile,\n undefined,\n importDec.moduleSpecifier.getText()\n ),\n ];\n }\n\n return [];\n }\n\n async transform(node: ImportDeclaration, context: SchemaExtractorContext) {\n const location = context.getLocation(node);\n\n return new UnImplementedSchema(location, node.getText(), node.kind.toString());\n }\n}\n"],"mappings":";;;;;;AAAA,SAAAA,YAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,WAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,mBAAA;EAAA,MAAAF,IAAA,GAAAC,O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pD,MAAMa,KAAK,GAAIF,YAAY,IAAID,IAAI,CAACV,OAAO,CAAC,CAAC,IAAKM,SAAS;QAC3D,MAAMQ,UAAU,GAAG,KAAIT,wBAAU,EAACO,EAAE,EAAEjB,UAAU,EAAEkB,KAAK,EAAEZ,cAAc,CAAC;QACxE,OAAOa,UAAU;MACnB,CAAC,CAAC;IACJ;;IAEA;IACA,IAAIrB,SAAS,CAACC,YAAY,CAACU,aAAa,CAACf,IAAI,KAAKC,wBAAU,CAACyB,eAAe,EAAE;MAC5E,OAAO,CACL,KAAIV,wBAAU,EACZZ,SAAS,CAACC,YAAY,CAACU,aAAa,CAACM,IAAI,CAACV,OAAO,CAAC,CAAC,EACnDL,UAAU,EACVW,SAAS,EACTb,SAAS,CAACM,eAAe,CAACC,OAAO,CAAC,CACpC,CAAC,CACF;IACH;IAEA,OAAO,EAAE;EACX;EAEA,MAAMgB,SAASA,CAAC5B,IAAuB,EAAE6B,OAA+B,EAAE;IACxE,MAAMC,QAAQ,GAAGD,OAAO,CAACE,WAAW,CAAC/B,IAAI,CAAC;IAE1C,OAAO,KAAIgC,wCAAmB,EAACF,QAAQ,EAAE9B,IAAI,CAACY,OAAO,CAAC,CAAC,EAAEZ,IAAI,CAACC,IAAI,CAACgC,QAAQ,CAAC,CAAC,CAAC;EAChF;AACF;AAACC,OAAA,CAAApC,4BAAA,GAAAA,4BAAA","ignoreList":[]}
@@ -0,0 +1,10 @@
1
+ import { Node, IndexSignatureDeclaration } from 'typescript';
2
+ import { IndexSignatureSchema, UnresolvedSchema } from '@teambit/semantics.entities.semantic-schema';
3
+ import { SchemaTransformer } from '../schema-transformer';
4
+ import { SchemaExtractorContext } from '../schema-extractor-context';
5
+ import { Identifier } from '../identifier';
6
+ export declare class IndexSignatureTransformer implements SchemaTransformer {
7
+ predicate(node: Node): boolean;
8
+ getIdentifiers(): Promise<Identifier[]>;
9
+ transform(node: IndexSignatureDeclaration, context: SchemaExtractorContext): Promise<IndexSignatureSchema | UnresolvedSchema>;
10
+ }
@@ -0,0 +1,41 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.IndexSignatureTransformer = void 0;
7
+ function _typescript() {
8
+ const data = _interopRequireDefault(require("typescript"));
9
+ _typescript = function () {
10
+ return data;
11
+ };
12
+ return data;
13
+ }
14
+ function _semanticsEntities() {
15
+ const data = require("@teambit/semantics.entities.semantic-schema");
16
+ _semanticsEntities = function () {
17
+ return data;
18
+ };
19
+ return data;
20
+ }
21
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
22
+ class IndexSignatureTransformer {
23
+ predicate(node) {
24
+ return node.kind === _typescript().default.SyntaxKind.IndexSignature;
25
+ }
26
+ async getIdentifiers() {
27
+ return [];
28
+ }
29
+ async transform(node, context) {
30
+ const param = node.parameters[0];
31
+ if (!param) {
32
+ return new (_semanticsEntities().UnresolvedSchema)(context.getLocation(node), `IndexSignatureTransformer: no parameter found`);
33
+ }
34
+ const keyType = await context.computeSchema(param);
35
+ const valueType = await context.computeSchema(node.type);
36
+ return new (_semanticsEntities().IndexSignatureSchema)(context.getLocation(node), keyType, valueType);
37
+ }
38
+ }
39
+ exports.IndexSignatureTransformer = IndexSignatureTransformer;
40
+
41
+ //# sourceMappingURL=index-signature.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_typescript","data","_interopRequireDefault","require","_semanticsEntities","e","__esModule","default","IndexSignatureTransformer","predicate","node","kind","ts","SyntaxKind","IndexSignature","getIdentifiers","transform","context","param","parameters","UnresolvedSchema","getLocation","keyType","computeSchema","valueType","type","IndexSignatureSchema","exports"],"sources":["index-signature.ts"],"sourcesContent":["import ts, { Node, IndexSignatureDeclaration } from 'typescript';\nimport { IndexSignatureSchema, ParameterSchema, UnresolvedSchema } from '@teambit/semantics.entities.semantic-schema';\nimport { SchemaTransformer } from '../schema-transformer';\nimport { SchemaExtractorContext } from '../schema-extractor-context';\nimport { Identifier } from '../identifier';\n\nexport class IndexSignatureTransformer implements SchemaTransformer {\n predicate(node: Node) {\n return node.kind === ts.SyntaxKind.IndexSignature;\n }\n\n async getIdentifiers(): Promise<Identifier[]> {\n return [];\n }\n\n async transform(node: IndexSignatureDeclaration, context: SchemaExtractorContext) {\n const param = node.parameters[0];\n if (!param) {\n return new UnresolvedSchema(context.getLocation(node), `IndexSignatureTransformer: no parameter found`);\n }\n const keyType = (await context.computeSchema(param)) as ParameterSchema;\n const valueType = await context.computeSchema(node.type);\n return new IndexSignatureSchema(context.getLocation(node), keyType, valueType);\n }\n}\n"],"mappings":";;;;;;AAAA,SAAAA,YAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,WAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,mBAAA;EAAA,MAAAH,IAAA,GAAAE,OAAA;EAAAC,kBAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAAsH,SAAAC,uBAAAG,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAK/G,MAAMG,yBAAyB,CAA8B;EAClEC,SAASA,CAACC,IAAU,EAAE;IACpB,OAAOA,IAAI,CAACC,IAAI,KAAKC,qBAAE,CAACC,UAAU,CAACC,cAAc;EACnD;EAEA,MAAMC,cAAcA,CAAA,EAA0B;IAC5C,OAAO,EAAE;EACX;EAEA,MAAMC,SAASA,CAACN,IAA+B,EAAEO,OAA+B,EAAE;IAChF,MAAMC,KAAK,GAAGR,IAAI,CAACS,UAAU,CAAC,CAAC,CAAC;IAChC,IAAI,CAACD,KAAK,EAAE;MACV,OAAO,KAAIE,qCAAgB,EAACH,OAAO,CAACI,WAAW,CAACX,IAAI,CAAC,EAAE,+CAA+C,CAAC;IACzG;IACA,MAAMY,OAAO,GAAI,MAAML,OAAO,CAACM,aAAa,CAACL,KAAK,CAAqB;IACvE,MAAMM,SAAS,GAAG,MAAMP,OAAO,CAACM,aAAa,CAACb,IAAI,CAACe,IAAI,CAAC;IACxD,OAAO,KAAIC,yCAAoB,EAACT,OAAO,CAACI,WAAW,CAACX,IAAI,CAAC,EAAEY,OAAO,EAAEE,SAAS,CAAC;EAChF;AACF;AAACG,OAAA,CAAAnB,yBAAA,GAAAA,yBAAA","ignoreList":[]}
@@ -0,0 +1,43 @@
1
+ export { ExportDeclarationTransformer } from './export-declaration';
2
+ export { FunctionLikeTransformer } from './function-like';
3
+ export { ParameterTransformer } from './parameter';
4
+ export { VariableStatementTransformer } from './variable-statement';
5
+ export { VariableDeclaration } from './variable-declaration';
6
+ export { SourceFileTransformer } from './source-file-transformer';
7
+ export { TypeAliasTransformer } from './type-alias';
8
+ export { IntersectionTypeTransformer } from './intersection-type';
9
+ export { UnionTypeTransformer } from './union-type';
10
+ export { TypeReferenceTransformer } from './type-reference';
11
+ export { TypeLiteralTransformer } from './type-literal';
12
+ export { LiteralTypeTransformer } from './literal-type';
13
+ export { TypeQueryTransformer } from './type-query';
14
+ export { TypeOperatorTransformer } from './type-operator';
15
+ export { KeywordTypeTransformer } from './keyword-type';
16
+ export { TupleTypeTransformer } from './tuple-type';
17
+ export { ParenthesizedTypeTransformer } from './parenthesized-type';
18
+ export { TypePredicateTransformer } from './type-predicate';
19
+ export { IndexedAccessTypeTransformer } from './indexed-access-type';
20
+ export { TemplateLiteralTypeSpanTransformer } from './template-literal-type-span';
21
+ export { TemplateLiteralTypeTransformer } from './template-literal-type';
22
+ export { ThisTypeTransformer } from './this-type';
23
+ export { ConditionalTypeTransformer } from './conditional-type';
24
+ export { NamedTupleTransformer } from './named-tuple';
25
+ export { ArrayTypeTransformer } from './array-type';
26
+ export { ClassDeclarationTransformer } from './class-declaration';
27
+ export { ConstructorTransformer } from './constructor';
28
+ export { PropertyDeclarationTransformer } from './property-declaration';
29
+ export { SetAccessorTransformer } from './set-accessor';
30
+ export { GetAccessorTransformer } from './get-accessor';
31
+ export { IndexSignatureTransformer } from './index-signature';
32
+ export { InterfaceDeclarationTransformer } from './interface-declaration';
33
+ export { EnumDeclarationTransformer } from './enum-declaration';
34
+ export { BindingElementTransformer } from './binding-element';
35
+ export { ExportAssignmentTransformer } from './export-assignment';
36
+ export { ImportDeclarationTransformer } from './import-declaration';
37
+ export { ExpressionStatementTransformer } from './expression-statement';
38
+ export { ModuleDeclarationTransformer } from './module-declaration';
39
+ export { DecoratorTransformer } from './decorator';
40
+ export { ArrayLiteralExpressionTransformer } from './array-literal-expression';
41
+ export { ObjectLiteralExpressionTransformer } from './object-literal-expression';
42
+ export { PropertyAssignmentTransformer } from './property-assignment';
43
+ export { LiteralValueTransformer } from './literal-value';