Options
All
  • Public
  • Public/Protected
  • All
Menu

Index

Type aliases

OnPropChangeHandlers

OnPropChangeHandlers<TEvents>: { [ P in keyof TEvents & string as `onchanged_${P}`]?: (oldValue: TEvents[P], newValue?: TEvents[P]) => any }

Maps every property of the given type to an optional "onchanged" function that accepts the old and the new values of a changed property.

Type parameters

  • TEvents

WebElmAttrChangeHandler

WebElmAttrChangeHandler<T>: (newValue: T, attrName: string) => any

Type parameters

  • T = any

Type declaration

    • (newValue: T, attrName: string): any
    • Defines function signature for attribute change notification handler.

      Parameters

      • newValue: T
      • attrName: string

      Returns any

WebElmAttrOptions

WebElmAttrOptions: { fromHtml?: WebElmFromHtmlConverter; noTrigger?: boolean; onchanged?: WebElmAttrChangeHandler; toHtml?: WebElmToHtmlConverter }

Options specified when defining an element attribute.

Type declaration

  • Optional fromHtml?: WebElmFromHtmlConverter

    Converter function that converts the string attribute value to a property native type

  • Optional noTrigger?: boolean

    Flag indicating that no trigger should be created for the property reflecting the attribute's value.

  • Optional onchanged?: WebElmAttrChangeHandler

    Notification function that is called when the attribute value changes

  • Optional toHtml?: WebElmToHtmlConverter

    Converter function that converts a value to a string that can be set to the HTML attribute

WebElmFromHtmlConverter

WebElmFromHtmlConverter: (stringValue: string | null | undefined, attrName: string) => any

Type declaration

    • (stringValue: string | null | undefined, attrName: string): any
    • Defines function signature for converting an attribute string value to the corresponding property's type. Converter functions are specified as part of attribute options, e.g. in the attr decorator.

      Parameters

      • stringValue: string | null | undefined

        Attribute's string value to convert to the corresponding type.

      • attrName: string

        Name of the attribute whose value is being converted from string

      Returns any

WebElmOptions

WebElmOptions: Partial<ShadowRootInit> & { deferred?: boolean; extends?: string; noShadow?: boolean }

Options determining behavior of the custom element. They include ShadowRootInit properties (including the shadow root mode) and several additional configuration parameters.

WebElmToHtmlConverter

WebElmToHtmlConverter: (value: any, attrName: string) => string | null

Type declaration

    • (value: any, attrName: string): string | null
    • Defines function signature for converting a value to the corresponding attributes's string. Converter functions are specified as part of attribute options, e.g. in the attr decorator.

      Parameters

      • value: any

        Value to convert to string.

      • attrName: string

        Name of the attribute whose value is being converted to string

      Returns string | null