Skip to main content

purview_gpui/
aliases.rs

1//! Type aliases fixing `Cx = gpui::App`, plus re-exports of purview's
2//! non-generic types, so gpui hosts avoid spelling `<App>` everywhere.
3
4use gpui::App;
5
6/// [`purview::AppHandle`] over gpui's `App`.
7pub type PvApp = purview::AppHandle<App>;
8/// [`purview::Window`] over gpui's `App` (avoids the `gpui::Window` name
9/// clash).
10pub type PvWindow = purview::Window<App>;
11/// [`purview::Blocks`] over gpui's `App`.
12pub type PvBlocks<'a> = purview::Blocks<'a, App>;
13/// [`purview::Actions`] over gpui's `App`.
14pub type PvActions<'a> = purview::Actions<'a, App>;
15/// [`purview::FieldsHandle`] over gpui's `App`.
16pub type PvFields = purview::FieldsHandle<App>;
17/// [`purview::TableHandle`] over gpui's `App`.
18pub type PvTable = purview::TableHandle<App>;
19/// [`purview::ListHandle`] over gpui's `App`.
20pub type PvList = purview::ListHandle<App>;
21/// [`purview::TextHandle`] over gpui's `App`.
22pub type PvText = purview::TextHandle<App>;
23/// [`purview::NoticeHandle`] over gpui's `App`.
24pub type PvNotice = purview::NoticeHandle<App>;
25/// [`purview::MediaHandle`] over gpui's `App`.
26pub type PvMedia = purview::MediaHandle<App>;
27/// [`purview::BlockHandle`] over gpui's `App`.
28pub type PvBlock = purview::BlockHandle<App>;
29/// [`purview::ActionHandle`] over gpui's `App`.
30pub type PvAction = purview::ActionHandle<App>;
31/// [`purview::BlockRef`] over gpui's `App`.
32pub type PvBlockRef = purview::BlockRef<App>;
33/// [`purview::Ui`] over gpui's `App` — the main-thread proxy an `async` handler
34/// captures to hop back with `ui.run(|app| …).await`.
35pub type PvUi = purview::Ui<App>;
36
37// Non-generic purview types + the `on_ui` entry point — no name clash with
38// gpui, so `use purview_gpui::*` is safe alongside `use gpui::*`.
39pub use purview::{ActionError, Block, Field, NoArgs, Outcome, Severity, on_ui};