Skip to main content

Function: createEventDecorator()

createEventDecorator(type, name?, webViewId?): MethodDecorator

Factory for creating method decorators that bind controller methods to runtime events.

Parameters

type

EventType

The type of the event (from EventType enum) to listen for.

name?

string

Optional custom event name; defaults to the method name.

webViewId?

Optional identifier for targeting a specific WebView instance.

string | number

Returns

MethodDecorator

A method decorator that registers the decorated method in the controller's event metadata.

Throws

If the same method is decorated more than once with an event decorator.