How to use the TSTypeAnnotation function from @babel/types

Find comprehensive JavaScript @babel/types.TSTypeAnnotation code examples handpicked from public code repositorys.

21
22
23
24
25
26
27
28
29
30
  t.tsTypeLiteral(
    params.map((param, index) => {
      const key = index ? (index === 1 ? 'record' : 'index') : 'text'
      return t.tsPropertySignature(
        t.identifier(key),
        param.typeAnnotation || t.TSTypeAnnotation(t.TSAnyKeyword())
      )
    })
  )
)
fork icon0
star icon5
watch icon2

+ 7 other calls in file

Other functions in @babel/types

Sorted by popularity

function icon

@babel/types.identifier is the most popular function in @babel/types (20936 examples)