Global

Type Definitions

InvocationData

Type:
  • Object
Properties:
Name Type Attributes Description
phetioID string The id of the instance
method string name of method to invoke
args Array.<*> <optional>
the parameters needed from the method to invoke.

LaunchSimOptions

Type:
  • Object
Properties:
Name Type Default Description
debug boolean false Launches the simulation that has better error reporting, for development
queryString string '' Appended to the simulation launch URL, can begin with '?' or '&' or neither
passThroughQueryParameters boolean true True if the query parameters from the wrapper should propagate through to the simulation.
phetioEventsListener function | null null called when any message is delivered from the simulation
callback function no-op called after the phet-io sim's "launch" command is called
onSimInitialized function no-op Callback after the sim has been fully initialized and is ready to be displayed.
onPhETiOInitialized function no-op Callback after the PhET-iO layer in the simulation frame is ready for communication. It can receive some PhET-iO commands (such as adding listeners or customization expressions) before the sim starts to launch.
onError function no-op called whenever an error is received from the sim. Exists for the lifetime of the wrapper. If you want to add error listeners that can be removed, see SimIFrameClient.addOnErrorListener().
emitStates boolean false Whether states should be emitted in the data stream every frame. Can be overriden by the phetioEmitStates query parameter.
emitInputEvents boolean false Whether input events should be emitted in the data stream every frame. Can be overriden by the phetioEmitInputEvents query parameter
simStartedMetadata Object {} This metadata will be logged to the PhET-iO event stream in the simStarted event on sim launch.
supplySimStartedMetadata boolean true Determines whether or not to give the sim metadata from the wrapper to be emitted in the simStartedEvent on the events stream. See simStartedMetadata for the object proper. Note: This flag is used for backwards compatibility in the api-diff wrapper, and can be removed once all published sims have the phetio.setSimStartedMetadata method.

WrapperType

Type:
  • Object
Properties:
Name Type Description
typeName String the name of the type
events Array.<String> list of events that this component type can emit to the data stream