bitwarden_error/
wasm.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
use wasm_bindgen::prelude::*;

#[cfg_attr(feature = "wasm", wasm_bindgen)]
extern "C" {
    #[wasm_bindgen(js_name = Error)]
    pub type SdkJsError;

    #[wasm_bindgen(constructor, js_class = Error)]
    pub fn new(message: String) -> SdkJsError;

    #[wasm_bindgen(method, getter, structural)]
    pub fn message(this: &SdkJsError) -> String;

    #[wasm_bindgen(method, getter, structural)]
    pub fn name(this: &SdkJsError) -> String;

    #[wasm_bindgen(method, setter, structural)]
    pub fn set_name(this: &SdkJsError, name: String);

    #[wasm_bindgen(method, getter, structural)]
    pub fn variant(this: &SdkJsError) -> String;

    #[wasm_bindgen(method, setter, structural)]
    pub fn set_variant(this: &SdkJsError, variant: String);
}