ghcjs-dom-javascript-0.10.0.0: src/GHCJS/DOM/JSFFI/Generated/FilePropertyBag.hs
{-# LANGUAGE PatternSynonyms #-}
{-# LANGUAGE ForeignFunctionInterface, JavaScriptFFI #-}
{-# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
-- | Generated by dom-gen from FileAPI (webref). Do not edit.
module GHCJS.DOM.JSFFI.Generated.FilePropertyBag
(js_newFilePropertyBag, js_setLastModified, js_getLastModified, newFilePropertyBag, setLastModified, getLastModified, getLastModifiedUnsafe, getLastModifiedUnchecked, FilePropertyBag(..), gTypeFilePropertyBag)
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_newFilePropertyBag :: IO FilePropertyBag
-- | <https://w3c.github.io/FileAPI/#dfn-FilePropertyBag FilePropertyBag specification>
newFilePropertyBag :: (MonadDOM m) => m FilePropertyBag
newFilePropertyBag = liftDOM ((js_newFilePropertyBag))
foreign import javascript safe "(($1, $2) => { $1[\"lastModified\"] = $2; })"
js_setLastModified :: FilePropertyBag -> JSVal -> IO ()
-- | <https://w3c.github.io/FileAPI/#dfn-FPdate FilePropertyBag.lastModified specification>
setLastModified :: (MonadDOM m) => FilePropertyBag -> Int53 -> m ()
setLastModified self val = liftDOM (void (((toJSVal val) >>= \a2' -> js_setLastModified (self) a2')))
foreign import javascript unsafe "(($1) => { return $1[\"lastModified\"]; })"
js_getLastModified :: FilePropertyBag -> IO JSVal
-- | <https://w3c.github.io/FileAPI/#dfn-FPdate FilePropertyBag.lastModified specification>
getLastModified :: (MonadDOM m) => FilePropertyBag -> m (Maybe Int53)
getLastModified self = liftDOM (((js_getLastModified (self)) >>= fromJSValUnchecked))
-- | <https://w3c.github.io/FileAPI/#dfn-FPdate FilePropertyBag.lastModified specification>
getLastModifiedUnsafe :: (MonadDOM m, HasCallStack) => FilePropertyBag -> m Int53
getLastModifiedUnsafe self = liftDOM ((((js_getLastModified (self)) >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))
-- | <https://w3c.github.io/FileAPI/#dfn-FPdate FilePropertyBag.lastModified specification>
getLastModifiedUnchecked :: (MonadDOM m) => FilePropertyBag -> m Int53
getLastModifiedUnchecked self = liftDOM ((pFromJSVal <$> (js_getLastModified (self))))