VScript Integration
When Panorama is enabled, a new SendToPanorama
function is added to the
VScript API. This functions takes two parameters, the name of an event and an
additional value to be sent to JavaScript (currently only strings are
supported), and dispatches a global Panorama event with the given name and
argument.
Usage Example
First, the event needs to be defined in scripts/util/event-definition.ts
:
Then a global event handler can be attached to it in any Panorama JS file:
Finally the event can be dispatched from a VScript file:
TypeScript Compatibility
When using Typescript with the Strata types library, it is expected that all events should be declared alongside their parameter types. Events can be added by re-declaring the PanelEventNameMap
/GlobalEventNameMap
interfaces with only your custom events. This will merge the interface rather than override it.
These checks can also be disabled by declaring the ALLOW_MISSING_EVENTS
type as true
.