jsaddle-dom-0.10.0.0: src/JSDOM/Generated/SVGPointList.hs
{-# LANGUAGE PatternSynonyms #-}
{-# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
-- | Generated by dom-gen from SVG2 (webref). Do not edit.
module JSDOM.Generated.SVGPointList
(appendItem, appendItem_, clear, getItem, getItem_, initialize, initialize_, insertItemBefore, insertItemBefore_, removeItem, removeItem_, replaceItem, replaceItem_, getLength, getNumberOfItems, SVGPointList(..), gTypeSVGPointList)
where
import Prelude ((.), (==), (>>=), (<$>), (++), Bool(..), Maybe(..), IO, Int, Word, Double, Float)
import qualified Prelude as P
import Control.Monad (void)
import Control.Lens.Operators ((^.))
import Language.Javascript.JSaddle (JSM, JSVal, JSString, toJSVal, valToBool, valToNumber, js, jss, jsf, jsg, new, function, asyncFunction, jsUndefined, jsNull)
import JSDOM.Types
import qualified JSDOM.Types as Types
import JSDOM.EventTargetClosures (EventName, unsafeEventName, unsafeEventNameAsync)
import JSDOM.Generated.Enums
-- | <https://developer.mozilla.org/docs/Web/API/SVGPointList/appendItem MDN SVGPointList.appendItem documentation>
appendItem :: (MonadDOM m) => SVGPointList -> DOMPoint -> m DOMPoint
appendItem self newItem = liftDOM (((self ^. jsf "appendItem" [toJSVal newItem]) >>= fromJSValUnchecked))
-- | <https://developer.mozilla.org/docs/Web/API/SVGPointList/appendItem MDN SVGPointList.appendItem documentation>
appendItem_ :: (MonadDOM m) => SVGPointList -> DOMPoint -> m ()
appendItem_ self newItem = liftDOM (void (self ^. jsf "appendItem" [toJSVal newItem]))
-- | <https://developer.mozilla.org/docs/Web/API/SVGPointList/clear MDN SVGPointList.clear documentation>
clear :: (MonadDOM m) => SVGPointList -> m ()
clear self = liftDOM (void (self ^. jsf "clear" ()))
-- | <https://developer.mozilla.org/docs/Web/API/SVGPointList/getItem MDN SVGPointList.getItem documentation>
getItem :: (MonadDOM m) => SVGPointList -> Word -> m DOMPoint
getItem self index = liftDOM (((self ^. jsf "getItem" [toJSVal index]) >>= fromJSValUnchecked))
-- | <https://developer.mozilla.org/docs/Web/API/SVGPointList/getItem MDN SVGPointList.getItem documentation>
getItem_ :: (MonadDOM m) => SVGPointList -> Word -> m ()
getItem_ self index = liftDOM (void (self ^. jsf "getItem" [toJSVal index]))
-- | <https://developer.mozilla.org/docs/Web/API/SVGPointList/initialize MDN SVGPointList.initialize documentation>
initialize :: (MonadDOM m) => SVGPointList -> DOMPoint -> m DOMPoint
initialize self newItem = liftDOM (((self ^. jsf "initialize" [toJSVal newItem]) >>= fromJSValUnchecked))
-- | <https://developer.mozilla.org/docs/Web/API/SVGPointList/initialize MDN SVGPointList.initialize documentation>
initialize_ :: (MonadDOM m) => SVGPointList -> DOMPoint -> m ()
initialize_ self newItem = liftDOM (void (self ^. jsf "initialize" [toJSVal newItem]))
-- | <https://developer.mozilla.org/docs/Web/API/SVGPointList/insertItemBefore MDN SVGPointList.insertItemBefore documentation>
insertItemBefore :: (MonadDOM m) => SVGPointList -> DOMPoint -> Word -> m DOMPoint
insertItemBefore self newItem index = liftDOM (((self ^. jsf "insertItemBefore" [toJSVal newItem, toJSVal index]) >>= fromJSValUnchecked))
-- | <https://developer.mozilla.org/docs/Web/API/SVGPointList/insertItemBefore MDN SVGPointList.insertItemBefore documentation>
insertItemBefore_ :: (MonadDOM m) => SVGPointList -> DOMPoint -> Word -> m ()
insertItemBefore_ self newItem index = liftDOM (void (self ^. jsf "insertItemBefore" [toJSVal newItem, toJSVal index]))
-- | <https://developer.mozilla.org/docs/Web/API/SVGPointList/removeItem MDN SVGPointList.removeItem documentation>
removeItem :: (MonadDOM m) => SVGPointList -> Word -> m DOMPoint
removeItem self index = liftDOM (((self ^. jsf "removeItem" [toJSVal index]) >>= fromJSValUnchecked))
-- | <https://developer.mozilla.org/docs/Web/API/SVGPointList/removeItem MDN SVGPointList.removeItem documentation>
removeItem_ :: (MonadDOM m) => SVGPointList -> Word -> m ()
removeItem_ self index = liftDOM (void (self ^. jsf "removeItem" [toJSVal index]))
-- | <https://developer.mozilla.org/docs/Web/API/SVGPointList/replaceItem MDN SVGPointList.replaceItem documentation>
replaceItem :: (MonadDOM m) => SVGPointList -> DOMPoint -> Word -> m DOMPoint
replaceItem self newItem index = liftDOM (((self ^. jsf "replaceItem" [toJSVal newItem, toJSVal index]) >>= fromJSValUnchecked))
-- | <https://developer.mozilla.org/docs/Web/API/SVGPointList/replaceItem MDN SVGPointList.replaceItem documentation>
replaceItem_ :: (MonadDOM m) => SVGPointList -> DOMPoint -> Word -> m ()
replaceItem_ self newItem index = liftDOM (void (self ^. jsf "replaceItem" [toJSVal newItem, toJSVal index]))
-- | <https://developer.mozilla.org/docs/Web/API/SVGPointList/length MDN SVGPointList.length documentation>
getLength :: (MonadDOM m) => SVGPointList -> m Word
getLength self = liftDOM ((P.round <$> ((self ^. js "length") >>= valToNumber)))
-- | <https://developer.mozilla.org/docs/Web/API/SVGPointList/numberOfItems MDN SVGPointList.numberOfItems documentation>
getNumberOfItems :: (MonadDOM m) => SVGPointList -> m Word
getNumberOfItems self = liftDOM ((P.round <$> ((self ^. js "numberOfItems") >>= valToNumber)))