在“@typescript eslint/parser”AST中获取超类引用

在“@typescript eslint/parser”AST中获取超类引用,typescript,abstract-syntax-tree,typescript-eslint,Typescript,Abstract Syntax Tree,Typescript Eslint,给定以下类层次结构: class Foo { fooMember = 1; } class Bar extends Foo { barMember = 2; } 将扩展Foo语句引用为具有以下属性的超类: superClass: Identifier { type: "Identifier", name: "Foo", range: [ 50 53 ] } 是否可以从此条目中提取与Foo对应的ClassDeclaration,如果可以,如何提取? 如果导入扩展类,相同的

给定以下类层次结构:

class Foo {
  fooMember = 1;
}

class Bar extends Foo {
  barMember = 2;
}
扩展Foo
语句引用为具有以下属性的
超类

superClass: Identifier {
  type: "Identifier",
  name: "Foo",
  range: [ 50 53 ]
}
是否可以从此条目中提取与
Foo
对应的
ClassDeclaration
,如果可以,如何提取?
如果导入扩展类,相同的解决方案是否适用

从概念上讲,这应该是可能的,因为Typescript正确地推断了错误,例如父子类之间的公共-私有定义不匹配等