ConfiguredRenderable
A container that holds a Renderable class and a configuration to use when it is instanatiated.
Example:
class MyClass {}
const configured = new ConfiguredRenderable(MyClass, { configProp: true });
ConfiguredRenderable.resolve(configured); // => MyClass
ConfiguredRenderable.resolveConfiguration(configured); // => { configProp: true }
Static Method Summary
Static Public Methods | ||
public static |
inList(list: RenderableArg<Renderable>[], item: RenderableArg<Renderable>): boolean Determines whether a resolved renderable is within a list of resolved renderables. |
|
public static |
isRenderableArg(config: *): * |
|
public static |
isRenderableConstructor(arg: *): * |
|
public static |
resolve(item: Type<T> | ConfiguredRenderable<T> | T): Type<T> Resolves a renderable class from a configured renderable or renderable instance. |
|
public static |
resolveConfiguration(item: ConfiguredRenderable<any> | any): * Resolves a configuration from a configured renderable. |
Constructor Summary
Public Constructor | ||
public |
constructor(_renderable: Type<T>, _config: *) Creates an instance of ConfiguredRenderable. |
Member Summary
Public Members | ||
public get |
config: * The configuration for the renderable. |
|
public get |
renderable: Type<T> The renderable to instantiate. |
Static Public Methods
public static inList(list: RenderableArg<Renderable>[], item: RenderableArg<Renderable>): boolean source
Determines whether a resolved renderable is within a list of resolved renderables.
Params:
Name | Type | Attribute | Description |
list | RenderableArg<Renderable>[] | ||
item | RenderableArg<Renderable> |
public static isRenderableArg(config: *): * source
Params:
Name | Type | Attribute | Description |
config | * |
Return:
* |
public static isRenderableConstructor(arg: *): * source
Params:
Name | Type | Attribute | Description |
arg | * |
Return:
* |
public static resolve(item: Type<T> | ConfiguredRenderable<T> | T): Type<T> source
Resolves a renderable class from a configured renderable or renderable instance.
Params:
Name | Type | Attribute | Description |
item | Type<T> | ConfiguredRenderable<T> | T |
public static resolveConfiguration(item: ConfiguredRenderable<any> | any): * source
Resolves a configuration from a configured renderable.
Params:
Name | Type | Attribute | Description |
item | ConfiguredRenderable<any> | any |
Return:
* |