ghcjs-dom-javascript-0.10.0.0: src/GHCJS/DOM/JSFFI/Generated/SpeechSynthesisEvent.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.SpeechSynthesisEvent
(js_newSpeechSynthesisEvent, js_getUtterance, js_getCharIndex, js_getCharLength, js_getElapsedTime, js_getName, newSpeechSynthesisEvent, getUtterance, getCharIndex, getCharLength, getElapsedTime, getName, SpeechSynthesisEvent(..), gTypeSpeechSynthesisEvent, IsSpeechSynthesisEvent, toSpeechSynthesisEvent)
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 new globalThis[\"SpeechSynthesisEvent\"]($1, $2); })"
js_newSpeechSynthesisEvent :: JSString -> SpeechSynthesisEventInit -> IO SpeechSynthesisEvent
-- | <https://developer.mozilla.org/docs/Web/API/SpeechSynthesisEvent/SpeechSynthesisEvent MDN SpeechSynthesisEvent. documentation>
newSpeechSynthesisEvent :: (MonadDOM m, ToJSString type', IsSpeechSynthesisEventInit eventInitDict) => type' -> eventInitDict -> m SpeechSynthesisEvent
newSpeechSynthesisEvent type' eventInitDict = liftDOM ((js_newSpeechSynthesisEvent (toJSString type') (Types.toSpeechSynthesisEventInit eventInitDict)))
foreign import javascript unsafe "(($1) => { return $1[\"utterance\"]; })"
js_getUtterance :: SpeechSynthesisEvent -> IO SpeechSynthesisUtterance
-- | <https://developer.mozilla.org/docs/Web/API/SpeechSynthesisEvent/utterance MDN SpeechSynthesisEvent.utterance documentation>
getUtterance :: (MonadDOM m, IsSpeechSynthesisEvent self) => self -> m SpeechSynthesisUtterance
getUtterance self = liftDOM ((js_getUtterance ((Types.toSpeechSynthesisEvent self))))
foreign import javascript unsafe "(($1) => { return $1[\"charIndex\"]; })"
js_getCharIndex :: SpeechSynthesisEvent -> IO Word
-- | <https://developer.mozilla.org/docs/Web/API/SpeechSynthesisEvent/charIndex MDN SpeechSynthesisEvent.charIndex documentation>
getCharIndex :: (MonadDOM m, IsSpeechSynthesisEvent self) => self -> m Word
getCharIndex self = liftDOM ((js_getCharIndex ((Types.toSpeechSynthesisEvent self))))
foreign import javascript unsafe "(($1) => { return $1[\"charLength\"]; })"
js_getCharLength :: SpeechSynthesisEvent -> IO Word
-- | <https://developer.mozilla.org/docs/Web/API/SpeechSynthesisEvent/charLength MDN SpeechSynthesisEvent.charLength documentation>
getCharLength :: (MonadDOM m, IsSpeechSynthesisEvent self) => self -> m Word
getCharLength self = liftDOM ((js_getCharLength ((Types.toSpeechSynthesisEvent self))))
foreign import javascript unsafe "(($1) => { return $1[\"elapsedTime\"]; })"
js_getElapsedTime :: SpeechSynthesisEvent -> IO Float
-- | <https://developer.mozilla.org/docs/Web/API/SpeechSynthesisEvent/elapsedTime MDN SpeechSynthesisEvent.elapsedTime documentation>
getElapsedTime :: (MonadDOM m, IsSpeechSynthesisEvent self) => self -> m Float
getElapsedTime self = liftDOM ((js_getElapsedTime ((Types.toSpeechSynthesisEvent self))))
foreign import javascript unsafe "(($1) => { return $1[\"name\"]; })"
js_getName :: SpeechSynthesisEvent -> IO JSString
-- | <https://developer.mozilla.org/docs/Web/API/SpeechSynthesisEvent/name MDN SpeechSynthesisEvent.name documentation>
getName :: (MonadDOM m, IsSpeechSynthesisEvent self, FromJSString result) => self -> m result
getName self = liftDOM ((fromJSString <$> (js_getName ((Types.toSpeechSynthesisEvent self)))))