ProtocolBridge

interface ProtocolBridge : EventSink

Exposes a Widget.Children and WidgetSystem whose changes can be captured as a list of Changes to send to a remote frontend. Incoming Events can also be sent to this instance and will be routed to the appropriate handler.

Types

Link copied to clipboard
interface Factory

Properties

Link copied to clipboard
abstract val root: Widget.Children<Unit>

The root of the widget tree onto which widgetSystem-produced widgets can be added. Changes to this instance are recorded as changes to Id.Root and ChildrenTag.Root.

Link copied to clipboard
abstract val widgetSystem: WidgetSystem<Unit>

The provider of factories of widgets which record property changes and whose children changes are also recorded. You must attach returned widgets to root or the children of a widget in the tree beneath root in order for it to be tracked.

Functions

Link copied to clipboard
abstract fun getChangesOrNull(): List<Change>?

Returns any changes to root or widgetSystem-produced widgets since the last time this function was called. Returns null if no changes occurred.

Link copied to clipboard
abstract fun sendEvent(event: Event)