pub mod document;
pub mod evaluator;
pub mod io;
pub mod matcher;
mod profile;
pub mod recompute;
pub mod sketch;
#[cfg(test)]
mod test_support;
pub mod undo;

pub use bone_kernel::{
    BrepError, BrepFace, BrepSolid, DraftAngle, DraftDirection, DraftMagnitude, ExtrudeDirection,
    ExtrudeEndCondition, ExtrudeFeature, ExtrudeSense, MergeResult, ProfileDefect, ThinWall,
    ThinWallDirection, TruckGap,
};
pub use document::{
    BindSketchToFaceError, Document, DocumentHeader, DocumentParameters, ExtrudeFile, FeatureEdge,
    FeatureNode, FeatureTree, ImportedSolid, PrincipalPlane, RenameExtrudeError, RenameSketchError,
    SketchFile, SketchRegistry, SketchRegistryEntry, UnitsPreference, extrude_filename,
    sketch_filename,
};
pub use evaluator::{
    EvaluatedExtrude, EvaluatedSketch, ExtrudeError, evaluate_extrude, evaluate_sketch,
};
pub use io::{
    BlobHash, BlobKind, DocumentFolder, FolderError, FolderErrorKind, LabelSidecar, RonError,
    from_str, load, read_solid, read_tessellation, save, to_string, write_solid,
    write_tessellation,
};
pub use matcher::{ResolvedEntity, ResolvedFace, resolve, resolve_face};
pub use recompute::{EvaluatedModel, RebuildBudget, RebuildCost, RebuildPass, RecomputeScope};
pub use sketch::{
    ArcData, CircleData, DimensionKind, DimensionRefs, DimensionValue, DimensionValueMismatch,
    EditOutcome, EntityRefs, LineData, PointData, RelationRefs, Sketch, SketchDimension,
    SketchDofReport, SketchEdit, SketchEditError, SketchEntity, SketchEntityKind, SketchParameter,
    SketchRelation, SketchStatusReport, SketchVersion, SolverError,
};
pub use undo::UndoStack;

#[derive(Debug, thiserror::Error)]
pub enum DocumentError {
    #[error(transparent)]
    SketchEdit(#[from] SketchEditError),
    #[error(transparent)]
    Folder(#[from] FolderError),
    #[error(transparent)]
    Ron(#[from] RonError),
}

pub type Result<T, E = DocumentError> = core::result::Result<T, E>;
