jsaddle-dom-0.10.0.0: src/JSDOM/Generated/SVGLengthList.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.SVGLengthList
(appendItem, appendItem_, clear, getItem, getItem_, initialize, initialize_, insertItemBefore, insertItemBefore_, removeItem, removeItem_, replaceItem, replaceItem_, getLength, getNumberOfItems, SVGLengthList(..), gTypeSVGLengthList)
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/SVGLengthList/appendItem MDN SVGLengthList.appendItem documentation>
appendItem :: (MonadDOM m) => SVGLengthList -> SVGLength -> m SVGLength
appendItem self newItem = liftDOM (((self ^. jsf "appendItem" [toJSVal newItem]) >>= fromJSValUnchecked))
-- | <https://developer.mozilla.org/docs/Web/API/SVGLengthList/appendItem MDN SVGLengthList.appendItem documentation>
appendItem_ :: (MonadDOM m) => SVGLengthList -> SVGLength -> m ()
appendItem_ self newItem = liftDOM (void (self ^. jsf "appendItem" [toJSVal newItem]))
-- | <https://developer.mozilla.org/docs/Web/API/SVGLengthList/clear MDN SVGLengthList.clear documentation>
clear :: (MonadDOM m) => SVGLengthList -> m ()
clear self = liftDOM (void (self ^. jsf "clear" ()))
-- | <https://developer.mozilla.org/docs/Web/API/SVGLengthList/getItem MDN SVGLengthList.getItem documentation>
getItem :: (MonadDOM m) => SVGLengthList -> Word -> m SVGLength
getItem self index = liftDOM (((self ^. jsf "getItem" [toJSVal index]) >>= fromJSValUnchecked))
-- | <https://developer.mozilla.org/docs/Web/API/SVGLengthList/getItem MDN SVGLengthList.getItem documentation>
getItem_ :: (MonadDOM m) => SVGLengthList -> Word -> m ()
getItem_ self index = liftDOM (void (self ^. jsf "getItem" [toJSVal index]))
-- | <https://developer.mozilla.org/docs/Web/API/SVGLengthList/initialize MDN SVGLengthList.initialize documentation>
initialize :: (MonadDOM m) => SVGLengthList -> SVGLength -> m SVGLength
initialize self newItem = liftDOM (((self ^. jsf "initialize" [toJSVal newItem]) >>= fromJSValUnchecked))
-- | <https://developer.mozilla.org/docs/Web/API/SVGLengthList/initialize MDN SVGLengthList.initialize documentation>
initialize_ :: (MonadDOM m) => SVGLengthList -> SVGLength -> m ()
initialize_ self newItem = liftDOM (void (self ^. jsf "initialize" [toJSVal newItem]))
-- | <https://developer.mozilla.org/docs/Web/API/SVGLengthList/insertItemBefore MDN SVGLengthList.insertItemBefore documentation>
insertItemBefore :: (MonadDOM m) => SVGLengthList -> SVGLength -> Word -> m SVGLength
insertItemBefore self newItem index = liftDOM (((self ^. jsf "insertItemBefore" [toJSVal newItem, toJSVal index]) >>= fromJSValUnchecked))
-- | <https://developer.mozilla.org/docs/Web/API/SVGLengthList/insertItemBefore MDN SVGLengthList.insertItemBefore documentation>
insertItemBefore_ :: (MonadDOM m) => SVGLengthList -> SVGLength -> Word -> m ()
insertItemBefore_ self newItem index = liftDOM (void (self ^. jsf "insertItemBefore" [toJSVal newItem, toJSVal index]))
-- | <https://developer.mozilla.org/docs/Web/API/SVGLengthList/removeItem MDN SVGLengthList.removeItem documentation>
removeItem :: (MonadDOM m) => SVGLengthList -> Word -> m SVGLength
removeItem self index = liftDOM (((self ^. jsf "removeItem" [toJSVal index]) >>= fromJSValUnchecked))
-- | <https://developer.mozilla.org/docs/Web/API/SVGLengthList/removeItem MDN SVGLengthList.removeItem documentation>
removeItem_ :: (MonadDOM m) => SVGLengthList -> Word -> m ()
removeItem_ self index = liftDOM (void (self ^. jsf "removeItem" [toJSVal index]))
-- | <https://developer.mozilla.org/docs/Web/API/SVGLengthList/replaceItem MDN SVGLengthList.replaceItem documentation>
replaceItem :: (MonadDOM m) => SVGLengthList -> SVGLength -> Word -> m SVGLength
replaceItem self newItem index = liftDOM (((self ^. jsf "replaceItem" [toJSVal newItem, toJSVal index]) >>= fromJSValUnchecked))
-- | <https://developer.mozilla.org/docs/Web/API/SVGLengthList/replaceItem MDN SVGLengthList.replaceItem documentation>
replaceItem_ :: (MonadDOM m) => SVGLengthList -> SVGLength -> Word -> m ()
replaceItem_ self newItem index = liftDOM (void (self ^. jsf "replaceItem" [toJSVal newItem, toJSVal index]))
-- | <https://developer.mozilla.org/docs/Web/API/SVGLengthList/length MDN SVGLengthList.length documentation>
getLength :: (MonadDOM m) => SVGLengthList -> m Word
getLength self = liftDOM ((P.round <$> ((self ^. js "length") >>= valToNumber)))
-- | <https://developer.mozilla.org/docs/Web/API/SVGLengthList/numberOfItems MDN SVGLengthList.numberOfItems documentation>
getNumberOfItems :: (MonadDOM m) => SVGLengthList -> m Word
getNumberOfItems self = liftDOM ((P.round <$> ((self ^. js "numberOfItems") >>= valToNumber)))