@supernovaio/cli 2.0.39 → 2.0.40

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 (136) hide show
  1. package/dist/code-analyzer/analyzers/component-usage.d.ts +6 -0
  2. package/dist/code-analyzer/analyzers/component-usage.d.ts.map +1 -0
  3. package/dist/code-analyzer/analyzers/component-usage.js +344 -0
  4. package/dist/code-analyzer/analyzers/component-usage.js.map +1 -0
  5. package/dist/code-analyzer/analyzers/helpers.d.ts +11 -0
  6. package/dist/code-analyzer/analyzers/helpers.d.ts.map +1 -0
  7. package/dist/code-analyzer/analyzers/helpers.js +59 -0
  8. package/dist/code-analyzer/analyzers/helpers.js.map +1 -0
  9. package/dist/code-analyzer/analyzers/index.d.ts +8 -0
  10. package/dist/code-analyzer/analyzers/index.d.ts.map +1 -0
  11. package/dist/code-analyzer/analyzers/index.js +11 -0
  12. package/dist/code-analyzer/analyzers/index.js.map +1 -0
  13. package/dist/code-analyzer/analyzers/jsdoc.d.ts +3 -0
  14. package/dist/code-analyzer/analyzers/jsdoc.d.ts.map +1 -0
  15. package/dist/code-analyzer/analyzers/jsdoc.js +7 -0
  16. package/dist/code-analyzer/analyzers/jsdoc.js.map +1 -0
  17. package/dist/code-analyzer/analyzers/static-components.d.ts +3 -0
  18. package/dist/code-analyzer/analyzers/static-components.d.ts.map +1 -0
  19. package/dist/code-analyzer/analyzers/static-components.js +399 -0
  20. package/dist/code-analyzer/analyzers/static-components.js.map +1 -0
  21. package/dist/code-analyzer/analyzers/storybook-docs.d.ts +3 -0
  22. package/dist/code-analyzer/analyzers/storybook-docs.d.ts.map +1 -0
  23. package/dist/code-analyzer/analyzers/storybook-docs.js +163 -0
  24. package/dist/code-analyzer/analyzers/storybook-docs.js.map +1 -0
  25. package/dist/code-analyzer/analyzers/storybook-stories.d.ts +3 -0
  26. package/dist/code-analyzer/analyzers/storybook-stories.d.ts.map +1 -0
  27. package/dist/code-analyzer/analyzers/storybook-stories.js +91 -0
  28. package/dist/code-analyzer/analyzers/storybook-stories.js.map +1 -0
  29. package/dist/code-analyzer/analyzers/types.d.ts +88 -0
  30. package/dist/code-analyzer/analyzers/types.d.ts.map +1 -0
  31. package/dist/code-analyzer/analyzers/types.js +12 -0
  32. package/dist/code-analyzer/analyzers/types.js.map +1 -0
  33. package/dist/code-analyzer/analyzers/typescript-api.d.ts +3 -0
  34. package/dist/code-analyzer/analyzers/typescript-api.d.ts.map +1 -0
  35. package/dist/code-analyzer/analyzers/typescript-api.js +7 -0
  36. package/dist/code-analyzer/analyzers/typescript-api.js.map +1 -0
  37. package/dist/code-analyzer/components/analyze.d.ts +8 -0
  38. package/dist/code-analyzer/components/analyze.d.ts.map +1 -0
  39. package/dist/code-analyzer/components/analyze.js +38 -0
  40. package/dist/code-analyzer/components/analyze.js.map +1 -0
  41. package/dist/code-analyzer/components/mappers/component.d.ts +4 -0
  42. package/dist/code-analyzer/components/mappers/component.d.ts.map +1 -0
  43. package/dist/code-analyzer/components/mappers/component.js +20 -0
  44. package/dist/code-analyzer/components/mappers/component.js.map +1 -0
  45. package/dist/code-analyzer/components/mappers/property.d.ts +4 -0
  46. package/dist/code-analyzer/components/mappers/property.d.ts.map +1 -0
  47. package/dist/code-analyzer/components/mappers/property.js +19 -0
  48. package/dist/code-analyzer/components/mappers/property.js.map +1 -0
  49. package/dist/code-analyzer/components/parser/index.d.ts +6 -0
  50. package/dist/code-analyzer/components/parser/index.d.ts.map +1 -0
  51. package/dist/code-analyzer/components/parser/index.js +9 -0
  52. package/dist/code-analyzer/components/parser/index.js.map +1 -0
  53. package/dist/code-analyzer/components/parser/module-parser.d.ts +12 -0
  54. package/dist/code-analyzer/components/parser/module-parser.d.ts.map +1 -0
  55. package/dist/code-analyzer/components/parser/module-parser.js +116 -0
  56. package/dist/code-analyzer/components/parser/module-parser.js.map +1 -0
  57. package/dist/code-analyzer/components/parser/parser.d.ts +46 -0
  58. package/dist/code-analyzer/components/parser/parser.d.ts.map +1 -0
  59. package/dist/code-analyzer/components/parser/parser.js +904 -0
  60. package/dist/code-analyzer/components/parser/parser.js.map +1 -0
  61. package/dist/code-analyzer/components/parser/types.d.ts +123 -0
  62. package/dist/code-analyzer/components/parser/types.d.ts.map +1 -0
  63. package/dist/code-analyzer/components/parser/types.js +21 -0
  64. package/dist/code-analyzer/components/parser/types.js.map +1 -0
  65. package/dist/code-analyzer/components/parser/utils/build-filter.d.ts +3 -0
  66. package/dist/code-analyzer/components/parser/utils/build-filter.d.ts.map +1 -0
  67. package/dist/code-analyzer/components/parser/utils/build-filter.js +31 -0
  68. package/dist/code-analyzer/components/parser/utils/build-filter.js.map +1 -0
  69. package/dist/code-analyzer/components/parser/utils/filter-duplicates.d.ts +3 -0
  70. package/dist/code-analyzer/components/parser/utils/filter-duplicates.d.ts.map +1 -0
  71. package/dist/code-analyzer/components/parser/utils/filter-duplicates.js +17 -0
  72. package/dist/code-analyzer/components/parser/utils/filter-duplicates.js.map +1 -0
  73. package/dist/code-analyzer/components/parser/utils/is-react-component.d.ts +4 -0
  74. package/dist/code-analyzer/components/parser/utils/is-react-component.d.ts.map +1 -0
  75. package/dist/code-analyzer/components/parser/utils/is-react-component.js +43 -0
  76. package/dist/code-analyzer/components/parser/utils/is-react-component.js.map +1 -0
  77. package/dist/code-analyzer/components/parser/utils/trim-file-name.d.ts +2 -0
  78. package/dist/code-analyzer/components/parser/utils/trim-file-name.d.ts.map +1 -0
  79. package/dist/code-analyzer/components/parser/utils/trim-file-name.js +22 -0
  80. package/dist/code-analyzer/components/parser/utils/trim-file-name.js.map +1 -0
  81. package/dist/code-analyzer/components/types.d.ts +18 -0
  82. package/dist/code-analyzer/components/types.d.ts.map +1 -0
  83. package/dist/code-analyzer/components/types.js +5 -0
  84. package/dist/code-analyzer/components/types.js.map +1 -0
  85. package/dist/code-analyzer/components/utils/get-module-exports-path.d.ts +2 -0
  86. package/dist/code-analyzer/components/utils/get-module-exports-path.d.ts.map +1 -0
  87. package/dist/code-analyzer/components/utils/get-module-exports-path.js +60 -0
  88. package/dist/code-analyzer/components/utils/get-module-exports-path.js.map +1 -0
  89. package/dist/code-analyzer/index.d.ts +5 -0
  90. package/dist/code-analyzer/index.d.ts.map +1 -0
  91. package/dist/code-analyzer/index.js +8 -0
  92. package/dist/code-analyzer/index.js.map +1 -0
  93. package/dist/code-analyzer/orchestrator/index.d.ts +2 -0
  94. package/dist/code-analyzer/orchestrator/index.d.ts.map +1 -0
  95. package/dist/code-analyzer/orchestrator/index.js +5 -0
  96. package/dist/code-analyzer/orchestrator/index.js.map +1 -0
  97. package/dist/code-analyzer/orchestrator/run-analysis.d.ts +19 -0
  98. package/dist/code-analyzer/orchestrator/run-analysis.d.ts.map +1 -0
  99. package/dist/code-analyzer/orchestrator/run-analysis.js +109 -0
  100. package/dist/code-analyzer/orchestrator/run-analysis.js.map +1 -0
  101. package/dist/code-analyzer/snapshot/index.d.ts +2 -0
  102. package/dist/code-analyzer/snapshot/index.d.ts.map +1 -0
  103. package/dist/code-analyzer/snapshot/index.js +5 -0
  104. package/dist/code-analyzer/snapshot/index.js.map +1 -0
  105. package/dist/code-analyzer/snapshot/write-snapshot.d.ts +17 -0
  106. package/dist/code-analyzer/snapshot/write-snapshot.d.ts.map +1 -0
  107. package/dist/code-analyzer/snapshot/write-snapshot.js +60 -0
  108. package/dist/code-analyzer/snapshot/write-snapshot.js.map +1 -0
  109. package/dist/commands/components-import.js +3 -3
  110. package/dist/commands/components-import.js.map +1 -1
  111. package/dist/commands/publish-documentation.d.ts +2 -2
  112. package/dist/commands/run-local-exporter.js +2 -2
  113. package/dist/commands/run-local-exporter.js.map +1 -1
  114. package/dist/commands/storybook-import.d.ts +2 -2
  115. package/dist/commands/template-upload.d.ts.map +1 -1
  116. package/dist/commands/template-upload.js +10 -12
  117. package/dist/commands/template-upload.js.map +1 -1
  118. package/dist/types/config.d.ts +5 -5
  119. package/dist/types/types.js +2 -2
  120. package/dist/types/types.js.map +1 -1
  121. package/dist/utils/analyze-command.js +3 -3
  122. package/dist/utils/analyze-command.js.map +1 -1
  123. package/dist/utils/discover.d.ts +2 -2
  124. package/dist/utils/discover.d.ts.map +1 -1
  125. package/dist/utils/discover.js +25 -23
  126. package/dist/utils/discover.js.map +1 -1
  127. package/dist/utils/figma-tokens-data-loader.js +2 -2
  128. package/dist/utils/figma-tokens-data-loader.js.map +1 -1
  129. package/dist/utils/run-exporter/exporter-utils.js +2 -2
  130. package/dist/utils/run-exporter/exporter-utils.js.map +1 -1
  131. package/dist/utils/validate-templates.d.ts +1 -1
  132. package/dist/utils/validate-templates.d.ts.map +1 -1
  133. package/dist/utils/validate-templates.js +4 -4
  134. package/dist/utils/validate-templates.js.map +1 -1
  135. package/oclif.manifest.json +1 -1
  136. package/package.json +8 -3
