{-# LANGUAGE OverloadedStrings #-} -- | Core types and error definitions for Docster module Docster.Types ( -- * Error Types DocsterError(..) -- * Output Format , OutputFormat(..) -- * Domain Types , SourceDir(..) , OutputPath(..) , DiagramId(..) , DiagramConfig(..) ) where import Data.Text (Text) import Control.Exception (Exception) -- | Custom error types for comprehensive error handling data DocsterError = InvalidUsage Text | FileError Text | PDFGenerationError Text | ProcessError Text deriving (Show) instance Exception DocsterError -- | Output format for document generation data OutputFormat = PDF | HTML deriving (Show, Eq) -- | Type-safe wrapper for source directory paths newtype SourceDir = SourceDir FilePath deriving (Show, Eq) -- | Type-safe wrapper for output file paths newtype OutputPath = OutputPath FilePath deriving (Show, Eq) -- | Type-safe wrapper for diagram identifiers newtype DiagramId = DiagramId Text deriving (Show, Eq) -- | Configuration for diagram generation data DiagramConfig = DiagramConfig { dcSourceDir :: SourceDir , dcOutputFormat :: OutputFormat } deriving (Show)