File tree Expand file tree Collapse file tree 4 files changed +19
-0
lines changed
tests/baselines/reference/api Expand file tree Collapse file tree 4 files changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -452,6 +452,15 @@ namespace ts {
452452 isClass ( ) : this is InterfaceType {
453453 return ! ! ( getObjectFlags ( this ) & ObjectFlags . Class ) ;
454454 }
455+ /**
456+ * This polyfills `referenceType.typeArguments` for API consumers
457+ */
458+ get typeArguments ( ) {
459+ if ( getObjectFlags ( this ) & ObjectFlags . Reference ) {
460+ return this . checker . getTypeArguments ( this as Type as TypeReference ) ;
461+ }
462+ return undefined ;
463+ }
455464 }
456465
457466 class SignatureObject implements Signature {
Original file line number Diff line number Diff line change @@ -68,6 +68,10 @@ namespace ts {
6868 isClass ( ) : this is InterfaceType ;
6969 }
7070
71+ export interface TypeReference {
72+ typeArguments ?: readonly Type [ ] ;
73+ }
74+
7175 export interface Signature {
7276 getDeclaration ( ) : SignatureDeclaration ;
7377 getTypeParameters ( ) : TypeParameter [ ] | undefined ;
Original file line number Diff line number Diff line change @@ -4902,6 +4902,9 @@ declare namespace ts {
49024902 isClassOrInterface ( ) : this is InterfaceType ;
49034903 isClass ( ) : this is InterfaceType ;
49044904 }
4905+ interface TypeReference {
4906+ typeArguments ?: readonly Type [ ] ;
4907+ }
49054908 interface Signature {
49064909 getDeclaration ( ) : SignatureDeclaration ;
49074910 getTypeParameters ( ) : TypeParameter [ ] | undefined ;
Original file line number Diff line number Diff line change @@ -4902,6 +4902,9 @@ declare namespace ts {
49024902 isClassOrInterface ( ) : this is InterfaceType ;
49034903 isClass ( ) : this is InterfaceType ;
49044904 }
4905+ interface TypeReference {
4906+ typeArguments ?: readonly Type [ ] ;
4907+ }
49054908 interface Signature {
49064909 getDeclaration ( ) : SignatureDeclaration ;
49074910 getTypeParameters ( ) : TypeParameter [ ] | undefined ;
You can’t perform that action at this time.
0 commit comments