ghcjs-dom-javascript-0.10.0.0: src/GHCJS/DOM/JSFFI/Generated/FileSystemFlags.hs
{-# LANGUAGE PatternSynonyms #-}
{-# LANGUAGE ForeignFunctionInterface, JavaScriptFFI #-}
{-# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
-- | Generated by dom-gen from entries-api (webref). Do not edit.
module GHCJS.DOM.JSFFI.Generated.FileSystemFlags
(js_newFileSystemFlags, js_setCreate, js_getCreate, js_setExclusive, js_getExclusive, newFileSystemFlags, setCreate, getCreate, getCreateUnsafe, getCreateUnchecked, setExclusive, getExclusive, getExclusiveUnsafe, getExclusiveUnchecked, FileSystemFlags(..), gTypeFileSystemFlags)
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_newFileSystemFlags :: IO FileSystemFlags
-- | <https://wicg.github.io/entries-api/#dictdef-filesystemflags FileSystemFlags specification>
newFileSystemFlags :: (MonadDOM m) => m FileSystemFlags
newFileSystemFlags = liftDOM ((js_newFileSystemFlags))
foreign import javascript safe "(($1, $2) => { $1[\"create\"] = $2; })"
js_setCreate :: FileSystemFlags -> Bool -> IO ()
-- | <https://wicg.github.io/entries-api/#dom-filesystemflags-create FileSystemFlags.create specification>
setCreate :: (MonadDOM m) => FileSystemFlags -> Bool -> m ()
setCreate self val = liftDOM (void ((js_setCreate (self) (val))))
foreign import javascript unsafe "(($1) => { return $1[\"create\"]; })"
js_getCreate :: FileSystemFlags -> IO JSVal
-- | <https://wicg.github.io/entries-api/#dom-filesystemflags-create FileSystemFlags.create specification>
getCreate :: (MonadDOM m) => FileSystemFlags -> m (Maybe Bool)
getCreate self = liftDOM (((js_getCreate (self)) >>= fromJSValUnchecked))
-- | <https://wicg.github.io/entries-api/#dom-filesystemflags-create FileSystemFlags.create specification>
getCreateUnsafe :: (MonadDOM m, HasCallStack) => FileSystemFlags -> m Bool
getCreateUnsafe self = liftDOM ((((js_getCreate (self)) >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))
-- | <https://wicg.github.io/entries-api/#dom-filesystemflags-create FileSystemFlags.create specification>
getCreateUnchecked :: (MonadDOM m) => FileSystemFlags -> m Bool
getCreateUnchecked self = liftDOM ((pFromJSVal <$> (js_getCreate (self))))
foreign import javascript safe "(($1, $2) => { $1[\"exclusive\"] = $2; })"
js_setExclusive :: FileSystemFlags -> Bool -> IO ()
-- | <https://wicg.github.io/entries-api/#dom-filesystemflags-exclusive FileSystemFlags.exclusive specification>
setExclusive :: (MonadDOM m) => FileSystemFlags -> Bool -> m ()
setExclusive self val = liftDOM (void ((js_setExclusive (self) (val))))
foreign import javascript unsafe "(($1) => { return $1[\"exclusive\"]; })"
js_getExclusive :: FileSystemFlags -> IO JSVal
-- | <https://wicg.github.io/entries-api/#dom-filesystemflags-exclusive FileSystemFlags.exclusive specification>
getExclusive :: (MonadDOM m) => FileSystemFlags -> m (Maybe Bool)
getExclusive self = liftDOM (((js_getExclusive (self)) >>= fromJSValUnchecked))
-- | <https://wicg.github.io/entries-api/#dom-filesystemflags-exclusive FileSystemFlags.exclusive specification>
getExclusiveUnsafe :: (MonadDOM m, HasCallStack) => FileSystemFlags -> m Bool
getExclusiveUnsafe self = liftDOM ((((js_getExclusive (self)) >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))
-- | <https://wicg.github.io/entries-api/#dom-filesystemflags-exclusive FileSystemFlags.exclusive specification>
getExclusiveUnchecked :: (MonadDOM m) => FileSystemFlags -> m Bool
getExclusiveUnchecked self = liftDOM ((pFromJSVal <$> (js_getExclusive (self))))