web_sys/features/
gen_CaretPosition.rs1#![allow(unused_imports)]
2#![allow(clippy::all)]
3use super::*;
4use wasm_bindgen::prelude::*;
5#[wasm_bindgen]
6extern "C" {
7 #[wasm_bindgen(
8 extends = "::js_sys::Object",
9 js_name = "CaretPosition",
10 typescript_type = "CaretPosition"
11 )]
12 #[derive(Debug, Clone, PartialEq, Eq)]
13 #[doc = "The `CaretPosition` class."]
14 #[doc = ""]
15 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CaretPosition)"]
16 #[doc = ""]
17 #[doc = "*This API requires the following crate features to be activated: `CaretPosition`*"]
18 pub type CaretPosition;
19 #[cfg(feature = "Node")]
20 #[wasm_bindgen(method, getter, js_class = "CaretPosition", js_name = "offsetNode")]
21 #[doc = "Getter for the `offsetNode` field of this object."]
22 #[doc = ""]
23 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CaretPosition/offsetNode)"]
24 #[doc = ""]
25 #[doc = "*This API requires the following crate features to be activated: `CaretPosition`, `Node`*"]
26 pub fn offset_node(this: &CaretPosition) -> Option<Node>;
27 #[wasm_bindgen(method, getter, js_class = "CaretPosition", js_name = "offset")]
28 #[doc = "Getter for the `offset` field of this object."]
29 #[doc = ""]
30 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CaretPosition/offset)"]
31 #[doc = ""]
32 #[doc = "*This API requires the following crate features to be activated: `CaretPosition`*"]
33 pub fn offset(this: &CaretPosition) -> u32;
34 #[cfg(feature = "DomRect")]
35 #[wasm_bindgen(method, js_class = "CaretPosition", js_name = "getClientRect")]
36 #[doc = "The `getClientRect()` method."]
37 #[doc = ""]
38 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CaretPosition/getClientRect)"]
39 #[doc = ""]
40 #[doc = "*This API requires the following crate features to be activated: `CaretPosition`, `DomRect`*"]
41 pub fn get_client_rect(this: &CaretPosition) -> Option<DomRect>;
42}