{-# LANGUAGE PatternSynonyms #-}
{-# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
module JSDOM.Generated.IDBRequest
(getResult, getResultUnsafe, getResultUnchecked, getError,
getErrorUnsafe, getErrorUnchecked, getSource, getSourceUnsafe,
getSourceUnchecked, getTransaction, getReadyState, success, error,
IDBRequest(..), gTypeIDBRequest, IsIDBRequest, toIDBRequest)
where
import Prelude ((.), (==), (>>=), return, IO, Int, Float, Double, Bool(..), Maybe, maybe, fromIntegral, round, realToFrac, fmap, Show, Read, Eq, Ord, Maybe(..))
import qualified Prelude (error)
import Data.Typeable (Typeable)
import Data.Traversable (mapM)
import Language.Javascript.JSaddle (JSM(..), JSVal(..), JSString, strictEqual, toJSVal, valToStr, valToNumber, valToBool, js, jss, jsf, jsg, function, asyncFunction, new, array, jsUndefined, (!), (!!))
import Data.Int (Int64)
import Data.Word (Word, Word64)
import JSDOM.Types
import Control.Applicative ((<$>))
import Control.Monad (void)
import Control.Lens.Operators ((^.))
import JSDOM.EventTargetClosures (EventName, unsafeEventName, unsafeEventNameAsync)
import JSDOM.Enums
getResult ::
(MonadDOM m, IsIDBRequest self) =>
self -> m (Maybe IDBRequestResult)
getResult self
= liftDOM (((toIDBRequest self) ^. js "result") >>= fromJSVal)
getResultUnsafe ::
(MonadDOM m, IsIDBRequest self, HasCallStack) =>
self -> m IDBRequestResult
getResultUnsafe self
= liftDOM
((((toIDBRequest self) ^. js "result") >>= fromJSVal) >>=
maybe (Prelude.error "Nothing to return") return)
getResultUnchecked ::
(MonadDOM m, IsIDBRequest self) => self -> m IDBRequestResult
getResultUnchecked self
= liftDOM
(((toIDBRequest self) ^. js "result") >>= fromJSValUnchecked)
getError ::
(MonadDOM m, IsIDBRequest self) => self -> m (Maybe DOMError)
getError self
= liftDOM (((toIDBRequest self) ^. js "error") >>= fromJSVal)
getErrorUnsafe ::
(MonadDOM m, IsIDBRequest self, HasCallStack) => self -> m DOMError
getErrorUnsafe self
= liftDOM
((((toIDBRequest self) ^. js "error") >>= fromJSVal) >>=
maybe (Prelude.error "Nothing to return") return)
getErrorUnchecked ::
(MonadDOM m, IsIDBRequest self) => self -> m DOMError
getErrorUnchecked self
= liftDOM
(((toIDBRequest self) ^. js "error") >>= fromJSValUnchecked)
getSource ::
(MonadDOM m, IsIDBRequest self) =>
self -> m (Maybe IDBRequestSource)
getSource self
= liftDOM (((toIDBRequest self) ^. js "source") >>= fromJSVal)
getSourceUnsafe ::
(MonadDOM m, IsIDBRequest self, HasCallStack) =>
self -> m IDBRequestSource
getSourceUnsafe self
= liftDOM
((((toIDBRequest self) ^. js "source") >>= fromJSVal) >>=
maybe (Prelude.error "Nothing to return") return)
getSourceUnchecked ::
(MonadDOM m, IsIDBRequest self) => self -> m IDBRequestSource
getSourceUnchecked self
= liftDOM
(((toIDBRequest self) ^. js "source") >>= fromJSValUnchecked)
getTransaction ::
(MonadDOM m, IsIDBRequest self) => self -> m IDBTransaction
getTransaction self
= liftDOM
(((toIDBRequest self) ^. js "transaction") >>= fromJSValUnchecked)
getReadyState ::
(MonadDOM m, IsIDBRequest self) => self -> m IDBRequestReadyState
getReadyState self
= liftDOM
(((toIDBRequest self) ^. js "readyState") >>= fromJSValUnchecked)
success ::
(IsIDBRequest self, IsEventTarget self) => EventName self Event
success = unsafeEventName (toJSString "success")
error ::
(IsIDBRequest self, IsEventTarget self) => EventName self Event
error = unsafeEventName (toJSString "error")