#![cfg_attr(not(feature = "js-appservice"), allow(dead_code, unused_imports))]
#[cfg(all(test, target_vendor = "apple"))]
#[path = "../../lingxia-platform/tests/support/apple_host_stubs.rs"]
mod apple_host_stubs;
mod appservice;
mod archive;
#[cfg(feature = "automation")]
pub mod automation;
pub(crate) mod bridge;
mod cache;
mod control_document_bootstrap;
mod delegate;
pub mod device;
mod error;
mod executor;
pub mod host;
pub mod lifecycle;
pub mod log {
pub use lingxia_log::{LogLevel, LogMessage, LogProvider};
}
pub mod inline_native;
#[cfg(feature = "js-appservice")]
pub mod lx;
mod lxapp;
mod native_authority;
mod native_component;
mod page;
pub(crate) mod plugin;
pub mod provider;
mod route;
pub mod startup;
pub mod terminal_automation;
#[cfg(feature = "test-utils")]
mod test_authority_harness;
mod update;
pub(crate) mod view_call;
pub const SDK_RUNTIME_VERSION: &str = env!("CARGO_PKG_VERSION");
#[cfg(feature = "js-appservice")]
pub use appservice::PageSvc;
pub use appservice::event_bus::{
APPEARANCE_CHANGE_EVENT, BROWSER_TAB_CLOSED_EVENT, DISPLAY_LANGUAGE_CHANGE_EVENT,
DISPLAY_LANGUAGE_STATE_CHANGE_EVENT, HOST_APPEARANCE_CHANGE_EVENT, publish_app_event,
publish_page_event,
};
#[cfg(feature = "js-appservice")]
pub use appservice::event_bus::{
AppHandlerUnsub, HandlerToken, app_handler_unsub, register_app_handler, register_page_handler,
unregister_app_handler, unregister_app_handler_token, unregister_page_handler,
};
#[doc(hidden)]
pub use bridge::{
DeferredRequiredV3Cancellation, PreparedRequiredV3Incoming, RequiredV3DocumentGate,
};
pub use cache::product::{
ClearReport as ProductCacheClearReport, clear as clear_product_cache,
usage_bytes as product_cache_usage_bytes,
};
pub use cache::touch_access_time;
pub use control_document_bootstrap::{
ControlDocumentAuthority, ControlDocumentBootstrap, ControlDocumentBootstrapError,
RequiredV3ExecutionGate, RequiredV3ExecutionPermit, issue_control_document_bootstrap,
};
pub use delegate::{LxAppDelegate, LxAppUiEventType};
pub use error::LxAppError;
pub use lifecycle::{
AppServiceEvent, AppServiceEventArgs, AppServiceEventReason, AppServiceEventSource,
PageLifecycleEvent,
};
pub use lingxia_platform::traits::ui::WindowChrome;
pub use lingxia_surface;
pub use lingxia_surface::{FloatDismiss, SurfaceInteraction};
pub use lingxia_update::default_channel;
pub use lingxia_update::{
Channel, RuntimeCompatibilityError, SemanticVersion, Version, VersionError,
};
pub use lingxia_webview::url_callback;
pub use lxapp::set_num_workers;
pub use lxapp::{
AppSessionClass, CloseReason, CreatePageInstanceRequest, CreatedPageInstance,
DisplayLanguageEffectiveSource, DisplayLanguageEffectiveUpdate, DisplayLanguagePreference,
DisplayLanguageSessionOwner, DisplayLanguageState, DisplayLanguageStateUpdate,
HOST_SURFACE_OWNER_APP_ID, HostAppearanceState, HostAppearanceUpdate,
HostMainSurfaceRegistration, HostSurfaceMenuExecution, LXAPP_MORE_ACTION_LIMIT, LanguageTag,
LxApp, LxAppMoreAction, LxAppMoreActions, LxAppOpenRegion, LxAppRuntimeInfo,
LxAppRuntimePageInfo, LxAppRuntimeSurfaceInfo, LxAppSecurityPrivilege, ManagedNativeSurface,
PageDefinition, PageInstanceEvent, PageInstanceRuntimeInfo, PageOwner, PageQueryInput,
PageSurface, PageSurfaceRequest, PageSurfaceTarget, PageTarget, PresentationKind, ResolvedPage,
SceneId, SurfaceKind, SurfacePosition, SurfaceRole, UrlCallbackSurface, UrlCallbackWaitError,
add_display_language_effective_listener, add_display_language_state_listener,
block_lxapp_admission, bundled_lxapp_asset_available,
clear_active_display_language_session_override, clear_display_language_session_override,
close_lxapp,
config::LxAppInfo,
create_page_instance, display_language, display_language_state, display_language_state_update,
dispose_page_instance, dispose_page_instance_by_id, drain_lxapps, ensure_builtin_lxapp,
ensure_control_lxapp, ensure_control_surface_lxapp, ensure_host_surface_owner, ensure_lxapp,
find_page_by_instance_id, get_current_lxapp, get_platform, host_appearance_dark,
host_appearance_state, host_class, init, initialize_display_language,
initialize_host_appearance, install_display_language_session_override, installed_lxapp_path,
is_dev_session, is_public_network_address, is_pull_down_refresh_enabled, list_lxapps,
mark_lxapp_active, navbar, notify_lxapp_host_visibility, notify_page_host_visibility,
notify_page_instance, notify_page_instance_by_id, on_low_memory, open_control_lxapp_page,
open_lxapp, open_region, page_chrome, refresh_auto_appearances,
refresh_display_language_system, refresh_host_appearance_system, register_builtin_asset_bundle,
register_dev_bundle_source, register_runner_host, register_surface_active_main_observer,
register_surface_close_observer, register_surface_context_observer,
register_surface_visibility_observer, register_synthetic_lxapp,
registry::{
display_icon_path as lxapp_display_icon_path, display_name as lxapp_display_name,
display_status as lxapp_registry_status, ensure_open_allowed,
notify_open_blocked as notify_lxapp_open_blocked,
refresh_registry as refresh_lxapp_registry, registry_unavailable_status,
set_open_blocked_listener as set_lxapp_open_blocked_listener,
set_registry_change_listener as set_lxapp_registry_change_listener,
},
restart_lxapp, resume_lxapp_admission, set_display_language_preference,
set_display_language_preference_in, set_host_appearance_preference, shutdown_lxapps_except,
subscribe_display_language_effective, subscribe_display_language_state,
subscribe_host_appearance, tabbar, terminate_lxapp, touch_page_instance_by_id, try_get,
uninstall_lxapp,
};
#[doc(hidden)]
pub use native_authority::NativeControlPlaneAuthority;
pub use native_component::{
NativeComponentHost, on_native_component_event, register_native_component_host,
};
pub use page::config::{OrientationConfig, PageOrientation};
pub use page::{
NavigationType, PageAutomationState, PageInstance, PageInstanceId, ViewCallOptions,
register_page_resolver, resolve_page_path,
};
pub use plugin::{build_plugin_page_path, parse_plugin_page_path, parse_plugin_url};
pub use provider::{
BoxFuture, FingerprintProvider, LxAppChannel, LxAppNetworkPermission, LxAppPermissions,
LxAppRegistryInfo, LxAppRegistryProvider, LxAppRegistryRequest, LxAppStatus, LxAppUpdateQuery,
NoOpProvider, Provider, ProviderError, ProviderErrorCode, ProviderErrorExt,
PushNotificationProvider, UpdateAuthentication, UpdatePackageInfo, UpdateProvider,
UpdateTarget, register_lxapp_registry_provider, register_provider,
};
pub use startup::{
LxAppStartupOptions, Scene, append_page_query, parse_channel, parse_optional_channel,
};
pub use update::{
DownloadedUpdateInfo, OtaUpdateTarget, UpdateManager, ensure_first_install,
ensure_target_version_ready, prepare_lxapp_open, schedule_lxapp_update_check,
};
pub(crate) use provider::get_provider;
pub fn js_appservice_supported() -> bool {
cfg!(feature = "js-appservice")
}
pub fn js_lxapp_supported() -> bool {
js_appservice_supported()
}
#[doc(hidden)]
pub mod __private {
pub use lingxia_log::{LogBuilder, LogLevel, LogTag};
}
#[macro_export]
macro_rules! info {
($($arg:tt)*) => {
$crate::__private::LogBuilder::new(
$crate::__private::LogTag::Native,
format!($($arg)*),
)
};
}
#[macro_export]
macro_rules! warn {
($($arg:tt)*) => {
$crate::__private::LogBuilder::new(
$crate::__private::LogTag::Native,
format!($($arg)*),
)
.with_level($crate::__private::LogLevel::Warn)
};
}
#[macro_export]
macro_rules! error {
($($arg:tt)*) => {
$crate::__private::LogBuilder::new(
$crate::__private::LogTag::Native,
format!($($arg)*),
)
.with_level($crate::__private::LogLevel::Error)
};
}
#[macro_export]
macro_rules! debug {
($($arg:tt)*) => {
$crate::__private::LogBuilder::new(
$crate::__private::LogTag::Native,
format!($($arg)*),
)
.with_level($crate::__private::LogLevel::Debug)
};
}
#[macro_export]
macro_rules! verbose {
($($arg:tt)*) => {
$crate::__private::LogBuilder::new(
$crate::__private::LogTag::Native,
format!($($arg)*),
)
.with_level($crate::__private::LogLevel::Verbose)
};
}