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

pub use document::{
    Document, DocumentHeader, DocumentParameters, FeatureEdge, FeatureNode, FeatureTree,
    PrincipalPlane, RenameSketchError, SketchFile, SketchRegistry, SketchRegistryEntry,
    UnitsPreference, sketch_filename,
};
pub use evaluator::{EvaluatedSketch, FeatureCache, evaluate_sketch};
pub use io::{
    BlobHash, BlobKind, DocumentFolder, FolderError, FolderErrorKind, LabelSidecar, RonError,
    from_str, load, read_solid, save, to_string, write_solid,
};
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>;
