electron_sys/module/
remote.rs1use crate::{
2 class::{BrowserWindow, WebContents},
3 interface::Process,
4};
5use wasm_bindgen::prelude::*;
6
7#[wasm_bindgen(module = "electron")]
8extern {
9 #[wasm_bindgen]
10 pub type Remote;
11
12 pub static remote: Remote;
13
14 #[wasm_bindgen(method, js_name = "getCurrentWebContents")]
19 pub fn get_current_web_contents(this: &Remote) -> WebContents;
20
21 #[wasm_bindgen(method, js_name = "getCurrentWindow")]
22 pub fn get_current_window(this: &Remote) -> BrowserWindow;
23
24 #[wasm_bindgen(method, js_name = "getGlobal")]
25 pub fn get_global(this: &Remote, name: &str) -> JsValue;
26
27 #[wasm_bindgen(method)]
28 pub fn require(this: &Remote, module: &str) -> JsValue;
29
30 #[wasm_bindgen(method, getter)] pub fn process(this: &Remote) -> Process;
36}