Skip to content

UiView

type UiView<T = UiJson> = Readonly<{
id: string; resource: UiResource;
opened: Promise<UiOpening>; ready: Promise<UiReadiness>; result: Promise<UiInteractionResult<T>>;
send(data: UiJson): boolean; focus(): boolean; close(): void;
}>;
Field Meaning
id, resource Unique view identity and its immutable resource.
opened Acknowledges browser creation.
ready Resolves when the page is ready with its first complete frame.
result Resolves once with the terminal interaction outcome.
send(data) Deliver JSON to page listeners; returns false until ready or after closing.
focus() Bring this ready view to the top; returns false until ready or after closing.
close() Close this view; its result is script cancellation if still open.