JsUiSession class final
Owns or attaches to a Lemon JS host and manages one loaded JSUI page.
Constructors
- JsUiSession({JsEngine? engine, JsUiRuntime? runtime, JsConsoleSink? onConsole, JsUiInspector? inspector})
-
Creates a session using an attached
engine, sharedruntime, or a lazily created owned engine.engineandruntimeare mutually exclusive.
Properties
- context → JsContext?
-
Active context, when the session is runtime-backed.
no setter
- engine → JsEngine?
-
Attached or owned engine, when the session is engine-backed.
no setter
-
features
→ List<
JsFeatures> -
Host feature groups installed for the current page.
no setter
-
grantedPermissions
→ Set<
String> -
Permission names granted to the current page.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- inspector ↔ JsUiInspector?
-
Inspector receiving page diagnostics, or
nullwhen disabled.getter/setter pair - isDisposed → bool
-
Whether this session has been disposed.
no setter
- lastLoadMetrics → JsUiLoadMetrics?
-
Timing metrics from the latest successful page load.
no setter
- node → JsUiNode?
-
Latest committed JSUI node tree.
no setter
- permissionPolicy → JsUiPermissionPolicy?
-
Permission policy used for the current page.
no setter
- plugin → JsPlugin?
-
Currently loaded page plugin.
no setter
-
props
→ Map<
String, Object?> -
Immutable properties of the current page.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- state → Object?
-
Latest JavaScript-owned state snapshot.
no setter
Methods
-
dispatch(
Map< String, Object?> event) → Future<void> - Dispatches one structured page event and refreshes when state changes.
-
dispatchBatch(
Iterable< Map< events) → Future<String, Object?> >void> - Dispatches a burst of events through one session operation and performs one state sync and one renderer refresh after the whole burst completes. Event handlers still execute in input order inside QuickJS.
-
dispose(
) → Future< void> - Terminates this page session and waits for runtime cleanup.
-
lifecycle(
JsUiLifecycle type, {Object? payload, bool render = true}) → Future< bool> -
Sends a general lifecycle
typeand optionally refreshes the schema. -
loadPlugin(
JsPlugin plugin, {Map< String, Object?> initialProps = const <String, Object?>{}, List<JsFeatures> features = const <JsFeatures>[], Iterable<String> grantedPermissions = const <String>[], JsUiPermissionPolicy? permissionPolicy}) → Future<void> -
Loads
plugin, validates permissions, and commits its initial schema. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
pumpTimers(
) → Future< ({bool changed, Duration? nextDelay})> - Runs due JavaScript timers and returns change and next-delay information.
-
refresh(
) → Future< void> - Recommits the current JavaScript page schema.
-
reload(
) → Future< void> - Reloads the current plugin with the same props, features, and permissions.
-
routeLifecycle(
JsUiLifecycle type, {Object? payload, bool render = true}) → Future< bool> -
Sends a route lifecycle
typeonly when the page declares support. -
setState(
Map< String, Object?> patch) → Future<void> - Applies a partial state update and refreshes the committed schema.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited