packages feed

ghcjs-dom-javascript-0.10.0.0: src/GHCJS/DOM/JSFFI/Generated/FontFaceSetLoadEvent.hs

{-# LANGUAGE PatternSynonyms #-}
{-# LANGUAGE ForeignFunctionInterface, JavaScriptFFI #-}
{-# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
-- | Generated by dom-gen from css-font-loading-3 (webref). Do not edit.
module GHCJS.DOM.JSFFI.Generated.FontFaceSetLoadEvent
       (js_newFontFaceSetLoadEvent, js_getFontfaces, newFontFaceSetLoadEvent, getFontfaces, FontFaceSetLoadEvent(..), gTypeFontFaceSetLoadEvent)
       where
import Prelude ((.), (==), (>>=), (<$>), (++), Bool(..), Maybe(..), IO, Int, Word, Double, Float)
import qualified Prelude as P
import Control.Monad (void)
import GHCJS.Types (JSVal, JSString)
import GHCJS.Foreign (jsUndefined, jsNull)
import GHCJS.DOM.Types
import qualified GHCJS.DOM.Types as Types
import GHCJS.DOM.EventTargetClosures (EventName, unsafeEventName, unsafeEventNameAsync)
import GHCJS.DOM.JSFFI.Generated.Enums

foreign import javascript safe "(($1, $2) => { return new globalThis[\"FontFaceSetLoadEvent\"]($1, $2); })"
        js_newFontFaceSetLoadEvent :: JSString -> JSVal -> IO FontFaceSetLoadEvent
-- | <https://developer.mozilla.org/docs/Web/API/FontFaceSetLoadEvent/FontFaceSetLoadEvent MDN FontFaceSetLoadEvent. documentation>
newFontFaceSetLoadEvent :: (MonadDOM m, ToJSString type') => type' -> Maybe FontFaceSetLoadEventInit -> m FontFaceSetLoadEvent
newFontFaceSetLoadEvent type' eventInitDict = liftDOM (((P.maybe (P.return jsUndefined) toJSVal eventInitDict) >>= \a2' -> js_newFontFaceSetLoadEvent (toJSString type') a2'))

foreign import javascript unsafe "(($1) => { return $1[\"fontfaces\"]; })"
        js_getFontfaces :: FontFaceSetLoadEvent -> IO JSVal
-- | <https://developer.mozilla.org/docs/Web/API/FontFaceSetLoadEvent/fontfaces MDN FontFaceSetLoadEvent.fontfaces documentation>
getFontfaces :: (MonadDOM m) => FontFaceSetLoadEvent -> m [FontFace]
getFontfaces self = liftDOM (((js_getFontfaces (self)) >>= fromJSValUnchecked))