ghcjs-dom-javascript-0.10.0.0: src/GHCJS/DOM/JSFFI/Generated/SpeechSynthesisErrorEventInit.hs
{-# LANGUAGE PatternSynonyms #-}
{-# LANGUAGE ForeignFunctionInterface, JavaScriptFFI #-}
{-# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
-- | Generated by dom-gen from speech-api (webref). Do not edit.
module GHCJS.DOM.JSFFI.Generated.SpeechSynthesisErrorEventInit
(js_newSpeechSynthesisErrorEventInit, js_setError, js_getError, newSpeechSynthesisErrorEventInit, setError, getError, SpeechSynthesisErrorEventInit(..), gTypeSpeechSynthesisErrorEventInit)
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 ({\"utterance\": $1, \"error\": $2}); })"
js_newSpeechSynthesisErrorEventInit :: SpeechSynthesisUtterance -> JSVal -> IO SpeechSynthesisErrorEventInit
-- | <https://webaudio.github.io/web-speech-api/#dictdef-speechsynthesiserroreventinit SpeechSynthesisErrorEventInit specification>
newSpeechSynthesisErrorEventInit :: (MonadDOM m) => SpeechSynthesisUtterance -> SpeechSynthesisErrorCode -> m SpeechSynthesisErrorEventInit
newSpeechSynthesisErrorEventInit utterance error = liftDOM (((toJSVal error) >>= \a2' -> js_newSpeechSynthesisErrorEventInit (utterance) a2'))
foreign import javascript safe "(($1, $2) => { $1[\"error\"] = $2; })"
js_setError :: SpeechSynthesisErrorEventInit -> JSVal -> IO ()
-- | <https://webaudio.github.io/web-speech-api/#dom-speechsynthesiserroreventinit-error SpeechSynthesisErrorEventInit.error specification>
setError :: (MonadDOM m) => SpeechSynthesisErrorEventInit -> SpeechSynthesisErrorCode -> m ()
setError self val = liftDOM (void (((toJSVal val) >>= \a2' -> js_setError (self) a2')))
foreign import javascript unsafe "(($1) => { return $1[\"error\"]; })"
js_getError :: SpeechSynthesisErrorEventInit -> IO JSVal
-- | <https://webaudio.github.io/web-speech-api/#dom-speechsynthesiserroreventinit-error SpeechSynthesisErrorEventInit.error specification>
getError :: (MonadDOM m) => SpeechSynthesisErrorEventInit -> m SpeechSynthesisErrorCode
getError self = liftDOM (((js_getError (self)) >>= fromJSValUnchecked))