/** * @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 */ import { PropertyDeclaration } from './updating-element.js'; export declare type Constructor = { new (...args: any[]): T; }; interface ClassDescriptor { kind: 'class'; elements: ClassElement[]; finisher?: (clazz: Constructor) => undefined | Constructor; } interface ClassElement { kind: 'field' | 'method'; key: PropertyKey; placement: 'static' | 'prototype' | 'own'; initializer?: Function; extras?: ClassElement[]; finisher?: (clazz: Constructor) => undefined | Constructor; descriptor?: PropertyDescriptor; } /** * Class decorator factory that defines the decorated class as a custom element. * * @param tagName the name of the custom element to define * * In TypeScript, the `tagName` passed to `customElement` should be a key of the * `HTMLElementTagNameMap` interface. To add your element to the interface, * declare the interface in this module: * * @customElement('my-element') * export class MyElement extends LitElement {} * * declare global { * interface HTMLElementTagNameMap { * 'my-element': MyElement; * } * } * */ export declare const customElement: (tagName: string) => (classOrDescriptor: ClassDescriptor | Constructor) => any; /** * A property decorator which creates a LitElement property which reflects a * corresponding attribute value. A `PropertyDeclaration` may optionally be * supplied to configure property features. */ export declare const property: (options?: PropertyDeclaration | undefined) => (protoOrDescriptor: Object | ClassElement, name?: string | number | symbol | undefined) => any; /** * A property decorator that converts a class property into a getter that * executes a querySelector on the element's renderRoot. */ export declare const query: (selector: string) => (protoOrDescriptor: Object | ClassElement, name?: string | number | symbol | undefined) => any; /** * A property decorator that converts a class property into a getter * that executes a querySelectorAll on the element's renderRoot. */ export declare const queryAll: (selector: string) => (protoOrDescriptor: Object | ClassElement, name?: string | number | symbol | undefined) => any; /** * Adds event listener options to a method used as an event listener in a * lit-html template. * * @param options An object that specifis event listener options as accepted by * `EventTarget#addEventListener` and `EventTarget#removeEventListener`. * * Current browsers support the `capture`, `passive`, and `once` options. See: * https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener#Parameters * * @example * * class MyElement { * * clicked = false; * * render() { * return html`
`; * } * * @eventOptions({capture: true}) * _onClick(e) { * this.clicked = true; * } * } */ export declare const eventOptions: (options: AddEventListenerOptions) => any; export {}; //# sourceMappingURL=decorators.d.ts.map