ghcjs-dom-javascript-0.10.0.0: src/GHCJS/DOM/JSFFI/Generated/TextDecoderOptions.hs
{-# LANGUAGE PatternSynonyms #-}
{-# LANGUAGE ForeignFunctionInterface, JavaScriptFFI #-}
{-# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
-- | Generated by dom-gen from encoding (webref). Do not edit.
module GHCJS.DOM.JSFFI.Generated.TextDecoderOptions
(js_newTextDecoderOptions, js_setFatal, js_getFatal, js_setIgnoreBOM, js_getIgnoreBOM, newTextDecoderOptions, setFatal, getFatal, getFatalUnsafe, getFatalUnchecked, setIgnoreBOM, getIgnoreBOM, getIgnoreBOMUnsafe, getIgnoreBOMUnchecked, TextDecoderOptions(..), gTypeTextDecoderOptions)
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_newTextDecoderOptions :: IO TextDecoderOptions
-- | <https://encoding.spec.whatwg.org/#textdecoderoptions TextDecoderOptions specification>
newTextDecoderOptions :: (MonadDOM m) => m TextDecoderOptions
newTextDecoderOptions = liftDOM ((js_newTextDecoderOptions))
foreign import javascript safe "(($1, $2) => { $1[\"fatal\"] = $2; })"
js_setFatal :: TextDecoderOptions -> Bool -> IO ()
-- | <https://encoding.spec.whatwg.org/#dom-textdecoderoptions-fatal TextDecoderOptions.fatal specification>
setFatal :: (MonadDOM m) => TextDecoderOptions -> Bool -> m ()
setFatal self val = liftDOM (void ((js_setFatal (self) (val))))
foreign import javascript unsafe "(($1) => { return $1[\"fatal\"]; })"
js_getFatal :: TextDecoderOptions -> IO JSVal
-- | <https://encoding.spec.whatwg.org/#dom-textdecoderoptions-fatal TextDecoderOptions.fatal specification>
getFatal :: (MonadDOM m) => TextDecoderOptions -> m (Maybe Bool)
getFatal self = liftDOM (((js_getFatal (self)) >>= fromJSValUnchecked))
-- | <https://encoding.spec.whatwg.org/#dom-textdecoderoptions-fatal TextDecoderOptions.fatal specification>
getFatalUnsafe :: (MonadDOM m, HasCallStack) => TextDecoderOptions -> m Bool
getFatalUnsafe self = liftDOM ((((js_getFatal (self)) >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))
-- | <https://encoding.spec.whatwg.org/#dom-textdecoderoptions-fatal TextDecoderOptions.fatal specification>
getFatalUnchecked :: (MonadDOM m) => TextDecoderOptions -> m Bool
getFatalUnchecked self = liftDOM ((pFromJSVal <$> (js_getFatal (self))))
foreign import javascript safe "(($1, $2) => { $1[\"ignoreBOM\"] = $2; })"
js_setIgnoreBOM :: TextDecoderOptions -> Bool -> IO ()
-- | <https://encoding.spec.whatwg.org/#dom-textdecoderoptions-ignorebom TextDecoderOptions.ignoreBOM specification>
setIgnoreBOM :: (MonadDOM m) => TextDecoderOptions -> Bool -> m ()
setIgnoreBOM self val = liftDOM (void ((js_setIgnoreBOM (self) (val))))
foreign import javascript unsafe "(($1) => { return $1[\"ignoreBOM\"]; })"
js_getIgnoreBOM :: TextDecoderOptions -> IO JSVal
-- | <https://encoding.spec.whatwg.org/#dom-textdecoderoptions-ignorebom TextDecoderOptions.ignoreBOM specification>
getIgnoreBOM :: (MonadDOM m) => TextDecoderOptions -> m (Maybe Bool)
getIgnoreBOM self = liftDOM (((js_getIgnoreBOM (self)) >>= fromJSValUnchecked))
-- | <https://encoding.spec.whatwg.org/#dom-textdecoderoptions-ignorebom TextDecoderOptions.ignoreBOM specification>
getIgnoreBOMUnsafe :: (MonadDOM m, HasCallStack) => TextDecoderOptions -> m Bool
getIgnoreBOMUnsafe self = liftDOM ((((js_getIgnoreBOM (self)) >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))
-- | <https://encoding.spec.whatwg.org/#dom-textdecoderoptions-ignorebom TextDecoderOptions.ignoreBOM specification>
getIgnoreBOMUnchecked :: (MonadDOM m) => TextDecoderOptions -> m Bool
getIgnoreBOMUnchecked self = liftDOM ((pFromJSVal <$> (js_getIgnoreBOM (self))))