Docs · API reference · Verso.Abstractions

ILayoutInteractionHandler Interface#

Capability interface for extensions that handle bidirectional interactions scoped to a layout owned by the same extension. Implement alongside an ILayoutEngine on the same class (the common case) or as a sibling class that shares the layout's LayoutId. Routing is by the (ExtensionId, LayoutId) identity pair.

public interface ILayoutInteractionHandler : Verso.Abstractions.IExtension

Implements IExtension

Properties#

LayoutId Property#

The LayoutId this handler services. The handler's ExtensionId supplies the other half of the identity pair. The handler's owning extension must also register an ILayoutEngine with this same LayoutId.

string LayoutId { get; }

Property Value#

System.String

Methods#

OnLayoutInteractionAsync(LayoutInteractionContext) Method#

Invoked when the client routes a layout interaction (via the layout/interact JSON-RPC method) to this handler. Implementations should mutate layout state, persist it through Verso when applicable, and call RequestRender or RequestCellRefresh to drive UI updates. Returns System.Threading.Tasks.Task only; layout interactions do not return payloads to the client.

System.Threading.Tasks.Task OnLayoutInteractionAsync(Verso.Abstractions.LayoutInteractionContext context);

Parameters#

context LayoutInteractionContext

Returns#

System.Threading.Tasks.Task

Remarks#

Interaction types in the verso/ namespace are reserved by the host and are intercepted before this handler is invoked (for example verso/requestRender routes directly to RequestRender). Handler implementations MUST NOT depend on receiving them; using a verso/ prefix as an application-defined type will silently never reach the handler.