{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
module THREE.Stats
(
Stats (..)
, THREE.Stats.new
, showPanel
, update
, dom
) where
import Miso hiding (update)
import qualified Miso as J
import qualified THREE.Internal as THREE
newtype Stats
= Stats
{ Stats -> JSVal
unStats :: JSVal
} deriving (Stats -> IO Object
(Stats -> IO Object) -> ToObject Stats
forall a. (a -> IO Object) -> ToObject a
$ctoObject :: Stats -> IO Object
toObject :: Stats -> IO Object
ToObject, Stats -> IO JSVal
(Stats -> IO JSVal) -> ToJSVal Stats
forall a. (a -> IO JSVal) -> ToJSVal a
$ctoJSVal :: Stats -> IO JSVal
toJSVal :: Stats -> IO JSVal
ToJSVal)
instance FromJSVal Stats where
fromJSVal :: JSVal -> IO (Maybe Stats)
fromJSVal = Maybe Stats -> IO (Maybe Stats)
forall a. a -> IO a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (Maybe Stats -> IO (Maybe Stats))
-> (JSVal -> Maybe Stats) -> JSVal -> IO (Maybe Stats)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Stats -> Maybe Stats
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (Stats -> Maybe Stats) -> (JSVal -> Stats) -> JSVal -> Maybe Stats
forall b c a. (b -> c) -> (a -> b) -> a -> c
. JSVal -> Stats
Stats
new :: () -> THREE.Three Stats
new :: () -> IO Stats
new () = do
v <- MisoString -> IO JSVal
jsg (MisoString
"Stats" :: MisoString)
Stats <$> J.new v ()
showPanel :: THREE.Method Stats Int ()
showPanel :: Method Stats Int ()
showPanel = MisoString -> Method Stats Int ()
forall object return args.
(FromJSVal return, ToArgs args, ToObject object) =>
MisoString -> Method object args return
THREE.method MisoString
"showPanel"
update :: THREE.Method Stats () ()
update :: Method Stats () ()
update = MisoString -> Method Stats () ()
forall object return args.
(FromJSVal return, ToArgs args, ToObject object) =>
MisoString -> Method object args return
THREE.method MisoString
"update"
dom :: THREE.Property Stats JSVal
dom :: Property Stats JSVal
dom = MisoString -> Property Stats JSVal
forall object field.
(ToObject object, ToJSVal field, FromJSVal field) =>
MisoString -> Property object field
THREE.property MisoString
"dom"