Skip to main content

beamterm_renderer/
lib.rs

1//! # Stability Policy
2//!
3//! beamterm-renderer's public API includes types from the following third-party crates:
4//!
5//! | Crate            | Types exposed                                                                | Re-exported as                                    |
6//! |------------------|------------------------------------------------------------------------------|---------------------------------------------------|
7//! | [`glow`]         | [`glow::Context`] via [`Terminal::gl()`]                                     | [`beamterm_renderer::glow`](glow)                 |
8//! | [`compact_str`]  | [`CompactString`](compact_str::CompactString) in return types                | [`beamterm_renderer::compact_str`](compact_str)   |
9//! | [`web_sys`]      | [`HtmlCanvasElement`](web_sys::HtmlCanvasElement) via [`Terminal::canvas()`] | [`beamterm_renderer::web_sys`](web_sys)           |
10//! | [`js_sys`]       | [`Array`](js_sys::Array), [`Function`](js_sys::Function) in WASM bindings    | [`beamterm_renderer::js_sys`](js_sys)             |
11//! | [`wasm_bindgen`] | [`JsValue`](wasm_bindgen::JsValue) in WASM bindings                          | [`beamterm_renderer::wasm_bindgen`](wasm_bindgen) |
12//!
13//! These crates are re-exported so that downstream users can depend on
14//! beamterm-renderer's re-exports without adding separate dependencies
15//! or worrying about version mismatches.
16//!
17//! **Semver policy**: A dependency version bump is only considered a
18//! beamterm breaking change if the type signatures used in beamterm's
19//! public API actually change. A version bump that preserves the same
20//! type signatures is a compatible update.
21
22mod error;
23mod gl;
24mod terminal;
25
26pub(crate) mod js;
27
28#[cfg(feature = "js-api")]
29pub mod wasm;
30
31pub mod mouse;
32
33// Re-export third-party crates that appear in beamterm's public API.
34// Downstream users can depend on these re-exports instead of adding
35// separate dependencies or worrying about version mismatches.
36// Re-export platform-agnostic types from beamterm-core
37pub use ::beamterm_data::{DebugSpacePattern, GlyphEffect};
38pub use beamterm_core::{
39    CellSize, CursorPosition, FontAtlasData, FontStyle, GlslVersion, SerializationError,
40    TerminalSize, UrlMatch, compact_str, find_url_at_cursor, glow, is_double_width, is_emoji,
41};
42pub use js_sys;
43pub use terminal::*;
44pub use wasm_bindgen;
45pub use web_sys;
46
47pub use crate::{error::Error, gl::*};
48
49#[cfg(test)]
50mod tests {
51    use beamterm_data::FontAtlasData;
52
53    #[test]
54    fn test_font_atlas_config_deserialization() {
55        let _ = FontAtlasData::default();
56    }
57}