{-# LANGUAGE PatternSynonyms #-} module Language.Javascript.JSaddle.DOM.Generated.SpeechSynthesis (speak, cancel, pause, resume, getVoices, getPending, getSpeaking, getPaused, SpeechSynthesis, castToSpeechSynthesis, gTypeSpeechSynthesis) where import Prelude ((.), (==), (>>=), return, IO, Int, Float, Double, Bool(..), Maybe, maybe, fromIntegral, round, realToFrac, fmap, Show, Read, Eq, Ord, Maybe(..)) import Data.Typeable (Typeable) import Language.Javascript.JSaddle (JSM(..), JSVal(..), JSString, strictEqual, toJSVal, valToStr, valToNumber, valToBool, js, jss, jsf, jsg, function, new, array) import Data.Int (Int64) import Data.Word (Word, Word64) import Language.Javascript.JSaddle.DOM.Types import Control.Applicative ((<$>)) import Control.Monad (void) import Control.Lens.Operators ((^.)) import Language.Javascript.JSaddle.DOM.EventTargetClosures (EventName, unsafeEventName) import Language.Javascript.JSaddle.DOM.Enums -- | speak :: (MonadDOM m) => SpeechSynthesis -> Maybe SpeechSynthesisUtterance -> m () speak self utterance = liftDOM (void (self ^. jsf "speak" [toJSVal utterance])) -- | cancel :: (MonadDOM m) => SpeechSynthesis -> m () cancel self = liftDOM (void (self ^. js "cancel")) -- | pause :: (MonadDOM m) => SpeechSynthesis -> m () pause self = liftDOM (void (self ^. js "pause")) -- | resume :: (MonadDOM m) => SpeechSynthesis -> m () resume self = liftDOM (void (self ^. js "resume")) -- | getVoices :: (MonadDOM m) => SpeechSynthesis -> m [Maybe SpeechSynthesisVoice] getVoices self = liftDOM ((self ^. js "getVoices") >>= fromJSArray) -- | getPending :: (MonadDOM m) => SpeechSynthesis -> m Bool getPending self = liftDOM ((self ^. js "pending") >>= valToBool) -- | getSpeaking :: (MonadDOM m) => SpeechSynthesis -> m Bool getSpeaking self = liftDOM ((self ^. js "speaking") >>= valToBool) -- | getPaused :: (MonadDOM m) => SpeechSynthesis -> m Bool getPaused self = liftDOM ((self ^. js "paused") >>= valToBool)