minor additions
This commit is contained in:
parent
538c88728f
commit
566109306b
|
@ -20,6 +20,7 @@ library
|
|||
, Torrent
|
||||
other-modules:
|
||||
-- other-extensions:
|
||||
ghc-options: -Wall
|
||||
build-depends: base ^>=4.14.1.0
|
||||
, wreq
|
||||
, aeson
|
||||
|
@ -36,6 +37,7 @@ executable kino
|
|||
main-is: Main.hs
|
||||
-- other-modules:
|
||||
-- other-extensions:
|
||||
ghc-options: -Wall
|
||||
build-depends: base ^>=4.14.1.0
|
||||
, kino
|
||||
, brick
|
||||
|
|
|
@ -5,8 +5,6 @@ module JSONTypes where
|
|||
import Data.Aeson
|
||||
import Data.Aeson.Types
|
||||
import qualified Data.Text as T
|
||||
import Data.Aeson.Lens (key, nth)
|
||||
import qualified Data.ByteString.Lazy.Internal as BL
|
||||
|
||||
data JSONResponse d = JSONResponse
|
||||
{ resp_status :: T.Text
|
||||
|
|
|
@ -9,8 +9,6 @@ import qualified Network.Wreq as WR (Options)
|
|||
import Control.Lens
|
||||
import Data.Aeson
|
||||
import Data.Text as T
|
||||
import Data.Aeson.Lens (key, nth)
|
||||
import qualified Data.ByteString.Lazy as BL
|
||||
|
||||
makeRequest :: (FromJSON a) => String -> WR.Options -> IO (Either T.Text a)
|
||||
makeRequest url opts = do
|
||||
|
|
22
src/UI.hs
22
src/UI.hs
|
@ -3,22 +3,36 @@ module UI where
|
|||
import Brick
|
||||
import Brick.Main
|
||||
|
||||
data Identifiers = Nil
|
||||
data Ident = Nil
|
||||
|
||||
data AppState = Null
|
||||
data AppS = Null
|
||||
|
||||
app :: App AppState () Identifiers
|
||||
app :: App AppS () Ident
|
||||
app = App
|
||||
{ appDraw = draw
|
||||
, appChooseCursor = chooseCursor
|
||||
, appHandleEvent = eventHandler
|
||||
, appStartEvent = startEvent
|
||||
, appAttrMap = attributeMap
|
||||
}
|
||||
|
||||
runApp :: IO AppS
|
||||
runApp = defaultMain app initialState
|
||||
|
||||
initialState :: AppS
|
||||
initialState = undefined
|
||||
|
||||
startEvent :: EventM Ident (Next Apps)
|
||||
startEvent = return -- replace if needed
|
||||
|
||||
draw :: AppS -> [Widget Ident]
|
||||
draw = undefined
|
||||
|
||||
chooseCursor = undefined
|
||||
chooseCursor :: AppS -> [CursorLocation Ident] -> Maybe (CursorLocation Ident)
|
||||
chooseCursor = showFirstCursor -- replace if needed
|
||||
|
||||
eventHandler :: AppS -> BrickEvent Identifier () -> EventM Ident (Next AppS)
|
||||
eventHandler = undefined
|
||||
|
||||
attributeMap :: AttrMap
|
||||
attributeMap = undefined
|
||||
|
|
Loading…
Reference in New Issue
Block a user