UNPKG

@kephas/reflection

Version:

Provides reflection capabilities, like TypeInfoRegistry, ITypeInfo, and IProperty.

50 lines (49 loc) 1.81 kB
import { DisplayInfo } from './displayInfo'; import { ElementInfo } from './elementInfo'; import { ITypeInfo, ITypeInfoRegistry, IValueElementInfo } from './interfaces'; /** * Reflective element information holding a value. * * @export * @class ValueElementInfo * @extends {ElementInfo} */ export declare abstract class ValueElementInfo extends ElementInfo implements IValueElementInfo { private _valueType?; private _valueTypeGetter?; /** * Gets the type of the element's value. * * @type {TypeInfo} * @memberof ValueElementInfo */ get valueType(): ITypeInfo; /** * Creates an instance of ValueElementInfo. * * @param {string} name The element name. * @param {string} [fullName] Optional. The full name of the element. * @param {DisplayInfo} [displayInfo] Optional. The display information. * @param {ITypeInfo} [valueType] The value type. * @param {ITypeInfoRegistry} [registry] The root type info registry. * @memberof ValueElementInfo */ constructor({ name, fullName, displayInfo, valueType, registry, ...args }: { name: string; fullName?: string; displayInfo?: DisplayInfo; valueType?: ITypeInfo | string; registry?: ITypeInfoRegistry; [key: string]: any; }); /** * Gets the value type based on the type name. * * @protected * @param {string} valueType The name or full name of the value type. * @param {ITypeInfoRegistry} [registry] The type info registry. If not provided, TypeInfoRegistry.Instance will be used. * @returns * @memberof ValueElementInfo */ protected getValueType(valueType: string, registry?: ITypeInfoRegistry): ITypeInfo | undefined; }