pub mod document;
pub mod evaluator;
pub mod io;
mod profile;
pub mod sketch;
pub mod undo;

pub use document::{
    Document, DocumentHeader, DocumentParameters, ExtrudeFile, FeatureEdge, FeatureNode,
    FeatureTree, PrincipalPlane, RenameSketchError, SketchFile, SketchRegistry,
    SketchRegistryEntry, UnitsPreference, extrude_filename, sketch_filename,
};
pub use evaluator::{
    EvaluatedExtrude, EvaluatedSketch, ExtrudeError, FeatureCache, 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 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>;
