packages feed

ghcjs-dom-javascript-0.10.0.0: src/GHCJS/DOM/JSFFI/Generated/SpeechSynthesisEventInit.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.SpeechSynthesisEventInit
       (js_newSpeechSynthesisEventInit, js_setUtterance, js_getUtterance, js_setCharIndex, js_getCharIndex, js_setCharLength, js_getCharLength, js_setElapsedTime, js_getElapsedTime, js_setName, js_getName, newSpeechSynthesisEventInit, setUtterance, getUtterance, setCharIndex, getCharIndex, getCharIndexUnsafe, getCharIndexUnchecked, setCharLength, getCharLength, getCharLengthUnsafe, getCharLengthUnchecked, setElapsedTime, getElapsedTime, getElapsedTimeUnsafe, getElapsedTimeUnchecked, setName, getName, getNameUnsafe, getNameUnchecked, SpeechSynthesisEventInit(..), gTypeSpeechSynthesisEventInit, IsSpeechSynthesisEventInit, toSpeechSynthesisEventInit)
       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 ({\"utterance\": $1}); })"
        js_newSpeechSynthesisEventInit :: SpeechSynthesisUtterance -> IO SpeechSynthesisEventInit
-- | <https://webaudio.github.io/web-speech-api/#dictdef-speechsynthesiseventinit SpeechSynthesisEventInit specification>
newSpeechSynthesisEventInit :: (MonadDOM m) => SpeechSynthesisUtterance -> m SpeechSynthesisEventInit
newSpeechSynthesisEventInit utterance = liftDOM ((js_newSpeechSynthesisEventInit (utterance)))

foreign import javascript safe "(($1, $2) => { $1[\"utterance\"] = $2; })"
        js_setUtterance :: SpeechSynthesisEventInit -> SpeechSynthesisUtterance -> IO ()
-- | <https://webaudio.github.io/web-speech-api/#dom-speechsynthesiseventinit-utterance SpeechSynthesisEventInit.utterance specification>
setUtterance :: (MonadDOM m, IsSpeechSynthesisEventInit self) => self -> SpeechSynthesisUtterance -> m ()
setUtterance self val = liftDOM (void ((js_setUtterance ((Types.toSpeechSynthesisEventInit self)) (val))))

foreign import javascript unsafe "(($1) => { return $1[\"utterance\"]; })"
        js_getUtterance :: SpeechSynthesisEventInit -> IO SpeechSynthesisUtterance
-- | <https://webaudio.github.io/web-speech-api/#dom-speechsynthesiseventinit-utterance SpeechSynthesisEventInit.utterance specification>
getUtterance :: (MonadDOM m, IsSpeechSynthesisEventInit self) => self -> m SpeechSynthesisUtterance
getUtterance self = liftDOM ((js_getUtterance ((Types.toSpeechSynthesisEventInit self))))

foreign import javascript safe "(($1, $2) => { $1[\"charIndex\"] = $2; })"
        js_setCharIndex :: SpeechSynthesisEventInit -> Word -> IO ()
-- | <https://webaudio.github.io/web-speech-api/#dom-speechsynthesiseventinit-charindex SpeechSynthesisEventInit.charIndex specification>
setCharIndex :: (MonadDOM m, IsSpeechSynthesisEventInit self) => self -> Word -> m ()
setCharIndex self val = liftDOM (void ((js_setCharIndex ((Types.toSpeechSynthesisEventInit self)) (val))))

foreign import javascript unsafe "(($1) => { return $1[\"charIndex\"]; })"
        js_getCharIndex :: SpeechSynthesisEventInit -> IO JSVal
-- | <https://webaudio.github.io/web-speech-api/#dom-speechsynthesiseventinit-charindex SpeechSynthesisEventInit.charIndex specification>
getCharIndex :: (MonadDOM m, IsSpeechSynthesisEventInit self) => self -> m (Maybe Word)
getCharIndex self = liftDOM (((js_getCharIndex ((Types.toSpeechSynthesisEventInit self))) >>= fromJSValUnchecked))

-- | <https://webaudio.github.io/web-speech-api/#dom-speechsynthesiseventinit-charindex SpeechSynthesisEventInit.charIndex specification>
getCharIndexUnsafe :: (MonadDOM m, IsSpeechSynthesisEventInit self, HasCallStack) => self -> m Word
getCharIndexUnsafe self = liftDOM ((((js_getCharIndex ((Types.toSpeechSynthesisEventInit self))) >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))

-- | <https://webaudio.github.io/web-speech-api/#dom-speechsynthesiseventinit-charindex SpeechSynthesisEventInit.charIndex specification>
getCharIndexUnchecked :: (MonadDOM m, IsSpeechSynthesisEventInit self) => self -> m Word
getCharIndexUnchecked self = liftDOM ((pFromJSVal <$> (js_getCharIndex ((Types.toSpeechSynthesisEventInit self)))))

foreign import javascript safe "(($1, $2) => { $1[\"charLength\"] = $2; })"
        js_setCharLength :: SpeechSynthesisEventInit -> Word -> IO ()
-- | <https://webaudio.github.io/web-speech-api/#dom-speechsynthesiseventinit-charlength SpeechSynthesisEventInit.charLength specification>
setCharLength :: (MonadDOM m, IsSpeechSynthesisEventInit self) => self -> Word -> m ()
setCharLength self val = liftDOM (void ((js_setCharLength ((Types.toSpeechSynthesisEventInit self)) (val))))

foreign import javascript unsafe "(($1) => { return $1[\"charLength\"]; })"
        js_getCharLength :: SpeechSynthesisEventInit -> IO JSVal
-- | <https://webaudio.github.io/web-speech-api/#dom-speechsynthesiseventinit-charlength SpeechSynthesisEventInit.charLength specification>
getCharLength :: (MonadDOM m, IsSpeechSynthesisEventInit self) => self -> m (Maybe Word)
getCharLength self = liftDOM (((js_getCharLength ((Types.toSpeechSynthesisEventInit self))) >>= fromJSValUnchecked))

-- | <https://webaudio.github.io/web-speech-api/#dom-speechsynthesiseventinit-charlength SpeechSynthesisEventInit.charLength specification>
getCharLengthUnsafe :: (MonadDOM m, IsSpeechSynthesisEventInit self, HasCallStack) => self -> m Word
getCharLengthUnsafe self = liftDOM ((((js_getCharLength ((Types.toSpeechSynthesisEventInit self))) >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))

-- | <https://webaudio.github.io/web-speech-api/#dom-speechsynthesiseventinit-charlength SpeechSynthesisEventInit.charLength specification>
getCharLengthUnchecked :: (MonadDOM m, IsSpeechSynthesisEventInit self) => self -> m Word
getCharLengthUnchecked self = liftDOM ((pFromJSVal <$> (js_getCharLength ((Types.toSpeechSynthesisEventInit self)))))

foreign import javascript safe "(($1, $2) => { $1[\"elapsedTime\"] = $2; })"
        js_setElapsedTime :: SpeechSynthesisEventInit -> Float -> IO ()
-- | <https://webaudio.github.io/web-speech-api/#dom-speechsynthesiseventinit-elapsedtime SpeechSynthesisEventInit.elapsedTime specification>
setElapsedTime :: (MonadDOM m, IsSpeechSynthesisEventInit self) => self -> Float -> m ()
setElapsedTime self val = liftDOM (void ((js_setElapsedTime ((Types.toSpeechSynthesisEventInit self)) (val))))

foreign import javascript unsafe "(($1) => { return $1[\"elapsedTime\"]; })"
        js_getElapsedTime :: SpeechSynthesisEventInit -> IO JSVal
-- | <https://webaudio.github.io/web-speech-api/#dom-speechsynthesiseventinit-elapsedtime SpeechSynthesisEventInit.elapsedTime specification>
getElapsedTime :: (MonadDOM m, IsSpeechSynthesisEventInit self) => self -> m (Maybe Float)
getElapsedTime self = liftDOM (((js_getElapsedTime ((Types.toSpeechSynthesisEventInit self))) >>= fromJSValUnchecked))

-- | <https://webaudio.github.io/web-speech-api/#dom-speechsynthesiseventinit-elapsedtime SpeechSynthesisEventInit.elapsedTime specification>
getElapsedTimeUnsafe :: (MonadDOM m, IsSpeechSynthesisEventInit self, HasCallStack) => self -> m Float
getElapsedTimeUnsafe self = liftDOM ((((js_getElapsedTime ((Types.toSpeechSynthesisEventInit self))) >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))

-- | <https://webaudio.github.io/web-speech-api/#dom-speechsynthesiseventinit-elapsedtime SpeechSynthesisEventInit.elapsedTime specification>
getElapsedTimeUnchecked :: (MonadDOM m, IsSpeechSynthesisEventInit self) => self -> m Float
getElapsedTimeUnchecked self = liftDOM ((pFromJSVal <$> (js_getElapsedTime ((Types.toSpeechSynthesisEventInit self)))))

foreign import javascript safe "(($1, $2) => { $1[\"name\"] = $2; })"
        js_setName :: SpeechSynthesisEventInit -> JSString -> IO ()
-- | <https://webaudio.github.io/web-speech-api/#dom-speechsynthesiseventinit-name SpeechSynthesisEventInit.name specification>
setName :: (MonadDOM m, IsSpeechSynthesisEventInit self, ToJSString val) => self -> val -> m ()
setName self val = liftDOM (void ((js_setName ((Types.toSpeechSynthesisEventInit self)) (toJSString val))))

foreign import javascript unsafe "(($1) => { return $1[\"name\"]; })"
        js_getName :: SpeechSynthesisEventInit -> IO JSVal
-- | <https://webaudio.github.io/web-speech-api/#dom-speechsynthesiseventinit-name SpeechSynthesisEventInit.name specification>
getName :: (MonadDOM m, IsSpeechSynthesisEventInit self, FromJSString result) => self -> m (Maybe result)
getName self = liftDOM (((fromMaybeJSString . Nullable) <$> (js_getName ((Types.toSpeechSynthesisEventInit self)))))

-- | <https://webaudio.github.io/web-speech-api/#dom-speechsynthesiseventinit-name SpeechSynthesisEventInit.name specification>
getNameUnsafe :: (MonadDOM m, IsSpeechSynthesisEventInit self, HasCallStack, FromJSString result) => self -> m result
getNameUnsafe self = liftDOM ((((fromMaybeJSString . Nullable) <$> (js_getName ((Types.toSpeechSynthesisEventInit self)))) >>= P.maybe (P.error "Nothing to return") P.return))

-- | <https://webaudio.github.io/web-speech-api/#dom-speechsynthesiseventinit-name SpeechSynthesisEventInit.name specification>
getNameUnchecked :: (MonadDOM m, IsSpeechSynthesisEventInit self, FromJSString result) => self -> m result
getNameUnchecked self = liftDOM ((pFromJSVal <$> (js_getName ((Types.toSpeechSynthesisEventInit self)))))