Module: vorple

Methods

(static) addEventListener(eventNames, listener) → {function}

Registers a listener for an event. See "Filters and event listeners" in the documentation for details.
Parameters:
Name Type Description
eventNames string | Array.<string> The event name or an array of event names where to add the listener
listener function The listener to register
Since:
  • 3.2.0
Source:
Returns:
A function that can be called to remove the listeners
Type
function

(static) evaluate(filename)

Evaluates JavaScript code and writes the return value and its type to the virtual filesystem for the story file to read.
Parameters:
Name Type Description
filename string
Source:

(static) getInformVersion() → {number|undefined}

Returns the Inform version, detected at handshake. Before the handshake the value is undefined.
Since:
  • 3.2.0
Source:
Returns:
6 or 7
Type
number | undefined

(static) init()

Initializes and starts Vorple.
Source:

(static) removeEventListener(eventNamesopt, listener) → {boolean}

Removes a registered event listener.
Parameters:
Name Type Attributes Description
eventNames string | Array.<string> <optional>
The event name or an array of event names from where to remove the listener. Leaving this parameter out completely (i.e. passing the listener function as the first and only parameter) removes the listener from all events where it's been registered.
listener function The listener to remove
Since:
  • 3.2.0
Source:
Returns:
True if the listener was removed from at least one event
Type
boolean

(static) requireVersion(requiredVersion, callbackopt) → {boolean}

Require a minimum version of Vorple. Minor updates are accepted if they're not specified in the request. In other words, if version "3.1" is requested, then any Vorple version below 3.2 (3.1, 3.1.1, 3.1.2 etc) will pass. If version "3" is requested, every version 3.x.x will pass. If an optional callback is passed to the function, it will be run with one boolean parameter: true if version matches, false otherwise. Otherwise an error is thrown if the version doesn't match.
Parameters:
Name Type Attributes Description
requiredVersion string The minimum version of Vorple that's required.
callback function <optional>
A custom callback
Source:
Returns:
True if version matches
Type
boolean