#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct ImportInfo {
pub source: String,
pub names: Vec<String>,
pub kind: ImportKind,
pub line: usize,
pub is_type_only: bool,
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum ImportKind {
Named,
Default,
Star,
SideEffect,
Dynamic,
Reexport,
}
#[derive(Debug, Clone)]
pub struct CallSite {
pub callee: String,
pub line: usize,
pub col: usize,
pub receiver: Option<String>,
pub is_method: bool,
pub callee_pos: Option<(usize, usize)>,
}
#[derive(Debug, Clone)]
pub struct TypeDef {
pub name: String,
pub kind: TypeDefKind,
pub line: usize,
pub end_line: usize,
pub is_exported: bool,
pub generics: Vec<String>,
pub namespace: Option<String>,
}
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct ExtMethodDef {
pub name: String,
pub line: usize,
pub end_line: usize,
}
#[derive(Debug, Clone, PartialEq)]
pub enum TypeDefKind {
Class,
Interface,
TypeAlias,
Enum,
Struct,
Trait,
Protocol,
Record,
Annotation,
Union,
}
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct TypeUse {
pub name: String,
pub line: usize,
}
#[derive(Debug, Clone)]
pub struct DeepAnalysis {
pub imports: Vec<ImportInfo>,
pub calls: Vec<CallSite>,
pub types: Vec<TypeDef>,
pub exports: Vec<String>,
pub type_uses: Vec<TypeUse>,
pub ext_methods: Vec<ExtMethodDef>,
}
impl DeepAnalysis {
pub fn empty() -> Self {
Self {
imports: Vec::new(),
calls: Vec::new(),
types: Vec::new(),
exports: Vec::new(),
type_uses: Vec::new(),
ext_methods: Vec::new(),
}
}
}