Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix Geolocation's PositionOptions interface #850

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions api-reports/2_12.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17206,9 +17206,9 @@ PositionError[JO] val POSITION_UNAVAILABLE: Int
PositionError[JO] val TIMEOUT: Int
PositionError[JT] def code: Int
PositionError[JT] def message: String
PositionOptions[JC] var enableHighAccuracy: Boolean
PositionOptions[JC] var maximumAge: Int
PositionOptions[JC] var timeout: Int
PositionOptions[JT] var enableHighAccuracy: js.UndefOr[Boolean]
PositionOptions[JT] var maximumAge: js.UndefOr[Int]
PositionOptions[JT] var timeout: js.UndefOr[Int]
PresentationStyle[JT]
PresentationStyle[SO] val attachment: PresentationStyle
PresentationStyle[SO] val inline: PresentationStyle
Expand Down
6 changes: 3 additions & 3 deletions api-reports/2_13.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17206,9 +17206,9 @@ PositionError[JO] val POSITION_UNAVAILABLE: Int
PositionError[JO] val TIMEOUT: Int
PositionError[JT] def code: Int
PositionError[JT] def message: String
PositionOptions[JC] var enableHighAccuracy: Boolean
PositionOptions[JC] var maximumAge: Int
PositionOptions[JC] var timeout: Int
PositionOptions[JT] var enableHighAccuracy: js.UndefOr[Boolean]
PositionOptions[JT] var maximumAge: js.UndefOr[Int]
PositionOptions[JT] var timeout: js.UndefOr[Int]
PresentationStyle[JT]
PresentationStyle[SO] val attachment: PresentationStyle
PresentationStyle[SO] val inline: PresentationStyle
Expand Down
11 changes: 4 additions & 7 deletions dom/src/main/scala/org/scalajs/dom/PositionOptions.scala
Original file line number Diff line number Diff line change
Expand Up @@ -7,34 +7,31 @@
package org.scalajs.dom

import scala.scalajs.js
import scala.scalajs.js.annotation._

/** The PositionOptions interface describes the options to use when calling the geolocation backend. The user agent
* itself doesn't create such an object itself: it is the calling script that create it and use it as a parameter of
* Geolocation.getCurrentPosition() and Geolocation.watchPosition().
*/
@js.native
@JSGlobal
class PositionOptions extends js.Object {
trait PositionOptions extends js.Object {

/** The PositionOptions.enableHighAccuracy property is a Boolean that indicates the application would like to receive
* the best possible results. If true and if the device is able to provide a more accurate position, it will do so.
* Note that this can result in slower response times or increased power consumption (with a GPS chip on a mobile
* device for example). On the other hand, if false (the default value), the device can take the liberty to save
* resources by responding more quickly and/or using less power.
*/
var enableHighAccuracy: Boolean = js.native
var enableHighAccuracy: js.UndefOr[Boolean] = js.undefined

/** The PositionOptions.timeout property is a positive long value representing the maximum length of time (in
* milliseconds) the device is allowed to take in order to return a position. The default value is Infinity, meaning
* that getCurrentPosition() won't return until the position is available.
*/
var timeout: Int = js.native
var timeout: js.UndefOr[Int] = js.undefined

/** The PositionOptions.maximumAge property is a positive long value indicating the maximum age in milliseconds of a
* possible cached position that is acceptable to return. If set to 0, it means that the device cannot use a cached
* position and must attempt to retrieve the real current position. If set to Infinity the device must return a
* cached position regardless of its age.
*/
var maximumAge: Int = js.native
var maximumAge: js.UndefOr[Int] = js.undefined
}