Package client.teavm.common.parameter


package client.teavm.common.parameter
This package contains event parameter classes for controlling and interacting with the emulator via JavaScript and Web Worker functions.

The events defined in this package are used to configure the emulator's runtime behavior, such as initializations, file loading, and handling specific operations like SID writes, printer outputs, and more. Each event corresponds to a specific action that the emulator must take based on messages received from the Web Worker environment.

The event parameters are designed to be validated at runtime using the AJV (Another JSON Schema Validator) library. The schema validation ensures that event data is correctly structured and adheres to the expected format before the emulator processes it. The validation mechanism is integrated into the Web Worker, where the event data is validated using a compiled AJV schema.

Each event is validated against a corresponding schema, and the event type is used to determine which schema to apply. If the validation fails, the Web Worker logs the errors and closes the connection. If the validation passes, the event is processed by invoking the appropriate function in the `eventMap`.

In addition to validation, the package also supports automatic documentation generation, providing a clear and structured overview of available events, their parameters, default values, and usage instructions. The documentation and schemas assist developers in understanding how to interact with the emulator API in a browser runtime, especially when developer tools are enabled.

Key Classes:

  • ExportEventParameters - Contains parameters for events that control the emulator (sent from JavaScript to the WebWorker).
  • ImportEventParameters - Contains parameters for events that represent the output of the emulator (sent from the WebWorker to JavaScript).

These events include operations such as initializing the emulator, opening tunes, handling SID writes, and controlling I/O devices (e.g., printers and sound expansion devices).

Siehe auch: