How to use the GenericTypeAnnotation function from babel-types

Find comprehensive JavaScript babel-types.GenericTypeAnnotation code examples handpicked from public code repositorys.

6
7
8
9
10
11
12
13
14
15

function swaggerTypeToFlowType (sType, imports) {
  imports = imports || []
  if (sType.$ref && sType.$ref.match(/^#\/definitions/)) {
    imports.push(sType.$ref.replace('#/definitions/', ''))
    return t.GenericTypeAnnotation(
      t.Identifier(sType.$ref.replace('#/definitions/', '')),
      null
    )
  }
fork icon4
star icon9
watch icon2

+ 47 other calls in file

169
170
171
172
173
174
175
176
177
178
    .concat(bodyParam),
  body
)

fnStatement.returnType = t.TypeAnnotation(
  t.GenericTypeAnnotation(
    t.Identifier('AjaxPipe'),
    t.TypeParameterInstantiation([
      t.GenericTypeAnnotation(t.Identifier('AjaxObject'), null),
      t.GenericTypeAnnotation(t.Identifier('Response'), null)
fork icon4
star icon9
watch icon2

+ 89 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 (4076 examples)