jsaddle-dom-0.10.0.0: src/JSDOM/Generated/GamepadHapticActuator.hs
{-# LANGUAGE PatternSynonyms #-}
{-# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
-- | Generated by dom-gen from gamepad (webref). Do not edit.
module JSDOM.Generated.GamepadHapticActuator
(playEffect, playEffect_, reset, reset_, GamepadHapticActuator(..), gTypeGamepadHapticActuator)
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://developer.mozilla.org/docs/Web/API/GamepadHapticActuator/playEffect MDN GamepadHapticActuator.playEffect documentation>
playEffect :: (MonadDOM m) => GamepadHapticActuator -> GamepadHapticEffectType -> Maybe GamepadEffectParameters -> m GamepadHapticsResult
playEffect self type' params = liftDOM (((((self ^. jsf "playEffect" [toJSVal type', P.maybe (P.return jsUndefined) toJSVal params]) >>= readPromise)) >>= fromJSValUnchecked))
-- | <https://developer.mozilla.org/docs/Web/API/GamepadHapticActuator/playEffect MDN GamepadHapticActuator.playEffect documentation>
playEffect_ :: (MonadDOM m) => GamepadHapticActuator -> GamepadHapticEffectType -> Maybe GamepadEffectParameters -> m ()
playEffect_ self type' params = liftDOM (void (((self ^. jsf "playEffect" [toJSVal type', P.maybe (P.return jsUndefined) toJSVal params]) >>= readPromise)))
-- | <https://developer.mozilla.org/docs/Web/API/GamepadHapticActuator/reset MDN GamepadHapticActuator.reset documentation>
reset :: (MonadDOM m) => GamepadHapticActuator -> m GamepadHapticsResult
reset self = liftDOM (((((self ^. jsf "reset" ()) >>= readPromise)) >>= fromJSValUnchecked))
-- | <https://developer.mozilla.org/docs/Web/API/GamepadHapticActuator/reset MDN GamepadHapticActuator.reset documentation>
reset_ :: (MonadDOM m) => GamepadHapticActuator -> m ()
reset_ self = liftDOM (void (((self ^. jsf "reset" ()) >>= readPromise)))