packages feed

ghcjs-dom-javascript-0.10.0.0: src/GHCJS/DOM/JSFFI/Generated/VideoDecoderSupport.hs

{-# LANGUAGE PatternSynonyms #-}
{-# LANGUAGE ForeignFunctionInterface, JavaScriptFFI #-}
{-# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
-- | Generated by dom-gen from webcodecs (webref). Do not edit.
module GHCJS.DOM.JSFFI.Generated.VideoDecoderSupport
       (js_newVideoDecoderSupport, js_setSupported, js_getSupported, js_setConfig, js_getConfig, newVideoDecoderSupport, setSupported, getSupported, getSupportedUnsafe, getSupportedUnchecked, setConfig, getConfig, getConfigUnsafe, getConfigUnchecked, VideoDecoderSupport(..), gTypeVideoDecoderSupport)
       where
import Prelude ((.), (==), (>>=), (<$>), (++), Bool(..), Maybe(..), IO, Int, Word, Double, Float)
import qualified Prelude as P
import Control.Monad (void)
import GHCJS.Types (JSVal, JSString)
import GHCJS.Foreign (jsUndefined, jsNull)
import GHCJS.DOM.Types
import qualified GHCJS.DOM.Types as Types
import GHCJS.DOM.EventTargetClosures (EventName, unsafeEventName, unsafeEventNameAsync)
import GHCJS.DOM.JSFFI.Generated.Enums

foreign import javascript safe "(() => { return ({}); })"
        js_newVideoDecoderSupport :: IO VideoDecoderSupport
-- | <https://w3c.github.io/webcodecs/#dictdef-videodecodersupport VideoDecoderSupport specification>
newVideoDecoderSupport :: (MonadDOM m) => m VideoDecoderSupport
newVideoDecoderSupport = liftDOM ((js_newVideoDecoderSupport))

foreign import javascript safe "(($1, $2) => { $1[\"supported\"] = $2; })"
        js_setSupported :: VideoDecoderSupport -> Bool -> IO ()
-- | <https://w3c.github.io/webcodecs/#dom-videodecodersupport-supported VideoDecoderSupport.supported specification>
setSupported :: (MonadDOM m) => VideoDecoderSupport -> Bool -> m ()
setSupported self val = liftDOM (void ((js_setSupported (self) (val))))

foreign import javascript unsafe "(($1) => { return $1[\"supported\"]; })"
        js_getSupported :: VideoDecoderSupport -> IO JSVal
-- | <https://w3c.github.io/webcodecs/#dom-videodecodersupport-supported VideoDecoderSupport.supported specification>
getSupported :: (MonadDOM m) => VideoDecoderSupport -> m (Maybe Bool)
getSupported self = liftDOM (((js_getSupported (self)) >>= fromJSValUnchecked))

-- | <https://w3c.github.io/webcodecs/#dom-videodecodersupport-supported VideoDecoderSupport.supported specification>
getSupportedUnsafe :: (MonadDOM m, HasCallStack) => VideoDecoderSupport -> m Bool
getSupportedUnsafe self = liftDOM ((((js_getSupported (self)) >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))

-- | <https://w3c.github.io/webcodecs/#dom-videodecodersupport-supported VideoDecoderSupport.supported specification>
getSupportedUnchecked :: (MonadDOM m) => VideoDecoderSupport -> m Bool
getSupportedUnchecked self = liftDOM ((pFromJSVal <$> (js_getSupported (self))))

foreign import javascript safe "(($1, $2) => { $1[\"config\"] = $2; })"
        js_setConfig :: VideoDecoderSupport -> VideoDecoderConfig -> IO ()
-- | <https://w3c.github.io/webcodecs/#dom-videodecodersupport-config VideoDecoderSupport.config specification>
setConfig :: (MonadDOM m) => VideoDecoderSupport -> VideoDecoderConfig -> m ()
setConfig self val = liftDOM (void ((js_setConfig (self) (val))))

foreign import javascript unsafe "(($1) => { return $1[\"config\"]; })"
        js_getConfig :: VideoDecoderSupport -> IO JSVal
-- | <https://w3c.github.io/webcodecs/#dom-videodecodersupport-config VideoDecoderSupport.config specification>
getConfig :: (MonadDOM m) => VideoDecoderSupport -> m (Maybe VideoDecoderConfig)
getConfig self = liftDOM (((js_getConfig (self)) >>= fromJSValUnchecked))

-- | <https://w3c.github.io/webcodecs/#dom-videodecodersupport-config VideoDecoderSupport.config specification>
getConfigUnsafe :: (MonadDOM m, HasCallStack) => VideoDecoderSupport -> m VideoDecoderConfig
getConfigUnsafe self = liftDOM ((((js_getConfig (self)) >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))

-- | <https://w3c.github.io/webcodecs/#dom-videodecodersupport-config VideoDecoderSupport.config specification>
getConfigUnchecked :: (MonadDOM m) => VideoDecoderSupport -> m VideoDecoderConfig
getConfigUnchecked self = liftDOM ((pFromJSVal <$> (js_getConfig (self))))