Options
All
  • Public
  • Public/Protected
  • All
Menu

External module "components/decorators"

Index

Variables

Const query

query: (Anonymous function) = _query((target: NodeSelector, selector: string) => target.querySelector(selector))

A TypeScript property decorator factory that converts a class property into a getter that executes a querySelector on the element's shadow root.

By annotating the property with the correct type, elements can have type-checked access to internal elements.

This function must be invoked to return a decorator.

Const queryAll

queryAll: (Anonymous function) = _query((target: NodeSelector, selector: string) =>target.querySelectorAll(selector))

A TypeScript property decorator factory that converts a class property into a getter that executes a querySelectorAll on the element's shadow root.

By annotating the property with the correct type, elements can have type-checked access to internal elements. The type should be NodeList with the correct type argument.

This function must be invoked to return a decorator.

Functions

_query

  • _query(queryFn: function): (Anonymous function)
  • Creates a decorator function that accepts a selector, and replaces a property with a getter than executes the selector with the given queryFn

    Parameters

    • queryFn: function

      A function that executes a query with a selector

        • (target: NodeSelector, selector: string): Element | NodeList | null
        • Parameters

          • target: NodeSelector
          • selector: string

          Returns Element | NodeList | null

    Returns (Anonymous function)

createProperty

customElement

  • customElement(tagname?: string): (Anonymous function)
  • A TypeScript class decorator factory that registers the class as a custom element.

    If tagname is provided, it will be used as the custom element name, and will be assigned to the class static is property. If tagname is omitted, the static is property of the class will be used instead. If neither exist, or if both exist but have different values (except in the case that the is property is not an own-property of the class), an exception is thrown.

    Parameters

    • Optional tagname: string

    Returns (Anonymous function)

property

  • A TypeScript property decorator factory that defines this as a Polymer property.

    This function must be invoked to return a decorator.

    Parameters

    Returns (Anonymous function)