{-# LANGUAGE PatternSynonyms #-}
{-# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
module JSDOM.Generated.IDBTransaction
(objectStore, objectStore_, abort, getObjectStoreNames, getMode,
getDb, getError, abortEvent, complete, error, IDBTransaction(..),
gTypeIDBTransaction)
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
objectStore ::
(MonadDOM m, ToJSString name) =>
IDBTransaction -> name -> m IDBObjectStore
objectStore self name
= liftDOM
((self ^. jsf "objectStore" [toJSVal name]) >>= fromJSValUnchecked)
objectStore_ ::
(MonadDOM m, ToJSString name) => IDBTransaction -> name -> m ()
objectStore_ self name
= liftDOM (void (self ^. jsf "objectStore" [toJSVal name]))
abort :: (MonadDOM m) => IDBTransaction -> m ()
abort self = liftDOM (void (self ^. jsf "abort" ()))
getObjectStoreNames ::
(MonadDOM m) => IDBTransaction -> m DOMStringList
getObjectStoreNames self
= liftDOM ((self ^. js "objectStoreNames") >>= fromJSValUnchecked)
getMode :: (MonadDOM m) => IDBTransaction -> m IDBTransactionMode
getMode self = liftDOM ((self ^. js "mode") >>= fromJSValUnchecked)
getDb :: (MonadDOM m) => IDBTransaction -> m IDBDatabase
getDb self = liftDOM ((self ^. js "db") >>= fromJSValUnchecked)
getError :: (MonadDOM m) => IDBTransaction -> m DOMError
getError self
= liftDOM ((self ^. js "error") >>= fromJSValUnchecked)
abortEvent :: EventName IDBTransaction Event
abortEvent = unsafeEventName (toJSString "abort")
complete :: EventName IDBTransaction Event
complete = unsafeEventName (toJSString "complete")
error :: EventName IDBTransaction Event
error = unsafeEventName (toJSString "error")