ghcjs-dom-javascript-0.10.0.0: src/GHCJS/DOM/JSFFI/Generated/PaymentCurrencyAmount.hs
{-# LANGUAGE PatternSynonyms #-}
{-# LANGUAGE ForeignFunctionInterface, JavaScriptFFI #-}
{-# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
-- | Generated by dom-gen from payment-request (webref). Do not edit.
module GHCJS.DOM.JSFFI.Generated.PaymentCurrencyAmount
(js_newPaymentCurrencyAmount, js_setCurrency, js_getCurrency, js_setValue, js_getValue, newPaymentCurrencyAmount, setCurrency, getCurrency, setValue, getValue, PaymentCurrencyAmount(..), gTypePaymentCurrencyAmount)
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 ({\"currency\": $1, \"value\": $2}); })"
js_newPaymentCurrencyAmount :: JSString -> JSString -> IO PaymentCurrencyAmount
-- | <https://w3c.github.io/payment-request/#dom-paymentcurrencyamount PaymentCurrencyAmount specification>
newPaymentCurrencyAmount :: (MonadDOM m, ToJSString currency, ToJSString value) => currency -> value -> m PaymentCurrencyAmount
newPaymentCurrencyAmount currency value = liftDOM ((js_newPaymentCurrencyAmount (toJSString currency) (toJSString value)))
foreign import javascript safe "(($1, $2) => { $1[\"currency\"] = $2; })"
js_setCurrency :: PaymentCurrencyAmount -> JSString -> IO ()
-- | <https://w3c.github.io/payment-request/#dom-paymentcurrencyamount-currency PaymentCurrencyAmount.currency specification>
setCurrency :: (MonadDOM m, ToJSString val) => PaymentCurrencyAmount -> val -> m ()
setCurrency self val = liftDOM (void ((js_setCurrency (self) (toJSString val))))
foreign import javascript unsafe "(($1) => { return $1[\"currency\"]; })"
js_getCurrency :: PaymentCurrencyAmount -> IO JSString
-- | <https://w3c.github.io/payment-request/#dom-paymentcurrencyamount-currency PaymentCurrencyAmount.currency specification>
getCurrency :: (MonadDOM m, FromJSString result) => PaymentCurrencyAmount -> m result
getCurrency self = liftDOM ((fromJSString <$> (js_getCurrency (self))))
foreign import javascript safe "(($1, $2) => { $1[\"value\"] = $2; })"
js_setValue :: PaymentCurrencyAmount -> JSString -> IO ()
-- | <https://w3c.github.io/payment-request/#dom-paymentcurrencyamount-value PaymentCurrencyAmount.value specification>
setValue :: (MonadDOM m, ToJSString val) => PaymentCurrencyAmount -> val -> m ()
setValue self val = liftDOM (void ((js_setValue (self) (toJSString val))))
foreign import javascript unsafe "(($1) => { return $1[\"value\"]; })"
js_getValue :: PaymentCurrencyAmount -> IO JSString
-- | <https://w3c.github.io/payment-request/#dom-paymentcurrencyamount-value PaymentCurrencyAmount.value specification>
getValue :: (MonadDOM m, FromJSString result) => PaymentCurrencyAmount -> m result
getValue self = liftDOM ((fromJSString <$> (js_getValue (self))))