packages feed

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

{-# LANGUAGE PatternSynonyms #-}
{-# LANGUAGE ForeignFunctionInterface, JavaScriptFFI #-}
{-# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
-- | Generated by dom-gen from fs (webref). Do not edit.
module GHCJS.DOM.JSFFI.Generated.FileSystemCreateWritableOptions
       (js_newFileSystemCreateWritableOptions, js_setKeepExistingData, js_getKeepExistingData, newFileSystemCreateWritableOptions, setKeepExistingData, getKeepExistingData, getKeepExistingDataUnsafe, getKeepExistingDataUnchecked, FileSystemCreateWritableOptions(..), gTypeFileSystemCreateWritableOptions)
       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_newFileSystemCreateWritableOptions :: IO FileSystemCreateWritableOptions
-- | <https://fs.spec.whatwg.org/#dictdef-filesystemcreatewritableoptions FileSystemCreateWritableOptions specification>
newFileSystemCreateWritableOptions :: (MonadDOM m) => m FileSystemCreateWritableOptions
newFileSystemCreateWritableOptions = liftDOM ((js_newFileSystemCreateWritableOptions))

foreign import javascript safe "(($1, $2) => { $1[\"keepExistingData\"] = $2; })"
        js_setKeepExistingData :: FileSystemCreateWritableOptions -> Bool -> IO ()
-- | <https://fs.spec.whatwg.org/#dom-filesystemcreatewritableoptions-keepexistingdata FileSystemCreateWritableOptions.keepExistingData specification>
setKeepExistingData :: (MonadDOM m) => FileSystemCreateWritableOptions -> Bool -> m ()
setKeepExistingData self val = liftDOM (void ((js_setKeepExistingData (self) (val))))

foreign import javascript unsafe "(($1) => { return $1[\"keepExistingData\"]; })"
        js_getKeepExistingData :: FileSystemCreateWritableOptions -> IO JSVal
-- | <https://fs.spec.whatwg.org/#dom-filesystemcreatewritableoptions-keepexistingdata FileSystemCreateWritableOptions.keepExistingData specification>
getKeepExistingData :: (MonadDOM m) => FileSystemCreateWritableOptions -> m (Maybe Bool)
getKeepExistingData self = liftDOM (((js_getKeepExistingData (self)) >>= fromJSValUnchecked))

-- | <https://fs.spec.whatwg.org/#dom-filesystemcreatewritableoptions-keepexistingdata FileSystemCreateWritableOptions.keepExistingData specification>
getKeepExistingDataUnsafe :: (MonadDOM m, HasCallStack) => FileSystemCreateWritableOptions -> m Bool
getKeepExistingDataUnsafe self = liftDOM ((((js_getKeepExistingData (self)) >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))

-- | <https://fs.spec.whatwg.org/#dom-filesystemcreatewritableoptions-keepexistingdata FileSystemCreateWritableOptions.keepExistingData specification>
getKeepExistingDataUnchecked :: (MonadDOM m) => FileSystemCreateWritableOptions -> m Bool
getKeepExistingDataUnchecked self = liftDOM ((pFromJSVal <$> (js_getKeepExistingData (self))))