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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
//! This module provides functionalities for
//! manipulating the actual Document Object Model in the browser

pub use callback::Callback;
pub use component::{Component, Container, Widget};
pub use effects::Effects;
pub use modifier::Modifier;
pub use task::Task;

mod callback;
mod component;
mod effects;
mod modifier;
mod task;

use cfg_if::cfg_if;

cfg_if! {if #[cfg(feature = "with-dom")] {
    pub use application::{Application, Measurements};
    #[cfg(feature = "custom_element")]
    pub use custom_element::{register_custom_element, CustomElement, WebComponent};
    pub use dom_patch::{DomPatch, PatchVariant};
    pub use http::Http;
    pub use program::{MountAction, MountTarget, Program};
    pub use util::{
        document, history, now, performance,
        spawn_local, window, inject_style,
    };
    pub use raf::{request_animation_frame, AnimationFrameHandle};
    pub use ric::{request_idle_callback, IdleCallbackHandle};
    pub use timeout::{async_delay, request_timeout_callback, TimeoutCallbackHandle};
    pub use cmd::Cmd;
    use crate::dom::events::MountEvent;

    mod application;
    pub mod cmd;
    mod dom_node;
    #[cfg(feature = "custom_element")]
    mod custom_element;
    mod dom_patch;
    pub mod events;
    mod http;
    mod program;
    pub mod util;
    mod raf;
    mod ric;
    mod window;
    mod timeout;


    /// Map the Event to DomEvent, which are browser events
    #[derive(Debug, Clone, PartialEq, Eq)]
    pub enum Event {
        /// native dome events web_sys::Events
        WebEvent(web_sys::Event),
        /// custom event here follows
        MountEvent(MountEvent),
    }

}}

/// When event is not needed, such as just rendering the dom
/// tree in server side application
#[cfg(not(feature = "with-dom"))]
pub type Event = ();