#![allow(clippy::needless_doctest_main)]
#![deny(
missing_docs,
missing_debug_implementations,
bare_trait_objects,
anonymous_parameters,
elided_lifetimes_in_paths
)]
#![allow(macro_expanded_macro_exports_accessed_by_absolute_paths)]
#![recursion_limit = "512"]
extern crate self as yew;
use proc_macro_hack::proc_macro_hack;
#[proc_macro_hack(support_nested)]
pub use yew_macro::html;
#[doc(hidden)]
#[proc_macro_hack(support_nested)]
pub use yew_macro::html_nested;
pub mod macros {
pub use crate::html;
pub use crate::html_nested;
pub use yew_macro::Properties;
}
pub mod app;
pub mod callback;
pub mod components;
pub mod format;
pub mod html;
pub mod scheduler;
pub mod utils;
pub mod virtual_dom;
#[cfg(feature = "agent")]
pub mod agent;
#[cfg(feature = "services")]
pub mod services;
pub mod events {
pub use crate::html::{ChangeData, InputData};
pub use stdweb::web::event::{
BlurEvent, ClickEvent, ContextMenuEvent, DoubleClickEvent, DragDropEvent, DragEndEvent,
DragEnterEvent, DragEvent, DragExitEvent, DragLeaveEvent, DragOverEvent, DragStartEvent,
FocusEvent, GotPointerCaptureEvent, IKeyboardEvent, IMouseEvent, IPointerEvent,
KeyDownEvent, KeyPressEvent, KeyUpEvent, LostPointerCaptureEvent, MouseDownEvent,
MouseEnterEvent, MouseLeaveEvent, MouseMoveEvent, MouseOutEvent, MouseOverEvent,
MouseUpEvent, MouseWheelEvent, PointerCancelEvent, PointerDownEvent, PointerEnterEvent,
PointerLeaveEvent, PointerMoveEvent, PointerOutEvent, PointerOverEvent, PointerUpEvent,
ScrollEvent, SubmitEvent, TouchCancel, TouchEnd, TouchEnter, TouchMove, TouchStart,
};
}
pub fn initialize() {
stdweb::initialize();
}
pub fn run_loop() {
stdweb::event_loop();
}
pub fn start_app<COMP>()
where
COMP: Component,
COMP::Properties: Default,
{
initialize();
App::<COMP>::new().mount_to_body();
run_loop();
}
pub fn start_app_with_props<COMP>(props: COMP::Properties)
where
COMP: Component,
{
initialize();
App::<COMP>::new().mount_to_body_with_props(props);
run_loop();
}
pub mod prelude {
#[cfg(feature = "agent")]
pub use crate::agent::{Bridge, Bridged, Threaded};
pub use crate::app::App;
pub use crate::callback::Callback;
pub use crate::events::*;
pub use crate::html::{
Children, ChildrenWithProps, Component, ComponentLink, Href, Html, NodeRef, Properties,
Renderable, ShouldRender,
};
pub use crate::macros::*;
pub use crate::virtual_dom::Classes;
#[cfg(feature = "agent")]
pub mod worker {
pub use crate::agent::{
Agent, AgentLink, Bridge, Bridged, Context, Global, HandlerId, Job, Private, Public,
};
}
}
pub use self::prelude::*;