packages feed

ghcjs-dom-javascript-0.10.0.0: src/GHCJS/DOM/JSFFI/Generated/IDBObjectStore.hs

{-# LANGUAGE PatternSynonyms #-}
{-# LANGUAGE ForeignFunctionInterface, JavaScriptFFI #-}
{-# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
-- | Generated by dom-gen from IndexedDB-3 (webref). Do not edit.
module GHCJS.DOM.JSFFI.Generated.IDBObjectStore
       (js_add, js_clear, js_count, js_createIndex, js_delete, js_deleteIndex, js_get, js_getAll, js_getAllKeys, js_getAllRecords, js_getKey, js_index, js_openCursor, js_openKeyCursor, js_put, js_setName, js_getName, js_getKeyPath, js_getIndexNames, js_getTransaction, js_getAutoIncrement, 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 GHCJS.Types (JSVal, JSString)
import GHCJS.Foreign (jsUndefined, jsNull)
import GHCJS.DOM.Types
import qualified GHCJS.DOM.Types as Types
import GHCJS.DOM.EventTargetClosures (EventName, unsafeEventName, unsafeEventNameAsync)
import GHCJS.DOM.JSFFI.Generated.Enums

foreign import javascript safe "(($1, $2, $3) => { return $1[\"add\"]($2, $3); })"
        js_add :: IDBObjectStore -> JSVal -> JSVal -> IO IDBRequest
-- | <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 ((js_add (self) (value) (key)))

-- | <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 ((js_add (self) (value) (key))))

foreign import javascript safe "(($1) => { return $1[\"clear\"](); })"
        js_clear :: IDBObjectStore -> IO IDBRequest
-- | <https://developer.mozilla.org/docs/Web/API/IDBObjectStore/clear MDN IDBObjectStore.clear documentation>
clear :: (MonadDOM m) => IDBObjectStore -> m IDBRequest
clear self = liftDOM ((js_clear (self)))

-- | <https://developer.mozilla.org/docs/Web/API/IDBObjectStore/clear MDN IDBObjectStore.clear documentation>
clear_ :: (MonadDOM m) => IDBObjectStore -> m ()
clear_ self = liftDOM (void ((js_clear (self))))

foreign import javascript safe "(($1, $2) => { return $1[\"count\"]($2); })"
        js_count :: IDBObjectStore -> JSVal -> IO IDBRequest
-- | <https://developer.mozilla.org/docs/Web/API/IDBObjectStore/count MDN IDBObjectStore.count documentation>
count :: (MonadDOM m) => IDBObjectStore -> JSVal -> m IDBRequest
count self query = liftDOM ((js_count (self) (query)))

-- | <https://developer.mozilla.org/docs/Web/API/IDBObjectStore/count MDN IDBObjectStore.count documentation>
count_ :: (MonadDOM m) => IDBObjectStore -> JSVal -> m ()
count_ self query = liftDOM (void ((js_count (self) (query))))

foreign import javascript safe "(($1, $2, $3, $4) => { return $1[\"createIndex\"]($2, $3, $4); })"
        js_createIndex :: IDBObjectStore -> JSString -> StringOrSequenceString -> JSVal -> IO IDBIndex
-- | <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 (((P.maybe (P.return jsUndefined) toJSVal options) >>= \a4' -> js_createIndex (self) (toJSString name) (Types.toStringOrSequenceString keyPath) a4'))

-- | <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 (((P.maybe (P.return jsUndefined) toJSVal options) >>= \a4' -> js_createIndex (self) (toJSString name) (Types.toStringOrSequenceString keyPath) a4')))

foreign import javascript safe "(($1, $2) => { return $1[\"delete\"]($2); })"
        js_delete :: IDBObjectStore -> JSVal -> IO IDBRequest
-- | <https://developer.mozilla.org/docs/Web/API/IDBObjectStore/delete MDN IDBObjectStore.delete documentation>
delete :: (MonadDOM m) => IDBObjectStore -> JSVal -> m IDBRequest
delete self query = liftDOM ((js_delete (self) (query)))

-- | <https://developer.mozilla.org/docs/Web/API/IDBObjectStore/delete MDN IDBObjectStore.delete documentation>
delete_ :: (MonadDOM m) => IDBObjectStore -> JSVal -> m ()
delete_ self query = liftDOM (void ((js_delete (self) (query))))

foreign import javascript safe "(($1, $2) => { return $1[\"deleteIndex\"]($2); })"
        js_deleteIndex :: IDBObjectStore -> JSString -> IO ()
-- | <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 ((js_deleteIndex (self) (toJSString name))))

foreign import javascript safe "(($1, $2) => { return $1[\"get\"]($2); })"
        js_get :: IDBObjectStore -> JSVal -> IO IDBRequest
-- | <https://developer.mozilla.org/docs/Web/API/IDBObjectStore/get MDN IDBObjectStore.get documentation>
get :: (MonadDOM m) => IDBObjectStore -> JSVal -> m IDBRequest
get self query = liftDOM ((js_get (self) (query)))

-- | <https://developer.mozilla.org/docs/Web/API/IDBObjectStore/get MDN IDBObjectStore.get documentation>
get_ :: (MonadDOM m) => IDBObjectStore -> JSVal -> m ()
get_ self query = liftDOM (void ((js_get (self) (query))))

foreign import javascript safe "(($1, $2, $3) => { return $1[\"getAll\"]($2, $3); })"
        js_getAll :: IDBObjectStore -> JSVal -> JSVal -> IO IDBRequest
-- | <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 (((P.maybe (P.return jsUndefined) toJSVal count) >>= \a3' -> js_getAll (self) (queryOrOptions) a3'))

-- | <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 (((P.maybe (P.return jsUndefined) toJSVal count) >>= \a3' -> js_getAll (self) (queryOrOptions) a3')))

