ghcjs-dom-javascript-0.10.0.0: src/GHCJS/DOM/JSFFI/Generated/IDBGetAllOptions.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.IDBGetAllOptions
(js_newIDBGetAllOptions, js_setQuery, js_getQuery, js_setCount, js_getCount, js_setDirection, js_getDirection, newIDBGetAllOptions, setQuery, getQuery, setCount, getCount, getCountUnsafe, getCountUnchecked, setDirection, getDirection, getDirectionUnsafe, getDirectionUnchecked, IDBGetAllOptions(..), gTypeIDBGetAllOptions)
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 "(() => { return ({}); })"
js_newIDBGetAllOptions :: IO IDBGetAllOptions
-- | <https://w3c.github.io/IndexedDB/#dictdef-idbgetalloptions IDBGetAllOptions specification>
newIDBGetAllOptions :: (MonadDOM m) => m IDBGetAllOptions
newIDBGetAllOptions = liftDOM ((js_newIDBGetAllOptions))
foreign import javascript safe "(($1, $2) => { $1[\"query\"] = $2; })"
js_setQuery :: IDBGetAllOptions -> JSVal -> IO ()
-- | <https://w3c.github.io/IndexedDB/#dom-idbgetalloptions-query IDBGetAllOptions.query specification>
setQuery :: (MonadDOM m) => IDBGetAllOptions -> JSVal -> m ()
setQuery self val = liftDOM (void ((js_setQuery (self) (val))))
foreign import javascript unsafe "(($1) => { return $1[\"query\"]; })"
js_getQuery :: IDBGetAllOptions -> IO JSVal
-- | <https://w3c.github.io/IndexedDB/#dom-idbgetalloptions-query IDBGetAllOptions.query specification>
getQuery :: (MonadDOM m) => IDBGetAllOptions -> m JSVal
getQuery self = liftDOM ((js_getQuery (self)))
foreign import javascript safe "(($1, $2) => { $1[\"count\"] = $2; })"
js_setCount :: IDBGetAllOptions -> Word -> IO ()
-- | <https://w3c.github.io/IndexedDB/#dom-idbgetalloptions-count IDBGetAllOptions.count specification>
setCount :: (MonadDOM m) => IDBGetAllOptions -> Word -> m ()
setCount self val = liftDOM (void ((js_setCount (self) (val))))
foreign import javascript unsafe "(($1) => { return $1[\"count\"]; })"
js_getCount :: IDBGetAllOptions -> IO JSVal
-- | <https://w3c.github.io/IndexedDB/#dom-idbgetalloptions-count IDBGetAllOptions.count specification>
getCount :: (MonadDOM m) => IDBGetAllOptions -> m (Maybe Word)
getCount self = liftDOM (((js_getCount (self)) >>= fromJSValUnchecked))
-- | <https://w3c.github.io/IndexedDB/#dom-idbgetalloptions-count IDBGetAllOptions.count specification>
getCountUnsafe :: (MonadDOM m, HasCallStack) => IDBGetAllOptions -> m Word
getCountUnsafe self = liftDOM ((((js_getCount (self)) >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))
-- | <https://w3c.github.io/IndexedDB/#dom-idbgetalloptions-count IDBGetAllOptions.count specification>
getCountUnchecked :: (MonadDOM m) => IDBGetAllOptions -> m Word
getCountUnchecked self = liftDOM ((pFromJSVal <$> (js_getCount (self))))
foreign import javascript safe "(($1, $2) => { $1[\"direction\"] = $2; })"
js_setDirection :: IDBGetAllOptions -> JSVal -> IO ()
-- | <https://w3c.github.io/IndexedDB/#dom-idbgetalloptions-direction IDBGetAllOptions.direction specification>
setDirection :: (MonadDOM m) => IDBGetAllOptions -> IDBCursorDirection -> m ()
setDirection self val = liftDOM (void (((toJSVal val) >>= \a2' -> js_setDirection (self) a2')))
foreign import javascript unsafe "(($1) => { return $1[\"direction\"]; })"
js_getDirection :: IDBGetAllOptions -> IO JSVal
-- | <https://w3c.github.io/IndexedDB/#dom-idbgetalloptions-direction IDBGetAllOptions.direction specification>
getDirection :: (MonadDOM m) => IDBGetAllOptions -> m (Maybe IDBCursorDirection)
getDirection self = liftDOM (((js_getDirection (self)) >>= fromJSValUnchecked))
-- | <https://w3c.github.io/IndexedDB/#dom-idbgetalloptions-direction IDBGetAllOptions.direction specification>
getDirectionUnsafe :: (MonadDOM m, HasCallStack) => IDBGetAllOptions -> m IDBCursorDirection
getDirectionUnsafe self = liftDOM ((((js_getDirection (self)) >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))
-- | <https://w3c.github.io/IndexedDB/#dom-idbgetalloptions-direction IDBGetAllOptions.direction specification>
getDirectionUnchecked :: (MonadDOM m) => IDBGetAllOptions -> m IDBCursorDirection
getDirectionUnchecked self = liftDOM ((pFromJSVal <$> (js_getDirection (self))))