@polymer/polymer
Version:
The Polymer library makes it easy to create your own web components. Give your element some markup and properties, and then use it on a site. Polymer provides features like dynamic templates and data binding to reduce the amount of boilerplate you need to
54 lines (45 loc) • 2.4 kB
TypeScript
/**
* DO NOT EDIT
*
* This file was automatically generated by
* https://github.com/Polymer/tools/tree/master/packages/gen-typescript-declarations
*
* To modify these typings, edit the source file(s):
* lib/mixins/disable-upgrade-mixin.html
*/
// tslint:disable:variable-name Describing an API that's defined elsewhere.
// tslint:disable:no-any describes the API as best we are able today
/// <reference path="element-mixin.d.ts" />
declare namespace Polymer {
/**
* Element class mixin that allows the element to boot up in a non-enabled
* state when the `disable-upgrade` attribute is present. This mixin is
* designed to be used with element classes like Polymer.Element that perform
* initial startup work when they are first connected. When the
* `disable-upgrade` attribute is removed, if the element is connected, it
* boots up and "enables" as it otherwise would; if it is not connected, the
* element boots up when it is next connected.
*
* Using `disable-upgrade` with Polymer.Element prevents any data propagation
* to the element, any element DOM from stamping, or any work done in
* connected/disconnctedCallback from occuring, but it does not prevent work
* done in the element constructor.
*
* Note, this mixin must be applied on top of any element class that
* itself implements a `connectedCallback` so that it can control the work
* done in `connectedCallback`. For example,
*
* MyClass = Polymer.DisableUpgradeMixin(class extends BaseClass {...});
*/
function DisableUpgradeMixin<T extends new (...args: any[]) => {}>(base: T): T & DisableUpgradeMixinConstructor & Polymer.ElementMixinConstructor & Polymer.PropertyEffectsConstructor & Polymer.TemplateStampConstructor & Polymer.PropertyAccessorsConstructor & Polymer.PropertiesChangedConstructor & Polymer.PropertiesMixinConstructor;
interface DisableUpgradeMixinConstructor {
new(...args: any[]): DisableUpgradeMixin;
}
interface DisableUpgradeMixin extends Polymer.ElementMixin, Polymer.PropertyEffects, Polymer.TemplateStamp, Polymer.PropertyAccessors, Polymer.PropertiesChanged, Polymer.PropertiesMixin {
_initializeProperties(): void;
_enableProperties(): void;
attributeChangedCallback(name: any, old: any, value: any, namespace: any): void;
connectedCallback(): void;
disconnectedCallback(): void;
}
}