Interface StylableBackground<BackgroundType>

Interface for an object that has stylable background.

Type Parameters

Hierarchy

Methods

  • Get elements Background object

    Type of Background is generic, see UIBackground for minimum interface.

    Returns

    Background object

    Returns BackgroundType

  • Get state of component highlighting.

    Returns

    Number between 0 and 1, where 1 is fully highlighted.

    Returns number

  • Get padding around object in pixels. Padding is empty space between the UiElements content and Background

    Returns

    Margin datastructure

    Returns Margin

  • Unsubscribe from Highlight object event. This is called whenever an object is highlighted

    Returns

    True if the unsubscription was successful.

    Parameters

    • token: Token

      Token that was received when subscribing to the event.

    Returns boolean

  • Subscribe to highlight object event. This is called whenever an object is highlighted.

    Returns

    Token that can be used to unsubscribe from the event.

    Parameters

    • handler: ((highlight: number | boolean) => void)

      Function that is called when event is triggered.

        • (highlight: number | boolean): void
        • Parameters

          • highlight: number | boolean

          Returns void

    Returns Token

  • Method for mutating Background of object.

    Type of Background is generic, see UIBackground for minimum interface.

    Returns

    Object itself for fluent interface

    Parameters

    • mutator: Mutator<BackgroundType>

      Mutator function for Background

    Returns StylableBackground<BackgroundType>

  • Set state of component highlighting.

     // Example usage

    component.setHighlight(true)

    Returns

    Object itself

    Parameters

    • highlight: number | boolean

      Boolean or number between 0 and 1, where 1 is fully highlighted.

    Returns StylableBackground<BackgroundType>

  • Set padding around object in pixels. Padding is empty space between the UiElements content and Background

    Returns

    Object itself

    Parameters

    • padding: number | Partial<Margin>

      Number with pixel margins for all sides or datastructure with individual pixel paddings for each side. Any side can be omitted, only passed values will be overridden.

    Returns StylableBackground<BackgroundType>