packages feed

jsaddle-dom-0.10.0.0: src/JSDOM/Generated/PhotoCapabilities.hs

{-# LANGUAGE PatternSynonyms #-}
{-# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
-- | Generated by dom-gen from image-capture (webref). Do not edit.
module JSDOM.Generated.PhotoCapabilities
       (newPhotoCapabilities, setRedEyeReduction, getRedEyeReduction, getRedEyeReductionUnsafe, getRedEyeReductionUnchecked, setImageHeight, getImageHeight, getImageHeightUnsafe, getImageHeightUnchecked, setImageWidth, getImageWidth, getImageWidthUnsafe, getImageWidthUnchecked, setFillLightMode, getFillLightMode, getFillLightModeUnsafe, getFillLightModeUnchecked, PhotoCapabilities(..), gTypePhotoCapabilities)
       where
import Prelude ((.), (==), (>>=), (<$>), (++), Bool(..), Maybe(..), IO, Int, Word, Double, Float)
import qualified Prelude as P
import Control.Monad (void)
import Control.Lens.Operators ((^.))
import Language.Javascript.JSaddle (JSM, JSVal, JSString, toJSVal, valToBool, valToNumber, js, jss, jsf, jsg, new, function, asyncFunction, jsUndefined, jsNull)
import JSDOM.Types
import qualified JSDOM.Types as Types
import JSDOM.EventTargetClosures (EventName, unsafeEventName, unsafeEventNameAsync)
import JSDOM.Generated.Enums

-- | <https://w3c.github.io/mediacapture-image/#dictdef-photocapabilities PhotoCapabilities specification>
newPhotoCapabilities :: (MonadDOM m) => m PhotoCapabilities
newPhotoCapabilities = liftDOM ((((new (jsg "Object") () >>= \o -> P.return o)) >>= fromJSValUnchecked))

-- | <https://w3c.github.io/mediacapture-image/#dom-photocapabilities-redeyereduction PhotoCapabilities.redEyeReduction specification>
setRedEyeReduction :: (MonadDOM m) => PhotoCapabilities -> RedEyeReduction -> m ()
setRedEyeReduction self val = liftDOM (void (self ^. jss "redEyeReduction" (toJSVal val)))

-- | <https://w3c.github.io/mediacapture-image/#dom-photocapabilities-redeyereduction PhotoCapabilities.redEyeReduction specification>
getRedEyeReduction :: (MonadDOM m) => PhotoCapabilities -> m (Maybe RedEyeReduction)
getRedEyeReduction self = liftDOM (((self ^. js "redEyeReduction") >>= fromJSValUnchecked))

-- | <https://w3c.github.io/mediacapture-image/#dom-photocapabilities-redeyereduction PhotoCapabilities.redEyeReduction specification>
getRedEyeReductionUnsafe :: (MonadDOM m, HasCallStack) => PhotoCapabilities -> m RedEyeReduction
getRedEyeReductionUnsafe self = liftDOM ((((self ^. js "redEyeReduction") >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))

-- | <https://w3c.github.io/mediacapture-image/#dom-photocapabilities-redeyereduction PhotoCapabilities.redEyeReduction specification>
getRedEyeReductionUnchecked :: (MonadDOM m) => PhotoCapabilities -> m RedEyeReduction
getRedEyeReductionUnchecked self = liftDOM (((self ^. js "redEyeReduction") >>= fromJSValUnchecked))

-- | <https://w3c.github.io/mediacapture-image/#dom-photocapabilities-imageheight PhotoCapabilities.imageHeight specification>
setImageHeight :: (MonadDOM m) => PhotoCapabilities -> MediaSettingsRange -> m ()
setImageHeight self val = liftDOM (void (self ^. jss "imageHeight" (toJSVal val)))

-- | <https://w3c.github.io/mediacapture-image/#dom-photocapabilities-imageheight PhotoCapabilities.imageHeight specification>
getImageHeight :: (MonadDOM m) => PhotoCapabilities -> m (Maybe MediaSettingsRange)
getImageHeight self = liftDOM (((self ^. js "imageHeight") >>= fromJSValUnchecked))

-- | <https://w3c.github.io/mediacapture-image/#dom-photocapabilities-imageheight PhotoCapabilities.imageHeight specification>
getImageHeightUnsafe :: (MonadDOM m, HasCallStack) => PhotoCapabilities -> m MediaSettingsRange
getImageHeightUnsafe self = liftDOM ((((self ^. js "imageHeight") >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))

-- | <https://w3c.github.io/mediacapture-image/#dom-photocapabilities-imageheight PhotoCapabilities.imageHeight specification>
getImageHeightUnchecked :: (MonadDOM m) => PhotoCapabilities -> m MediaSettingsRange
getImageHeightUnchecked self = liftDOM (((self ^. js "imageHeight") >>= fromJSValUnchecked))

-- | <https://w3c.github.io/mediacapture-image/#dom-photocapabilities-imagewidth PhotoCapabilities.imageWidth specification>
setImageWidth :: (MonadDOM m) => PhotoCapabilities -> MediaSettingsRange -> m ()
setImageWidth self val = liftDOM (void (self ^. jss "imageWidth" (toJSVal val)))

-- | <https://w3c.github.io/mediacapture-image/#dom-photocapabilities-imagewidth PhotoCapabilities.imageWidth specification>
getImageWidth :: (MonadDOM m) => PhotoCapabilities -> m (Maybe MediaSettingsRange)
getImageWidth self = liftDOM (((self ^. js "imageWidth") >>= fromJSValUnchecked))

-- | <https://w3c.github.io/mediacapture-image/#dom-photocapabilities-imagewidth PhotoCapabilities.imageWidth specification>
getImageWidthUnsafe :: (MonadDOM m, HasCallStack) => PhotoCapabilities -> m MediaSettingsRange
getImageWidthUnsafe self = liftDOM ((((self ^. js "imageWidth") >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))

-- | <https://w3c.github.io/mediacapture-image/#dom-photocapabilities-imagewidth PhotoCapabilities.imageWidth specification>
getImageWidthUnchecked :: (MonadDOM m) => PhotoCapabilities -> m MediaSettingsRange
getImageWidthUnchecked self = liftDOM (((self ^. js "imageWidth") >>= fromJSValUnchecked))

-- | <https://w3c.github.io/mediacapture-image/#dom-photocapabilities-filllightmode PhotoCapabilities.fillLightMode specification>
setFillLightMode :: (MonadDOM m) => PhotoCapabilities -> [FillLightMode] -> m ()
setFillLightMode self val = liftDOM (void (self ^. jss "fillLightMode" (toJSVal val)))

-- | <https://w3c.github.io/mediacapture-image/#dom-photocapabilities-filllightmode PhotoCapabilities.fillLightMode specification>
getFillLightMode :: (MonadDOM m) => PhotoCapabilities -> m (Maybe [FillLightMode])
getFillLightMode self = liftDOM (((self ^. js "fillLightMode") >>= fromJSValUnchecked))

-- | <https://w3c.github.io/mediacapture-image/#dom-photocapabilities-filllightmode PhotoCapabilities.fillLightMode specification>
getFillLightModeUnsafe :: (MonadDOM m, HasCallStack) => PhotoCapabilities -> m [FillLightMode]
getFillLightModeUnsafe self = liftDOM ((((self ^. js "fillLightMode") >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))

-- | <https://w3c.github.io/mediacapture-image/#dom-photocapabilities-filllightmode PhotoCapabilities.fillLightMode specification>
getFillLightModeUnchecked :: (MonadDOM m) => PhotoCapabilities -> m [FillLightMode]
getFillLightModeUnchecked self = liftDOM (((self ^. js "fillLightMode") >>= fromJSValUnchecked))