How to use the isInterfaceDeclaration function from @babel/types

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

44
45
46
47
48
49
50
51
52
53
    }
  }
} else if (t.isTypeAlias(node) || t.isTSTypeAliasDeclaration(node)) {
  comment.kind = 'typedef';
} else if (
  t.isInterfaceDeclaration(node) ||
  t.isTSInterfaceDeclaration(node)
) {
  comment.kind = 'interface';
} else if (t.isVariableDeclaration(node)) {
fork icon509
star icon0
watch icon0

+ 20 other calls in file

187
188
189
190
191
192
193
194
195
196
  }
} else if (
  t.isClassDeclaration(declaration) ||
  t.isFunctionDeclaration(declaration) ||
  t.isTypeAlias(declaration) ||
  t.isInterfaceDeclaration(declaration) ||
  t.isTSTypeAliasDeclaration(declaration) ||
  t.isTSInterfaceDeclaration(declaration) ||
  t.isTSEnumDeclaration(declaration) ||
  t.isTSDeclareFunction(declaration) ||
fork icon6
star icon34
watch icon0

+ 3 other calls in file

166
167
168
169
170
171
172
173
174
175
} else if (t.isClassDeclaration(declaration)) {
  push(declaration.id.name, declaration, hasPrivateJsDoc(node.leadingComments));
}

// Types (Flow only)
else if (t.isTypeAlias(declaration) || t.isInterfaceDeclaration(declaration)) {
  push(declaration.id.name, declaration, hasPrivateJsDoc(node.leadingComments));
}

// Unsupported types yet
fork icon1
star icon2
watch icon0

Other functions in @babel/types

Sorted by popularity

function icon

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