jsaddle-dom-0.10.0.0: src/JSDOM/Generated/IDBObjectStore.hs
{-# LANGUAGE PatternSynonyms #-}
{-# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
-- | Generated by dom-gen from IndexedDB-3 (webref). Do not edit.
module JSDOM.Generated.IDBObjectStore
(add, add_, clear, clear_, count, count_, createIndex, createIndex_, delete, delete_, deleteIndex, get, get_, getAll, getAll_, getAllKeys, getAllKeys_, getAllRecords, getAllRecords_, getKey, getKey_, index, index_, openCursor, openCursor_, openKeyCursor, openKeyCursor_, put, put_, setName, getName, getKeyPath, getIndexNames, getTransaction, getAutoIncrement, IDBObjectStore(..), gTypeIDBObjectStore)
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/IDBObjectStore/add MDN IDBObjectStore.add documentation>
add :: (MonadDOM m) => IDBObjectStore -> JSVal -> JSVal -> m IDBRequest
add self value key = liftDOM (((self ^. jsf "add" [toJSVal value, toJSVal key]) >>= fromJSValUnchecked))
-- | <https://developer.mozilla.org/docs/Web/API/IDBObjectStore/add MDN IDBObjectStore.add documentation>
add_ :: (MonadDOM m) => IDBObjectStore -> JSVal -> JSVal -> m ()
add_ self value key = liftDOM (void (self ^. jsf "add" [toJSVal value, toJSVal key]))
-- | <https://developer.mozilla.org/docs/Web/API/IDBObjectStore/clear MDN IDBObjectStore.clear documentation>
clear :: (MonadDOM m) => IDBObjectStore -> m IDBRequest
clear self = liftDOM (((self ^. jsf "clear" ()) >>= fromJSValUnchecked))
-- | <https://developer.mozilla.org/docs/Web/API/IDBObjectStore/clear MDN IDBObjectStore.clear documentation>
clear_ :: (MonadDOM m) => IDBObjectStore -> m ()
clear_ self = liftDOM (void (self ^. jsf "clear" ()))
-- | <https://developer.mozilla.org/docs/Web/API/IDBObjectStore/count MDN IDBObjectStore.count documentation>
count :: (MonadDOM m) => IDBObjectStore -> JSVal -> m IDBRequest
count self query = liftDOM (((self ^. jsf "count" [toJSVal query]) >>= fromJSValUnchecked))
-- | <https://developer.mozilla.org/docs/Web/API/IDBObjectStore/count MDN IDBObjectStore.count documentation>
count_ :: (MonadDOM m) => IDBObjectStore -> JSVal -> m ()
count_ self query = liftDOM (void (self ^. jsf "count" [toJSVal query]))
-- | <https://developer.mozilla.org/docs/Web/API/IDBObjectStore/createIndex MDN IDBObjectStore.createIndex documentation>
createIndex :: (MonadDOM m, ToJSString name, IsStringOrSequenceString keyPath) => IDBObjectStore -> name -> keyPath -> Maybe IDBIndexParameters -> m IDBIndex
createIndex self name keyPath options = liftDOM (((self ^. jsf "createIndex" [toJSVal name, toJSVal keyPath, P.maybe (P.return jsUndefined) toJSVal options]) >>= fromJSValUnchecked))
-- | <https://developer.mozilla.org/docs/Web/API/IDBObjectStore/createIndex MDN IDBObjectStore.createIndex documentation>
createIndex_ :: (MonadDOM m, ToJSString name, IsStringOrSequenceString keyPath) => IDBObjectStore -> name -> keyPath -> Maybe IDBIndexParameters -> m ()
createIndex_ self name keyPath options = liftDOM (void (self ^. jsf "createIndex" [toJSVal name, toJSVal keyPath, P.maybe (P.return jsUndefined) toJSVal options]))
-- | <https://developer.mozilla.org/docs/Web/API/IDBObjectStore/delete MDN IDBObjectStore.delete documentation>
delete :: (MonadDOM m) => IDBObjectStore -> JSVal -> m IDBRequest
delete self query = liftDOM (((self ^. jsf "delete" [toJSVal query]) >>= fromJSValUnchecked))
-- | <https://developer.mozilla.org/docs/Web/API/IDBObjectStore/delete MDN IDBObjectStore.delete documentation>
delete_ :: (MonadDOM m) => IDBObjectStore -> JSVal -> m ()
delete_ self query = liftDOM (void (self ^. jsf "delete" [toJSVal query]))
-- | <https://developer.mozilla.org/docs/Web/API/IDBObjectStore/deleteIndex MDN IDBObjectStore.deleteIndex documentation>
deleteIndex :: (MonadDOM m, ToJSString name) => IDBObjectStore -> name -> m ()
deleteIndex self name = liftDOM (void (self ^. jsf "deleteIndex" [toJSVal name]))
-- | <https://developer.mozilla.org/docs/Web/API/IDBObjectStore/get MDN IDBObjectStore.get documentation>
get :: (MonadDOM m) => IDBObjectStore -> JSVal -> m IDBRequest
get self query = liftDOM (((self ^. jsf "get" [toJSVal query]) >>= fromJSValUnchecked))
-- | <https://developer.mozilla.org/docs/Web/API/IDBObjectStore/get MDN IDBObjectStore.get documentation>
get_ :: (MonadDOM m) => IDBObjectStore -> JSVal -> m ()
get_ self query = liftDOM (void (self ^. jsf "get" [toJSVal query]))
-- | <https://developer.mozilla.org/docs/Web/API/IDBObjectStore/getAll MDN IDBObjectStore.getAll documentation>
getAll :: (MonadDOM m) => IDBObjectStore -> JSVal -> Maybe Word -> m IDBRequest
getAll self queryOrOptions count = liftDOM (((self ^. jsf "getAll" [toJSVal queryOrOptions, P.maybe (P.return jsUndefined) toJSVal count]) >>= fromJSValUnchecked))
-- | <https://developer.mozilla.org/docs/Web/API/IDBObjectStore/getAll MDN IDBObjectStore.getAll documentation>
getAll_ :: (MonadDOM m) => IDBObjectStore -> JSVal -> Maybe Word -> m ()
getAll_ self queryOrOptions count = liftDOM (void (self ^. jsf "getAll" [toJSVal queryOrOptions, P.maybe (P.return jsUndefined) toJSVal count]))
-- | <https://developer.mozilla.org/docs/Web/API/IDBObjectStore/getAllKeys MDN IDBObjectStore.getAllKeys documentation>
getAllKeys :: (MonadDOM m) => IDBObjectStore -> JSVal -> Maybe Word -> m IDBRequest
getAllKeys self queryOrOptions count = liftDOM (((self ^. jsf "getAllKeys" [toJSVal queryOrOptions, P.maybe (P.return jsUndefined) toJSVal count]) >>= fromJSValUnchecked))
-- | <https://developer.mozilla.org/docs/Web/API/IDBObjectStore/getAllKeys MDN IDBObjectStore.getAllKeys documentation>
getAllKeys_ :: (MonadDOM m) => IDBObjectStore -> JSVal -> Maybe Word -> m ()
getAllKeys_ self queryOrOptions count = liftDOM (void (self ^. jsf "getAllKeys" [toJSVal queryOrOptions, P.maybe (P.return jsUndefined) toJSVal count]))
-- | <https://developer.mozilla.org/docs/Web/API/IDBObjectStore/getAllRecords MDN IDBObjectStore.getAllRecords documentation>
getAllRecords :: (MonadDOM m) => IDBObjectStore -> Maybe IDBGetAllOptions -> m IDBRequest
getAllRecords self options = liftDOM (((self ^. jsf "getAllRecords" [P.maybe (P.return jsUndefined) toJSVal options]) >>= fromJSValUnchecked))
-- | <https://developer.mozilla.org/docs/Web/API/IDBObjectStore/getAllRecords MDN IDBObjectStore.getAllRecords documentation>
getAllRecords_ :: (MonadDOM m) => IDBObjectStore -> Maybe IDBGetAllOptions -> m ()
getAllRecords_ self options = liftDOM (void (self ^. jsf "getAllRecords" [P.maybe (P.return jsUndefined) toJSVal options]))
-- | <https://developer.mozilla.org/docs/Web/API/IDBObjectStore/getKey MDN IDBObjectStore.getKey documentation>
getKey :: (MonadDOM m) => IDBObjectStore -> JSVal -> m IDBRequest
getKey self query = liftDOM (((self ^. jsf "getKey" [toJSVal query]) >>= fromJSValUnchecked))
-- | <https://developer.mozilla.org/docs/Web/API/IDBObjectStore/getKey MDN IDBObjectStore.getKey documentation>
getKey_ :: (MonadDOM m) => IDBObjectStore -> JSVal -> m ()
getKey_ self query = liftDOM (void (self ^. jsf "getKey" [toJSVal query]))
-- | <https://developer.mozilla.org/docs/Web/API/IDBObjectStore/index MDN IDBObjectStore.index documentation>
index :: (MonadDOM m, ToJSString name) => IDBObjectStore -> name -> m IDBIndex
index self name = liftDOM (((self ^. jsf "index" [toJSVal name]) >>= fromJSValUnchecked))
-- | <https://developer.mozilla.org/docs/Web/API/IDBObjectStore/index MDN IDBObjectStore.index documentation>
index_ :: (MonadDOM m, ToJSString name) => IDBObjectStore -> name -> m ()
index_ self name = liftDOM (void (self ^. jsf "index" [toJSVal name]))
-- | <https://developer.mozilla.org/docs/Web/API/IDBObjectStore/openCursor MDN IDBObjectStore.openCursor documentation>
openCursor :: (MonadDOM m) => IDBObjectStore -> JSVal -> Maybe IDBCursorDirection -> m IDBRequest
openCursor self query direction = liftDOM (((self ^. jsf "openCursor" [toJSVal query, P.maybe (P.return jsUndefined) toJSVal direction]) >>= fromJSValUnchecked))
-- | <https://developer.mozilla.org/docs/Web/API/IDBObjectStore/openCursor MDN IDBObjectStore.openCursor documentation>
openCursor_ :: (MonadDOM m) => IDBObjectStore -> JSVal -> Maybe IDBCursorDirection -> m ()
openCursor_ self query direction = liftDOM (void (self ^. jsf "openCursor" [toJSVal query, P.maybe (P.return jsUndefined) toJSVal direction]))
-- | <https://developer.mozilla.org/docs/Web/API/IDBObjectStore/openKeyCursor MDN IDBObjectStore.openKeyCursor documentation>
openKeyCursor :: (MonadDOM m) => IDBObjectStore -> JSVal -> Maybe IDBCursorDirection -> m IDBRequest
openKeyCursor self query direction = liftDOM (((self ^. jsf "openKeyCursor" [toJSVal query, P.maybe (P.return jsUndefined) toJSVal direction]) >>= fromJSValUnchecked))
-- | <https://developer.mozilla.org/docs/Web/API/IDBObjectStore/openKeyCursor MDN IDBObjectStore.openKeyCursor documentation>
openKeyCursor_ :: (MonadDOM m) => IDBObjectStore -> JSVal -> Maybe IDBCursorDirection -> m ()
openKeyCursor_ self query direction = liftDOM (void (self ^. jsf "openKeyCursor" [toJSVal query, P.maybe (P.return jsUndefined) toJSVal direction]))
-- | <https://developer.mozilla.org/docs/Web/API/IDBObjectStore/put MDN IDBObjectStore.put documentation>
put :: (MonadDOM m) => IDBObjectStore -> JSVal -> JSVal -> m IDBRequest
put self value key = liftDOM (((self ^. jsf "put" [toJSVal value, toJSVal key]) >>= fromJSValUnchecked))
-- | <https://developer.mozilla.org/docs/Web/API/IDBObjectStore/put MDN IDBObjectStore.put documentation>
put_ :: (MonadDOM m) => IDBObjectStore -> JSVal -> JSVal -> m ()
put_ self value key = liftDOM (void (self ^. jsf "put" [toJSVal value, toJSVal key]))
-- | <https://developer.mozilla.org/docs/Web/API/IDBObjectStore/name MDN IDBObjectStore.name documentation>
setName :: (MonadDOM m, ToJSString val) => IDBObjectStore -> val -> m ()
setName self val = liftDOM (void (self ^. jss "name" (toJSVal val)))
-- | <https://developer.mozilla.org/docs/Web/API/IDBObjectStore/name MDN IDBObjectStore.name documentation>
getName :: (MonadDOM m, FromJSString result) => IDBObjectStore -> m result
getName self = liftDOM (((self ^. js "name") >>= fromJSValUnchecked))
-- | <https://developer.mozilla.org/docs/Web/API/IDBObjectStore/keyPath MDN IDBObjectStore.keyPath documentation>
getKeyPath :: (MonadDOM m) => IDBObjectStore -> m JSVal
getKeyPath self = liftDOM (self ^. js "keyPath")
-- | <https://developer.mozilla.org/docs/Web/API/IDBObjectStore/indexNames MDN IDBObjectStore.indexNames documentation>
getIndexNames :: (MonadDOM m) => IDBObjectStore -> m DOMStringList
getIndexNames self = liftDOM (((self ^. js "indexNames") >>= fromJSValUnchecked))
-- | <https://developer.mozilla.org/docs/Web/API/IDBObjectStore/transaction MDN IDBObjectStore.transaction documentation>
getTransaction :: (MonadDOM m) => IDBObjectStore -> m IDBTransaction
getTransaction self = liftDOM (((self ^. js "transaction") >>= fromJSValUnchecked))
-- | <https://developer.mozilla.org/docs/Web/API/IDBObjectStore/autoIncrement MDN IDBObjectStore.autoIncrement documentation>
getAutoIncrement :: (MonadDOM m) => IDBObjectStore -> m Bool
getAutoIncrement self = liftDOM (((self ^. js "autoIncrement") >>= valToBool))