use std::collections::BTreeMap;
use serde::{Deserialize, Serialize};
use crate::conventions::{Convention, Manual};
use crate::graph::{ContractView, Node};
use crate::search::SearchHit;
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct Search {
pub hits: Vec<SearchHit>,
pub markdown: String,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct Why {
pub name: String,
pub markdown: String,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct Ledger {
pub markdown: String,
pub note: Option<String>,
pub failed: bool,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct Flow {
pub focus: String,
pub narration: Option<(String, Vec<String>)>,
pub steps: Vec<Step>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct Step {
pub depth: usize,
pub via: String,
pub name: String,
pub location: String,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct Contracts {
pub total: usize,
pub views: Vec<ContractView>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct Conventions {
pub conventions: Vec<Convention>,
pub hidden: Vec<Manual>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct Explore {
pub symbols: usize,
pub edges: usize,
pub dangling: usize,
pub view: Option<ExploreView>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ExploreView {
pub focus: Option<Node>,
pub container: Option<Node>,
pub callees: Vec<Node>,
pub callers: Vec<Node>,
pub importers: Vec<Node>,
pub members: Vec<Node>,
pub dependents: usize,
pub by_repo: BTreeMap<String, usize>,
pub budget: usize,
pub pack: Vec<(Node, usize)>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct Stats {
pub symbols: usize,
pub indexed: usize,
pub unknown: Vec<String>,
pub repos: Vec<RepoStats>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct RepoStats {
pub repo: String,
pub symbols: usize,
pub edges: usize,
pub enriched: usize,
pub kinds: BTreeMap<String, usize>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct Preflight {
pub markdown: String,
pub blocking: bool,
}
pub const RIPPLE_DEPTH: usize = 4;
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct Hook {
pub text: String,
pub ids: Vec<String>,
}