packages feed

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

{-# LANGUAGE PatternSynonyms #-}
{-# LANGUAGE ForeignFunctionInterface, JavaScriptFFI #-}
{-# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
-- | Generated by dom-gen from storage (webref). Do not edit.
module GHCJS.DOM.JSFFI.Generated.StorageManager
       (js_estimate, js_getDirectory, js_persist, js_persisted, estimate, estimate_, getDirectory, getDirectory_, persist, persist_, persisted, persisted_, StorageManager(..), gTypeStorageManager)
       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 interruptible "(($1, $c) => { return $1[\"estimate\"]().then(function(s) { $c(null, s);}, function(e) { $c(e, null);}); })"
        js_estimate :: StorageManager -> IO (JSVal, StorageEstimate)
-- | <https://developer.mozilla.org/docs/Web/API/StorageManager/estimate MDN StorageManager.estimate documentation>
estimate :: (MonadDOM m) => StorageManager -> m StorageEstimate
estimate self = liftDOM (((js_estimate (self)) >>= checkPromiseResult))

-- | <https://developer.mozilla.org/docs/Web/API/StorageManager/estimate MDN StorageManager.estimate documentation>
estimate_ :: (MonadDOM m) => StorageManager -> m ()
estimate_ self = liftDOM (void (((js_estimate (self)) >>= checkPromiseResult)))

foreign import javascript interruptible "(($1, $c) => { return $1[\"getDirectory\"]().then(function(s) { $c(null, s);}, function(e) { $c(e, null);}); })"
        js_getDirectory :: StorageManager -> IO (JSVal, FileSystemDirectoryHandle)
-- | <https://developer.mozilla.org/docs/Web/API/StorageManager/getDirectory MDN StorageManager.getDirectory documentation>
getDirectory :: (MonadDOM m) => StorageManager -> m FileSystemDirectoryHandle
getDirectory self = liftDOM (((js_getDirectory (self)) >>= checkPromiseResult))

-- | <https://developer.mozilla.org/docs/Web/API/StorageManager/getDirectory MDN StorageManager.getDirectory documentation>
getDirectory_ :: (MonadDOM m) => StorageManager -> m ()
getDirectory_ self = liftDOM (void (((js_getDirectory (self)) >>= checkPromiseResult)))

foreign import javascript interruptible "(($1, $c) => { return $1[\"persist\"]().then(function(s) { $c(null, s);}, function(e) { $c(e, null);}); })"
        js_persist :: StorageManager -> IO (JSVal, Bool)
-- | <https://developer.mozilla.org/docs/Web/API/StorageManager/persist MDN StorageManager.persist documentation>
persist :: (MonadDOM m) => StorageManager -> m Bool
persist self = liftDOM (((js_persist (self)) >>= checkPromiseResult))

-- | <https://developer.mozilla.org/docs/Web/API/StorageManager/persist MDN StorageManager.persist documentation>
persist_ :: (MonadDOM m) => StorageManager -> m ()
persist_ self = liftDOM (void (((js_persist (self)) >>= checkPromiseResult)))

foreign import javascript interruptible "(($1, $c) => { return $1[\"persisted\"]().then(function(s) { $c(null, s);}, function(e) { $c(e, null);}); })"
        js_persisted :: StorageManager -> IO (JSVal, Bool)
-- | <https://developer.mozilla.org/docs/Web/API/StorageManager/persisted MDN StorageManager.persisted documentation>
persisted :: (MonadDOM m) => StorageManager -> m Bool
persisted self = liftDOM (((js_persisted (self)) >>= checkPromiseResult))

-- | <https://developer.mozilla.org/docs/Web/API/StorageManager/persisted MDN StorageManager.persisted documentation>
persisted_ :: (MonadDOM m) => StorageManager -> m ()
persisted_ self = liftDOM (void (((js_persisted (self)) >>= checkPromiseResult)))