How to use the objectTypeAnnotation function from babel-types

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

131
132
133
134
135
136
137
138
139
140
      t.stringLiteral('type'),
    ),
  );
}

let CSSPropertySetType = t.objectTypeAnnotation(propList);
CSSPropertySetType.exact = true;

statementList.push(
  t.exportNamedDeclaration(
fork icon10
star icon148
watch icon8

+ 5 other calls in file

115
116
117
118
119
120
121
122
123
124
        if (!(field.type instanceof GraphQLNonNull)) {
          property.optional = true;
        }
        return property;
      });
    return t.objectTypeAnnotation(props);
  } else {
    throw new Error(`Could not convert from GraphQL type ${type.toString()}`);
  }
}
fork icon0
star icon10
watch icon3

+ 5 other calls in file

19
20
21
22
23
24
25
26
27
 * {|
 *   PROPS
 * |}
 */
function exactObjectTypeAnnotation(props: Array<BabelAST>) {
  const typeAnnotation = t.objectTypeAnnotation(props);
  typeAnnotation.exact = true;
  return typeAnnotation;
}
fork icon0
star icon1
watch icon3

+ 5 other calls in file

68
69
70
71
72
73
74
75
76
77
function transform(node: Fragment | LinkedField): Annotation {
  return t.exportNamedDeclaration(
    t.typeAlias(
      t.identifier(node.name),
      null,
      t.objectTypeAnnotation(
        node.selections
          .map(selection => transformSelection(selection))
          .reduce((prev, curr) => {
            if (!curr) {
fork icon0
star icon1
watch icon2

+ 9 other calls in file

92
93
94
95
96
97
98
99
100
101
    )
  )
) {
  for (const concreteType in byConcreteType) {
    types.push(
      t.objectTypeAnnotation([
        ...baseFields.map(selection => makeProp(selection, concreteType)),
        ...byConcreteType[concreteType].map(
          selection => makeProp(selection, concreteType)
        ),
fork icon0
star icon0
watch icon2

+ 19 other calls in file

128
129
130
131
132
133
134
135
136
137
      if (!(field.type instanceof GraphQLNonNull)) {
        property.optional = true;
      }
      return property;
    });
  state.generatedInputObjectTypes[typeIdentifier] = t.objectTypeAnnotation(
    props,
  );
  return t.identifier(typeIdentifier);
} else {
fork icon0
star icon0
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 (4076 examples)