packages feed

jsaddle-dom-0.10.0.0: src/JSDOM/Generated/FontFaceSetLoadEventInit.hs

{-# LANGUAGE PatternSynonyms #-}
{-# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
-- | Generated by dom-gen from css-font-loading-3 (webref). Do not edit.
module JSDOM.Generated.FontFaceSetLoadEventInit
       (newFontFaceSetLoadEventInit, setFontfaces, getFontfaces, getFontfacesUnsafe, getFontfacesUnchecked, FontFaceSetLoadEventInit(..), gTypeFontFaceSetLoadEventInit)
       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://drafts.csswg.org/css-font-loading-3/#dictdef-fontfacesetloadeventinit FontFaceSetLoadEventInit specification>
newFontFaceSetLoadEventInit :: (MonadDOM m) => m FontFaceSetLoadEventInit
newFontFaceSetLoadEventInit = liftDOM ((((new (jsg "Object") () >>= \o -> P.return o)) >>= fromJSValUnchecked))

-- | <https://drafts.csswg.org/css-font-loading-3/#dom-fontfacesetloadeventinit-fontfaces FontFaceSetLoadEventInit.fontfaces specification>
setFontfaces :: (MonadDOM m) => FontFaceSetLoadEventInit -> [FontFace] -> m ()
setFontfaces self val = liftDOM (void (self ^. jss "fontfaces" (toJSVal val)))

-- | <https://drafts.csswg.org/css-font-loading-3/#dom-fontfacesetloadeventinit-fontfaces FontFaceSetLoadEventInit.fontfaces specification>
getFontfaces :: (MonadDOM m) => FontFaceSetLoadEventInit -> m (Maybe [FontFace])
getFontfaces self = liftDOM (((self ^. js "fontfaces") >>= fromJSValUnchecked))

-- | <https://drafts.csswg.org/css-font-loading-3/#dom-fontfacesetloadeventinit-fontfaces FontFaceSetLoadEventInit.fontfaces specification>
getFontfacesUnsafe :: (MonadDOM m, HasCallStack) => FontFaceSetLoadEventInit -> m [FontFace]
getFontfacesUnsafe self = liftDOM ((((self ^. js "fontfaces") >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))

-- | <https://drafts.csswg.org/css-font-loading-3/#dom-fontfacesetloadeventinit-fontfaces FontFaceSetLoadEventInit.fontfaces specification>
getFontfacesUnchecked :: (MonadDOM m) => FontFaceSetLoadEventInit -> m [FontFace]
getFontfacesUnchecked self = liftDOM (((self ^. js "fontfaces") >>= fromJSValUnchecked))