foreign import javascript safe "(($1, $2, $3) => { return $1[\"getAllKeys\"]($2, $3); })"
        js_getAllKeys :: IDBObjectStore -> JSVal -> JSVal -> IO IDBRequest
-- | <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 (((P.maybe (P.return jsUndefined) toJSVal count) >>= \a3' -> js_getAllKeys (self) (queryOrOptions) a3'))

-- | <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 (((P.maybe (P.return jsUndefined) toJSVal count) >>= \a3' -> js_getAllKeys (self) (queryOrOptions) a3')))

foreign import javascript safe "(($1, $2) => { return $1[\"getAllRecords\"]($2); })"
        js_getAllRecords :: IDBObjectStore -> JSVal -> IO IDBRequest
-- | <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 (((P.maybe (P.return jsUndefined) toJSVal options) >>= \a2' -> js_getAllRecords (self) a2'))

-- | <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 (((P.maybe (P.return jsUndefined) toJSVal options) >>= \a2' -> js_getAllRecords (self) a2')))

foreign import javascript safe "(($1, $2) => { return $1[\"getKey\"]($2); })"
        js_getKey :: IDBObjectStore -> JSVal -> IO IDBRequest
-- | <https://developer.mozilla.org/docs/Web/API/IDBObjectStore/getKey MDN IDBObjectStore.getKey documentation>
getKey :: (MonadDOM m) => IDBObjectStore -> JSVal -> m IDBRequest
getKey self query = liftDOM ((js_getKey (self) (query)))

-- | <https://developer.mozilla.org/docs/Web/API/IDBObjectStore/getKey MDN IDBObjectStore.getKey documentation>
getKey_ :: (MonadDOM m) => IDBObjectStore -> JSVal -> m ()
getKey_ self query = liftDOM (void ((js_getKey (self) (query))))

foreign import javascript safe "(($1, $2) => { return $1[\"index\"]($2); })"
        js_index :: IDBObjectStore -> JSString -> IO IDBIndex
-- | <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 ((js_index (self) (toJSString name)))

