Verona Schemer Interface Handles communication between schemer and host application.

// 1. Instantiate
const schemer = new VeronaSchemeApiService({ debug: true });

// 2. Register handler BEFORE sendReady()
schemer.onStartCommand((cmd) => {
initUiFromVariables(cmd.variables);
if (cmd.codingScheme) loadScheme(cmd.codingScheme, cmd.codingSchemeType);
if (cmd.schemerConfig?.directDownloadUrl) configureDownloadUrl(cmd.schemerConfig.directDownloadUrl);
});

// 3. Announce readiness
schemer.sendReady({ metadata: JSON.stringify(meta) });

// 4. Send scheme changes whenever the user edits the coding scheme
schemer.sendSchemeChanged(scheme, schemeType, dependencies, sharedParameters);

// 5. Cleanup (e.g. in ngOnDestroy)
schemer.destroy();

Constructors

Properties

messageHandlers: Map<string, Set<Function>> = ...
sessionId: null | string = null
debug: boolean
allowedOrigin: string
targetWindow: Window
messageListener: ((event: MessageEvent<any>) => void)

Accessors

Methods

  • Send vosReadyNotification to the host. Call this after registering onStartCommand, as the host will respond with a vosStartCommand immediately upon receiving this notification.

    Parameters

    Returns void

  • Send vosSchemeChangedNotification to the host whenever the user edits the coding scheme.

    The full, updated scheme is always sent — not a diff. The host stores it for later use by a coder. dependenciesToCode must list all external files or services required at coding time so the host can ensure they remain accessible.

    Requires an active session (i.e. onStartCommand must have fired first, as sessionId is mandatory in this notification).

    Parameters

    • OptionalcodingScheme: string

      The complete, updated coding scheme serialised as a string

    • OptionalcodingSchemeType: string

      Optional format/version identifier for the coding scheme

    • OptionaldependenciesToCode: MainSchema.Dependency[]

      Optional external files or services needed during coding

    • OptionalsharedParameters: MainSchema.SharedParameter[]

      Optional shared parameters for cross-module data exchange

    Returns void

  • Register a handler for vosStartCommand.

    Unlike the Widget, the StartCommand is mandatory for the Schemer – the variables list is the foundation the schemer's UI is built upon. The session ID is stored automatically before your callback is called.

    Register this handler before calling sendReady().

    Typical usage in the callback:

    • Initialise the UI from variables
    • Load an existing codingScheme if provided
    • Configure runtime behaviour from schemerConfig (e.g. set directDownloadUrl for lazy-loaded resources)

    Parameters

    Returns void