module JSDOM.Generated.Headers
(append, delete, get, get_, getUnsafe, getUnchecked, has, has_,
set, Headers(..), gTypeHeaders)
where
import Prelude ((.), (==), (>>=), return, IO, Int, Float, Double, Bool(..), Maybe, maybe, fromIntegral, round, realToFrac, fmap, Show, Read, Eq, Ord, Maybe(..))
import qualified Prelude (error)
import Data.Typeable (Typeable)
import Data.Traversable (mapM)
import Language.Javascript.JSaddle (JSM(..), JSVal(..), JSString, strictEqual, toJSVal, valToStr, valToNumber, valToBool, js, jss, jsf, jsg, function, asyncFunction, new, array, jsUndefined, (!), (!!))
import Data.Int (Int64)
import Data.Word (Word, Word64)
import JSDOM.Types
import Control.Applicative ((<$>))
import Control.Monad (void)
import Control.Lens.Operators ((^.))
import JSDOM.EventTargetClosures (EventName, unsafeEventName)
import JSDOM.Enums
append ::
(MonadDOM m, ToJSString name, ToJSString value) =>
Headers -> name -> value -> m ()
append self name value
= liftDOM
(void (self ^. jsf "append" [toJSVal name, toJSVal value]))
delete :: (MonadDOM m, ToJSString name) => Headers -> name -> m ()
delete self name
= liftDOM (void (self ^. jsf "delete" [toJSVal name]))
get ::
(MonadDOM m, ToJSString name, FromJSString result) =>
Headers -> name -> m (Maybe result)
get self name
= liftDOM ((self ^. jsf "get" [toJSVal name]) >>= fromJSVal)
get_ :: (MonadDOM m, ToJSString name) => Headers -> name -> m ()
get_ self name = liftDOM (void (self ^. jsf "get" [toJSVal name]))
getUnsafe ::
(MonadDOM m, ToJSString name, HasCallStack, FromJSString result) =>
Headers -> name -> m result
getUnsafe self name
= liftDOM
(((self ^. jsf "get" [toJSVal name]) >>= fromJSVal) >>=
maybe (Prelude.error "Nothing to return") return)
getUnchecked ::
(MonadDOM m, ToJSString name, FromJSString result) =>
Headers -> name -> m result
getUnchecked self name
= liftDOM
((self ^. jsf "get" [toJSVal name]) >>= fromJSValUnchecked)
has :: (MonadDOM m, ToJSString name) => Headers -> name -> m Bool
has self name
= liftDOM ((self ^. jsf "has" [toJSVal name]) >>= valToBool)
has_ :: (MonadDOM m, ToJSString name) => Headers -> name -> m ()
has_ self name = liftDOM (void (self ^. jsf "has" [toJSVal name]))
set ::
(MonadDOM m, ToJSString name, ToJSString value) =>
Headers -> name -> value -> m ()
set self name value
= liftDOM (void (self ^. jsf "set" [toJSVal name, toJSVal value]))