-----------------------------------------------------------------------------
{-# LANGUAGE DerivingVia #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE OverloadedStrings #-}
-----------------------------------------------------------------------------
module THREE.Sphere
  ( -- * Types
    Sphere (..)
    -- * Methods
  , THREE.Sphere.new
    -- * Properties
  ) where
-----------------------------------------------------------------------------
import           Miso
-----------------------------------------------------------------------------
import qualified THREE.Internal as THREE
-----------------------------------------------------------------------------
-- | https://threejs.org/docs/#api/en/scenes/Sphere
newtype Sphere
  = Sphere
  { Sphere -> JSVal
unSphere :: JSVal
  } deriving newtype (Sphere -> IO [JSVal]
(Sphere -> IO [JSVal]) -> ToArgs Sphere
forall args. (args -> IO [JSVal]) -> ToArgs args
$ctoArgs :: Sphere -> IO [JSVal]
toArgs :: Sphere -> IO [JSVal]
ToArgs, Sphere -> IO Object
(Sphere -> IO Object) -> ToObject Sphere
forall a. (a -> IO Object) -> ToObject a
$ctoObject :: Sphere -> IO Object
toObject :: Sphere -> IO Object
ToObject, Sphere -> IO JSVal
(Sphere -> IO JSVal) -> ToJSVal Sphere
forall a. (a -> IO JSVal) -> ToJSVal a
$ctoJSVal :: Sphere -> IO JSVal
toJSVal :: Sphere -> IO JSVal
ToJSVal)
-----------------------------------------------------------------------------
-- | https://threejs.org/docs/#api/en/cameras/Sphere
new :: THREE.Three Sphere
new :: Three Sphere
new = (JSVal -> Sphere) -> MisoString -> [MisoString] -> Three Sphere
forall args con.
ToArgs args =>
(JSVal -> con) -> MisoString -> args -> Three con
THREE.new JSVal -> Sphere
Sphere MisoString
"Sphere" ([] :: [MisoString])
-----------------------------------------------------------------------------
instance FromJSVal Sphere where
  fromJSVal :: JSVal -> IO (Maybe Sphere)
fromJSVal = Maybe Sphere -> IO (Maybe Sphere)
forall a. a -> IO a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (Maybe Sphere -> IO (Maybe Sphere))
-> (JSVal -> Maybe Sphere) -> JSVal -> IO (Maybe Sphere)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Sphere -> Maybe Sphere
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (Sphere -> Maybe Sphere)
-> (JSVal -> Sphere) -> JSVal -> Maybe Sphere
forall b c a. (b -> c) -> (a -> b) -> a -> c
. JSVal -> Sphere
Sphere
-----------------------------------------------------------------------------