How to use the isTSDeclareMethod function from @babel/types

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

20
21
22
23
24
25
26
27
28
29
  if (node.abstract) {
    comment.abstract = true;
  }
} else if (
  t.isFunction(node) ||
  t.isTSDeclareMethod(node) ||
  t.isTSDeclareFunction(node) ||
  t.isFunctionTypeAnnotation(node) ||
  t.isTSMethodSignature(node)
) {
fork icon509
star icon0
watch icon0

+ 20 other calls in file

99
100
101
102
103
104
105
106
107
108

function getReturnType(fn) {
  if (
    t.isFunction(fn) ||
    t.isTSDeclareFunction(fn) ||
    t.isTSDeclareMethod(fn) ||
    t.isFunctionTypeAnnotation(fn)
  ) {
    return fn.returnType;
  }
fork icon509
star icon0
watch icon0

+ 3 other calls in file

192
193
194
195
196
197
198
199
200
201
  t.isInterfaceDeclaration(declaration) ||
  t.isTSTypeAliasDeclaration(declaration) ||
  t.isTSInterfaceDeclaration(declaration) ||
  t.isTSEnumDeclaration(declaration) ||
  t.isTSDeclareFunction(declaration) ||
  t.isTSDeclareMethod(declaration)
) {
  let name = declaration.id.name;
  exploded.exports.push(toModuleSpecifier(null, name, name, source, declaration.loc));
  exploded.statements.push(declaration);
fork icon6
star icon34
watch icon0

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