File tree 2 files changed +12
-0
lines changed
2 files changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -138,6 +138,9 @@ namespace ts {
138
138
node = getParseTreeNode(node, isExportSpecifier);
139
139
return node ? getExportSpecifierLocalTargetSymbol(node) : undefined;
140
140
},
141
+ getExportSymbolOfSymbol(symbol) {
142
+ return getMergedSymbol(symbol.exportSymbol || symbol);
143
+ },
141
144
getTypeAtLocation: node => {
142
145
node = getParseTreeNode(node);
143
146
return node ? getTypeOfNode(node) : unknownType;
Original file line number Diff line number Diff line change @@ -2568,6 +2568,15 @@ namespace ts {
2568
2568
getSymbolsOfParameterPropertyDeclaration ( parameter : ParameterDeclaration , parameterName : string ) : Symbol [ ] ;
2569
2569
getShorthandAssignmentValueSymbol ( location : Node ) : Symbol | undefined ;
2570
2570
getExportSpecifierLocalTargetSymbol ( location : ExportSpecifier ) : Symbol | undefined ;
2571
+ /**
2572
+ * If a symbol is a local symbol with an associated exported symbol, returns the exported symbol.
2573
+ * Otherwise returns its input.
2574
+ * For example, at `export type T = number;`:
2575
+ * - `getSymbolAtLocation` at the location `T` will return the exported symbol for `T`.
2576
+ * - But the result of `getSymbolsInScope` will contain the *local* symbol for `T`, not the exported symbol.
2577
+ * - Calling `getExportSymbolOfSymbol` on that local symbol will return the exported symbol.
2578
+ */
2579
+ getExportSymbolOfSymbol ( symbol : Symbol ) : Symbol ;
2571
2580
getPropertySymbolOfDestructuringAssignment ( location : Identifier ) : Symbol | undefined ;
2572
2581
getTypeAtLocation ( node : Node ) : Type ;
2573
2582
getTypeFromTypeNode ( node : TypeNode ) : Type ;
You can’t perform that action at this time.
0 commit comments