extern crate self as lingxia;
pub use host_addon::{HostAddon, register_host_addon};
pub use lingxia_native_macros::native;
pub use lxapp::host;
pub use lxapp::host::{ChannelContext, ChannelMessage, StreamContext};
pub use lxapp::set_automation_auto_grant;
pub use lxapp::{
FloatDismiss, LxApp, LxAppSecurityPrivilege, PageQueryInput, PageSurface, PageSurfaceRequest,
PageSurfaceTarget, SurfaceInteraction, SurfaceKind, SurfacePosition, SurfaceRole,
UrlCallbackSurface, UrlCallbackWaitError,
};
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct RuntimeInfo {
lxapp_id: Option<String>,
}
impl RuntimeInfo {
pub(crate) fn new(lxapp_id: Option<String>) -> Self {
Self { lxapp_id }
}
pub fn lxapp_id(&self) -> Option<&str> {
self.lxapp_id.as_deref()
}
pub fn into_lxapp_id(self) -> Option<String> {
self.lxapp_id
}
}
#[cfg(feature = "automation-runtime")]
pub mod automation_runtime {
pub use lingxia_automation::runtime::*;
}
pub mod app;
pub use app::{home_app_id, lingxia_id, product_version};
mod applink;
mod bootstrap;
mod capabilities;
#[cfg(feature = "devtool")]
pub mod dev {
pub use crate::devtool::{
DeviceController, DeviceEntry, DeviceState, LxAppDevConfig, LxAppDevIdentity,
LxAppDevPageInfo, LxAppDevPageWaitResult, LxAppDevPageWaitState, device_get, device_list,
device_set, install_lxapp_dev_config, install_lxapp_dev_config_from_env, list_app_windows,
lxapp_dev_nav_back, lxapp_dev_nav_redirect, lxapp_dev_nav_relaunch,
lxapp_dev_nav_switch_tab, lxapp_dev_nav_to, lxapp_dev_page_back, lxapp_dev_page_click,
lxapp_dev_page_current, lxapp_dev_page_eval, lxapp_dev_page_fill, lxapp_dev_page_info,
lxapp_dev_page_input_supported, lxapp_dev_page_list, lxapp_dev_page_press,
lxapp_dev_page_query, lxapp_dev_page_screenshot, lxapp_dev_page_screenshot_with_info,
lxapp_dev_page_scroll, lxapp_dev_page_scroll_to, lxapp_dev_page_type, lxapp_dev_page_wait,
lxapp_dev_restart, perform_app_keyboard, perform_app_mouse, register_device_controller,
take_app_screenshot, take_app_screenshot_with_info,
};
pub use lingxia_platform::traits::keyboard::{
AppKeyboardAction, AppKeyboardModifier, AppKeyboardRequest, AppKeyboardResult,
};
pub use lingxia_platform::traits::mouse::{
AppMouseAction, AppMouseButton, AppMouseRequest, AppMouseResult,
};
}
pub mod device;
#[cfg(feature = "devtool")]
mod devtool;
mod error;
pub mod file;
mod host_addon;
#[cfg(feature = "standard")]
pub mod js;
pub mod location;
mod logging;
pub mod media;
pub mod network;
pub mod provider;
mod runtime;
pub(crate) mod shell;
pub mod task;
#[cfg(feature = "terminal-runtime")]
pub mod terminal {
pub use lingxia_terminal::{
BackendStatus, TerminalBackend, TerminalCell, TerminalSnapshot, ghostty_available,
ghostty_status, ghostty_status_json, terminal_close, terminal_create, terminal_exited,
terminal_read, terminal_resize, terminal_scroll, terminal_snapshot, terminal_snapshot_data,
terminal_write,
};
}
pub mod update;
pub mod url_callback;
#[cfg(any(
target_os = "android",
target_os = "ios",
target_os = "macos",
target_env = "ohos"
))]
mod webview_error;
pub mod wifi;
pub use error::{Error, Result};
pub mod log {
pub use crate::logging::{DownstreamLoggerError, register_downstream_logger};
pub use ::log::{debug, error, info, trace, warn};
pub use lingxia_log::{
AttachedLogStream, LogLevel, LogMessage, LogStreamError, LogTag, attach_log_stream,
attach_log_stream_default,
};
}
#[cfg(target_os = "android")]
#[path = "ffi/android.rs"]
pub mod android;
#[cfg(any(target_os = "ios", target_os = "macos"))]
#[path = "ffi/apple.rs"]
#[allow(clippy::enum_variant_names)]
pub mod apple;
#[cfg(target_env = "ohos")]
#[path = "ffi/harmony.rs"]
pub mod harmony;
#[cfg(target_os = "windows")]
pub mod windows;
pub(crate) mod browser;
pub(crate) mod push;
pub(crate) use bootstrap::init_with_platform;
#[cfg(any(
target_os = "android",
target_os = "ios",
target_os = "macos",
target_env = "ohos"
))]
pub(crate) fn should_enable_webview_debugging() -> bool {
lxapp::is_dev_session()
}