How to use the typeParameterInstantiation function from @babel/types

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

130
131
132
133
134
135
136
137
138
139
 * $ReadOnlyArray<TYPE>
 */
function readOnlyArrayOfType(thing: BabelAST): $FlowFixMe {
  return t.genericTypeAnnotation(
    t.identifier('$ReadOnlyArray'),
    t.typeParameterInstantiation([thing]),
  );
}

/**
fork icon0
star icon1
watch icon3

+ 3 other calls in file

672
673
674
675
676
677
678
679
680
681
// Generate an extra opaque type for client 3D fields
state.runtimeImports.add('Local3DPayload');
types.push(
  t.genericTypeAnnotation(
    t.identifier('Local3DPayload'),
    t.typeParameterInstantiation([
      t.stringLiteralTypeAnnotation(moduleImport.documentName),
      exactObjectTypeAnnotation(
        selections
          .filter(sel => sel.schemaName !== 'js')
fork icon0
star icon0
watch icon1

Other functions in @babel/types

Sorted by popularity

function icon

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