-- | <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 ((js_index (self) (toJSString name))))

foreign import javascript safe "(($1, $2, $3) => { return $1[\"openCursor\"]($2, $3); })"
        js_openCursor :: IDBObjectStore -> JSVal -> JSVal -> IO IDBRequest
-- | <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 (((P.maybe (P.return jsUndefined) toJSVal direction) >>= \a3' -> js_openCursor (self) (query) a3'))

-- | <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 (((P.maybe (P.return jsUndefined) toJSVal direction) >>= \a3' -> js_openCursor (self) (query) a3')))

foreign import javascript safe "(($1, $2, $3) => { return $1[\"openKeyCursor\"]($2, $3); })"
        js_openKeyCursor :: IDBObjectStore -> JSVal -> JSVal -> IO IDBRequest
-- | <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 (((P.maybe (P.return jsUndefined) toJSVal direction) >>= \a3' -> js_openKeyCursor (self) (query) a3'))

-- | <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 (((P.maybe (P.return jsUndefined) toJSVal direction) >>= \a3' -> js_openKeyCursor (self) (query) a3')))

foreign import javascript safe "(($1, $2, $3) => { return $1[\"put\"]($2, $3); })"
        js_put :: IDBObjectStore -> JSVal -> JSVal -> IO IDBRequest
-- | <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 ((js_put (self) (value) (key)))

-- | <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 ((js_put (self) (value) (key))))

foreign import javascript safe "(($1, $2) => { $1[\"name\"] = $2; })"
        js_setName :: IDBObjectStore -> JSString -> IO ()
-- | <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 ((js_setName (self) (toJSString val))))

foreign import javascript unsafe "(($1) => { return $1[\"name\"]; })"
        js_getName :: IDBObjectStore -> IO JSString
-- | <https://developer.mozilla.org/docs/Web/API/IDBObjectStore/name MDN IDBObjectStore.name documentation>
getName :: (MonadDOM m, FromJSString result) => IDBObjectStore -> m result
getName self = liftDOM ((fromJSString <$> (js_getName (self))))

foreign import javascript unsafe "(($1) => { return $1[\"keyPath\"]; })"
        js_getKeyPath :: IDBObjectStore -> IO JSVal
-- | <https://developer.mozilla.org/docs/Web/API/IDBObjectStore/keyPath MDN IDBObjectStore.keyPath documentation>
getKeyPath :: (MonadDOM m) => IDBObjectStore -> m JSVal
getKeyPath self = liftDOM ((js_getKeyPath (self)))

foreign import javascript unsafe "(($1) => { return $1[\"indexNames\"]; })"
        js_getIndexNames :: IDBObjectStore -> IO DOMStringList
-- | <https://developer.mozilla.org/docs/Web/API/IDBObjectStore/indexNames MDN IDBObjectStore.indexNames documentation>
getIndexNames :: (MonadDOM m) => IDBObjectStore -> m DOMStringList
getIndexNames self = liftDOM ((js_getIndexNames (self)))

foreign import javascript unsafe "(($1) => { return $1[\"transaction\"]; })"
        js_getTransaction :: IDBObjectStore -> IO IDBTransaction
-- | <https://developer.mozilla.org/docs/Web/API/IDBObjectStore/transaction MDN IDBObjectStore.transaction documentation>
getTransaction :: (MonadDOM m) => IDBObjectStore -> m IDBTransaction
getTransaction self = liftDOM ((js_getTransaction (self)))

foreign import javascript unsafe "(($1) => { return $1[\"autoIncrement\"]; })"
        js_getAutoIncrement :: IDBObjectStore -> IO Bool
-- | <https://developer.mozilla.org/docs/Web/API/IDBObjectStore/autoIncrement MDN IDBObjectStore.autoIncrement documentation>
getAutoIncrement :: (MonadDOM m) => IDBObjectStore -> m Bool
getAutoIncrement self = liftDOM ((js_getAutoIncrement (self)))