module JSDOM.Generated.IDBObjectStore
(put, put_, add, add_, deleteRange, deleteRange_, delete, delete_,
getRange, getRange_, get, get_, getKeyRange, getKeyRange_, getKey,
getKey_, clear, clear_, openCursorRange, openCursorRange_,
openCursor, openCursor_, openKeyCursorRange, openKeyCursorRange_,
openKeyCursor, openKeyCursor_, getAllRange, getAllRange_, getAll,
getAll_, getAllKeysRange, getAllKeysRange_, getAllKeys,
getAllKeys_, createIndex, createIndex_, index, index_, deleteIndex,
countRange, countRange_, count, count_, setName, getName,
getKeyPath, getKeyPathUnsafe, getKeyPathUnchecked, getIndexNames,
getTransaction, getAutoIncrement, IDBObjectStore(..),
gTypeIDBObjectStore)
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)
import JSDOM.Enums
put ::
(MonadDOM m, ToJSVal value, ToJSVal key) =>
IDBObjectStore -> value -> Maybe key -> m IDBRequest
put self value key
= liftDOM
((self ^. jsf "put" [toJSVal value, toJSVal key]) >>=
fromJSValUnchecked)
put_ ::
(MonadDOM m, ToJSVal value, ToJSVal key) =>
IDBObjectStore -> value -> Maybe key -> m ()
put_ self value key
= liftDOM (void (self ^. jsf "put" [toJSVal value, toJSVal key]))
add ::
(MonadDOM m, ToJSVal value, ToJSVal key) =>
IDBObjectStore -> value -> Maybe key -> m IDBRequest
add self value key
= liftDOM
((self ^. jsf "add" [toJSVal value, toJSVal key]) >>=
fromJSValUnchecked)
add_ ::
(MonadDOM m, ToJSVal value, ToJSVal key) =>
IDBObjectStore -> value -> Maybe key -> m ()
add_ self value key
= liftDOM (void (self ^. jsf "add" [toJSVal value, toJSVal key]))
deleteRange ::
(MonadDOM m) => IDBObjectStore -> Maybe IDBKeyRange -> m IDBRequest
deleteRange self keyRange
= liftDOM
((self ^. jsf "delete" [toJSVal keyRange]) >>= fromJSValUnchecked)
deleteRange_ ::
(MonadDOM m) => IDBObjectStore -> Maybe IDBKeyRange -> m ()
deleteRange_ self keyRange
= liftDOM (void (self ^. jsf "delete" [toJSVal keyRange]))
delete ::
(MonadDOM m, ToJSVal key) => IDBObjectStore -> key -> m IDBRequest
delete self key
= liftDOM
((self ^. jsf "delete" [toJSVal key]) >>= fromJSValUnchecked)
delete_ ::
(MonadDOM m, ToJSVal key) => IDBObjectStore -> key -> m ()
delete_ self key
= liftDOM (void (self ^. jsf "delete" [toJSVal key]))
getRange ::
(MonadDOM m) => IDBObjectStore -> Maybe IDBKeyRange -> m IDBRequest
getRange self key
= liftDOM
((self ^. jsf "get" [toJSVal key]) >>= fromJSValUnchecked)
getRange_ ::
(MonadDOM m) => IDBObjectStore -> Maybe IDBKeyRange -> m ()
getRange_ self key
= liftDOM (void (self ^. jsf "get" [toJSVal key]))
get ::
(MonadDOM m, ToJSVal key) => IDBObjectStore -> key -> m IDBRequest
get self key
= liftDOM
((self ^. jsf "get" [toJSVal key]) >>= fromJSValUnchecked)
get_ :: (MonadDOM m, ToJSVal key) => IDBObjectStore -> key -> m ()
get_ self key = liftDOM (void (self ^. jsf "get" [toJSVal key]))
getKeyRange ::
(MonadDOM m) => IDBObjectStore -> Maybe IDBKeyRange -> m IDBRequest
getKeyRange self key
= liftDOM
((self ^. jsf "getKey" [toJSVal key]) >>= fromJSValUnchecked)
getKeyRange_ ::
(MonadDOM m) => IDBObjectStore -> Maybe IDBKeyRange -> m ()
getKeyRange_ self key
= liftDOM (void (self ^. jsf "getKey" [toJSVal key]))
getKey ::
(MonadDOM m, ToJSVal key) => IDBObjectStore -> key -> m IDBRequest
getKey self key
= liftDOM
((self ^. jsf "getKey" [toJSVal key]) >>= fromJSValUnchecked)
getKey_ ::
(MonadDOM m, ToJSVal key) => IDBObjectStore -> key -> m ()
getKey_ self key
= liftDOM (void (self ^. jsf "getKey" [toJSVal key]))
clear :: (MonadDOM m) => IDBObjectStore -> m IDBRequest
clear self
= liftDOM ((self ^. jsf "clear" ()) >>= fromJSValUnchecked)
clear_ :: (MonadDOM m) => IDBObjectStore -> m ()
clear_ self = liftDOM (void (self ^. jsf "clear" ()))
openCursorRange ::
(MonadDOM m) =>
IDBObjectStore ->
Maybe IDBKeyRange -> Maybe IDBCursorDirection -> m IDBRequest
openCursorRange self range direction
= liftDOM
((self ^. jsf "openCursor" [toJSVal range, toJSVal direction]) >>=
fromJSValUnchecked)
openCursorRange_ ::
(MonadDOM m) =>
IDBObjectStore ->
Maybe IDBKeyRange -> Maybe IDBCursorDirection -> m ()
openCursorRange_ self range direction
= liftDOM
(void
(self ^. jsf "openCursor" [toJSVal range, toJSVal direction]))
openCursor ::
(MonadDOM m, ToJSVal key) =>
IDBObjectStore -> key -> Maybe IDBCursorDirection -> m IDBRequest
openCursor self key direction
= liftDOM
((self ^. jsf "openCursor" [toJSVal key, toJSVal direction]) >>=
fromJSValUnchecked)
openCursor_ ::
(MonadDOM m, ToJSVal key) =>
IDBObjectStore -> key -> Maybe IDBCursorDirection -> m ()
openCursor_ self key direction
= liftDOM
(void (self ^. jsf "openCursor" [toJSVal key, toJSVal direction]))
openKeyCursorRange ::
(MonadDOM m) =>
IDBObjectStore ->
Maybe IDBKeyRange -> Maybe IDBCursorDirection -> m IDBRequest
openKeyCursorRange self range direction
= liftDOM
((self ^. jsf "openKeyCursor" [toJSVal range, toJSVal direction])
>>= fromJSValUnchecked)
openKeyCursorRange_ ::
(MonadDOM m) =>
IDBObjectStore ->
Maybe IDBKeyRange -> Maybe IDBCursorDirection -> m ()
openKeyCursorRange_ self range direction
= liftDOM
(void
(self ^. jsf "openKeyCursor" [toJSVal range, toJSVal direction]))
openKeyCursor ::
(MonadDOM m, ToJSVal key) =>
IDBObjectStore -> key -> Maybe IDBCursorDirection -> m IDBRequest
openKeyCursor self key direction
= liftDOM
((self ^. jsf "openKeyCursor" [toJSVal key, toJSVal direction]) >>=
fromJSValUnchecked)
openKeyCursor_ ::
(MonadDOM m, ToJSVal key) =>
IDBObjectStore -> key -> Maybe IDBCursorDirection -> m ()
openKeyCursor_ self key direction
= liftDOM
(void
(self ^. jsf "openKeyCursor" [toJSVal key, toJSVal direction]))
getAllRange ::
(MonadDOM m) =>
IDBObjectStore -> Maybe IDBKeyRange -> Maybe Word -> m IDBRequest
getAllRange self range count
= liftDOM
((self ^. jsf "getAll" [toJSVal range, toJSVal count]) >>=
fromJSValUnchecked)
getAllRange_ ::
(MonadDOM m) =>
IDBObjectStore -> Maybe IDBKeyRange -> Maybe Word -> m ()
getAllRange_ self range count
= liftDOM
(void (self ^. jsf "getAll" [toJSVal range, toJSVal count]))
getAll ::
(MonadDOM m, ToJSVal key) =>
IDBObjectStore -> key -> Maybe Word -> m IDBRequest
getAll self key count
= liftDOM
((self ^. jsf "getAll" [toJSVal key, toJSVal count]) >>=
fromJSValUnchecked)
getAll_ ::
(MonadDOM m, ToJSVal key) =>
IDBObjectStore -> key -> Maybe Word -> m ()
getAll_ self key count
= liftDOM
(void (self ^. jsf "getAll" [toJSVal key, toJSVal count]))
getAllKeysRange ::
(MonadDOM m) =>
IDBObjectStore -> Maybe IDBKeyRange -> Maybe Word -> m IDBRequest
getAllKeysRange self range count
= liftDOM
((self ^. jsf "getAllKeys" [toJSVal range, toJSVal count]) >>=
fromJSValUnchecked)
getAllKeysRange_ ::
(MonadDOM m) =>
IDBObjectStore -> Maybe IDBKeyRange -> Maybe Word -> m ()
getAllKeysRange_ self range count
= liftDOM
(void (self ^. jsf "getAllKeys" [toJSVal range, toJSVal count]))
getAllKeys ::
(MonadDOM m, ToJSVal key) =>
IDBObjectStore -> key -> Maybe Word -> m IDBRequest
getAllKeys self key count
= liftDOM
((self ^. jsf "getAllKeys" [toJSVal key, toJSVal count]) >>=
fromJSValUnchecked)
getAllKeys_ ::
(MonadDOM m, ToJSVal key) =>
IDBObjectStore -> key -> Maybe Word -> m ()
getAllKeys_ self key count
= liftDOM
(void (self ^. jsf "getAllKeys" [toJSVal key, toJSVal count]))
createIndex ::
(MonadDOM m, ToJSString name, IsStringOrStrings keyPath) =>
IDBObjectStore ->
name -> keyPath -> Maybe IDBIndexParameters -> m IDBIndex
createIndex self name keyPath options
= liftDOM
((self ^. jsf "createIndex"
[toJSVal name, toJSVal keyPath, toJSVal options])
>>= fromJSValUnchecked)
createIndex_ ::
(MonadDOM m, ToJSString name, IsStringOrStrings keyPath) =>
IDBObjectStore ->
name -> keyPath -> Maybe IDBIndexParameters -> m ()
createIndex_ self name keyPath options
= liftDOM
(void
(self ^. jsf "createIndex"
[toJSVal name, toJSVal keyPath, toJSVal options]))
index ::
(MonadDOM m, ToJSString name) =>
IDBObjectStore -> name -> m IDBIndex
index self name
= liftDOM
((self ^. jsf "index" [toJSVal name]) >>= fromJSValUnchecked)
index_ ::
(MonadDOM m, ToJSString name) => IDBObjectStore -> name -> m ()
index_ self name
= liftDOM (void (self ^. jsf "index" [toJSVal name]))
deleteIndex ::
(MonadDOM m, ToJSString name) => IDBObjectStore -> name -> m ()
deleteIndex self name
= liftDOM (void (self ^. jsf "deleteIndex" [toJSVal name]))
countRange ::
(MonadDOM m) => IDBObjectStore -> Maybe IDBKeyRange -> m IDBRequest
countRange self range
= liftDOM
((self ^. jsf "count" [toJSVal range]) >>= fromJSValUnchecked)
countRange_ ::
(MonadDOM m) => IDBObjectStore -> Maybe IDBKeyRange -> m ()
countRange_ self range
= liftDOM (void (self ^. jsf "count" [toJSVal range]))
count ::
(MonadDOM m, ToJSVal key) => IDBObjectStore -> key -> m IDBRequest
count self key
= liftDOM
((self ^. jsf "count" [toJSVal key]) >>= fromJSValUnchecked)
count_ ::
(MonadDOM m, ToJSVal key) => IDBObjectStore -> key -> m ()
count_ self key
= liftDOM (void (self ^. jsf "count" [toJSVal key]))
setName ::
(MonadDOM m, ToJSString val) => IDBObjectStore -> val -> m ()
setName self val = liftDOM (self ^. jss "name" (toJSVal val))
getName ::
(MonadDOM m, FromJSString result) => IDBObjectStore -> m result
getName self = liftDOM ((self ^. js "name") >>= fromJSValUnchecked)
getKeyPath ::
(MonadDOM m) => IDBObjectStore -> m (Maybe IDBKeyPath)
getKeyPath self = liftDOM ((self ^. js "keyPath") >>= fromJSVal)
getKeyPathUnsafe ::
(MonadDOM m, HasCallStack) => IDBObjectStore -> m IDBKeyPath
getKeyPathUnsafe self
= liftDOM
(((self ^. js "keyPath") >>= fromJSVal) >>=
maybe (Prelude.error "Nothing to return") return)
getKeyPathUnchecked ::
(MonadDOM m) => IDBObjectStore -> m IDBKeyPath
getKeyPathUnchecked self
= liftDOM ((self ^. js "keyPath") >>= fromJSValUnchecked)
getIndexNames :: (MonadDOM m) => IDBObjectStore -> m DOMStringList
getIndexNames self
= liftDOM ((self ^. js "indexNames") >>= fromJSValUnchecked)
getTransaction ::
(MonadDOM m) => IDBObjectStore -> m IDBTransaction
getTransaction self
= liftDOM ((self ^. js "transaction") >>= fromJSValUnchecked)
getAutoIncrement :: (MonadDOM m) => IDBObjectStore -> m Bool
getAutoIncrement self
= liftDOM ((self ^. js "autoIncrement") >>= valToBool)