pub use super::ast_typescript_compat::{
analyze_javascript_file, analyze_javascript_file_with_classifier,
analyze_javascript_file_with_complexity,
analyze_javascript_file_with_complexity_and_classifier, analyze_typescript_file,
analyze_typescript_file_with_classifier, analyze_typescript_file_with_complexity,
analyze_typescript_file_with_complexity_and_classifier,
};
pub struct TypeScriptParser {}
impl Default for TypeScriptParser {
fn default() -> Self {
Self::new()
}
}
impl TypeScriptParser {
#[must_use]
pub fn new() -> Self {
Self {}
}
}
#[derive(Debug, Clone)]
pub struct TypeScriptSymbol {
pub name: String,
pub kind: SymbolKind,
pub line: usize,
pub is_exported: bool,
pub is_async: bool,
pub variants_count: usize,
pub fields_count: usize,
}
#[derive(Debug, Clone)]
pub enum SymbolKind {
Function,
Class,
Interface,
TypeAlias,
Enum,
Variable,
Import,
Export,
Method,
Property,
}
pub async fn analyze_typescript_file_with_complexity_cached(
path: &std::path::Path,
_cache_manager: Option<
std::sync::Arc<crate::services::cache::persistent_manager::PersistentCacheManager>,
>,
) -> Result<crate::services::complexity::FileComplexityMetrics, crate::models::error::TemplateError>
{
analyze_typescript_file_with_complexity(path).await
}
#[cfg(test)]
mod property_tests {
use proptest::prelude::*;
proptest! {
#[test]
fn basic_property_stability(_input in ".*") {
prop_assert!(true);
}
#[test]
fn module_consistency_check(_x in 0u32..1000) {
prop_assert!(_x < 1001);
}
}
}