ghcjs-dom-javascript-0.10.0.0: src/GHCJS/DOM/JSFFI/Generated/IDBIndex.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.IDBIndex
(js_count, js_get, js_getAll, js_getAllKeys, js_getAllRecords, js_getKey, js_openCursor, js_openKeyCursor, js_setName, js_getName, js_getObjectStore, js_getKeyPath, js_getMultiEntry, js_getUnique, count, count_, get, get_, getAll, getAll_, getAllKeys, getAllKeys_, getAllRecords, getAllRecords_, getKey, getKey_, openCursor, openCursor_, openKeyCursor, openKeyCursor_, setName, getName, getObjectStore, getKeyPath, getMultiEntry, getUnique, IDBIndex(..), gTypeIDBIndex)
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) => { return $1[\"count\"]($2); })"
js_count :: IDBIndex -> JSVal -> IO IDBRequest
-- | <https://developer.mozilla.org/docs/Web/API/IDBIndex/count MDN IDBIndex.count documentation>
count :: (MonadDOM m) => IDBIndex -> JSVal -> m IDBRequest
count self query = liftDOM ((js_count (self) (query)))
-- | <https://developer.mozilla.org/docs/Web/API/IDBIndex/count MDN IDBIndex.count documentation>
count_ :: (MonadDOM m) => IDBIndex -> JSVal -> m ()
count_ self query = liftDOM (void ((js_count (self) (query))))
foreign import javascript safe "(($1, $2) => { return $1[\"get\"]($2); })"
js_get :: IDBIndex -> JSVal -> IO IDBRequest
-- | <https://developer.mozilla.org/docs/Web/API/IDBIndex/get MDN IDBIndex.get documentation>
get :: (MonadDOM m) => IDBIndex -> JSVal -> m IDBRequest
get self query = liftDOM ((js_get (self) (query)))
-- | <https://developer.mozilla.org/docs/Web/API/IDBIndex/get MDN IDBIndex.get documentation>
get_ :: (MonadDOM m) => IDBIndex -> 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 :: IDBIndex -> JSVal -> JSVal -> IO IDBRequest
-- | <https://developer.mozilla.org/docs/Web/API/IDBIndex/getAll MDN IDBIndex.getAll documentation>
getAll :: (MonadDOM m) => IDBIndex -> 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/IDBIndex/getAll MDN IDBIndex.getAll documentation>
getAll_ :: (MonadDOM m) => IDBIndex -> 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 :: IDBIndex -> JSVal -> JSVal -> IO IDBRequest
-- | <https://developer.mozilla.org/docs/Web/API/IDBIndex/getAllKeys MDN IDBIndex.getAllKeys documentation>
getAllKeys :: (MonadDOM m) => IDBIndex -> 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/IDBIndex/getAllKeys MDN IDBIndex.getAllKeys documentation>
getAllKeys_ :: (MonadDOM m) => IDBIndex -> 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 :: IDBIndex -> JSVal -> IO IDBRequest
-- | <https://developer.mozilla.org/docs/Web/API/IDBIndex/getAllRecords MDN IDBIndex.getAllRecords documentation>
getAllRecords :: (MonadDOM m) => IDBIndex -> 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/IDBIndex/getAllRecords MDN IDBIndex.getAllRecords documentation>
getAllRecords_ :: (MonadDOM m) => IDBIndex -> 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 :: IDBIndex -> JSVal -> IO IDBRequest
-- | <https://developer.mozilla.org/docs/Web/API/IDBIndex/getKey MDN IDBIndex.getKey documentation>
getKey :: (MonadDOM m) => IDBIndex -> JSVal -> m IDBRequest
getKey self query = liftDOM ((js_getKey (self) (query)))
-- | <https://developer.mozilla.org/docs/Web/API/IDBIndex/getKey MDN IDBIndex.getKey documentation>
getKey_ :: (MonadDOM m) => IDBIndex -> JSVal -> m ()
getKey_ self query = liftDOM (void ((js_getKey (self) (query))))
foreign import javascript safe "(($1, $2, $3) => { return $1[\"openCursor\"]($2, $3); })"
js_openCursor :: IDBIndex -> JSVal -> JSVal -> IO IDBRequest
-- | <https://developer.mozilla.org/docs/Web/API/IDBIndex/openCursor MDN IDBIndex.openCursor documentation>
openCursor :: (MonadDOM m) => IDBIndex -> 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/IDBIndex/openCursor MDN IDBIndex.openCursor documentation>
openCursor_ :: (MonadDOM m) => IDBIndex -> 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 :: IDBIndex -> JSVal -> JSVal -> IO IDBRequest
-- | <https://developer.mozilla.org/docs/Web/API/IDBIndex/openKeyCursor MDN IDBIndex.openKeyCursor documentation>
openKeyCursor :: (MonadDOM m) => IDBIndex -> 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/IDBIndex/openKeyCursor MDN IDBIndex.openKeyCursor documentation>
openKeyCursor_ :: (MonadDOM m) => IDBIndex -> 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) => { $1[\"name\"] = $2; })"
js_setName :: IDBIndex -> JSString -> IO ()
-- | <https://developer.mozilla.org/docs/Web/API/IDBIndex/name MDN IDBIndex.name documentation>
setName :: (MonadDOM m, ToJSString val) => IDBIndex -> val -> m ()
setName self val = liftDOM (void ((js_setName (self) (toJSString val))))
foreign import javascript unsafe "(($1) => { return $1[\"name\"]; })"
js_getName :: IDBIndex -> IO JSString
-- | <https://developer.mozilla.org/docs/Web/API/IDBIndex/name MDN IDBIndex.name documentation>
getName :: (MonadDOM m, FromJSString result) => IDBIndex -> m result
getName self = liftDOM ((fromJSString <$> (js_getName (self))))
foreign import javascript unsafe "(($1) => { return $1[\"objectStore\"]; })"
js_getObjectStore :: IDBIndex -> IO IDBObjectStore
-- | <https://developer.mozilla.org/docs/Web/API/IDBIndex/objectStore MDN IDBIndex.objectStore documentation>
getObjectStore :: (MonadDOM m) => IDBIndex -> m IDBObjectStore
getObjectStore self = liftDOM ((js_getObjectStore (self)))
foreign import javascript unsafe "(($1) => { return $1[\"keyPath\"]; })"
js_getKeyPath :: IDBIndex -> IO JSVal
-- | <https://developer.mozilla.org/docs/Web/API/IDBIndex/keyPath MDN IDBIndex.keyPath documentation>
getKeyPath :: (MonadDOM m) => IDBIndex -> m JSVal
getKeyPath self = liftDOM ((js_getKeyPath (self)))
foreign import javascript unsafe "(($1) => { return $1[\"multiEntry\"]; })"
js_getMultiEntry :: IDBIndex -> IO Bool
-- | <https://developer.mozilla.org/docs/Web/API/IDBIndex/multiEntry MDN IDBIndex.multiEntry documentation>
getMultiEntry :: (MonadDOM m) => IDBIndex -> m Bool
getMultiEntry self = liftDOM ((js_getMultiEntry (self)))
foreign import javascript unsafe "(($1) => { return $1[\"unique\"]; })"
js_getUnique :: IDBIndex -> IO Bool
-- | <https://developer.mozilla.org/docs/Web/API/IDBIndex/unique MDN IDBIndex.unique documentation>
getUnique :: (MonadDOM m) => IDBIndex -> m Bool
getUnique self = liftDOM ((js_getUnique (self)))