jsaddle-dom-0.10.0.0: src/JSDOM/Generated/FileSystemRemoveOptions.hs
{-# LANGUAGE PatternSynonyms #-}
{-# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
-- | Generated by dom-gen from fs (webref). Do not edit.
module JSDOM.Generated.FileSystemRemoveOptions
(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 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://fs.spec.whatwg.org/#dictdef-filesystemremoveoptions FileSystemRemoveOptions specification>
newFileSystemRemoveOptions :: (MonadDOM m) => m FileSystemRemoveOptions
newFileSystemRemoveOptions = liftDOM ((((new (jsg "Object") () >>= \o -> P.return o)) >>= fromJSValUnchecked))
-- | <https://fs.spec.whatwg.org/#dom-filesystemremoveoptions-recursive FileSystemRemoveOptions.recursive specification>
setRecursive :: (MonadDOM m) => FileSystemRemoveOptions -> Bool -> m ()
setRecursive self val = liftDOM (void (self ^. jss "recursive" (toJSVal val)))
-- | <https://fs.spec.whatwg.org/#dom-filesystemremoveoptions-recursive FileSystemRemoveOptions.recursive specification>
getRecursive :: (MonadDOM m) => FileSystemRemoveOptions -> m (Maybe Bool)
getRecursive self = liftDOM (((self ^. js "recursive") >>= fromJSValUnchecked))
-- | <https://fs.spec.whatwg.org/#dom-filesystemremoveoptions-recursive FileSystemRemoveOptions.recursive specification>
getRecursiveUnsafe :: (MonadDOM m, HasCallStack) => FileSystemRemoveOptions -> m Bool
getRecursiveUnsafe self = liftDOM ((((self ^. js "recursive") >>= 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 (((self ^. js "recursive") >>= valToBool))