How to use the declareOpaqueType function from @babel/types

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

80
81
82
83
84
85
86
87
88
89
/**
 * declare export type NAME = VALUE
 */
function declareExportOpaqueType(name: string, value: string): $FlowFixMe {
  return t.declareExportDeclaration(
    t.declareOpaqueType(
      t.identifier(name),
      null,
      t.genericTypeAnnotation(t.identifier(value)),
    ),
fork icon0
star icon1
watch icon3

+ 3 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)