material_dioxus/list/
action_detail.rs

1use crate::list::ListIndex;
2use js_sys::Object;
3use wasm_bindgen::prelude::*;
4use wasm_bindgen::JsCast;
5
6/// The `ActionDetail` type
7///
8/// [MWC Documentation](https://github.com/material-components/material-components-web-components/tree/v0.27.0/packages/list#mwc-list-2)
9#[derive(Debug)]
10pub struct ActionDetail {
11    #[allow(dead_code)]
12    index: ListIndex,
13}
14
15impl From<JsValue> for ActionDetail {
16    fn from(value: JsValue) -> Self {
17        let detail = value.unchecked_into::<ActionDetailJs>();
18        let index = ListIndex::from(detail.index());
19        Self { index }
20    }
21}
22
23#[wasm_bindgen]
24extern "C" {
25    #[derive(Debug)]
26    #[wasm_bindgen(extends = Object)]
27    type ActionDetailJs;
28
29    #[wasm_bindgen(method, getter)]
30    pub fn index(this: &ActionDetailJs) -> JsValue;
31}