use thiserror::Error;

mod book;
mod morphology;
mod reference;
mod reference_parser;
mod versification;

pub use book::*;
pub use morphology::{
    Case, Gender, Mood, Number, Parsing, ParsingError, PartOfSpeech, Person, Tense, Voice,
    parse_to_json,
};
pub use reference::{
    AbbreviationStyle, FormatOptions, Formatter, ListFormatOptions, RangeStyle, Reference,
    SeparatorStyle,
};
#[allow(deprecated)]
pub use reference_parser::{
    ContextualContext, ContextualResolution, DiagnosticSeverity, LocatedReference, ParseDiagnostic,
    ParseDiagnosticKind, ParseOptions, Parser, Span, Text, contains_possible_references,
    parse_reference, parse_reference_with_offsets, parse_reference_with_offsets_and_options,
    parse_reference_with_options,
};
pub use versification::Versification;

pub enum Testament {
    Old,
    New,
    Apocrypha,
}

#[derive(Debug, Error)]
pub enum ReferenceError {
    #[error("Invalid book specified: {0}")]
    InvalidBook(String),
    #[error("Book '{0}' does not contain chapter {1}")]
    InvalidChapter(String, u8),
    #[error("Chapter {1} in book '{0}' does not contain verse {2}")]
    InvalidVerse(String, u8, u8),
}
