packages feed

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

{-# LANGUAGE PatternSynonyms #-}
{-# LANGUAGE ForeignFunctionInterface, JavaScriptFFI #-}
{-# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
-- | Generated by dom-gen from media-capabilities (webref). Do not edit.
module GHCJS.DOM.JSFFI.Generated.KeySystemTrackConfiguration
       (js_newKeySystemTrackConfiguration, js_setRobustness, js_getRobustness, js_setEncryptionScheme, js_getEncryptionScheme, newKeySystemTrackConfiguration, setRobustness, getRobustness, getRobustnessUnsafe, getRobustnessUnchecked, setEncryptionScheme, getEncryptionScheme, getEncryptionSchemeUnsafe, getEncryptionSchemeUnchecked, KeySystemTrackConfiguration(..), gTypeKeySystemTrackConfiguration)
       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_newKeySystemTrackConfiguration :: IO KeySystemTrackConfiguration
-- | <https://w3c.github.io/media-capabilities/#dictdef-keysystemtrackconfiguration KeySystemTrackConfiguration specification>
newKeySystemTrackConfiguration :: (MonadDOM m) => m KeySystemTrackConfiguration
newKeySystemTrackConfiguration = liftDOM ((js_newKeySystemTrackConfiguration))

foreign import javascript safe "(($1, $2) => { $1[\"robustness\"] = $2; })"
        js_setRobustness :: KeySystemTrackConfiguration -> JSString -> IO ()
-- | <https://w3c.github.io/media-capabilities/#dom-keysystemtrackconfiguration-robustness KeySystemTrackConfiguration.robustness specification>
setRobustness :: (MonadDOM m, ToJSString val) => KeySystemTrackConfiguration -> val -> m ()
setRobustness self val = liftDOM (void ((js_setRobustness (self) (toJSString val))))

foreign import javascript unsafe "(($1) => { return $1[\"robustness\"]; })"
        js_getRobustness :: KeySystemTrackConfiguration -> IO JSVal
-- | <https://w3c.github.io/media-capabilities/#dom-keysystemtrackconfiguration-robustness KeySystemTrackConfiguration.robustness specification>
getRobustness :: (MonadDOM m, FromJSString result) => KeySystemTrackConfiguration -> m (Maybe result)
getRobustness self = liftDOM (((fromMaybeJSString . Nullable) <$> (js_getRobustness (self))))

-- | <https://w3c.github.io/media-capabilities/#dom-keysystemtrackconfiguration-robustness KeySystemTrackConfiguration.robustness specification>
getRobustnessUnsafe :: (MonadDOM m, HasCallStack, FromJSString result) => KeySystemTrackConfiguration -> m result
getRobustnessUnsafe self = liftDOM ((((fromMaybeJSString . Nullable) <$> (js_getRobustness (self))) >>= P.maybe (P.error "Nothing to return") P.return))

-- | <https://w3c.github.io/media-capabilities/#dom-keysystemtrackconfiguration-robustness KeySystemTrackConfiguration.robustness specification>
getRobustnessUnchecked :: (MonadDOM m, FromJSString result) => KeySystemTrackConfiguration -> m result
getRobustnessUnchecked self = liftDOM ((pFromJSVal <$> (js_getRobustness (self))))

foreign import javascript safe "(($1, $2) => { $1[\"encryptionScheme\"] = $2; })"
        js_setEncryptionScheme :: KeySystemTrackConfiguration -> (Nullable JSString) -> IO ()
-- | <https://w3c.github.io/media-capabilities/#dom-keysystemtrackconfiguration-encryptionscheme KeySystemTrackConfiguration.encryptionScheme specification>
setEncryptionScheme :: (MonadDOM m, ToJSString val) => KeySystemTrackConfiguration -> Maybe val -> m ()
setEncryptionScheme self val = liftDOM (void ((js_setEncryptionScheme (self) (toMaybeJSString val))))

foreign import javascript unsafe "(($1) => { return $1[\"encryptionScheme\"]; })"
        js_getEncryptionScheme :: KeySystemTrackConfiguration -> IO JSVal
-- | <https://w3c.github.io/media-capabilities/#dom-keysystemtrackconfiguration-encryptionscheme KeySystemTrackConfiguration.encryptionScheme specification>
getEncryptionScheme :: (MonadDOM m, FromJSString result) => KeySystemTrackConfiguration -> m (Maybe result)
getEncryptionScheme self = liftDOM (((fromMaybeJSString . Nullable) <$> (js_getEncryptionScheme (self))))

-- | <https://w3c.github.io/media-capabilities/#dom-keysystemtrackconfiguration-encryptionscheme KeySystemTrackConfiguration.encryptionScheme specification>
getEncryptionSchemeUnsafe :: (MonadDOM m, HasCallStack, FromJSString result) => KeySystemTrackConfiguration -> m result
getEncryptionSchemeUnsafe self = liftDOM ((((fromMaybeJSString . Nullable) <$> (js_getEncryptionScheme (self))) >>= P.maybe (P.error "Nothing to return") P.return))

-- | <https://w3c.github.io/media-capabilities/#dom-keysystemtrackconfiguration-encryptionscheme KeySystemTrackConfiguration.encryptionScheme specification>
getEncryptionSchemeUnchecked :: (MonadDOM m, FromJSString result) => KeySystemTrackConfiguration -> m result
getEncryptionSchemeUnchecked self = liftDOM ((pFromJSVal <$> (js_getEncryptionScheme (self))))