ABB Ability™ History UI SDK - Client API Reference
    Preparing search index...

    The component property API

    interface IPropertyAPI {
        Changed: IEvent<string>;
        RequestRefresh: IEvent<string>;
        Add<T>(
            name: string,
            type?: cPropertyType,
            options?: IPropertyConfig,
        ): IProperty<T>;
        AddListener(listener: TPropertyListener, propertyname?: string): void;
        Contains(name: string): boolean;
        GetHandle<T>(propertyname: string): IProperty<T>;
        GetInfo(propertyname: string): IPropertyInfo;
        GetNewItem(propertyname: string): unknown;
        GetNewItemName(propertyname: string): string;
        GetResolvedColorValue(colorpropertyname: string): IThemeColor;
        HasDefaultValue(propertyname: string): boolean;
        InstantiateProperties(): void;
        IsVisible(propertyname: string): boolean;
        List(): string[];
        OverrideGetter<T>(propertyname: string, newgetter: TGet<T>): void;
        OverrideSetter<T>(
            propertyname: string,
            newsetter: TSet<T>,
            nodefaultstorage?: boolean,
        ): void;
        Read(config: IComponentConfig, removehandled?: boolean): void;
        Remove(name: string): void;
        RemoveListener(listener: TPropertyListener, propertyname?: string): void;
        SaveOnlyChanged(
            collectionpropertyname: string,
            defaults: object | unknown[],
        ): void;
        SetAttributes(propertyname: string, attributes: IPropertyConfig): void;
        SetDefaultValue(
            propertyname: string,
            value: unknown,
            initialconfig?: IComponentConfig,
        ): void;
        SetNewItemHandler(propertyname: string, handler: () => unknown): void;
        SetNewItemNameHandler(
            propertyname: string,
            namehandler: () => string,
        ): void;
    }
    Index

    Properties

    Changed: IEvent<string>

    Fired when a property value is changed in the component.

    RequestRefresh: IEvent<string>

    Request refreshing the component's properties from an external component (usually the editor).

    Methods

    • Adds a new property to the component.

      Type Parameters

      • T

      Parameters

      • name: string

        The property name.

      • Optionaltype: cPropertyType

        The property type. (Default: cPropertyType.Text)

      • Optionaloptions: IPropertyConfig

        The property options (containing any of the options in IPropertyInfo).

      Returns IProperty<T>

    • Adds a property change listener.

      Parameters

      • listener: TPropertyListener

        A function that is called when a property value is changed (the property name is passed as a parameter to the function).

      • Optionalpropertyname: string

        The name of the property whose changes are listened. (If undefined or null, listens to all properties.)

      Returns void

    • Checks if the property with the given name exists.

      Parameters

      • name: string

        The name of the property.

      Returns boolean

    • Get a property handle

      Type Parameters

      • T

      Parameters

      • propertyname: string

        The name of an existing property.

      Returns IProperty<T>

    • Gets the attributes of a property. The instance specific attribute values can be changed using this object. RequestRefresh event is raised automatically when a property attribute is changed.

      Parameters

      • propertyname: string

        The name of the property.

      Returns IPropertyInfo

    • Parameters

      • propertyname: string

      Returns unknown

    • Parameters

      • propertyname: string

      Returns string

    • Gets resolved color value for specified color property.

      Parameters

      • colorpropertyname: string

        The name of the color property

      Returns IThemeColor

    • Does given property have its default value.

      Parameters

      • propertyname: string

        The property name.

      Returns boolean

    • Returns void

    • [ADVANCED] Resolve visibility of a property

      Parameters

      • propertyname: string

        The property name.

      Returns boolean

    • Get names of all the properties in the component.

      Returns string[]

    • Override the default getter function for the property.

      Type Parameters

      • T

      Parameters

      • propertyname: string

        The name of the property.

      • newgetter: TGet<T>

        The new getter function.

      Returns void

    • Override the default setter function for the property.

      Type Parameters

      • T

      Parameters

      • propertyname: string

        The name of the property.

      • newsetter: TSet<T>

        The new setter function.

      • Optionalnodefaultstorage: boolean

        Don't update the default property storage after calling the setter.

      Returns void

    • Reads property values from an object and sets them to this component. (Disregards properties that aren't found in the current component.)

      Parameters

      • config: IComponentConfig

        An object containing property names and values ({PropertyName1: PropertyValue1, PropertyName2: PropertyValue2, ...}).

      • Optionalremovehandled: boolean

        Remove read name value pairs from the properties object. Intended for preventing inheriting components reading the properties twice.

      Returns void

    • Remove a property

      Parameters

      • name: string

        The property name.

      Returns void

    • Removes a property change listener.

      Parameters

      • listener: TPropertyListener

        The function to be removed.

      • Optionalpropertyname: string

        The name of the property whose changes were listened.

      Returns void

    • Creates an auxilary property to store for the changes from defaults. Works only with Array and Dictionary type properties.

      Parameters

      • collectionpropertyname: string
      • defaults: object | unknown[]

      Returns void

    • Modifies one or several attributes of a property.

      Parameters

      • propertyname: string

        Name of the property.

      • attributes: IPropertyConfig

        Attributes with their new values.

      Returns void

    • Update the default value of a property (for this component instance).

      Parameters

      Returns void

    • Set the new item handler of a collection property. (Currently only supported for array or dictionary properties)

      Parameters

      • propertyname: string

        The collection property name.

      • handler: () => unknown

        The function creating a new item (to be added in the collection).

      Returns void

    • Set the new item name handler of a collection property.

      Parameters

      • propertyname: string
      • namehandler: () => string

      Returns void