definePluginFactory
Call Signature
Section titled “Call Signature”definePluginFactory<
Options,Made>(build):PluginFactory<[Options],Made>
Makes a plugin’s factory from build, which returns the plugin for its
options with definePlugin: the call a game lists, rounds(), which
makes one plugin for each distinct options the plugin records, so a
list written again on each render, and a kit that lists the plugin with
the same options as the game, name one plugin. The factory carries the
plugin’s handles, read from a call with no options, so they never
depend on its options: rounds.systems.advance for an anchor,
rounds.commands.start for what a page sends, and the plugin’s name, so
another plugin writes requires: [rounds]. As each engine plugin’s
factory is made.
Two calls make one plugin when their recorded options are the same JSON
and each function and handle they were given is the same object, such
as a Team from defineTeam: a handle is compared by identity, so two
worlds’ teams of one key are two plugins. A plugin whose options are
required, as teams()’s are, names the options its handles are read
from in handles, and a game’s call must pass its own.
Type Parameters
Section titled “Type Parameters”| Type Parameter |
|---|
Options |
Made extends Plugin<SystemHandles<Readonly<Record<string, unknown>>, Readonly<Record<string, unknown>>, Readonly<Record<string, unknown>>, Readonly<Record<string, unknown>>>, Readonly<Record<string, VectorInputDeclaration | AngleInputDeclaration | ButtonInputDeclaration | AxisInputDeclaration>>, Readonly<Record<string, PageActionDeclaration>>, string, Readonly<Record<string, CommandDeclaration<Readonly<Record<string, CommandField>>, string, Readonly<Record<string, ReturnField>> | undefined, boolean, boolean, boolean>>>, Readonly<Record<string, InputContextDeclaration>>> |
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
build |
(options?) => Made |
Returns
Section titled “Returns”PluginFactory<[Options], Made>
Call Signature
Section titled “Call Signature”definePluginFactory<
Options,Made>(build,handles):PluginFactory<[Options],Made>
Makes a plugin’s factory from build, which returns the plugin for its
options with definePlugin: the call a game lists, rounds(), which
makes one plugin for each distinct options the plugin records, so a
list written again on each render, and a kit that lists the plugin with
the same options as the game, name one plugin. The factory carries the
plugin’s handles, read from a call with no options, so they never
depend on its options: rounds.systems.advance for an anchor,
rounds.commands.start for what a page sends, and the plugin’s name, so
another plugin writes requires: [rounds]. As each engine plugin’s
factory is made.
Two calls make one plugin when their recorded options are the same JSON
and each function and handle they were given is the same object, such
as a Team from defineTeam: a handle is compared by identity, so two
worlds’ teams of one key are two plugins. A plugin whose options are
required, as teams()’s are, names the options its handles are read
from in handles, and a game’s call must pass its own.
Type Parameters
Section titled “Type Parameters”| Type Parameter |
|---|
Options |
Made extends Plugin<SystemHandles<Readonly<Record<string, unknown>>, Readonly<Record<string, unknown>>, Readonly<Record<string, unknown>>, Readonly<Record<string, unknown>>>, Readonly<Record<string, VectorInputDeclaration | AngleInputDeclaration | ButtonInputDeclaration | AxisInputDeclaration>>, Readonly<Record<string, PageActionDeclaration>>, string, Readonly<Record<string, CommandDeclaration<Readonly<Record<string, CommandField>>, string, Readonly<Record<string, ReturnField>> | undefined, boolean, boolean, boolean>>>, Readonly<Record<string, InputContextDeclaration>>> |
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
build |
(options) => Made |
handles |
PluginFactoryOptions<NoInfer<Options>> |
Returns
Section titled “Returns”PluginFactory<[Options], Made>