jsaddle-dom-0.10.0.0: src/JSDOM/Generated/Path2D.hs
{-# LANGUAGE PatternSynonyms #-}
{-# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
-- | Generated by dom-gen from html (webref). Do not edit.
module JSDOM.Generated.Path2D
(newPath2D, newPath2D', addPath, addPath', Path2D(..), gTypePath2D)
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/Path2D/Path2D MDN Path2D. documentation>
newPath2D :: (MonadDOM m) => m Path2D
newPath2D = liftDOM (((new (jsg "Path2D") ()) >>= fromJSValUnchecked))
-- | <https://developer.mozilla.org/docs/Web/API/Path2D/Path2D MDN Path2D. documentation>
newPath2D' :: (MonadDOM m, IsPath2DOrString path) => Maybe path -> m Path2D
newPath2D' path = liftDOM (((new (jsg "Path2D") [P.maybe (P.return jsUndefined) toJSVal path]) >>= fromJSValUnchecked))
-- | <https://developer.mozilla.org/docs/Web/API/Path2D/addPath MDN Path2D.addPath documentation>
addPath :: (MonadDOM m) => Path2D -> Path2D -> m ()
addPath self path = liftDOM (void (self ^. jsf "addPath" [toJSVal path]))
-- | <https://developer.mozilla.org/docs/Web/API/Path2D/addPath MDN Path2D.addPath documentation>
addPath' :: (MonadDOM m, IsDOMMatrix2DInit transform) => Path2D -> Path2D -> Maybe transform -> m ()
addPath' self path transform = liftDOM (void (self ^. jsf "addPath" [toJSVal path, P.maybe (P.return jsUndefined) toJSVal transform]))