@@ -0,0 +1,904 @@
1
+
2
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="f43107ed-302c-5e6b-965c-db25f3a82db1")}catch(e){}}();
3
+ import path from "node:path";
4
+ import * as ts from "typescript";
5
+ import { ResolvedTypeKind, } from "./types.js";
6
+ import { buildFilter } from "./utils/build-filter.js";
7
+ import { isReactComponent } from "./utils/is-react-component.js";
8
+ import { trimFileName } from "./utils/trim-file-name.js";
9
+ export const defaultOptions = {
10
+ jsx: ts.JsxEmit.React,
11
+ module: ts.ModuleKind.CommonJS,
12
+ target: ts.ScriptTarget.Latest,
13
+ };
14
+ const isOptional = (prop) => (prop.getFlags() & ts.SymbolFlags.Optional) !== 0;
15
+ const defaultJSDoc = {
16
+ description: "",
17
+ fullComment: "",
18
+ tags: {},
19
+ };
20
+ export class Parser {
21
+ checker;
22
+ propFilter;
23
+ savePropValueAsString;
24
+ shouldExtractLiteralValuesFromEnum;
25
+ shouldExtractValuesFromUnion;
26
+ shouldIncludeExpression;
27
+ shouldIncludePropTagMap;
28
+ shouldRemoveUndefinedFromOptional;
29
+ shouldSortUnions;
30
+ constructor(program, opts) {
31
+ const { savePropValueAsString, shouldExtractLiteralValuesFromEnum, shouldExtractValuesFromUnion, shouldIncludeExpression, shouldIncludePropTagMap, shouldRemoveUndefinedFromOptional, shouldSortUnions, } = opts;
32
+ this.checker = program.getTypeChecker();
33
+ this.propFilter = buildFilter(opts);
34
+ this.shouldExtractLiteralValuesFromEnum = Boolean(shouldExtractLiteralValuesFromEnum);
35
+ this.shouldRemoveUndefinedFromOptional = Boolean(shouldRemoveUndefinedFromOptional);
36
+ this.shouldExtractValuesFromUnion = Boolean(shouldExtractValuesFromUnion);
37
+ this.shouldSortUnions = Boolean(shouldSortUnions);
38
+ this.savePropValueAsString = Boolean(savePropValueAsString);
39
+ this.shouldIncludePropTagMap = Boolean(shouldIncludePropTagMap);
40
+ this.shouldIncludeExpression = Boolean(shouldIncludeExpression);
41
+ }
42
+ extractDefaultPropsFromComponent(symbol, source) {
43
+ const possibleStatements = [
44
+ ...source.statements
45
+ .filter(stmt => Boolean(stmt.name))
46
+ .filter(stmt => this.checker.getSymbolAtLocation(stmt.name) === symbol),
47
+ ...source.statements.filter(stmt => ts.isExpressionStatement(stmt) || ts.isVariableStatement(stmt)),
48
+ ];
49
+ return possibleStatements.reduce((res, statement) => {
50
+ if (statementIsClassDeclaration(statement) && statement.members.length > 0) {
51
+ const possibleDefaultProps = statement.members.filter(member => member.name && getPropertyName(member.name) === "defaultProps");
52
+ if (possibleDefaultProps.length === 0) {
53
+ return res;
54
+ }
55
+ const defaultProps = possibleDefaultProps[0];
56
+ let { initializer } = defaultProps;
57
+ if (!initializer) {
58
+ return res;
59
+ }
60
+ let { properties } = initializer;
61
+ while (ts.isIdentifier(initializer)) {
62
+ const defaultPropsReference = this.checker.getSymbolAtLocation(initializer);
63
+ if (defaultPropsReference) {
64
+ const declarations = defaultPropsReference.getDeclarations();
65
+ if (declarations) {
66
+ if (ts.isImportSpecifier(declarations[0])) {
67
+ const symbol = this.checker.getSymbolAtLocation(declarations[0].name);
68
+ if (!symbol) {
69
+ continue;
70
+ }
71
+ const aliasedSymbol = this.checker.getAliasedSymbol(symbol);
72
+ if (aliasedSymbol && aliasedSymbol.declarations && aliasedSymbol.declarations.length > 0) {
73
+ initializer = aliasedSymbol.declarations[0].initializer;
74
+ }
75
+ else {
76
+ continue;
77
+ }
78
+ }
79
+ else {
80
+ initializer = declarations[0].initializer;
81
+ }
82
+ properties = initializer.properties;
83
+ }
84
+ }
85
+ }
86
+ let propMap = {};
87
+ if (properties) {
88
+ propMap = this.getPropMap(properties);
89
+ }
90
+ return {
91
+ ...res,
92
+ ...propMap,
93
+ };
94
+ }
95
+ if (statementIsStatelessWithDefaultProps(statement)) {
96
+ let propMap = {};
97
+ for (const child of statement.getChildren()) {
98
+ let { right } = child;
99
+ if (right && ts.isIdentifier(right)) {
100
+ const value = source.locals.get(right.escapedText);
101
+ if (value &&
102
+ value.valueDeclaration &&
103
+ ts.isVariableDeclaration(value.valueDeclaration) &&
104
+ value.valueDeclaration.initializer) {
105
+ right = value.valueDeclaration.initializer;
106
+ }
107
+ }
108
+ if (right) {
109
+ const { properties } = right;
110
+ if (properties) {
111
+ propMap = this.getPropMap(properties);
112
+ }
113
+ }
114
+ }
115
+ return {
116
+ ...res,
117
+ ...propMap,
118
+ };
119
+ }
120
+ const functionStatement = this.getFunctionStatement(statement);
121
+ if (functionStatement && functionStatement.parameters && functionStatement.parameters.length > 0) {
122
+ const { name } = functionStatement.parameters[0];
123
+ if (ts.isObjectBindingPattern(name)) {
124
+ return {
125
+ ...res,
126
+ ...this.getPropMap(name.elements),
127
+ };
128
+ }
129
+ }
130
+ return res;
131
+ }, {});
132
+ }
133
+ extractMembersFromType(type) {
134
+ const methodSymbols = [];
135
+ for (const property of type.getProperties()) {
136
+ if (this.getCallSignature(property)) {
137
+ methodSymbols.push(property);
138
+ }
139
+ }
140
+ if (type.symbol && type.symbol.members) {
141
+ for (const [_, member] of type.symbol.members) {
142
+ methodSymbols.push(member);
143
+ }
144
+ }
145
+ return methodSymbols;
146
+ }
147
+ extractPropsFromTypeIfStatefulComponent(type) {
148
+ const constructSignatures = type.getConstructSignatures();
149
+ if (constructSignatures.length > 0) {
150
+ for (const sig of constructSignatures) {
151
+ const instanceType = sig.getReturnType();
152
+ const props = instanceType.getProperty("props");
153
+ if (props) {
154
+ return props;
155
+ }
156
+ }
157
+ }
158
+ return null;
159
+ }
160
+ extractPropsFromTypeIfStatelessComponent(type) {
161
+ const callSignatures = type.getCallSignatures();
162
+ if (callSignatures.length > 0) {
163
+ for (const sig of callSignatures) {
164
+ const params = sig.getParameters();
165
+ if (params.length === 0) {
166
+ continue;
167
+ }
168
+ const propsParam = params[0];
169
+ if (propsParam.name === "props" || params.length === 1) {
170
+ return propsParam;
171
+ }
172
+ }
173
+ }
174
+ return null;
175
+ }
176
+ findDocComment(symbol) {
177
+ const comment = this.getFullJsDocComment(symbol);
178
+ if (comment.fullComment || comment.tags.default) {
179
+ return comment;
180
+ }
181
+ const rootSymbols = this.checker.getRootSymbols(symbol);
182
+ const commentsOnRootSymbols = rootSymbols
183
+ .filter(x => x !== symbol)
184
+ .map(x => this.getFullJsDocComment(x))
185
+ .filter(x => Boolean(x.fullComment) || Boolean(comment.tags.default));
186
+ if (commentsOnRootSymbols.length > 0) {
187
+ return commentsOnRootSymbols[0];
188
+ }
189
+ return defaultJSDoc;
190
+ }
191
+ getCallSignature(symbol) {
192
+ const symbolType = this.checker.getTypeOfSymbolAtLocation(symbol, symbol.valueDeclaration);
193
+ return symbolType.getCallSignatures()[0];
194
+ }
195
+ getComponentInfo(exp, source, componentNameResolver = () => undefined, customComponentTypes = []) {
196
+ const rootExportName = exp.getName();
197
+ if (exp.declarations && exp.declarations.length === 0) {
198
+ return null;
199
+ }
200
+ let rootExp = this.getComponentFromExpression(exp);
201
+ const declaration = rootExp.valueDeclaration || rootExp.declarations[0];
202
+ const type = this.checker.getTypeOfSymbolAtLocation(rootExp, declaration);
203
+ let commentSource = rootExp;
204
+ const typeSymbol = type.symbol || type.aliasSymbol;
205
+ const originalName = rootExp.getName();
206
+ const filePath = exp.flags & ts.SymbolFlags.Alias
207
+ ? this.checker.getAliasedSymbol(exp).declarations?.[0]?.getSourceFile().fileName || source.fileName
208
+ : source.fileName;
209
+ if (!rootExp.valueDeclaration) {
210
+ if (!typeSymbol && (rootExp.flags & ts.SymbolFlags.Alias) !== 0) {
211
+ commentSource = this.checker.getAliasedSymbol(commentSource);
212
+ }
213
+ else if (typeSymbol) {
214
+ rootExp = typeSymbol;
215
+ const expName = rootExp.getName();
216
+ const defaultComponentTypes = [
217
+ "__function",
218
+ "StatelessComponent",
219
+ "Stateless",
220
+ "StyledComponentClass",
221
+ "StyledComponent",
222
+ "IStyledComponent",
223
+ "FunctionComponent",
224
+ "ForwardRefExoticComponent",
225
+ "MemoExoticComponent",
226
+ ];
227
+ const supportedComponentTypes = [...defaultComponentTypes, ...customComponentTypes];
228
+ commentSource = supportedComponentTypes.includes(expName)
229
+ ? this.checker.getAliasedSymbol(commentSource)
230
+ : rootExp;
231
+ }
232
+ else {
233
+ return null;
234
+ }
235
+ }
236
+ else if (type.symbol && (ts.isPropertyAccessExpression(declaration) || ts.isPropertyDeclaration(declaration))) {
237
+ commentSource = type.symbol;
238
+ }
239
+ if (typeSymbol && (typeSymbol.getEscapedName() === "Requireable" || typeSymbol.getEscapedName() === "Validator")) {
240
+ return null;
241
+ }
242
+ const propsType = this.extractPropsFromTypeIfStatelessComponent(type) || this.extractPropsFromTypeIfStatefulComponent(type);
243
+ const nameSource = originalName === "default" ? rootExp : commentSource;
244
+ const resolvedComponentName = componentNameResolver(nameSource, source);
245
+ const { description, tags } = this.findDocComment(commentSource);
246
+ const exportName = computeComponentExportName(nameSource, source, customComponentTypes, rootExportName);
247
+ const displayName = resolvedComponentName || tags.visibleName || computeComponentDisplayName(nameSource, source);
248
+ const methods = this.getMethodsInfo(type);
249
+ let result = null;
250
+ if (propsType) {
251
+ const defaultProps = commentSource.valueDeclaration
252
+ ? this.extractDefaultPropsFromComponent(commentSource, commentSource.valueDeclaration.getSourceFile())
253
+ : {};
254
+ const props = this.getPropsInfo(propsType, defaultProps);
255
+ for (const propName of Object.keys(props)) {
256
+ const prop = props[propName];
257
+ const component = { name: exportName };
258
+ if (!this.propFilter(prop, component)) {
259
+ delete props[propName];
260
+ }
261
+ }
262
+ result = {
263
+ description,
264
+ displayName,
265
+ exportName,
266
+ filePath,
267
+ methods,
268
+ props,
269
+ tags,
270
+ };
271
+ }
272
+ else if (exportName) {
273
+ result = {
274
+ description,
275
+ displayName,
276
+ exportName,
277
+ filePath,
278
+ methods,
279
+ props: {},
280
+ tags,
281
+ };
282
+ }
283
+ if (result !== null && this.shouldIncludeExpression) {
284
+ result.expression = rootExp;
285
+ result.rootExpression = exp;
286
+ }
287
+ return result;
288
+ }
289
+ getResolvedType({ propType, skipUndefinedInUnion, visitedTypes = new Set(), }) {
290
+ const typeString = this.checker.typeToString(propType);
291
+ const raw = typeString;
292
+ if (visitedTypes.has(typeString)) {
293
+ return { kind: ResolvedTypeKind.Any, raw };
294
+ }
295
+ const newVisitedTypes = new Set(visitedTypes);
296
+ newVisitedTypes.add(typeString);
297
+ if (propType.getCallSignatures().length > 0) {
298
+ return { kind: ResolvedTypeKind.Function, raw };
299
+ }
300
+ if (/^(ReactNode|ReactElement|Element)<?.*$/i.test(typeString)) {
301
+ return { kind: ResolvedTypeKind.Slot, raw };
302
+ }
303
+ if (propType.isUnion() && (propType.flags & ts.TypeFlags.Boolean) === 0) {
304
+ const types = propType.types
305
+ .filter(type => {
306
+ if (skipUndefinedInUnion && type.flags & ts.TypeFlags.Undefined) {
307
+ return false;
308
+ }
309
+ return true;
310
+ })
311
+ .map(subType => this.getResolvedType({ propType: subType, visitedTypes: newVisitedTypes }))
312
+ .filter((type) => type !== null);
313
+ if (types.length === 1) {
314
+ return types[0];
315
+ }
316
+ return {
317
+ kind: ResolvedTypeKind.Union,
318
+ raw: skipUndefinedInUnion ? raw.replaceAll(" | undefined", "") : raw,
319
+ types,
320
+ };
321
+ }
322
+ if (propType.isIntersection()) {
323
+ const isEverySubTypeObject = propType.types.every(subType => subType.flags & ts.TypeFlags.Object);
324
+ if (isEverySubTypeObject) {
325
+ return {
326
+ kind: ResolvedTypeKind.Object,
327
+ raw,
328
+ };
329
+ }
330
+ return {
331
+ kind: ResolvedTypeKind.Any,
332
+ raw,
333
+ };
334
+ }
335
+ if (this.checker.isArrayType(propType)) {
336
+ const elementType = this.checker.getTypeArguments(propType)[0];
337
+ const baseType = this.getResolvedType({ propType: elementType, visitedTypes: newVisitedTypes });
338
+ return {
339
+ ...baseType,
340
+ raw,
341
+ isArray: true,
342
+ };
343
+ }
344
+ if (propType.isStringLiteral()) {
345
+ return { kind: ResolvedTypeKind.StringLiteral, raw: raw.replaceAll('"', "") };
346
+ }
347
+ if ((propType.flags & ts.TypeFlags.String) !== 0) {
348
+ return { kind: ResolvedTypeKind.String, raw };
349
+ }
350
+ if (propType.isNumberLiteral()) {
351
+ return { kind: ResolvedTypeKind.NumberLiteral, raw };
352
+ }
353
+ if ((propType.flags & ts.TypeFlags.Number) !== 0) {
354
+ return { kind: ResolvedTypeKind.Number, raw };
355
+ }
356
+ if ((propType.flags & ts.TypeFlags.BooleanLiteral) !== 0) {
357
+ return { kind: ResolvedTypeKind.BooleanLiteral, raw };
358
+ }
359
+ if ((propType.flags & ts.TypeFlags.Boolean) !== 0) {
360
+ return { kind: ResolvedTypeKind.Boolean, raw };
361
+ }
362
+ if ((propType.flags & ts.TypeFlags.Null) !== 0) {
363
+ return { kind: ResolvedTypeKind.Null, raw };
364
+ }
365
+ if ((propType.flags & ts.TypeFlags.Undefined) !== 0) {
366
+ return { kind: ResolvedTypeKind.Undefined, raw };
367
+ }
368
+ if ((propType.flags & ts.TypeFlags.Object) !== 0) {
369
+ const rawDeclaration = propType.symbol?.declarations?.[0]?.getText();
370
+ const isDeclarationFromReact = propType.symbol?.declarations?.[0]
371
+ ?.getSourceFile()
372
+ .fileName.includes("@types/react");
373
+ return { kind: ResolvedTypeKind.Object, raw: rawDeclaration && !isDeclarationFromReact ? rawDeclaration : raw };
374
+ }
375
+ return { kind: ResolvedTypeKind.Any, raw };
376
+ }
377
+ getDocgenType(propType, isRequired) {
378
+ if (propType.getConstraint()) {
379
+ propType = propType.getConstraint();
380
+ }
381
+ let propTypeString = this.checker.typeToString(propType);
382
+ if (this.shouldRemoveUndefinedFromOptional && !isRequired) {
383
+ propTypeString = propTypeString.replace(" | undefined", "");
384
+ }
385
+ if (propType.isUnion() &&
386
+ (this.shouldExtractValuesFromUnion ||
387
+ (this.shouldExtractLiteralValuesFromEnum &&
388
+ propType.types.every(type => type.getFlags() &
389
+ (ts.TypeFlags.StringLiteral |
390
+ ts.TypeFlags.NumberLiteral |
391
+ ts.TypeFlags.EnumLiteral |
392
+ ts.TypeFlags.Undefined))))) {
393
+ let value = propType.types.map(type => this.getInfoFromUnionType(type));
394
+ if (this.shouldRemoveUndefinedFromOptional && !isRequired) {
395
+ value = value.filter(option => option.value != "undefined");
396
+ }
397
+ if (this.shouldSortUnions) {
398
+ value.sort((a, b) => a.value.toString().localeCompare(b.value.toString()));
399
+ }
400
+ return {
401
+ name: "enum",
402
+ raw: propTypeString,
403
+ value,
404
+ };
405
+ }
406
+ if (this.shouldRemoveUndefinedFromOptional && !isRequired) {
407
+ propTypeString = propTypeString.replace(" | undefined", "");
408
+ }
409
+ return { name: propTypeString };
410
+ }
411
+ getFullJsDocComment(symbol) {
412
+ if (symbol.getDocumentationComment === undefined) {
413
+ return defaultJSDoc;
414
+ }
415
+ let mainComment = ts.displayPartsToString(symbol.getDocumentationComment(this.checker));
416
+ if (mainComment) {
417
+ mainComment = mainComment.replaceAll("\r\n", "\n");
418
+ }
419
+ const tags = symbol.getJsDocTags() || [];
420
+ const tagComments = [];
421
+ const tagMap = {};
422
+ for (const tag of tags) {
423
+ const trimmedText = ts.displayPartsToString(tag.text).trim();
424
+ const currentValue = tagMap[tag.name];
425
+ tagMap[tag.name] = currentValue ? currentValue + "\n" + trimmedText : trimmedText;
426
+ if (!["default", "type"].includes(tag.name)) {
427
+ tagComments.push(formatTag(tag));
428
+ }
429
+ }
430
+ return {
431
+ description: mainComment,
432
+ fullComment: (mainComment + "\n" + tagComments.join("\n")).trim(),
433
+ tags: tagMap,
434
+ };
435
+ }
436
+ getFunctionStatement(statement) {
437
+ if (ts.isFunctionDeclaration(statement)) {
438
+ return statement;
439
+ }
440
+ if (ts.isVariableStatement(statement)) {
441
+ let initializer = statement.declarationList && statement.declarationList.declarations[0].initializer;
442
+ if (initializer && ts.isCallExpression(initializer)) {
443
+ const symbol = this.checker.getSymbolAtLocation(initializer.expression);
444
+ if (!symbol || symbol.getName() !== "forwardRef")
445
+ return;
446
+ initializer = initializer.arguments[0];
447
+ }
448
+ if (initializer && (ts.isArrowFunction(initializer) || ts.isFunctionExpression(initializer))) {
449
+ return initializer;
450
+ }
451
+ }
452
+ return undefined;
453
+ }
454
+ getLiteralValueFromImportSpecifier(property) {
455
+ if (ts.isImportSpecifier(property)) {
456
+ const symbol = this.checker.getSymbolAtLocation(property.name);
457
+ if (!symbol) {
458
+ return null;
459
+ }
460
+ const aliasedSymbol = this.checker.getAliasedSymbol(symbol);
461
+ if (aliasedSymbol && aliasedSymbol.declarations && aliasedSymbol.declarations.length > 0) {
462
+ return this.getLiteralValueFromPropertyAssignment(aliasedSymbol.declarations[0]);
463
+ }
464
+ return null;
465
+ }
466
+ return null;
467
+ }
468
+ getLiteralValueFromPropertyAssignment(property) {
469
+ let { initializer } = property;
470
+ if (!initializer && ts.isShorthandPropertyAssignment(property)) {
471
+ const symbol = this.checker.getShorthandAssignmentValueSymbol(property);
472
+ const decl = symbol && symbol.valueDeclaration;
473
+ if (decl && decl.initializer) {
474
+ initializer = decl.initializer;
475
+ }
476
+ }
477
+ if (!initializer) {
478
+ return undefined;
479
+ }
480
+ switch (initializer.kind) {
481
+ case ts.SyntaxKind.FalseKeyword: {
482
+ return this.savePropValueAsString ? "false" : false;
483
+ }
484
+ case ts.SyntaxKind.Identifier: {
485
+ if (initializer.text === "undefined") {
486
+ return "undefined";
487
+ }
488
+ const symbol = this.checker.getSymbolAtLocation(initializer);
489
+ if (symbol && symbol.declarations && symbol.declarations.length > 0) {
490
+ if (ts.isImportSpecifier(symbol.declarations[0])) {
491
+ return this.getLiteralValueFromImportSpecifier(symbol.declarations[0]);
492
+ }
493
+ return this.getLiteralValueFromPropertyAssignment(symbol.declarations[0]);
494
+ }
495
+ return null;
496
+ }
497
+ case ts.SyntaxKind.NullKeyword: {
498
+ return this.savePropValueAsString ? "null" : null;
499
+ }
500
+ case ts.SyntaxKind.NumericLiteral: {
501
+ return this.savePropValueAsString
502
+ ? `${initializer.text}`
503
+ : Number(initializer.text);
504
+ }
505
+ case ts.SyntaxKind.PrefixUnaryExpression: {
506
+ return this.savePropValueAsString
507
+ ? initializer.getFullText().trim()
508
+ : Number(initializer.getFullText());
509
+ }
510
+ case ts.SyntaxKind.StringLiteral: {
511
+ return initializer.text.trim();
512
+ }
513
+ case ts.SyntaxKind.TrueKeyword: {
514
+ return this.savePropValueAsString ? "true" : true;
515
+ }
516
+ case ts.SyntaxKind.PropertyAccessExpression: {
517
+ const symbol = this.checker.getSymbolAtLocation(initializer);
518
+ if (symbol && symbol.declarations && symbol.declarations.length > 0) {
519
+ const declaration = symbol.declarations[0];
520
+ if (ts.isBindingElement(declaration) || ts.isPropertyAssignment(declaration)) {
521
+ return this.getLiteralValueFromPropertyAssignment(declaration);
522
+ }
523
+ }
524
+ return null;
525
+ }
526
+ case ts.SyntaxKind.ObjectLiteralExpression:
527
+ default: {
528
+ try {
529
+ return initializer.getText();
530
+ }
531
+ catch {
532
+ return null;
533
+ }
534
+ }
535
+ }
536
+ }
537
+ getMethodsInfo(type) {
538
+ const members = this.extractMembersFromType(type);
539
+ const methods = [];
540
+ for (const member of members) {
541
+ if (!this.isTaggedPublic(member)) {
542
+ continue;
543
+ }
544
+ const name = member.getName();
545
+ const docblock = this.getFullJsDocComment(member).fullComment;
546
+ const callSignature = this.getCallSignature(member);
547
+ const params = this.getParameterInfo(callSignature);
548
+ const description = ts.displayPartsToString(member.getDocumentationComment(this.checker));
549
+ const returnType = this.checker.typeToString(callSignature.getReturnType());
550
+ const returnDescription = ts.displayPartsToString(this.getReturnDescription(member));
551
+ const modifiers = this.getModifiers(member);
552
+ methods.push({
553
+ description,
554
+ docblock,
555
+ modifiers,
556
+ name,
557
+ params,
558
+ returns: returnDescription
559
+ ? {
560
+ description: returnDescription,
561
+ type: returnType,
562
+ }
563
+ : null,
564
+ });
565
+ }
566
+ return methods;
567
+ }
568
+ getModifiers(member) {
569
+ const modifiers = [];
570
+ if (!member.valueDeclaration) {
571
+ return modifiers;
572
+ }
573
+ const flags = ts.getCombinedModifierFlags(member.valueDeclaration);
574
+ const isStatic = (flags & ts.ModifierFlags.Static) !== 0;
575
+ if (isStatic) {
576
+ modifiers.push("static");
577
+ }
578
+ return modifiers;
579
+ }
580
+ getParameterInfo(callSignature) {
581
+ return callSignature.parameters.map(param => {
582
+ const paramType = this.checker.getTypeOfSymbolAtLocation(param, param.valueDeclaration);
583
+ const paramDeclaration = this.checker.symbolToParameterDeclaration(param, undefined, undefined);
584
+ const isOptionalParam = Boolean(paramDeclaration && paramDeclaration.questionToken);
585
+ return {
586
+ description: ts.displayPartsToString(param.getDocumentationComment(this.checker)) || null,
587
+ name: param.getName() + (isOptionalParam ? "?" : ""),
588
+ type: { name: this.checker.typeToString(paramType) },
589
+ };
590
+ });
591
+ }
592
+ getPropMap(properties) {
593
+ return properties.reduce((acc, property) => {
594
+ if (ts.isSpreadAssignment(property) || !property.name) {
595
+ return acc;
596
+ }
597
+ const literalValue = this.getLiteralValueFromPropertyAssignment(property);
598
+ const propertyName = getPropertyName(property.name);
599
+ if ((typeof literalValue === "string" ||
600
+ typeof literalValue === "number" ||
601
+ typeof literalValue === "boolean" ||
602
+ literalValue === null) &&
603
+ propertyName !== null) {
604
+ acc[propertyName] = literalValue;
605
+ }
606
+ return acc;
607
+ }, {});
608
+ }
609
+ getPropsInfo(propsObj, defaultProps = {}) {
610
+ if (!propsObj.valueDeclaration) {
611
+ return {};
612
+ }
613
+ const propsType = this.checker.getTypeOfSymbolAtLocation(propsObj, propsObj.valueDeclaration);
614
+ const baseProps = propsType.getApparentProperties();
615
+ let propertiesOfProps = baseProps;
616
+ if (propsType.isUnionOrIntersection()) {
617
+ propertiesOfProps = [
618
+ ...(propertiesOfProps = this.checker.getAllPossiblePropertiesOfTypes(propsType.types)),
619
+ ...baseProps,
620
+ ];
621
+ if (propertiesOfProps.length === 0) {
622
+ const isUnionType = (type) => (type.flags & ts.TypeFlags.Union) !== 0;
623
+ const types = isUnionType(propsType) ? propsType.types : [propsType];
624
+ const subTypes = this.checker.getAllPossiblePropertiesOfTypes(types.reduce((all, t) => {
625
+ const typeArray = isUnionType(t) ? t.types : [t];
626
+ return [...all, ...typeArray.map(t => t.symbol).filter(s => s !== undefined)];
627
+ }, []));
628
+ propertiesOfProps = [...subTypes, ...baseProps];
629
+ }
630
+ }
631
+ const result = {};
632
+ for (const prop of propertiesOfProps) {
633
+ const propName = prop.getName();
634
+ const propType = this.checker.getTypeOfSymbolAtLocation(prop, propsObj.valueDeclaration);
635
+ const jsDocComment = this.findDocComment(prop);
636
+ const hasCodeBasedDefault = defaultProps[propName] !== undefined;
637
+ let defaultValue = null;
638
+ if (hasCodeBasedDefault) {
639
+ defaultValue = { value: defaultProps[propName] };
640
+ }
641
+ else if (jsDocComment.tags.default) {
642
+ defaultValue = { value: jsDocComment.tags.default };
643
+ }
644
+ const parent = getParentType(prop);
645
+ const parents = getDeclarations(prop);
646
+ const declarations = prop.declarations || [];
647
+ const baseProp = baseProps.find(p => p.getName() === propName);
648
+ const required = !isOptional(prop) &&
649
+ !hasCodeBasedDefault &&
650
+ declarations.every(d => !((ts.isPropertySignature(d) || ts.isPropertyDeclaration(d) || ts.isParameter(d)) && d.questionToken)) &&
651
+ (!baseProp || !isOptional(baseProp));
652
+ const type = jsDocComment.tags.type
653
+ ? {
654
+ name: jsDocComment.tags.type,
655
+ }
656
+ : this.getDocgenType(propType, required);
657
+ const propTags = this.shouldIncludePropTagMap ? { tags: jsDocComment.tags } : {};
658
+ const description = this.shouldIncludePropTagMap
659
+ ? jsDocComment.description.replaceAll("\r\n", "\n")
660
+ : jsDocComment.fullComment.replaceAll("\r\n", "\n");
661
+ const resolvedType = this.getResolvedType({ propType, skipUndefinedInUnion: !required });
662
+ result[propName] = {
663
+ resolvedType,
664
+ declarations: parents,
665
+ defaultValue,
666
+ description,
667
+ name: propName,
668
+ parent,
669
+ required,
670
+ type,
671
+ ...propTags,
672
+ };
673
+ }
674
+ return result;
675
+ }
676
+ getReturnDescription(symbol) {
677
+ const tags = symbol.getJsDocTags();
678
+ const returnTag = tags.find(tag => tag.name === "returns");
679
+ if (!returnTag || !Array.isArray(returnTag.text)) {
680
+ return;
681
+ }
682
+ return returnTag.text;
683
+ }
684
+ isTaggedPublic(symbol) {
685
+ const jsDocTags = symbol.getJsDocTags();
686
+ return Boolean(jsDocTags.find(tag => tag.name === "public"));
687
+ }
688
+ parseExportSymbol(exp, sourceFile) {
689
+ if (!isReactComponent(exp, sourceFile, this.checker)) {
690
+ return [];
691
+ }
692
+ const componentDocs = [];
693
+ const doc = this.getComponentInfo(exp, sourceFile);
694
+ if (doc) {
695
+ componentDocs.push(doc);
696
+ }
697
+ if (!exp.exports) {
698
+ return componentDocs;
699
+ }
700
+ for (const [_, symbol] of exp.exports) {
701
+ if (symbol.flags & ts.SymbolFlags.Prototype) {
702
+ continue;
703
+ }
704
+ if (symbol.flags & ts.SymbolFlags.Method) {
705
+ const signature = this.getCallSignature(symbol);
706
+ const returnType = this.checker.typeToString(signature.getReturnType());
707
+ if (returnType !== "Element") {
708
+ continue;
709
+ }
710
+ }
711
+ const doc = this.getComponentInfo(symbol, sourceFile);
712
+ if (doc) {
713
+ const prefix = exp.escapedName === "default" ? "" : `${exp.escapedName}.`;
714
+ componentDocs.push({
715
+ ...doc,
716
+ displayName: `${prefix}${symbol.escapedName}`,
717
+ });
718
+ }
719
+ }
720
+ return componentDocs;
721
+ }
722
+ getComponentFromExpression(exp) {
723
+ const declaration = exp.valueDeclaration || exp.declarations[0];
724
+ const type = this.checker.getTypeOfSymbolAtLocation(exp, declaration);
725
+ const typeSymbol = type.symbol || type.aliasSymbol;
726
+ if (!typeSymbol) {
727
+ return exp;
728
+ }
729
+ const symbolName = typeSymbol.getName();
730
+ if ((symbolName === "MemoExoticComponent" || symbolName === "ForwardRefExoticComponent") &&
731
+ exp.valueDeclaration &&
732
+ ts.isExportAssignment(exp.valueDeclaration) &&
733
+ ts.isCallExpression(exp.valueDeclaration.expression)) {
734
+ const component = this.checker.getSymbolAtLocation(exp.valueDeclaration.expression.arguments[0]);
735
+ if (component) {
736
+ exp = component;
737
+ }
738
+ }
739
+ return exp;
740
+ }
741
+ getInfoFromUnionType(type) {
742
+ let commentInfo = {};
743
+ if (type.getSymbol()) {
744
+ commentInfo = { ...this.getFullJsDocComment(type.getSymbol()) };
745
+ }
746
+ return {
747
+ value: this.getValuesFromUnionType(type),
748
+ ...commentInfo,
749
+ };
750
+ }
751
+ getValuesFromUnionType(type) {
752
+ if (type.isStringLiteral())
753
+ return `"${type.value}"`;
754
+ if (type.isNumberLiteral())
755
+ return `${type.value}`;
756
+ return this.checker.typeToString(type);
757
+ }
758
+ }
759
+ function statementIsClassDeclaration(statement) {
760
+ return Boolean(statement.members);
761
+ }
762
+ function statementIsStatelessWithDefaultProps(statement) {
763
+ const children = statement.getChildren();
764
+ for (const child of children) {
765
+ const { left } = child;
766
+ if (left) {
767
+ const { name } = left;
768
+ if (name && name.escapedText === "defaultProps") {
769
+ return true;
770
+ }
771
+ }
772
+ }
773
+ return false;
774
+ }
775
+ function getPropertyName(name) {
776
+ switch (name.kind) {
777
+ case ts.SyntaxKind.ComputedPropertyName: {
778
+ return name.getText();
779
+ }
780
+ case ts.SyntaxKind.Identifier:
781
+ case ts.SyntaxKind.NumericLiteral:
782
+ case ts.SyntaxKind.StringLiteral: {
783
+ return name.text;
784
+ }
785
+ default: {
786
+ return null;
787
+ }
788
+ }
789
+ }
790
+ function formatTag(tag) {
791
+ let result = "@" + tag.name;
792
+ if (tag.text) {
793
+ result += " " + ts.displayPartsToString(tag.text);
794
+ }
795
+ return result;
796
+ }
797
+ function getTextValueOfClassMember(classDeclaration, memberName) {
798
+ const classDeclarationMembers = classDeclaration.members || [];
799
+ const [textValue] = classDeclarationMembers &&
800
+ classDeclarationMembers
801
+ .filter(member => ts.isPropertyDeclaration(member))
802
+ .filter(member => {
803
+ const name = ts.getNameOfDeclaration(member);
804
+ return name && name.text === memberName;
805
+ })
806
+ .map(member => {
807
+ const property = member;
808
+ return property.initializer && property.initializer.text;
809
+ });
810
+ return textValue || "";
811
+ }
812
+ function getTextValueOfFunctionProperty(_exp, source, propertyName) {
813
+ const [textValue] = source.statements
814
+ .filter(statement => ts.isExpressionStatement(statement))
815
+ .filter(statement => {
816
+ const expr = statement.expression;
817
+ return (expr.left &&
818
+ expr.left.name &&
819
+ expr.left.name.escapedText === propertyName);
820
+ })
821
+ .filter(statement => ts.isStringLiteral(statement.expression.right))
822
+ .map(statement => statement.expression.right.text);
823
+ return textValue || "";
824
+ }
825
+ function computeComponentDisplayName(exp, source) {
826
+ const statelessDisplayName = getTextValueOfFunctionProperty(exp, source, "displayName");
827
+ const statefulDisplayName = exp.valueDeclaration &&
828
+ ts.isClassDeclaration(exp.valueDeclaration) &&
829
+ getTextValueOfClassMember(exp.valueDeclaration, "displayName");
830
+ return statelessDisplayName || statefulDisplayName || null;
831
+ }
832
+ function computeComponentExportName(rootExport, source, customComponentTypes = [], rootExportName) {
833
+ const exportName = rootExport.getName();
834
+ const defaultComponentTypes = [
835
+ "default",
836
+ "__function",
837
+ "Stateless",
838
+ "StyledComponentClass",
839
+ "StyledComponent",
840
+ "IStyledComponent",
841
+ "FunctionComponent",
842
+ "StatelessComponent",
843
+ "ForwardRefExoticComponent",
844
+ "MemoExoticComponent",
845
+ ];
846
+ const supportedComponentTypes = [...defaultComponentTypes, ...customComponentTypes];
847
+ if (!defaultComponentTypes.includes(rootExportName)) {
848
+ return rootExportName;
849
+ }
850
+ if (supportedComponentTypes.includes(exportName)) {
851
+ return getDefaultExportForFile(source);
852
+ }
853
+ return exportName;
854
+ }
855
+ export function getDefaultExportForFile(source) {
856
+ const name = path.basename(source.fileName).split(".")[0];
857
+ const filename = name === "index" ? path.basename(path.dirname(source.fileName)) : name;
858
+ const identifier = filename.replaceAll(/^[^A-Z]*/gi, "").replaceAll(/[^A-Z0-9]*/gi, "");
859
+ return identifier.length > 0 ? identifier : "DefaultName";
860
+ }
861
+ function isTypeLiteral(node) {
862
+ return node.kind === ts.SyntaxKind.TypeLiteral;
863
+ }
864
+ function getDeclarations(prop) {
865
+ const declarations = prop.getDeclarations();
866
+ if (declarations === undefined || declarations.length === 0) {
867
+ return undefined;
868
+ }
869
+ const parents = [];
870
+ for (const declaration of declarations) {
871
+ const { parent } = declaration;
872
+ if (!isTypeLiteral(parent) && !isInterfaceOrTypeAliasDeclaration(parent)) {
873
+ continue;
874
+ }
875
+ const parentName = "name" in parent ? parent.name.text : "TypeLiteral";
876
+ const { fileName } = parent.getSourceFile();
877
+ parents.push({
878
+ fileName,
879
+ name: parentName,
880
+ });
881
+ }
882
+ return parents;
883
+ }
884
+ function getParentType(prop) {
885
+ const declarations = prop.getDeclarations();
886
+ if (declarations == null || declarations.length === 0) {
887
+ return undefined;
888
+ }
889
+ const { parent } = declarations[0];
890
+ if (!isInterfaceOrTypeAliasDeclaration(parent)) {
891
+ return undefined;
892
+ }
893
+ const parentName = parent.name.text;
894
+ const { fileName } = parent.getSourceFile();
895
+ return {
896
+ fileName: trimFileName(fileName),
897
+ name: parentName,
898
+ };
899
+ }
900
+ function isInterfaceOrTypeAliasDeclaration(node) {
901
+ return node.kind === ts.SyntaxKind.InterfaceDeclaration || node.kind === ts.SyntaxKind.TypeAliasDeclaration;
902
+ }
903
+ //# sourceMappingURL=parser.js.map
904
+ //# debugId=f43107ed-302c-5e6b-965c-db25f3a82db1