JavaScriptModuleInstruction implements JsonSerializable
Table of Contents
Interfaces
- JsonSerializable
Constants
- FLAG_LOAD_REQUIRE_JS = 1
- Indicates a requireJS module shall be loaded.
- FLAG_USE_TOP_WINDOW = 16
- Indicates all actions shall be applied globally to `top.window`.
- ITEM_ASSIGN = 'assign'
- ITEM_INSTANCE = 'instance'
- ITEM_INVOKE = 'invoke'
Properties
- $exportName : string|null
- $flags : int
- $items : array<string|int, mixed>
- $name : string
Methods
- __construct() : mixed
- addFlags() : $this
- assign() : static
- forRequireJS() : self
- getExportName() : string|null
- getFlags() : int
- getItems() : array<string|int, mixed>
- getName() : string
- instance() : static
- invoke() : static
- jsonSerialize() : array<string|int, mixed>
- shallLoadRequireJs() : bool
- shallUseTopWindow() : bool
Constants
FLAG_LOAD_REQUIRE_JS
Indicates a requireJS module shall be loaded.
public
mixed
FLAG_LOAD_REQUIRE_JS
= 1
Tags
FLAG_USE_TOP_WINDOW
Indicates all actions shall be applied globally to `top.window`.
public
mixed
FLAG_USE_TOP_WINDOW
= 16
ITEM_ASSIGN
public
mixed
ITEM_ASSIGN
= 'assign'
ITEM_INSTANCE
public
mixed
ITEM_INSTANCE
= 'instance'
ITEM_INVOKE
public
mixed
ITEM_INVOKE
= 'invoke'
Properties
$exportName
protected
string|null
$exportName
$flags
protected
int
$flags
$items
protected
array<string|int, mixed>
$items
= []
$name
protected
string
$name
Methods
__construct()
public
__construct(string $name, int $flags) : mixed
Parameters
- $name : string
-
Module name
- $flags : int
addFlags()
public
addFlags(int ...$flags) : $this
Parameters
- $flags : int
Return values
$thisassign()
public
assign(array<string|int, mixed> $assignments) : static
Parameters
- $assignments : array<string|int, mixed>
-
key-value assignments
Return values
staticforRequireJS()
public
static forRequireJS(string $name[, string|null $exportName = null ]) : self
Parameters
- $name : string
-
RequireJS module name
- $exportName : string|null = null
-
(optional) name used internally to export the module
Return values
selfgetExportName()
public
getExportName() : string|null
Return values
string|nullgetFlags()
public
getFlags() : int
Return values
intgetItems()
public
getItems() : array<string|int, mixed>
Return values
array<string|int, mixed>getName()
public
getName() : string
Return values
stringinstance()
public
instance(mixed ...$args) : static
Parameters
- $args : mixed
-
new instance arguments
Return values
staticinvoke()
public
invoke(string $method, mixed ...$args) : static
Parameters
- $method : string
-
method of JavaScript module to be invoked
- $args : mixed
-
corresponding method arguments
Return values
staticjsonSerialize()
public
jsonSerialize() : array<string|int, mixed>
Return values
array<string|int, mixed>shallLoadRequireJs()
public
shallLoadRequireJs() : bool
Return values
boolshallUseTopWindow()
public
shallUseTopWindow() : bool