MCPcopy Create free account
hub / github.com/microsoft/typescript-go / IsTypeDeclaration

Function IsTypeDeclaration

internal/ast/utilities.go:3566–3577  ·  view source on GitHub ↗
(node *Node)

Source from the content-addressed store, hash-verified

3564}
3565
3566func IsTypeDeclaration(node *Node) bool {
3567 switch node.Kind {
3568 case KindTypeParameter, KindClassDeclaration, KindInterfaceDeclaration, KindTypeAliasDeclaration, KindJSTypeAliasDeclaration, KindEnumDeclaration:
3569 return true
3570 case KindImportClause:
3571 return node.IsTypeOnly()
3572 case KindImportSpecifier, KindExportSpecifier:
3573 return node.Parent.Parent.IsTypeOnly()
3574 default:
3575 return false
3576 }
3577}
3578
3579func IsTypeDeclarationName(name *Node) bool {
3580 return name.Kind == KindIdentifier &&

Callers 5

reportUnusedLocalMethod · 0.92
getTypeOfNodeMethod · 0.92
IsTypeDeclarationNameFunction · 0.85

Calls 1

IsTypeOnlyMethod · 0.80

Tested by

no test coverage detected