Options
All
  • Public
  • Public/Protected
  • All
Menu

External module "lib/decorators"

license

Copyright (c) 2017 The Polymer Project Authors. All rights reserved. This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt Code distributed by Google as part of the polymer project is also subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt

Index

Type aliases

Constructor

Constructor: object

Type declaration

Functions

Const customElement

  • customElement(tagName: string): (Anonymous function)
  • Class decorator factory that defines the decorated class as a custom element.

    Parameters

    • tagName: string

      the name of the custom element to define

    Returns (Anonymous function)

eventOptions

  • eventOptions(options: AddEventListenerOptions): any
  • Adds event listener options to a method used as an event listener in a lit-html template.

    example
    class MyElement {
    
      clicked = false;
    
      render() {
        return html`<div @click=${this._onClick}`><button></button></div>`;
      }
    
      @eventOptions({capture: true})
      _onClick(e) {
        this.clicked = true;
      }
    }
    exportdecorateditems

    Parameters

    Returns any

property

  • A property decorator which creates a LitElement property which reflects a corresponding attribute value. A PropertyDeclaration may optionally be supplied to configure property features.

    exportdecorateditems

    Parameters

    Returns (Anonymous function)

query

  • query(selector: string): (Anonymous function)
  • A property decorator that converts a class property into a getter that executes a querySelector on the element's renderRoot.

    exportdecorateditems

    Parameters

    • selector: string

    Returns (Anonymous function)

queryAll

  • queryAll(selector: string): (Anonymous function)
  • A property decorator that converts a class property into a getter that executes a querySelectorAll on the element's renderRoot.

    exportdecorateditems

    Parameters

    • selector: string

    Returns (Anonymous function)

Generated using TypeDoc