ruffle/web/js-src/source-api.js

37 lines
1.0 KiB
JavaScript
Raw Normal View History

2019-10-16 02:02:03 +00:00
import { polyfill } from "./polyfills";
/**
* Represents this particular version of Ruffle.
*
* Multiple APIs can be instantiated from different sources; e.g. an "extension"
* version, versus a "local" version. This expresses to the Public API
* negotiator (see `PublicAPI`) what this particular version of Ruffle is and
* how to control it.
*/
export class SourceAPI {
2019-10-15 02:52:53 +00:00
/**
* Construct a Source API.
*
* @param {string} source_name The name of this particular source.
*/
constructor(source_name) {
this.name = name;
}
get version() {
return "0.1.0";
}
2019-10-14 18:56:30 +00:00
/**
2019-10-16 02:02:03 +00:00
* Start up a particular set of polyfills.
2019-10-14 18:56:30 +00:00
*
2019-10-16 02:02:03 +00:00
* Polyfills, once enabled, may not be disabled. However, this function may
* be called again with a different list to enable further polyfills.
2019-10-14 18:56:30 +00:00
*
2019-10-16 02:02:03 +00:00
* @param {array} polyfills A list of polyfills. See the `polyfills` module
* for a list of allowable strings.
2019-10-14 18:56:30 +00:00
*/
2019-10-16 02:02:03 +00:00
polyfill(polyfills) {
polyfill(polyfills);
}
}