use serde::{Deserialize, Serialize};
pub use turbovault_parser::{
ContentBlock as Block, InlineElement, ListItem, TableAlignment as Alignment,
};
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct DocumentOutput {
pub document: DocumentRoot,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct DocumentRoot {
pub metadata: DocumentMetadata,
pub sections: Vec<Section>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct DocumentMetadata {
pub source: Option<String>,
#[serde(rename = "headingCount")]
pub heading_count: usize,
#[serde(rename = "maxDepth")]
pub max_depth: usize,
#[serde(rename = "wordCount")]
pub word_count: usize,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct Section {
pub id: String,
pub level: usize,
pub title: String,
pub slug: String,
pub position: Position,
pub content: Content,
pub children: Vec<Section>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct Position {
pub line: usize,
pub offset: usize,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct Content {
pub raw: String,
pub blocks: Vec<Block>,
}