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 {
452
452
isClass ( ) : this is InterfaceType {
453
453
return ! ! ( getObjectFlags ( this ) & ObjectFlags . Class ) ;
454
454
}
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
+ }
455
464
}
456
465
457
466
class SignatureObject implements Signature {
Original file line number Diff line number Diff line change @@ -68,6 +68,10 @@ namespace ts {
68
68
isClass ( ) : this is InterfaceType ;
69
69
}
70
70
71
+ export interface TypeReference {
72
+ typeArguments ?: readonly Type [ ] ;
73
+ }
74
+
71
75
export interface Signature {
72
76
getDeclaration ( ) : SignatureDeclaration ;
73
77
getTypeParameters ( ) : TypeParameter [ ] | undefined ;
Original file line number Diff line number Diff line change @@ -4902,6 +4902,9 @@ declare namespace ts {
4902
4902
isClassOrInterface ( ) : this is InterfaceType ;
4903
4903
isClass ( ) : this is InterfaceType ;
4904
4904
}
4905
+ interface TypeReference {
4906
+ typeArguments ?: readonly Type [ ] ;
4907
+ }
4905
4908
interface Signature {
4906
4909
getDeclaration ( ) : SignatureDeclaration ;
4907
4910
getTypeParameters ( ) : TypeParameter [ ] | undefined ;
Original file line number Diff line number Diff line change @@ -4902,6 +4902,9 @@ declare namespace ts {
4902
4902
isClassOrInterface ( ) : this is InterfaceType ;
4903
4903
isClass ( ) : this is InterfaceType ;
4904
4904
}
4905
+ interface TypeReference {
4906
+ typeArguments ?: readonly Type [ ] ;
4907
+ }
4905
4908
interface Signature {
4906
4909
getDeclaration ( ) : SignatureDeclaration ;
4907
4910
getTypeParameters ( ) : TypeParameter [ ] | undefined ;
You can’t perform that action at this time.
0 commit comments