JsWebApis class
Web platform APIs a runtime installs into each JS context.
Pick a preset, or name the modules you want and let the dependency closure take care of the rest:
const JsWebApis.none(); // pure QuickJS
const JsWebApis(); // core only (the default)
const JsWebApis(modules: {JsWebModule.url}); // core + url
JsWebApis.standard(fetch: JsFetchOptions()); // everything, with network
Constructors
-
JsWebApis({Set<
JsWebModule> modules = const {JsWebModule.core}, JsFetchOptions? fetch, String userAgent = _defaultUserAgent}) -
Installs
modulesand everything they require.const - JsWebApis.none()
-
Installs nothing at all: no
console, no timers, plain ECMAScript.const - JsWebApis.standard({JsFetchOptions? fetch, String userAgent = _defaultUserAgent})
-
Installs every module that needs no host configuration
(JsWebModule.standard), plus
fetchwhenfetchis given.const
Properties
- fetch → JsFetchOptions?
-
Network policy for JsWebModule.fetch.
nullmeans the context has no network at all and no globalfetch.final - hashCode → int
-
The hash code for this object.
no setterinherited
-
modules
→ Set<
JsWebModule> -
Modules explicitly requested. Their dependencies are installed too; see
resolvedModules.
final
-
resolvedModules
→ List<
JsWebModule> -
The dependency closure of modules (plus JsWebModule.fetch when
fetch is set), ordered so that every module comes after everything it
requires and after every installed module it lists as optional.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- userAgent → String
-
Value reported by
navigator.userAgentand used as the defaultUser-Agentby the built-in fetch handler.final
Methods
-
installs(
JsWebModule module) → bool -
Whether
moduleends up installed, directly or as a dependency. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited