electron_sys/module/
session.rs

1use crate::{class::Session, interface::FromPartitionOptions};
2use node_sys::events::EventEmitter;
3use wasm_bindgen::prelude::*;
4
5#[wasm_bindgen(module = "electron")]
6extern {
7    #[wasm_bindgen(extends = EventEmitter)]
8    #[derive(Clone, Debug)]
9    /// Docs: http://electronjs.org/docs/api/session
10    pub type SessionModule;
11
12    //******************//
13    // Instance Methods //
14    //******************//
15
16    #[wasm_bindgen(method, js_name = "fromPartition")]
17    pub fn from_partition(this: &SessionModule, partition: &str, options: Option<FromPartitionOptions>) -> Session;
18
19    //*********************//
20    // Instance Properties //
21    //*********************//
22
23    #[wasm_bindgen(method, getter, js_name = "defaultSession")]
24    pub fn default_session(this: &SessionModule) -> Session;
25}