packages feed

ghcjs-dom-javascript-0.10.0.0: src/GHCJS/DOM/JSFFI/Generated/VideoDecoderInit.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.VideoDecoderInit
       (js_newVideoDecoderInit, js_setOutput, js_setError, newVideoDecoderInit, setOutput, setError, VideoDecoderInit(..), gTypeVideoDecoderInit)
       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 "(($1, $2) => { return ({\"output\": $1, \"error\": $2}); })"
        js_newVideoDecoderInit :: JSVal -> JSVal -> IO VideoDecoderInit
-- | <https://w3c.github.io/webcodecs/#dictdef-videodecoderinit VideoDecoderInit specification>
newVideoDecoderInit :: (MonadDOM m) => VideoFrameOutputCallback -> WebCodecsErrorCallback -> m VideoDecoderInit
newVideoDecoderInit output error = liftDOM (((toJSVal output) >>= \a1' -> (toJSVal error) >>= \a2' -> js_newVideoDecoderInit a1' a2'))

foreign import javascript safe "(($1, $2) => { $1[\"output\"] = $2; })"
        js_setOutput :: VideoDecoderInit -> JSVal -> IO ()
-- | <https://w3c.github.io/webcodecs/#dom-videodecoderinit-output VideoDecoderInit.output specification>
setOutput :: (MonadDOM m) => VideoDecoderInit -> VideoFrameOutputCallback -> m ()
setOutput self val = liftDOM (void (((toJSVal val) >>= \a2' -> js_setOutput (self) a2')))

foreign import javascript safe "(($1, $2) => { $1[\"error\"] = $2; })"
        js_setError :: VideoDecoderInit -> JSVal -> IO ()
-- | <https://w3c.github.io/webcodecs/#dom-videodecoderinit-error VideoDecoderInit.error specification>
setError :: (MonadDOM m) => VideoDecoderInit -> WebCodecsErrorCallback -> m ()
setError self val = liftDOM (void (((toJSVal val) >>= \a2' -> js_setError (self) a2')))