UNPKG

4.01 kBTypeScriptView Raw
1/**
2 * @license
3 * Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
4 * This code may only be used under the BSD style license found at
5 * http://polymer.github.io/LICENSE.txt
6 * The complete set of authors may be found at
7 * http://polymer.github.io/AUTHORS.txt
8 * The complete set of contributors may be found at
9 * http://polymer.github.io/CONTRIBUTORS.txt
10 * Code distributed by Google as part of the polymer project is also
11 * subject to an additional IP rights grant found at
12 * http://polymer.github.io/PATENTS.txt
13 */
14import { TemplateResult } from 'lit-html';
15import { PropertyValues, UpdatingElement } from './lib/updating-element.js';
16export * from './lib/updating-element.js';
17export * from './lib/decorators.js';
18export { html, svg, TemplateResult, SVGTemplateResult } from 'lit-html/lit-html';
19import { CSSResult } from './lib/css-tag.js';
20export * from './lib/css-tag.js';
21export declare class LitElement extends UpdatingElement {
22 /**
23 * Ensure this class is marked as `finalized` as an optimization ensuring
24 * it will not needlessly try to `finalize`.
25 */
26 protected static finalized: boolean;
27 /**
28 * Render method used to render the lit-html TemplateResult to the element's
29 * DOM.
30 * @param {TemplateResult} Template to render.
31 * @param {Element|DocumentFragment} Node into which to render.
32 * @param {String} Element name.
33 * @nocollapse
34 */
35 static render: (result: TemplateResult, container: Element | DocumentFragment, options: import("lit-html/lib/shady-render").ShadyRenderOptions) => void;
36 /**
37 * Array of styles to apply to the element. The styles should be defined
38 * using the `css` tag function.
39 */
40 static readonly styles: CSSResult[];
41 private static _styles;
42 private static readonly _uniqueStyles;
43 private _needsShimAdoptedStyleSheets?;
44 /**
45 * Node or ShadowRoot into which element DOM should be rendered. Defaults
46 * to an open shadowRoot.
47 */
48 protected renderRoot?: Element | DocumentFragment;
49 /**
50 * Performs element initialization. By default this calls `createRenderRoot`
51 * to create the element `renderRoot` node and captures any pre-set values for
52 * registered properties.
53 */
54 protected initialize(): void;
55 /**
56 * Returns the node into which the element should render and by default
57 * creates and returns an open shadowRoot. Implement to customize where the
58 * element's DOM is rendered. For example, to render into the element's
59 * childNodes, return `this`.
60 * @returns {Element|DocumentFragment} Returns a node into which to render.
61 */
62 protected createRenderRoot(): Element | ShadowRoot;
63 /**
64 * Applies styling to the element shadowRoot using the `static get styles`
65 * property. Styling will apply using `shadowRoot.adoptedStyleSheets` where
66 * available and will fallback otherwise. When Shadow DOM is polyfilled,
67 * ShadyCSS scopes styles and adds them to the document. When Shadow DOM
68 * is available but `adoptedStyleSheets` is not, styles are appended to the
69 * end of the `shadowRoot` to [mimic spec
70 * behavior](https://wicg.github.io/construct-stylesheets/#using-constructed-stylesheets).
71 */
72 protected adoptStyles(): void;
73 connectedCallback(): void;
74 /**
75 * Updates the element. This method reflects property values to attributes
76 * and calls `render` to render DOM via lit-html. Setting properties inside
77 * this method will *not* trigger another update.
78 * * @param _changedProperties Map of changed properties with old values
79 */
80 protected update(changedProperties: PropertyValues): void;
81 /**
82 * Invoked on each update to perform rendering tasks. This method must return
83 * a lit-html TemplateResult. Setting properties inside this method will *not*
84 * trigger the element to update.
85 */
86 protected render(): TemplateResult | void;
87}
88//# sourceMappingURL=lit-element.d.ts.map
\No newline at end of file