ghcjs-dom-javascript-0.10.0.0: src/GHCJS/DOM/JSFFI/Generated/FileSystemRemoveOptions.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.FileSystemRemoveOptions
(js_newFileSystemRemoveOptions, js_setRecursive, js_getRecursive, newFileSystemRemoveOptions, setRecursive, getRecursive, getRecursiveUnsafe, getRecursiveUnchecked, FileSystemRemoveOptions(..), gTypeFileSystemRemoveOptions)
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_newFileSystemRemoveOptions :: IO FileSystemRemoveOptions
-- | <https://fs.spec.whatwg.org/#dictdef-filesystemremoveoptions FileSystemRemoveOptions specification>
newFileSystemRemoveOptions :: (MonadDOM m) => m FileSystemRemoveOptions
newFileSystemRemoveOptions = liftDOM ((js_newFileSystemRemoveOptions))
foreign import javascript safe "(($1, $2) => { $1[\"recursive\"] = $2; })"
js_setRecursive :: FileSystemRemoveOptions -> Bool -> IO ()
-- | <https://fs.spec.whatwg.org/#dom-filesystemremoveoptions-recursive FileSystemRemoveOptions.recursive specification>
setRecursive :: (MonadDOM m) => FileSystemRemoveOptions -> Bool -> m ()
setRecursive self val = liftDOM (void ((js_setRecursive (self) (val))))
foreign import javascript unsafe "(($1) => { return $1[\"recursive\"]; })"
js_getRecursive :: FileSystemRemoveOptions -> IO JSVal
-- | <https://fs.spec.whatwg.org/#dom-filesystemremoveoptions-recursive FileSystemRemoveOptions.recursive specification>
getRecursive :: (MonadDOM m) => FileSystemRemoveOptions -> m (Maybe Bool)
getRecursive self = liftDOM (((js_getRecursive (self)) >>= fromJSValUnchecked))
-- | <https://fs.spec.whatwg.org/#dom-filesystemremoveoptions-recursive FileSystemRemoveOptions.recursive specification>
getRecursiveUnsafe :: (MonadDOM m, HasCallStack) => FileSystemRemoveOptions -> m Bool
getRecursiveUnsafe self = liftDOM ((((js_getRecursive (self)) >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))
-- | <https://fs.spec.whatwg.org/#dom-filesystemremoveoptions-recursive FileSystemRemoveOptions.recursive specification>
getRecursiveUnchecked :: (MonadDOM m) => FileSystemRemoveOptions -> m Bool
getRecursiveUnchecked self = liftDOM ((pFromJSVal <$> (js_getRecursive (self))))