Skip to main content

Type Definitions

WebviewSource

A union of three source types. Always create using the webviewSource helpers:

HelperProducesFields
webviewSource.local(id)WebviewSourceLocal{ type: "local", id }
webviewSource.url(url)WebviewSourceUrl{ type: "url", url }
webviewSource.html(content)WebviewSourceHtml{ type: "html", content }

WebviewSourceLocal

FieldTypeDescription
type"local"Discriminant
idstringAsset ID (e.g., "my-mod:ui")

WebviewSourceUrl

FieldTypeDescription
type"url"Discriminant
urlstringURL string

WebviewSourceHtml

FieldTypeDescription
type"html"Discriminant
contentstringHTML string

WebviewSourceInfo

Webview source information returned in API responses. A union of WebviewSourceInfoLocal, WebviewSourceInfoUrl, and WebviewSourceInfoHtml. In list responses, HTML content is omitted.

WebviewSourceInfoLocal

FieldTypeDescription
type"local"Discriminant
idstringAsset ID

WebviewSourceInfoUrl

FieldTypeDescription
type"url"Discriminant
urlstringURL string

WebviewSourceInfoHtml

FieldTypeDescription
type"html"Discriminant
contentstring | undefinedHTML string (omitted in list responses)

WebviewInfo

Returned by Webview.list() and webview.info().

FieldTypeDescription
entitynumberThe webview's entity ID
sourceWebviewSourceInfoThe current source
sizeVec23D world space dimensions
viewportSizeVec2HTML pixel dimensions
offsetVec2Position offset
linkedVrmnumber | nullLinked VRM entity ID, or null

WebviewPatchRequest

Used by patch().

FieldTypeDescription
offsetVec2New position offset
sizeVec2New 3D dimensions
viewportSizeVec2New pixel dimensions

WebviewOpenOptions

Used by Webview.open().

FieldTypeDefaultDescription
sourceWebviewSource--What to display (required)
sizeVec2--Dimensions in 3D world space
viewportSizeVec2--HTML pixel dimensions
offsetVec2--Position relative to linked VRM or world origin
linkedVrmnumber--Entity ID of the VRM to attach to

WebviewNavigateRequest

Used internally by navigate().

FieldTypeDescription
sourceWebviewSourceThe new source to navigate to

SetLinkedVrmRequest

Used internally by setLinkedVrm().

FieldTypeDescription
vrmnumberEntity ID of the VRM to link