web_sys/features/
gen_Geolocation.rs1#![allow(unused_imports)]
2#![allow(clippy::all)]
3use super::*;
4use wasm_bindgen::prelude::*;
5#[wasm_bindgen]
6extern "C" {
7 # [wasm_bindgen (is_type_of = | _ | false , extends = :: js_sys :: Object , js_name = Geolocation , typescript_type = "Geolocation")]
8 #[derive(Debug, Clone, PartialEq, Eq)]
9 #[doc = "The `Geolocation` class."]
10 #[doc = ""]
11 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Geolocation)"]
12 #[doc = ""]
13 #[doc = "*This API requires the following crate features to be activated: `Geolocation`*"]
14 pub type Geolocation;
15 # [wasm_bindgen (method , structural , js_class = "Geolocation" , js_name = clearWatch)]
16 #[doc = "The `clearWatch()` method."]
17 #[doc = ""]
18 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Geolocation/clearWatch)"]
19 #[doc = ""]
20 #[doc = "*This API requires the following crate features to be activated: `Geolocation`*"]
21 pub fn clear_watch(this: &Geolocation, watch_id: i32);
22 # [wasm_bindgen (catch , method , structural , js_class = "Geolocation" , js_name = getCurrentPosition)]
23 #[doc = "The `getCurrentPosition()` method."]
24 #[doc = ""]
25 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Geolocation/getCurrentPosition)"]
26 #[doc = ""]
27 #[doc = "*This API requires the following crate features to be activated: `Geolocation`*"]
28 pub fn get_current_position(
29 this: &Geolocation,
30 success_callback: &::js_sys::Function,
31 ) -> Result<(), JsValue>;
32 # [wasm_bindgen (catch , method , structural , js_class = "Geolocation" , js_name = getCurrentPosition)]
33 #[doc = "The `getCurrentPosition()` method."]
34 #[doc = ""]
35 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Geolocation/getCurrentPosition)"]
36 #[doc = ""]
37 #[doc = "*This API requires the following crate features to be activated: `Geolocation`*"]
38 pub fn get_current_position_with_error_callback(
39 this: &Geolocation,
40 success_callback: &::js_sys::Function,
41 error_callback: Option<&::js_sys::Function>,
42 ) -> Result<(), JsValue>;
43 #[cfg(feature = "PositionOptions")]
44 # [wasm_bindgen (catch , method , structural , js_class = "Geolocation" , js_name = getCurrentPosition)]
45 #[doc = "The `getCurrentPosition()` method."]
46 #[doc = ""]
47 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Geolocation/getCurrentPosition)"]
48 #[doc = ""]
49 #[doc = "*This API requires the following crate features to be activated: `Geolocation`, `PositionOptions`*"]
50 pub fn get_current_position_with_error_callback_and_options(
51 this: &Geolocation,
52 success_callback: &::js_sys::Function,
53 error_callback: Option<&::js_sys::Function>,
54 options: &PositionOptions,
55 ) -> Result<(), JsValue>;
56 # [wasm_bindgen (catch , method , structural , js_class = "Geolocation" , js_name = watchPosition)]
57 #[doc = "The `watchPosition()` method."]
58 #[doc = ""]
59 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Geolocation/watchPosition)"]
60 #[doc = ""]
61 #[doc = "*This API requires the following crate features to be activated: `Geolocation`*"]
62 pub fn watch_position(
63 this: &Geolocation,
64 success_callback: &::js_sys::Function,
65 ) -> Result<i32, JsValue>;
66 # [wasm_bindgen (catch , method , structural , js_class = "Geolocation" , js_name = watchPosition)]
67 #[doc = "The `watchPosition()` method."]
68 #[doc = ""]
69 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Geolocation/watchPosition)"]
70 #[doc = ""]
71 #[doc = "*This API requires the following crate features to be activated: `Geolocation`*"]
72 pub fn watch_position_with_error_callback(
73 this: &Geolocation,
74 success_callback: &::js_sys::Function,
75 error_callback: Option<&::js_sys::Function>,
76 ) -> Result<i32, JsValue>;
77 #[cfg(feature = "PositionOptions")]
78 # [wasm_bindgen (catch , method , structural , js_class = "Geolocation" , js_name = watchPosition)]
79 #[doc = "The `watchPosition()` method."]
80 #[doc = ""]
81 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Geolocation/watchPosition)"]
82 #[doc = ""]
83 #[doc = "*This API requires the following crate features to be activated: `Geolocation`, `PositionOptions`*"]
84 pub fn watch_position_with_error_callback_and_options(
85 this: &Geolocation,
86 success_callback: &::js_sys::Function,
87 error_callback: Option<&::js_sys::Function>,
88 options: &PositionOptions,
89 ) -> Result<i32, JsValue>;
90}