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

pub use document::{
    Document, DocumentHeader, DocumentParameters, FeatureNode, FeatureTree, PrincipalPlane,
    SketchFile, SketchRegistry, SketchRegistryEntry, UnitsPreference, sketch_filename,
};
pub use evaluator::{EvaluatedSketch, FeatureCache, evaluate_sketch};
pub use io::{
    BlobHash, BlobKind, DocumentFolder, FolderError, FolderErrorKind, RonError, from_str, load,
    save, to_string,
};
pub use sketch::{
    ArcData, CircleData, DimensionKind, DimensionRefs, DimensionValue, DimensionValueMismatch,
    EditOutcome, EntityRefs, LineData, PointData, RelationRefs, Sketch, SketchDimension,
    SketchDofReport, SketchEdit, SketchEditError, SketchEntity, SketchEntityKind, SketchParameter,
    SketchRelation, 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>;
