1#![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 #[cfg(not(web_sys_unstable_apis))]
23 # [wasm_bindgen (catch , method , structural , js_class = "Geolocation" , js_name = getCurrentPosition)]
24 #[doc = "The `getCurrentPosition()` method."]
25 #[doc = ""]
26 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Geolocation/getCurrentPosition)"]
27 #[doc = ""]
28 #[doc = "*This API requires the following crate features to be activated: `Geolocation`*"]
29 pub fn get_current_position(
30 this: &Geolocation,
31 success_callback: &::js_sys::Function,
32 ) -> Result<(), JsValue>;
33 #[cfg(not(web_sys_unstable_apis))]
34 # [wasm_bindgen (catch , method , structural , js_class = "Geolocation" , js_name = getCurrentPosition)]
35 #[doc = "The `getCurrentPosition()` method."]
36 #[doc = ""]
37 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Geolocation/getCurrentPosition)"]
38 #[doc = ""]
39 #[doc = "*This API requires the following crate features to be activated: `Geolocation`*"]
40 pub fn get_current_position_with_error_callback(
41 this: &Geolocation,
42 success_callback: &::js_sys::Function,
43 error_callback: Option<&::js_sys::Function>,
44 ) -> Result<(), JsValue>;
45 #[cfg(not(web_sys_unstable_apis))]
46 #[cfg(feature = "PositionOptions")]
47 # [wasm_bindgen (catch , method , structural , js_class = "Geolocation" , js_name = getCurrentPosition)]
48 #[doc = "The `getCurrentPosition()` method."]
49 #[doc = ""]
50 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Geolocation/getCurrentPosition)"]
51 #[doc = ""]
52 #[doc = "*This API requires the following crate features to be activated: `Geolocation`, `PositionOptions`*"]
53 pub fn get_current_position_with_error_callback_and_options(
54 this: &Geolocation,
55 success_callback: &::js_sys::Function,
56 error_callback: Option<&::js_sys::Function>,
57 options: &PositionOptions,
58 ) -> Result<(), JsValue>;
59 #[cfg(web_sys_unstable_apis)]
60 #[cfg(feature = "GeolocationPosition")]
61 # [wasm_bindgen (method , structural , js_class = "Geolocation" , js_name = getCurrentPosition)]
62 #[doc = "The `getCurrentPosition()` method."]
63 #[doc = ""]
64 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Geolocation/getCurrentPosition)"]
65 #[doc = ""]
66 #[doc = "*This API requires the following crate features to be activated: `Geolocation`, `GeolocationPosition`*"]
67 #[doc = ""]
68 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
69 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
70 pub fn get_current_position(
71 this: &Geolocation,
72 success_callback: &::js_sys::Function<fn(GeolocationPosition) -> ::js_sys::Undefined>,
73 );
74 #[cfg(web_sys_unstable_apis)]
75 #[cfg(all(feature = "GeolocationPosition", feature = "GeolocationPositionError",))]
76 # [wasm_bindgen (method , structural , js_class = "Geolocation" , js_name = getCurrentPosition)]
77 #[doc = "The `getCurrentPosition()` method."]
78 #[doc = ""]
79 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Geolocation/getCurrentPosition)"]
80 #[doc = ""]
81 #[doc = "*This API requires the following crate features to be activated: `Geolocation`, `GeolocationPosition`, `GeolocationPositionError`*"]
82 #[doc = ""]
83 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
84 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
85 pub fn get_current_position_with_error_callback(
86 this: &Geolocation,
87 success_callback: &::js_sys::Function<fn(GeolocationPosition) -> ::js_sys::Undefined>,
88 error_callback: Option<
89 &::js_sys::Function<fn(GeolocationPositionError) -> ::js_sys::Undefined>,
90 >,
91 );
92 #[cfg(web_sys_unstable_apis)]
93 #[cfg(all(
94 feature = "GeolocationPosition",
95 feature = "GeolocationPositionError",
96 feature = "PositionOptions",
97 ))]
98 # [wasm_bindgen (method , structural , js_class = "Geolocation" , js_name = getCurrentPosition)]
99 #[doc = "The `getCurrentPosition()` method."]
100 #[doc = ""]
101 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Geolocation/getCurrentPosition)"]
102 #[doc = ""]
103 #[doc = "*This API requires the following crate features to be activated: `Geolocation`, `GeolocationPosition`, `GeolocationPositionError`, `PositionOptions`*"]
104 #[doc = ""]
105 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
106 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
107 pub fn get_current_position_with_error_callback_and_options(
108 this: &Geolocation,
109 success_callback: &::js_sys::Function<fn(GeolocationPosition) -> ::js_sys::Undefined>,
110 error_callback: Option<
111 &::js_sys::Function<fn(GeolocationPositionError) -> ::js_sys::Undefined>,
112 >,
113 options: &PositionOptions,
114 );
115 #[cfg(not(web_sys_unstable_apis))]
116 # [wasm_bindgen (catch , method , structural , js_class = "Geolocation" , js_name = watchPosition)]
117 #[doc = "The `watchPosition()` method."]
118 #[doc = ""]
119 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Geolocation/watchPosition)"]
120 #[doc = ""]
121 #[doc = "*This API requires the following crate features to be activated: `Geolocation`*"]
122 pub fn watch_position(
123 this: &Geolocation,
124 success_callback: &::js_sys::Function,
125 ) -> Result<i32, JsValue>;
126 #[cfg(not(web_sys_unstable_apis))]
127 # [wasm_bindgen (catch , method , structural , js_class = "Geolocation" , js_name = watchPosition)]
128 #[doc = "The `watchPosition()` method."]
129 #[doc = ""]
130 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Geolocation/watchPosition)"]
131 #[doc = ""]
132 #[doc = "*This API requires the following crate features to be activated: `Geolocation`*"]
133 pub fn watch_position_with_error_callback(
134 this: &Geolocation,
135 success_callback: &::js_sys::Function,
136 error_callback: Option<&::js_sys::Function>,
137 ) -> Result<i32, JsValue>;
138 #[cfg(not(web_sys_unstable_apis))]
139 #[cfg(feature = "PositionOptions")]
140 # [wasm_bindgen (catch , method , structural , js_class = "Geolocation" , js_name = watchPosition)]
141 #[doc = "The `watchPosition()` method."]
142 #[doc = ""]
143 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Geolocation/watchPosition)"]
144 #[doc = ""]
145 #[doc = "*This API requires the following crate features to be activated: `Geolocation`, `PositionOptions`*"]
146 pub fn watch_position_with_error_callback_and_options(
147 this: &Geolocation,
148 success_callback: &::js_sys::Function,
149 error_callback: Option<&::js_sys::Function>,
150 options: &PositionOptions,
151 ) -> Result<i32, JsValue>;
152 #[cfg(web_sys_unstable_apis)]
153 #[cfg(feature = "GeolocationPosition")]
154 # [wasm_bindgen (method , structural , js_class = "Geolocation" , js_name = watchPosition)]
155 #[doc = "The `watchPosition()` method."]
156 #[doc = ""]
157 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Geolocation/watchPosition)"]
158 #[doc = ""]
159 #[doc = "*This API requires the following crate features to be activated: `Geolocation`, `GeolocationPosition`*"]
160 #[doc = ""]
161 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
162 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
163 pub fn watch_position(
164 this: &Geolocation,
165 success_callback: &::js_sys::Function<fn(GeolocationPosition) -> ::js_sys::Undefined>,
166 ) -> i32;
167 #[cfg(web_sys_unstable_apis)]
168 #[cfg(all(feature = "GeolocationPosition", feature = "GeolocationPositionError",))]
169 # [wasm_bindgen (method , structural , js_class = "Geolocation" , js_name = watchPosition)]
170 #[doc = "The `watchPosition()` method."]
171 #[doc = ""]
172 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Geolocation/watchPosition)"]
173 #[doc = ""]
174 #[doc = "*This API requires the following crate features to be activated: `Geolocation`, `GeolocationPosition`, `GeolocationPositionError`*"]
175 #[doc = ""]
176 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
177 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
178 pub fn watch_position_with_error_callback(
179 this: &Geolocation,
180 success_callback: &::js_sys::Function<fn(GeolocationPosition) -> ::js_sys::Undefined>,
181 error_callback: Option<
182 &::js_sys::Function<fn(GeolocationPositionError) -> ::js_sys::Undefined>,
183 >,
184 ) -> i32;
185 #[cfg(web_sys_unstable_apis)]
186 #[cfg(all(
187 feature = "GeolocationPosition",
188 feature = "GeolocationPositionError",
189 feature = "PositionOptions",
190 ))]
191 # [wasm_bindgen (method , structural , js_class = "Geolocation" , js_name = watchPosition)]
192 #[doc = "The `watchPosition()` method."]
193 #[doc = ""]
194 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Geolocation/watchPosition)"]
195 #[doc = ""]
196 #[doc = "*This API requires the following crate features to be activated: `Geolocation`, `GeolocationPosition`, `GeolocationPositionError`, `PositionOptions`*"]
197 #[doc = ""]
198 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
199 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
200 pub fn watch_position_with_error_callback_and_options(
201 this: &Geolocation,
202 success_callback: &::js_sys::Function<fn(GeolocationPosition) -> ::js_sys::Undefined>,
203 error_callback: Option<
204 &::js_sys::Function<fn(GeolocationPositionError) -> ::js_sys::Undefined>,
205 >,
206 options: &PositionOptions,
207 ) -> i32;
208}