ghcjs-dom-javascript-0.10.0.0: src/GHCJS/DOM/JSFFI/Generated/StreamPipeOptions.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.StreamPipeOptions
(js_newStreamPipeOptions, js_setPreventClose, js_getPreventClose, js_setPreventAbort, js_getPreventAbort, js_setPreventCancel, js_getPreventCancel, js_setSignal, js_getSignal, newStreamPipeOptions, setPreventClose, getPreventClose, getPreventCloseUnsafe, getPreventCloseUnchecked, setPreventAbort, getPreventAbort, getPreventAbortUnsafe, getPreventAbortUnchecked, setPreventCancel, getPreventCancel, getPreventCancelUnsafe, getPreventCancelUnchecked, setSignal, getSignal, getSignalUnsafe, getSignalUnchecked, StreamPipeOptions(..), gTypeStreamPipeOptions)
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_newStreamPipeOptions :: IO StreamPipeOptions
-- | <https://streams.spec.whatwg.org/#dictdef-streampipeoptions StreamPipeOptions specification>
newStreamPipeOptions :: (MonadDOM m) => m StreamPipeOptions
newStreamPipeOptions = liftDOM ((js_newStreamPipeOptions))
foreign import javascript safe "(($1, $2) => { $1[\"preventClose\"] = $2; })"
js_setPreventClose :: StreamPipeOptions -> Bool -> IO ()
-- | <https://streams.spec.whatwg.org/#dom-streampipeoptions-preventclose StreamPipeOptions.preventClose specification>
setPreventClose :: (MonadDOM m) => StreamPipeOptions -> Bool -> m ()
setPreventClose self val = liftDOM (void ((js_setPreventClose (self) (val))))
foreign import javascript unsafe "(($1) => { return $1[\"preventClose\"]; })"
js_getPreventClose :: StreamPipeOptions -> IO JSVal
-- | <https://streams.spec.whatwg.org/#dom-streampipeoptions-preventclose StreamPipeOptions.preventClose specification>
getPreventClose :: (MonadDOM m) => StreamPipeOptions -> m (Maybe Bool)
getPreventClose self = liftDOM (((js_getPreventClose (self)) >>= fromJSValUnchecked))
-- | <https://streams.spec.whatwg.org/#dom-streampipeoptions-preventclose StreamPipeOptions.preventClose specification>
getPreventCloseUnsafe :: (MonadDOM m, HasCallStack) => StreamPipeOptions -> m Bool
getPreventCloseUnsafe self = liftDOM ((((js_getPreventClose (self)) >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))
-- | <https://streams.spec.whatwg.org/#dom-streampipeoptions-preventclose StreamPipeOptions.preventClose specification>
getPreventCloseUnchecked :: (MonadDOM m) => StreamPipeOptions -> m Bool
getPreventCloseUnchecked self = liftDOM ((pFromJSVal <$> (js_getPreventClose (self))))
foreign import javascript safe "(($1, $2) => { $1[\"preventAbort\"] = $2; })"
js_setPreventAbort :: StreamPipeOptions -> Bool -> IO ()
-- | <https://streams.spec.whatwg.org/#dom-streampipeoptions-preventabort StreamPipeOptions.preventAbort specification>
setPreventAbort :: (MonadDOM m) => StreamPipeOptions -> Bool -> m ()
setPreventAbort self val = liftDOM (void ((js_setPreventAbort (self) (val))))
foreign import javascript unsafe "(($1) => { return $1[\"preventAbort\"]; })"
js_getPreventAbort :: StreamPipeOptions -> IO JSVal
-- | <https://streams.spec.whatwg.org/#dom-streampipeoptions-preventabort StreamPipeOptions.preventAbort specification>
getPreventAbort :: (MonadDOM m) => StreamPipeOptions -> m (Maybe Bool)
getPreventAbort self = liftDOM (((js_getPreventAbort (self)) >>= fromJSValUnchecked))
-- | <https://streams.spec.whatwg.org/#dom-streampipeoptions-preventabort StreamPipeOptions.preventAbort specification>
getPreventAbortUnsafe :: (MonadDOM m, HasCallStack) => StreamPipeOptions -> m Bool
getPreventAbortUnsafe self = liftDOM ((((js_getPreventAbort (self)) >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))
-- | <https://streams.spec.whatwg.org/#dom-streampipeoptions-preventabort StreamPipeOptions.preventAbort specification>
getPreventAbortUnchecked :: (MonadDOM m) => StreamPipeOptions -> m Bool
getPreventAbortUnchecked self = liftDOM ((pFromJSVal <$> (js_getPreventAbort (self))))
foreign import javascript safe "(($1, $2) => { $1[\"preventCancel\"] = $2; })"
js_setPreventCancel :: StreamPipeOptions -> Bool -> IO ()
-- | <https://streams.spec.whatwg.org/#dom-streampipeoptions-preventcancel StreamPipeOptions.preventCancel specification>
setPreventCancel :: (MonadDOM m) => StreamPipeOptions -> Bool -> m ()
setPreventCancel self val = liftDOM (void ((js_setPreventCancel (self) (val))))
foreign import javascript unsafe "(($1) => { return $1[\"preventCancel\"]; })"
js_getPreventCancel :: StreamPipeOptions -> IO JSVal
-- | <https://streams.spec.whatwg.org/#dom-streampipeoptions-preventcancel StreamPipeOptions.preventCancel specification>
getPreventCancel :: (MonadDOM m) => StreamPipeOptions -> m (Maybe Bool)
getPreventCancel self = liftDOM (((js_getPreventCancel (self)) >>= fromJSValUnchecked))
-- | <https://streams.spec.whatwg.org/#dom-streampipeoptions-preventcancel StreamPipeOptions.preventCancel specification>
getPreventCancelUnsafe :: (MonadDOM m, HasCallStack) => StreamPipeOptions -> m Bool
getPreventCancelUnsafe self = liftDOM ((((js_getPreventCancel (self)) >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))
-- | <https://streams.spec.whatwg.org/#dom-streampipeoptions-preventcancel StreamPipeOptions.preventCancel specification>
getPreventCancelUnchecked :: (MonadDOM m) => StreamPipeOptions -> m Bool
getPreventCancelUnchecked self = liftDOM ((pFromJSVal <$> (js_getPreventCancel (self))))
foreign import javascript safe "(($1, $2) => { $1[\"signal\"] = $2; })"
js_setSignal :: StreamPipeOptions -> AbortSignal -> IO ()
-- | <https://streams.spec.whatwg.org/#dom-streampipeoptions-signal StreamPipeOptions.signal specification>
setSignal :: (MonadDOM m, IsAbortSignal val) => StreamPipeOptions -> val -> m ()
setSignal self val = liftDOM (void ((js_setSignal (self) (Types.toAbortSignal val))))
foreign import javascript unsafe "(($1) => { return $1[\"signal\"]; })"
js_getSignal :: StreamPipeOptions -> IO JSVal
-- | <https://streams.spec.whatwg.org/#dom-streampipeoptions-signal StreamPipeOptions.signal specification>
getSignal :: (MonadDOM m) => StreamPipeOptions -> m (Maybe AbortSignal)
getSignal self = liftDOM (((js_getSignal (self)) >>= fromJSValUnchecked))
-- | <https://streams.spec.whatwg.org/#dom-streampipeoptions-signal StreamPipeOptions.signal specification>
getSignalUnsafe :: (MonadDOM m, HasCallStack) => StreamPipeOptions -> m AbortSignal
getSignalUnsafe self = liftDOM ((((js_getSignal (self)) >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))
-- | <https://streams.spec.whatwg.org/#dom-streampipeoptions-signal StreamPipeOptions.signal specification>
getSignalUnchecked :: (MonadDOM m) => StreamPipeOptions -> m AbortSignal
getSignalUnchecked self = liftDOM ((pFromJSVal <$> (js_getSignal (self))))