jsaddle-dom-0.10.0.0: src/JSDOM/Generated/SpeechSynthesisErrorEventInit.hs
{-# LANGUAGE PatternSynonyms #-}
{-# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
-- | Generated by dom-gen from speech-api (webref). Do not edit.
module JSDOM.Generated.SpeechSynthesisErrorEventInit
(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 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://webaudio.github.io/web-speech-api/#dictdef-speechsynthesiserroreventinit SpeechSynthesisErrorEventInit specification>
newSpeechSynthesisErrorEventInit :: (MonadDOM m) => SpeechSynthesisUtterance -> SpeechSynthesisErrorCode -> m SpeechSynthesisErrorEventInit
newSpeechSynthesisErrorEventInit utterance error = liftDOM ((((new (jsg "Object") () >>= \o -> (o ^. jss "utterance" (toJSVal utterance)) P.>> (o ^. jss "error" (toJSVal error)) P.>> P.return o)) >>= fromJSValUnchecked))
-- | <https://webaudio.github.io/web-speech-api/#dom-speechsynthesiserroreventinit-error SpeechSynthesisErrorEventInit.error specification>
setError :: (MonadDOM m) => SpeechSynthesisErrorEventInit -> SpeechSynthesisErrorCode -> m ()
setError self val = liftDOM (void (self ^. jss "error" (toJSVal val)))
-- | <https://webaudio.github.io/web-speech-api/#dom-speechsynthesiserroreventinit-error SpeechSynthesisErrorEventInit.error specification>
getError :: (MonadDOM m) => SpeechSynthesisErrorEventInit -> m SpeechSynthesisErrorCode
getError self = liftDOM (((self ^. js "error") >>= fromJSValUnchecked))