ghcjs-dom-javascript-0.10.0.0: src/GHCJS/DOM/JSFFI/Generated/ReadableStreamBYOBReaderReadOptions.hs
{-# LANGUAGE PatternSynonyms #-}
{-# LANGUAGE ForeignFunctionInterface, JavaScriptFFI #-}
{-# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
-- | Generated by dom-gen from streams (webref). Do not edit.
module GHCJS.DOM.JSFFI.Generated.ReadableStreamBYOBReaderReadOptions
(js_newReadableStreamBYOBReaderReadOptions, js_setMin, js_getMin, newReadableStreamBYOBReaderReadOptions, setMin, getMin, getMinUnsafe, getMinUnchecked, ReadableStreamBYOBReaderReadOptions(..), gTypeReadableStreamBYOBReaderReadOptions)
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_newReadableStreamBYOBReaderReadOptions :: IO ReadableStreamBYOBReaderReadOptions
-- | <https://streams.spec.whatwg.org/#dictdef-readablestreambyobreaderreadoptions ReadableStreamBYOBReaderReadOptions specification>
newReadableStreamBYOBReaderReadOptions :: (MonadDOM m) => m ReadableStreamBYOBReaderReadOptions
newReadableStreamBYOBReaderReadOptions = liftDOM ((js_newReadableStreamBYOBReaderReadOptions))
foreign import javascript safe "(($1, $2) => { $1[\"min\"] = $2; })"
js_setMin :: ReadableStreamBYOBReaderReadOptions -> JSVal -> IO ()
-- | <https://streams.spec.whatwg.org/#dom-readablestreambyobreaderreadoptions-min ReadableStreamBYOBReaderReadOptions.min specification>
setMin :: (MonadDOM m) => ReadableStreamBYOBReaderReadOptions -> Word53 -> m ()
setMin self val = liftDOM (void (((toJSVal val) >>= \a2' -> js_setMin (self) a2')))
foreign import javascript unsafe "(($1) => { return $1[\"min\"]; })"
js_getMin :: ReadableStreamBYOBReaderReadOptions -> IO JSVal
-- | <https://streams.spec.whatwg.org/#dom-readablestreambyobreaderreadoptions-min ReadableStreamBYOBReaderReadOptions.min specification>
getMin :: (MonadDOM m) => ReadableStreamBYOBReaderReadOptions -> m (Maybe Word53)
getMin self = liftDOM (((js_getMin (self)) >>= fromJSValUnchecked))
-- | <https://streams.spec.whatwg.org/#dom-readablestreambyobreaderreadoptions-min ReadableStreamBYOBReaderReadOptions.min specification>
getMinUnsafe :: (MonadDOM m, HasCallStack) => ReadableStreamBYOBReaderReadOptions -> m Word53
getMinUnsafe self = liftDOM ((((js_getMin (self)) >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))
-- | <https://streams.spec.whatwg.org/#dom-readablestreambyobreaderreadoptions-min ReadableStreamBYOBReaderReadOptions.min specification>
getMinUnchecked :: (MonadDOM m) => ReadableStreamBYOBReaderReadOptions -> m Word53
getMinUnchecked self = liftDOM ((pFromJSVal <$> (js_getMin (self))))