Class: MapScriptRegistry<TCamera>
Mutable registry used by hosts and tests.
Type Parameters
| Type Parameter | Default type |
|---|---|
TCamera | unknown |
Implements
ScriptRegistry<TCamera>
Constructors
Constructor
ts
new MapScriptRegistry<TCamera>(scripts?): MapScriptRegistry<TCamera>;Seeds the registry from a { uid: constructor } map.
Parameters
| Parameter | Type |
|---|---|
scripts? | Record<string, ScriptConstructor<TCamera>> |
Returns
MapScriptRegistry<TCamera>
Methods
register()
ts
register(uid, ctor): void;Registers or replaces the constructor for uid.
Parameters
| Parameter | Type |
|---|---|
uid | string |
ctor | ScriptConstructor<TCamera> |
Returns
void
unregister()
ts
unregister(uid): void;Removes the constructor registered for uid.
Parameters
| Parameter | Type |
|---|---|
uid | string |
Returns
void
get()
ts
get(uid):
| ScriptConstructor<TCamera>
| undefined;Returns the constructor registered for uid, or undefined.
Parameters
| Parameter | Type |
|---|---|
uid | string |
Returns
| ScriptConstructor<TCamera> | undefined
Implementation of
has()
ts
has(uid): boolean;True when uid has a registered constructor.
Parameters
| Parameter | Type |
|---|---|
uid | string |
Returns
boolean
clear()
ts
clear(): void;Removes every registration.
Returns
void
