jsaddle-dom-0.10.0.0: src/JSDOM/Generated/FileSystemFlags.hs
{-# LANGUAGE PatternSynonyms #-}
{-# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
-- | Generated by dom-gen from entries-api (webref). Do not edit.
module JSDOM.Generated.FileSystemFlags
(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 Control.Lens.Operators ((^.))
import Language.Javascript.JSaddle (JSM, JSVal, JSString, toJSVal, valToBool, valToNumber, js, jss, jsf, jsg, new, function, asyncFunction, jsUndefined, jsNull)
import JSDOM.Types
import qualified JSDOM.Types as Types
import JSDOM.EventTargetClosures (EventName, unsafeEventName, unsafeEventNameAsync)
import JSDOM.Generated.Enums
-- | <https://wicg.github.io/entries-api/#dictdef-filesystemflags FileSystemFlags specification>
newFileSystemFlags :: (MonadDOM m) => m FileSystemFlags
newFileSystemFlags = liftDOM ((((new (jsg "Object") () >>= \o -> P.return o)) >>= fromJSValUnchecked))
-- | <https://wicg.github.io/entries-api/#dom-filesystemflags-create FileSystemFlags.create specification>
setCreate :: (MonadDOM m) => FileSystemFlags -> Bool -> m ()
setCreate self val = liftDOM (void (self ^. jss "create" (toJSVal val)))
-- | <https://wicg.github.io/entries-api/#dom-filesystemflags-create FileSystemFlags.create specification>
getCreate :: (MonadDOM m) => FileSystemFlags -> m (Maybe Bool)
getCreate self = liftDOM (((self ^. js "create") >>= fromJSValUnchecked))
-- | <https://wicg.github.io/entries-api/#dom-filesystemflags-create FileSystemFlags.create specification>
getCreateUnsafe :: (MonadDOM m, HasCallStack) => FileSystemFlags -> m Bool
getCreateUnsafe self = liftDOM ((((self ^. js "create") >>= 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 (((self ^. js "create") >>= valToBool))
-- | <https://wicg.github.io/entries-api/#dom-filesystemflags-exclusive FileSystemFlags.exclusive specification>
setExclusive :: (MonadDOM m) => FileSystemFlags -> Bool -> m ()
setExclusive self val = liftDOM (void (self ^. jss "exclusive" (toJSVal val)))
-- | <https://wicg.github.io/entries-api/#dom-filesystemflags-exclusive FileSystemFlags.exclusive specification>
getExclusive :: (MonadDOM m) => FileSystemFlags -> m (Maybe Bool)
getExclusive self = liftDOM (((self ^. js "exclusive") >>= fromJSValUnchecked))
-- | <https://wicg.github.io/entries-api/#dom-filesystemflags-exclusive FileSystemFlags.exclusive specification>
getExclusiveUnsafe :: (MonadDOM m, HasCallStack) => FileSystemFlags -> m Bool
getExclusiveUnsafe self = liftDOM ((((self ^. js "exclusive") >>= 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 (((self ^. js "exclusive") >>= valToBool))