ghcjs-dom-javascript-0.10.0.0: src/GHCJS/DOM/JSFFI/Generated/SpeechSynthesis.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.SpeechSynthesis
(js_cancel, js_getVoices, js_pause, js_resume, js_speak, js_getPending, js_getSpeaking, js_getPaused, cancel, getVoices, getVoices_, pause, resume, speak, getPending, getSpeaking, getPaused, voiceschanged, SpeechSynthesis(..), gTypeSpeechSynthesis)
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) => { return $1[\"cancel\"](); })"
js_cancel :: SpeechSynthesis -> IO ()
-- | <https://developer.mozilla.org/docs/Web/API/SpeechSynthesis/cancel MDN SpeechSynthesis.cancel documentation>
cancel :: (MonadDOM m) => SpeechSynthesis -> m ()
cancel self = liftDOM (void ((js_cancel (self))))
foreign import javascript safe "(($1) => { return $1[\"getVoices\"](); })"
js_getVoices :: SpeechSynthesis -> IO JSVal
-- | <https://developer.mozilla.org/docs/Web/API/SpeechSynthesis/getVoices MDN SpeechSynthesis.getVoices documentation>
getVoices :: (MonadDOM m) => SpeechSynthesis -> m [SpeechSynthesisVoice]
getVoices self = liftDOM (((js_getVoices (self)) >>= fromJSValUnchecked))
-- | <https://developer.mozilla.org/docs/Web/API/SpeechSynthesis/getVoices MDN SpeechSynthesis.getVoices documentation>
getVoices_ :: (MonadDOM m) => SpeechSynthesis -> m ()
getVoices_ self = liftDOM (void ((js_getVoices (self))))
foreign import javascript safe "(($1) => { return $1[\"pause\"](); })"
js_pause :: SpeechSynthesis -> IO ()
-- | <https://developer.mozilla.org/docs/Web/API/SpeechSynthesis/pause MDN SpeechSynthesis.pause documentation>
pause :: (MonadDOM m) => SpeechSynthesis -> m ()
pause self = liftDOM (void ((js_pause (self))))
foreign import javascript safe "(($1) => { return $1[\"resume\"](); })"
js_resume :: SpeechSynthesis -> IO ()
-- | <https://developer.mozilla.org/docs/Web/API/SpeechSynthesis/resume MDN SpeechSynthesis.resume documentation>
resume :: (MonadDOM m) => SpeechSynthesis -> m ()
resume self = liftDOM (void ((js_resume (self))))
foreign import javascript safe "(($1, $2) => { return $1[\"speak\"]($2); })"
js_speak :: SpeechSynthesis -> SpeechSynthesisUtterance -> IO ()
-- | <https://developer.mozilla.org/docs/Web/API/SpeechSynthesis/speak MDN SpeechSynthesis.speak documentation>
speak :: (MonadDOM m) => SpeechSynthesis -> SpeechSynthesisUtterance -> m ()
speak self utterance = liftDOM (void ((js_speak (self) (utterance))))
foreign import javascript unsafe "(($1) => { return $1[\"pending\"]; })"
js_getPending :: SpeechSynthesis -> IO Bool
-- | <https://developer.mozilla.org/docs/Web/API/SpeechSynthesis/pending MDN SpeechSynthesis.pending documentation>
getPending :: (MonadDOM m) => SpeechSynthesis -> m Bool
getPending self = liftDOM ((js_getPending (self)))
foreign import javascript unsafe "(($1) => { return $1[\"speaking\"]; })"
js_getSpeaking :: SpeechSynthesis -> IO Bool
-- | <https://developer.mozilla.org/docs/Web/API/SpeechSynthesis/speaking MDN SpeechSynthesis.speaking documentation>
getSpeaking :: (MonadDOM m) => SpeechSynthesis -> m Bool
getSpeaking self = liftDOM ((js_getSpeaking (self)))
foreign import javascript unsafe "(($1) => { return $1[\"paused\"]; })"
js_getPaused :: SpeechSynthesis -> IO Bool
-- | <https://developer.mozilla.org/docs/Web/API/SpeechSynthesis/paused MDN SpeechSynthesis.paused documentation>
getPaused :: (MonadDOM m) => SpeechSynthesis -> m Bool
getPaused self = liftDOM ((js_getPaused (self)))
-- | <https://webaudio.github.io/web-speech-api/#dom-speechsynthesis-onvoiceschanged voiceschanged event>
voiceschanged :: EventName SpeechSynthesis Event
voiceschanged = unsafeEventName (toJSString "voiceschanged")