workflow_nw/
global.rs

1use js_sys::Object;
2use wasm_bindgen::prelude::*;
3
4#[wasm_bindgen]
5extern "C" {
6    type Global;
7
8    #[wasm_bindgen(getter, static_method_of = Global, js_class = global, js_name = global)]
9    fn get_global() -> Object;
10
11    #[wasm_bindgen(getter, catch, static_method_of = Global, js_class = globalThis, js_name = globalThis)]
12    fn get_global_this() -> Result<Object, JsValue>;
13
14}
15
16pub fn global() -> Object {
17    Global::get_global()
18}
19
20pub fn global_this() -> Object {
21    Global::get_global()
22}