module JSDOM.Generated.HashChangeEvent
(newHashChangeEvent, initHashChangeEvent, getOldURL, getNewURL,
HashChangeEvent(..), gTypeHashChangeEvent)
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
newHashChangeEvent ::
(MonadDOM m, ToJSString type') =>
type' -> Maybe HashChangeEventInit -> m HashChangeEvent
newHashChangeEvent type' eventInitDict
= liftDOM
(HashChangeEvent <$>
new (jsg "HashChangeEvent") [toJSVal type', toJSVal eventInitDict])
initHashChangeEvent ::
(MonadDOM m, ToJSString type', ToJSString oldURL,
ToJSString newURL) =>
HashChangeEvent ->
Maybe type' -> Bool -> Bool -> Maybe oldURL -> Maybe newURL -> m ()
initHashChangeEvent self type' canBubble cancelable oldURL newURL
= liftDOM
(void
(self ^. jsf "initHashChangeEvent"
[toJSVal type', toJSVal canBubble, toJSVal cancelable,
toJSVal oldURL, toJSVal newURL]))
getOldURL ::
(MonadDOM m, FromJSString result) => HashChangeEvent -> m result
getOldURL self
= liftDOM ((self ^. js "oldURL") >>= fromJSValUnchecked)
getNewURL ::
(MonadDOM m, FromJSString result) => HashChangeEvent -> m result
getNewURL self
= liftDOM ((self ^. js "newURL") >>= fromJSValUnchecked)