module Configuration where

import Events

data Configuration m = Configuration
  { forall (m :: * -> *). Configuration m -> m [Event] -> IO [Event]
interpreter       :: m [Event] -> IO [Event]
  -- ^ How to run your algebraic effects or other.  This will apply to all `effectHandler`s.
  , forall (m :: * -> *). Configuration m -> String -> IO ()
logger            :: String -> IO ()
  -- ^ Specify what to do with logs
  , forall (m :: * -> *). Configuration m -> [String]
eventsToListenTo  :: [String]
  -- ^ For extending the handled events.  By default it covers the usual click, change, focus(in/out)
  , forall (m :: * -> *). Configuration m -> String
htmlHead          :: String
  -- ^ This is placed directly into the \<head\>, so that you can link to external
  -- CSS etc
  , forall (m :: * -> *). Configuration m -> Bool
devMode           :: Bool
  -- ^ When enabled, Purview will send the whole tree on websocket reconnection.
  -- This enables you to use
  -- "ghcid --command 'stack ghci examples/Main.hs' --test :main`"
  -- to restart the server on file change, and get a kind of live reloading
  , forall (m :: * -> *). Configuration m -> String
javascript        :: String
  , forall (m :: * -> *). Configuration m -> Int
port              :: Int
  -- ^ the port to run on
  , forall (m :: * -> *). Configuration m -> Bool
secure            :: Bool
  -- ^ whether the websocket tries to connect using ws:// or wss://
  -- locally you probably want this false, in prod secure of course
  }