* A JSdoc TypeReference may be to a value, but resolve it as a type anyway. * Example: import('./b').ConstructorFunction
(node, symbol)
| 60436 | * Example: import('./b').ConstructorFunction |
| 60437 | */ |
| 60438 | function getTypeFromJSDocValueReference(node, symbol) { |
| 60439 | var links = getNodeLinks(node); |
| 60440 | if (!links.resolvedJSDocType) { |
| 60441 | var valueType = getTypeOfSymbol(symbol); |
| 60442 | var typeType = valueType; |
| 60443 | if (symbol.valueDeclaration) { |
| 60444 | var isImportTypeWithQualifier = node.kind === 200 /* SyntaxKind.ImportType */ && node.qualifier; |
| 60445 | // valueType might not have a symbol, eg, {import('./b').STRING_LITERAL} |
| 60446 | if (valueType.symbol && valueType.symbol !== symbol && isImportTypeWithQualifier) { |
| 60447 | typeType = getTypeReferenceType(node, valueType.symbol); |
| 60448 | } |
| 60449 | } |
| 60450 | links.resolvedJSDocType = typeType; |
| 60451 | } |
| 60452 | return links.resolvedJSDocType; |
| 60453 | } |
| 60454 | function getSubstitutionType(baseType, substitute) { |
| 60455 | if (substitute.flags & 3 /* TypeFlags.AnyOrUnknown */ || substitute === baseType) { |
| 60456 | return baseType; |
no test coverage detected
searching dependent graphs…