ghcjs-dom-javascript-0.10.0.0: src/GHCJS/DOM/JSFFI/Generated/StructuredSerializeOptions.hs
{-# LANGUAGE PatternSynonyms #-}
{-# LANGUAGE ForeignFunctionInterface, JavaScriptFFI #-}
{-# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
-- | Generated by dom-gen from html (webref). Do not edit.
module GHCJS.DOM.JSFFI.Generated.StructuredSerializeOptions
(js_newStructuredSerializeOptions, js_setTransfer, js_getTransfer, newStructuredSerializeOptions, setTransfer, getTransfer, getTransferUnsafe, getTransferUnchecked, StructuredSerializeOptions(..), gTypeStructuredSerializeOptions, IsStructuredSerializeOptions, toStructuredSerializeOptions)
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_newStructuredSerializeOptions :: IO StructuredSerializeOptions
-- | <https://html.spec.whatwg.org/multipage/web-messaging.html#structuredserializeoptions StructuredSerializeOptions specification>
newStructuredSerializeOptions :: (MonadDOM m) => m StructuredSerializeOptions
newStructuredSerializeOptions = liftDOM ((js_newStructuredSerializeOptions))
foreign import javascript safe "(($1, $2) => { $1[\"transfer\"] = $2; })"
js_setTransfer :: StructuredSerializeOptions -> JSVal -> IO ()
-- | <https://html.spec.whatwg.org/multipage/web-messaging.html#dom-structuredserializeoptions-transfer StructuredSerializeOptions.transfer specification>
setTransfer :: (MonadDOM m, IsStructuredSerializeOptions self) => self -> [GObject] -> m ()
setTransfer self val = liftDOM (void (((toJSVal val) >>= \a2' -> js_setTransfer ((Types.toStructuredSerializeOptions self)) a2')))
foreign import javascript unsafe "(($1) => { return $1[\"transfer\"]; })"
js_getTransfer :: StructuredSerializeOptions -> IO JSVal
-- | <https://html.spec.whatwg.org/multipage/web-messaging.html#dom-structuredserializeoptions-transfer StructuredSerializeOptions.transfer specification>
getTransfer :: (MonadDOM m, IsStructuredSerializeOptions self) => self -> m (Maybe [GObject])
getTransfer self = liftDOM (((js_getTransfer ((Types.toStructuredSerializeOptions self))) >>= fromJSValUnchecked))
-- | <https://html.spec.whatwg.org/multipage/web-messaging.html#dom-structuredserializeoptions-transfer StructuredSerializeOptions.transfer specification>
getTransferUnsafe :: (MonadDOM m, IsStructuredSerializeOptions self, HasCallStack) => self -> m [GObject]
getTransferUnsafe self = liftDOM ((((js_getTransfer ((Types.toStructuredSerializeOptions self))) >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))
-- | <https://html.spec.whatwg.org/multipage/web-messaging.html#dom-structuredserializeoptions-transfer StructuredSerializeOptions.transfer specification>
getTransferUnchecked :: (MonadDOM m, IsStructuredSerializeOptions self) => self -> m [GObject]
getTransferUnchecked self = liftDOM (((js_getTransfer ((Types.toStructuredSerializeOptions self))) >>= fromJSValUnchecked))