Skip to content

@jsvision/ui / ModalHost

Interface: ModalHost ​

Defined in: ui/src/event/types.ts:19

The handle a self-closing modal view receives so it can close itself from its own event handling.

When you open a view with EventLoop.execView and that view implements ModalHostAware, the loop hands it a ModalHost before the modal opens. A Dialog uses it to catch its terminating command (OK/Cancel), run its validation gate, then call endModal to resolve the execView promise. You rarely implement this yourself — Dialog already does.

Methods ​

endModal() ​

endModal(result): void

Defined in: ui/src/event/types.ts:21

Resolve the active execView promise with result (e.g. the command that closed the dialog).

Parameters ​

result ​

unknown

Returns ​

void


isCommandEnabled() ​

isCommandEnabled(command): boolean

Defined in: ui/src/event/types.ts:23

Whether a command is currently enabled (a dialog gates its close-on-command on this).

Parameters ​

command ​

string

Returns ​

boolean