@@ -201,6 +201,66 @@ function unwrapTSAsExpression(node) {
201
201
return node ;
202
202
}
203
203
204
+ function isTSTypeReference ( node ) {
205
+ if ( ! node ) return false ;
206
+ const nodeType = node . type ;
207
+ return nodeType === 'TSTypeReference' ;
208
+ }
209
+
210
+ function isTSTypeAnnotation ( node ) {
211
+ if ( ! node ) return false ;
212
+ const nodeType = node . type ;
213
+ return nodeType === 'TSTypeAnnotation' ;
214
+ }
215
+
216
+ function isTSTypeLiteral ( node ) {
217
+ if ( ! node ) return false ;
218
+ const nodeType = node . type ;
219
+ return nodeType === 'TSTypeLiteral' ;
220
+ }
221
+
222
+ function isTSIntersectionType ( node ) {
223
+ if ( ! node ) return false ;
224
+ const nodeType = node . type ;
225
+ return nodeType === 'TSIntersectionType' ;
226
+ }
227
+
228
+ function isTSInterfaceHeritage ( node ) {
229
+ if ( ! node ) return false ;
230
+ const nodeType = node . type ;
231
+ return nodeType === 'TSInterfaceHeritage' ;
232
+ }
233
+
234
+ function isTSInterfaceDeclaration ( node ) {
235
+ if ( ! node ) return false ;
236
+ const nodeType = node . type ;
237
+ return nodeType === 'TSInterfaceDeclaration' ;
238
+ }
239
+
240
+ function isTSTypeAliasDeclaration ( node ) {
241
+ if ( ! node ) return false ;
242
+ const nodeType = node . type ;
243
+ return nodeType === 'TSTypeAliasDeclaration' ;
244
+ }
245
+
246
+ function isTSParenthesizedType ( node ) {
247
+ if ( ! node ) return false ;
248
+ const nodeType = node . type ;
249
+ return nodeType === 'TSTypeAliasDeclaration' ;
250
+ }
251
+
252
+ function isTSFunctionType ( node ) {
253
+ if ( ! node ) return false ;
254
+ const nodeType = node . type ;
255
+ return nodeType === 'TSFunctionType' ;
256
+ }
257
+
258
+ function isTSTypeQuery ( node ) {
259
+ if ( ! node ) return false ;
260
+ const nodeType = node . type ;
261
+ return nodeType === 'TSTypeQuery' ;
262
+ }
263
+
204
264
module . exports = {
205
265
findReturnStatement,
206
266
getFirstNodeInLine,
@@ -213,5 +273,15 @@ module.exports = {
213
273
isFunction,
214
274
isFunctionLikeExpression,
215
275
isNodeFirstInLine,
216
- unwrapTSAsExpression
276
+ unwrapTSAsExpression,
277
+ isTSTypeReference,
278
+ isTSTypeAnnotation,
279
+ isTSTypeLiteral,
280
+ isTSIntersectionType,
281
+ isTSInterfaceHeritage,
282
+ isTSInterfaceDeclaration,
283
+ isTSTypeAliasDeclaration,
284
+ isTSParenthesizedType,
285
+ isTSFunctionType,
286
+ isTSTypeQuery
217
287
} ;
0 commit comments