1/**
2 * DO NOT EDIT
3 *
4 * This file was automatically generated by
5 *   https://github.com/Polymer/gen-typescript-declarations
6 *
7 * To modify these typings, edit the source file(s):
8 *   lib/legacy/class.html
9 */
10
11/// <reference path="legacy-element-mixin.d.ts" />
12
13declare namespace Polymer {
14
15
16  /**
17   * Applies a "legacy" behavior or array of behaviors to the provided class.
18   *
19   * Note: this method will automatically also apply the `Polymer.LegacyElementMixin`
20   * to ensure that any legacy behaviors can rely on legacy Polymer API on
21   * the underlying element.
22   *
23   * @returns Returns a new Element class extended by the
24   * passed in `behaviors` and also by `Polymer.LegacyElementMixin`.
25   */
26  function mixinBehaviors<T>(behaviors: object|object[], klass: {new(): T}): {new(): T};
27
28
29  /**
30   * Generates a class that extends `Polymer.LegacyElement` based on the
31   * provided info object.  Metadata objects on the `info` object
32   * (`properties`, `observers`, `listeners`, `behaviors`, `is`) are used
33   * for Polymer's meta-programming systems, and any functions are copied
34   * to the generated class.
35   *
36   * Valid "metadata" values are as follows:
37   *
38   * `is`: String providing the tag name to register the element under. In
39   * addition, if a `dom-module` with the same id exists, the first template
40   * in that `dom-module` will be stamped into the shadow root of this element,
41   * with support for declarative event listeners (`on-...`), Polymer data
42   * bindings (`[[...]]` and `{{...}}`), and id-based node finding into
43   * `this.$`.
44   *
45   * `properties`: Object describing property-related metadata used by Polymer
46   * features (key: property names, value: object containing property metadata).
47   * Valid keys in per-property metadata include:
48   * - `type` (String|Number|Object|Array|...): Used by
49   *   `attributeChangedCallback` to determine how string-based attributes
50   *   are deserialized to JavaScript property values.
51   * - `notify` (boolean): Causes a change in the property to fire a
52   *   non-bubbling event called `<property>-changed`. Elements that have
53   *   enabled two-way binding to the property use this event to observe changes.
54   * - `readOnly` (boolean): Creates a getter for the property, but no setter.
55   *   To set a read-only property, use the private setter method
56   *   `_setProperty(property, value)`.
57   * - `observer` (string): Observer method name that will be called when
58   *   the property changes. The arguments of the method are
59   *   `(value, previousValue)`.
60   * - `computed` (string): String describing method and dependent properties
61   *   for computing the value of this property (e.g. `'computeFoo(bar, zot)'`).
62   *   Computed properties are read-only by default and can only be changed
63   *   via the return value of the computing method.
64   *
65   * `observers`: Array of strings describing multi-property observer methods
66   *  and their dependent properties (e.g. `'observeABC(a, b, c)'`).
67   *
68   * `listeners`: Object describing event listeners to be added to each
69   *  instance of this element (key: event name, value: method name).
70   *
71   * `behaviors`: Array of additional `info` objects containing metadata
72   * and callbacks in the same format as the `info` object here which are
73   * merged into this element.
74   *
75   * `hostAttributes`: Object listing attributes to be applied to the host
76   *  once created (key: attribute name, value: attribute value).  Values
77   *  are serialized based on the type of the value.  Host attributes should
78   *  generally be limited to attributes such as `tabIndex` and `aria-...`.
79   *  Attributes in `hostAttributes` are only applied if a user-supplied
80   *  attribute is not already present (attributes in markup override
81   *  `hostAttributes`).
82   *
83   * In addition, the following Polymer-specific callbacks may be provided:
84   * - `registered`: called after first instance of this element,
85   * - `created`: called during `constructor`
86   * - `attached`: called during `connectedCallback`
87   * - `detached`: called during `disconnectedCallback`
88   * - `ready`: called before first `attached`, after all properties of
89   *   this element have been propagated to its template and all observers
90   *   have run
91   *
92   * @returns Generated class
93   */
94  function Class(info: PolymerInit): {new(): HTMLElement};
95}
96
97declare class PolymerGenerated {
98  created(): void;
99  _registered(): void;
100  _applyListeners(): void;
101  _ensureAttributes(): void;
102  ready(): void;
103  attached(): void;
104  detached(): void;
105
106  /**
107   * Implements native Custom Elements `attributeChangedCallback` to
108   * set an attribute value to a property via `_attributeToProperty`.
109   *
110   * @param name Name of attribute that changed
111   * @param old Old attribute value
112   * @param value New attribute value
113   */
114  attributeChanged(name: string, old: string|null, value: string|null): void;
115}
116