Skip to main content

freya_core/
lib.rs

1pub mod accessibility;
2pub mod animation_clock;
3pub mod current_context;
4pub mod cursor;
5pub mod data;
6pub mod debug;
7pub mod diff_key;
8pub mod element;
9pub mod elements;
10pub mod event_handler;
11pub mod events;
12pub mod events_combos;
13pub mod extended_hashmap;
14pub mod fifo_cache;
15pub mod helpers;
16pub mod hooks;
17pub mod layers;
18pub mod lifecycle;
19pub mod lru_cache;
20pub mod node_id;
21pub mod notify;
22pub mod path_element;
23pub mod platform;
24pub mod reactive_context;
25pub mod render_pipeline;
26pub mod rendering_ticker;
27pub mod runner;
28pub mod scope;
29pub mod scope_id;
30pub mod style;
31pub mod text_cache;
32pub mod tree;
33pub mod tree_layout_adapter;
34pub mod user_event;
35
36#[cfg(feature = "hotreload")]
37pub mod hotreload {
38    pub use dioxus_devtools::*;
39}
40
41/// Used by all end users.
42pub mod prelude {
43    pub use bytes::Bytes;
44    pub use cursor_icon::CursorIcon;
45    pub use keyboard_types::{
46        Code,
47        Key,
48        Modifiers,
49        NamedKey,
50    };
51
52    pub use crate::{
53        accessibility::{
54            focus::*,
55            focus_strategy::*,
56            focusable::*,
57            id::{
58                AccessibilityId,
59                AccessibilityRole,
60            },
61            screen_reader::*,
62        },
63        animation_clock::AnimationClock,
64        cursor::*,
65        data::*,
66        debug::*,
67        diff_key::DiffKey,
68        element::RenderContext,
69        element::{
70            App,
71            Component,
72            ComponentKey,
73            ComponentOwned,
74            Element,
75            IntoElement,
76        },
77        elements::{
78            extensions::*,
79            image::{
80                AspectRatio,
81                ImageCover,
82                // The image element is hidden on purpose as its a "low level" element, users should rather use the `ImageViewer` component.
83                SamplingMode,
84            },
85            label::{
86                Label,
87                TextWidth,
88                label,
89            },
90            paragraph::{
91                Paragraph,
92                ParagraphHolder,
93                Span,
94                paragraph,
95            },
96            rect::{
97                Rect,
98                rect,
99            },
100            svg::{
101                Svg,
102                SvgBytes,
103                svg,
104            },
105        },
106        event_handler::{
107            Callback,
108            EventHandler,
109            NoArgCallback,
110        },
111        events::data::*,
112        events::modifiers::*,
113        events::*,
114        events_combos::*,
115        hooks::previous_and_current::*,
116        hooks::use_id::*,
117        layers::Layer,
118        lifecycle::{
119            base::*,
120            context::*,
121            effect::*,
122            future_task::*,
123            memo::*,
124            reactive::*,
125            readable::*,
126            state::*,
127            task::*,
128            writable::*,
129            writable_utils::*,
130        },
131        platform::*,
132        reactive_context::ReactiveContext,
133        rendering_ticker::RenderingTicker,
134        scope_id::ScopeId,
135        style::{
136            border::*,
137            color::*,
138            corner_radius::*,
139            cursor::*,
140            fill::*,
141            font_slant::*,
142            font_weight::*,
143            font_width::*,
144            gradient::*,
145            scale::*,
146            shader::*,
147            shadow::*,
148            text_align::*,
149            text_decoration::*,
150            text_height::*,
151            text_overflow::*,
152            text_shadow::*,
153            vertical_align::*,
154        },
155        user_event::UserEvent,
156    };
157}
158
159/// Used by renderers such as freya-testing, freya-winit or just integration crates.
160pub mod integration {
161    pub use rustc_hash::*;
162
163    pub use crate::{
164        accessibility::{
165            dirty_nodes::*,
166            focus_strategy::*,
167            id::*,
168            screen_reader::*,
169            tree::*,
170        },
171        animation_clock::AnimationClock,
172        data::*,
173        element::*,
174        elements::extensions::*,
175        events::{
176            data::*,
177            executor::*,
178            measurer::*,
179            modifiers::*,
180            name::*,
181            platform::*,
182        },
183        lifecycle::{
184            state::State,
185            writable_utils::WritableUtils,
186        },
187        node_id::NodeId,
188        platform::*,
189        render_pipeline::RenderPipeline,
190        rendering_ticker::*,
191        runner::Runner,
192        scope_id::ScopeId,
193        style::default_fonts::default_fonts,
194        tree::{
195            DiffModifies,
196            Tree,
197        },
198        user_event::*,
199    };
200}