ghcjs-dom-javascript-0.10.0.0: src/GHCJS/DOM/JSFFI/Generated/FileSystemReadWriteOptions.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.FileSystemReadWriteOptions
(js_newFileSystemReadWriteOptions, js_setAt, js_getAt, newFileSystemReadWriteOptions, setAt, getAt, getAtUnsafe, getAtUnchecked, FileSystemReadWriteOptions(..), gTypeFileSystemReadWriteOptions)
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_newFileSystemReadWriteOptions :: IO FileSystemReadWriteOptions
-- | <https://fs.spec.whatwg.org/#dictdef-filesystemreadwriteoptions FileSystemReadWriteOptions specification>
newFileSystemReadWriteOptions :: (MonadDOM m) => m FileSystemReadWriteOptions
newFileSystemReadWriteOptions = liftDOM ((js_newFileSystemReadWriteOptions))
foreign import javascript safe "(($1, $2) => { $1[\"at\"] = $2; })"
js_setAt :: FileSystemReadWriteOptions -> JSVal -> IO ()
-- | <https://fs.spec.whatwg.org/#dom-filesystemreadwriteoptions-at FileSystemReadWriteOptions.at specification>
setAt :: (MonadDOM m) => FileSystemReadWriteOptions -> Word53 -> m ()
setAt self val = liftDOM (void (((toJSVal val) >>= \a2' -> js_setAt (self) a2')))
foreign import javascript unsafe "(($1) => { return $1[\"at\"]; })"
js_getAt :: FileSystemReadWriteOptions -> IO JSVal
-- | <https://fs.spec.whatwg.org/#dom-filesystemreadwriteoptions-at FileSystemReadWriteOptions.at specification>
getAt :: (MonadDOM m) => FileSystemReadWriteOptions -> m (Maybe Word53)
getAt self = liftDOM (((js_getAt (self)) >>= fromJSValUnchecked))
-- | <https://fs.spec.whatwg.org/#dom-filesystemreadwriteoptions-at FileSystemReadWriteOptions.at specification>
getAtUnsafe :: (MonadDOM m, HasCallStack) => FileSystemReadWriteOptions -> m Word53
getAtUnsafe self = liftDOM ((((js_getAt (self)) >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))
-- | <https://fs.spec.whatwg.org/#dom-filesystemreadwriteoptions-at FileSystemReadWriteOptions.at specification>
getAtUnchecked :: (MonadDOM m) => FileSystemReadWriteOptions -> m Word53
getAtUnchecked self = liftDOM ((pFromJSVal <$> (js_getAt (self))))