| Copyright | (C) 2016-2025 David M. Johnson |
|---|---|
| License | BSD3-style (see the file LICENSE) |
| Maintainer | David M. Johnson <code@dmj.io> |
| Stability | experimental |
| Portability | non-portable |
| Safe Haskell | None |
| Language | Haskell2010 |
Miso.Navigator
Description
Synopsis
- getUserMedia :: UserMedia -> (Stream -> action) -> (JSVal -> action) -> Effect parent model action
- userMedia :: UserMedia
- data UserMedia = UserMedia {}
- type Stream = JSVal
- copyClipboard :: MisoString -> action -> (JSVal -> action) -> Effect parent model action
- isOnLine :: (Bool -> action) -> Effect parent model action
- geolocation :: (Geolocation -> action) -> (GeolocationError -> action) -> Effect parent model action
- data Geolocation = Geolocation {}
- data GeolocationError = GeolocationError GeolocationErrorCode MisoString
- data GeolocationErrorCode
User media
Arguments
| :: UserMedia | Options |
| -> (Stream -> action) | Successful callback |
| -> (JSVal -> action) | Errorful callback |
| -> Effect parent model action |
Get access to user's media devices.
https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia
Type for dealing with 'navigator.mediaDevices.getUserMedia'
https://developer.mozilla.org/en-US/docs/Web/API/Navigator/mediaDevices
Instances
Clipboard
Arguments
| :: MisoString | Options |
| -> action | Successful callback |
| -> (JSVal -> action) | Errorful callback |
| -> Effect parent model action |
Get access to the user's clipboard.
https://developer.mozilla.org/en-US/docs/Web/API/Navigator/clipboard
OnLine
Get user's online status
https://developer.mozilla.org/en-US/docs/Web/API/Navigator/onLine
Geolocation
geolocation :: (Geolocation -> action) -> (GeolocationError -> action) -> Effect parent model action Source #
Geolocation fetching
https://developer.mozilla.org/en-US/docs/Web/API/Navigator/geolocation
data Geolocation Source #
Geolocation holds latitude, longitude and accuracy, among others.
Instances
| Show Geolocation Source # | |
Defined in Miso.Navigator Methods showsPrec :: Int -> Geolocation -> ShowS # show :: Geolocation -> String # showList :: [Geolocation] -> ShowS # | |
| Eq Geolocation Source # | |
Defined in Miso.Navigator | |
| FromJSVal Geolocation Source # | |
Defined in Miso.Navigator Methods fromJSVal :: JSVal -> JSM (Maybe Geolocation) Source # fromJSValUnchecked :: JSVal -> JSM Geolocation Source # fromJSValListOf :: JSVal -> JSM (Maybe [Geolocation]) Source # fromJSValUncheckedListOf :: JSVal -> JSM [Geolocation] Source # | |
data GeolocationError Source #
Geolocation errors
Constructors
| GeolocationError GeolocationErrorCode MisoString |
Instances
| Show GeolocationError Source # | |
Defined in Miso.Navigator Methods showsPrec :: Int -> GeolocationError -> ShowS # show :: GeolocationError -> String # showList :: [GeolocationError] -> ShowS # | |
| Eq GeolocationError Source # | |
Defined in Miso.Navigator Methods (==) :: GeolocationError -> GeolocationError -> Bool # (/=) :: GeolocationError -> GeolocationError -> Bool # | |
| FromJSVal GeolocationError Source # | |
Defined in Miso.Navigator Methods fromJSVal :: JSVal -> JSM (Maybe GeolocationError) Source # fromJSValUnchecked :: JSVal -> JSM GeolocationError Source # fromJSValListOf :: JSVal -> JSM (Maybe [GeolocationError]) Source # fromJSValUncheckedListOf :: JSVal -> JSM [GeolocationError] Source # | |
data GeolocationErrorCode Source #
Geolocation error code
Constructors
| PERMISSION_DENIED | |
| POSITION_UNAVAILABLE | |
| TIMEOUT |