Home Manual Reference Source Repository
import {ConfiguredRenderable} from 'ug-layout/dom/ConfiguredRenderable'
public class | source

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
public static

resolve(item: Type<T> | ConfiguredRenderable<T> | T): Type<T>

Resolves a renderable class from a configured renderable or renderable instance.

public static

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

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:

NameTypeAttributeDescription
list RenderableArg<Renderable>[]
item RenderableArg<Renderable>

Return:

boolean

public static isRenderableArg(config: *): * source

Params:

NameTypeAttributeDescription
config *

Return:

*

public static isRenderableConstructor(arg: *): * source

Params:

NameTypeAttributeDescription
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:

NameTypeAttributeDescription
item Type<T> | ConfiguredRenderable<T> | T

Return:

Type<T>

public static resolveConfiguration(item: ConfiguredRenderable<any> | any): * source

Resolves a configuration from a configured renderable.

Params:

NameTypeAttributeDescription
item ConfiguredRenderable<any> | any

Return:

*

Public Constructors

public constructor(_renderable: Type<T>, _config: *) source

Creates an instance of ConfiguredRenderable.

Params:

NameTypeAttributeDescription
_renderable Type<T>
_config *

Public Members

public get config: * source

The configuration for the renderable.

public get renderable: Type<T> source

The renderable to instantiate.