From 1fd5f9cfbd5d3d35b182e29439bb34663666cdf0 Mon Sep 17 00:00:00 2001 From: Steven Orvell Date: Wed, 21 Feb 2018 11:54:53 -0800 Subject: [PATCH] update types --- types/externs/closure-types.d.ts | 10 ---------- types/externs/polymer-externs.d.ts | 10 ---------- .../externs/polymer-internal-shared-types.d.ts | 10 ---------- types/externs/webcomponents-externs.d.ts | 10 ---------- types/gulpfile.d.ts | 18 ------------------ types/lib/elements/array-selector.d.ts | 2 +- types/lib/elements/dom-module.d.ts | 13 +++++++++++++ types/lib/legacy/legacy-element-mixin.d.ts | 2 +- types/lib/legacy/mutable-data-behavior.d.ts | 4 ++++ types/lib/legacy/templatizer-behavior.d.ts | 2 ++ types/lib/mixins/dir-mixin.d.ts | 2 +- types/lib/mixins/disable-upgrade-mixin.d.ts | 10 +++++----- types/lib/mixins/element-mixin.d.ts | 2 +- types/lib/mixins/properties-changed.d.ts | 4 ++-- types/lib/mixins/properties-mixin.d.ts | 2 +- types/lib/mixins/property-accessors.d.ts | 8 ++++---- types/lib/mixins/property-effects.d.ts | 2 +- types/util/minimalDocument.d.ts | 13 ------------- 18 files changed, 36 insertions(+), 88 deletions(-) delete mode 100644 types/externs/closure-types.d.ts delete mode 100644 types/externs/polymer-externs.d.ts delete mode 100644 types/externs/polymer-internal-shared-types.d.ts delete mode 100644 types/externs/webcomponents-externs.d.ts delete mode 100644 types/gulpfile.d.ts delete mode 100644 types/util/minimalDocument.d.ts diff --git a/types/externs/closure-types.d.ts b/types/externs/closure-types.d.ts deleted file mode 100644 index a9dac916c2..0000000000 --- a/types/externs/closure-types.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -/** - * DO NOT EDIT - * - * This file was automatically generated by - * https://github.com/Polymer/gen-typescript-declarations - * - * To modify these typings, edit the source file(s): - * externs/closure-types.js - */ - diff --git a/types/externs/polymer-externs.d.ts b/types/externs/polymer-externs.d.ts deleted file mode 100644 index 6cf2cc7426..0000000000 --- a/types/externs/polymer-externs.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -/** - * DO NOT EDIT - * - * This file was automatically generated by - * https://github.com/Polymer/gen-typescript-declarations - * - * To modify these typings, edit the source file(s): - * externs/polymer-externs.js - */ - diff --git a/types/externs/polymer-internal-shared-types.d.ts b/types/externs/polymer-internal-shared-types.d.ts deleted file mode 100644 index f6fef0f1fe..0000000000 --- a/types/externs/polymer-internal-shared-types.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -/** - * DO NOT EDIT - * - * This file was automatically generated by - * https://github.com/Polymer/gen-typescript-declarations - * - * To modify these typings, edit the source file(s): - * externs/polymer-internal-shared-types.js - */ - diff --git a/types/externs/webcomponents-externs.d.ts b/types/externs/webcomponents-externs.d.ts deleted file mode 100644 index 87cdda9b58..0000000000 --- a/types/externs/webcomponents-externs.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -/** - * DO NOT EDIT - * - * This file was automatically generated by - * https://github.com/Polymer/gen-typescript-declarations - * - * To modify these typings, edit the source file(s): - * externs/webcomponents-externs.js - */ - diff --git a/types/gulpfile.d.ts b/types/gulpfile.d.ts deleted file mode 100644 index 2d52f67506..0000000000 --- a/types/gulpfile.d.ts +++ /dev/null @@ -1,18 +0,0 @@ -/** - * DO NOT EDIT - * - * This file was automatically generated by - * https://github.com/Polymer/gen-typescript-declarations - * - * To modify these typings, edit the source file(s): - * gulpfile.js - */ - -declare class BackfillStream { - _transform(file: any, enc: any, cb: any): any; - _flush(cb: any): any; -} - -declare class AddClosureTypeImport { - _transform(file: any, enc: any, cb: any): any; -} diff --git a/types/lib/elements/array-selector.d.ts b/types/lib/elements/array-selector.d.ts index 8a009f1248..1d99ee52e4 100644 --- a/types/lib/elements/array-selector.d.ts +++ b/types/lib/elements/array-selector.d.ts @@ -29,7 +29,7 @@ declare namespace Polymer { * representing the last selected item. When `multi` is true, `selected` * is an array of multiply selected items. */ - function ArraySelectorMixin {}>(base: T): T & ArraySelectorMixinConstructor & Polymer.ElementMixinConstructor; + function ArraySelectorMixin {}>(base: T): T & ArraySelectorMixinConstructor & Polymer.ElementMixinConstructor & Polymer.PropertyEffectsConstructor & Polymer.TemplateStampConstructor & Polymer.PropertyAccessorsConstructor & Polymer.PropertiesChangedConstructor & Polymer.PropertiesMixinConstructor; interface ArraySelectorMixinConstructor { new(...args: any[]): ArraySelectorMixin; diff --git a/types/lib/elements/dom-module.d.ts b/types/lib/elements/dom-module.d.ts index 960513849d..7229968d42 100644 --- a/types/lib/elements/dom-module.d.ts +++ b/types/lib/elements/dom-module.d.ts @@ -33,6 +33,19 @@ declare namespace Polymer { * let img = customElements.get('dom-module').import('foo', 'img'); */ class DomModule extends HTMLElement { + + /** + * The absolute URL of the original location of this `dom-module`. + * + * This value will differ from this element's `ownerDocument` in the + * following ways: + * - Takes into account any `assetpath` attribute added during bundling + * to indicate the original location relative to the bundled location + * - Uses the HTMLImports polyfill's `importForElement` API to ensure + * the path is relative to the import document's location since + * `ownerDocument` is not currently polyfilled + * + */ readonly assetpath: any; /** diff --git a/types/lib/legacy/legacy-element-mixin.d.ts b/types/lib/legacy/legacy-element-mixin.d.ts index d8b1fb0dfa..cfe9164678 100644 --- a/types/lib/legacy/legacy-element-mixin.d.ts +++ b/types/lib/legacy/legacy-element-mixin.d.ts @@ -26,7 +26,7 @@ declare namespace Polymer { * found on the Polymer 1.x `Polymer.Base` prototype applied to all elements * defined using the `Polymer({...})` function. */ - function LegacyElementMixin {}>(base: T): T & LegacyElementMixinConstructor & Polymer.ElementMixinConstructor & Polymer.GestureEventListenersConstructor; + function LegacyElementMixin {}>(base: T): T & LegacyElementMixinConstructor & Polymer.ElementMixinConstructor & Polymer.PropertyEffectsConstructor & Polymer.TemplateStampConstructor & Polymer.PropertyAccessorsConstructor & Polymer.PropertiesChangedConstructor & Polymer.PropertiesMixinConstructor & Polymer.GestureEventListenersConstructor; interface LegacyElementMixinConstructor { new(...args: any[]): LegacyElementMixin; diff --git a/types/lib/legacy/mutable-data-behavior.d.ts b/types/lib/legacy/mutable-data-behavior.d.ts index 67c7f5d50e..ea580cc881 100644 --- a/types/lib/legacy/mutable-data-behavior.d.ts +++ b/types/lib/legacy/mutable-data-behavior.d.ts @@ -66,6 +66,8 @@ declare namespace Polymer { _shouldPropertyChange(property: string, value: any, old: any): boolean; } + const MutableDataBehavior: object; + /** * Legacy element behavior to add the optional ability to skip strict * dirty-checking for objects and arrays (always consider them to be @@ -128,4 +130,6 @@ declare namespace Polymer { */ _shouldPropertyChange(property: string, value: any, old: any): boolean; } + + const OptionalMutableDataBehavior: object; } diff --git a/types/lib/legacy/templatizer-behavior.d.ts b/types/lib/legacy/templatizer-behavior.d.ts index cf91f2eb40..81f1df4a2e 100644 --- a/types/lib/legacy/templatizer-behavior.d.ts +++ b/types/lib/legacy/templatizer-behavior.d.ts @@ -111,4 +111,6 @@ declare namespace Polymer { */ modelForElement(el: HTMLElement|null): TemplateInstanceBase|null; } + + const Templatizer: object; } diff --git a/types/lib/mixins/dir-mixin.d.ts b/types/lib/mixins/dir-mixin.d.ts index 20f5050395..58aa8136b9 100644 --- a/types/lib/mixins/dir-mixin.d.ts +++ b/types/lib/mixins/dir-mixin.d.ts @@ -29,7 +29,7 @@ declare namespace Polymer { * - Changing `dir` at runtime is supported. * - Opting out of the global direction styling is permanent */ - function DirMixin {}>(base: T): T & DirMixinConstructor & Polymer.PropertyAccessorsConstructor; + function DirMixin {}>(base: T): T & DirMixinConstructor & Polymer.PropertyAccessorsConstructor & Polymer.PropertiesChangedConstructor; interface DirMixinConstructor { new(...args: any[]): DirMixin; diff --git a/types/lib/mixins/disable-upgrade-mixin.d.ts b/types/lib/mixins/disable-upgrade-mixin.d.ts index fe7bbc5ce7..2e1b1f32b2 100644 --- a/types/lib/mixins/disable-upgrade-mixin.d.ts +++ b/types/lib/mixins/disable-upgrade-mixin.d.ts @@ -38,28 +38,28 @@ declare namespace Polymer { } interface DisableUpgradeMixin { - attributeChangedCallback(name: any, old: any, value: any): any; + attributeChangedCallback(name: any, old: any, value: any): void; /** * NOTE: cannot gate on attribute because this is called before * attributes are delivered. Therefore, we stub this out and * call `super._initializeProperties()` manually. */ - _initializeProperties(): any; + _initializeProperties(): void; /** * prevent user code in connected from running */ - connectedCallback(): any; + connectedCallback(): void; /** * prevent element from turning on properties */ - _enableProperties(): any; + _enableProperties(): void; /** * only go if "enabled" */ - disconnectedCallback(): any; + disconnectedCallback(): void; } } diff --git a/types/lib/mixins/element-mixin.d.ts b/types/lib/mixins/element-mixin.d.ts index 3d98b8423a..d08da7e33d 100644 --- a/types/lib/mixins/element-mixin.d.ts +++ b/types/lib/mixins/element-mixin.d.ts @@ -76,7 +76,7 @@ declare namespace Polymer { * `observedAttributes` implementation will automatically return an array * of dash-cased attributes based on `properties`) */ - function ElementMixin {}>(base: T): T & ElementMixinConstructor & Polymer.PropertyEffectsConstructor & Polymer.PropertiesMixinConstructor; + function ElementMixin {}>(base: T): T & ElementMixinConstructor & Polymer.PropertyEffectsConstructor & Polymer.TemplateStampConstructor & Polymer.PropertyAccessorsConstructor & Polymer.PropertiesChangedConstructor & Polymer.PropertiesMixinConstructor; interface ElementMixinConstructor { new(...args: any[]): ElementMixin; diff --git a/types/lib/mixins/properties-changed.d.ts b/types/lib/mixins/properties-changed.d.ts index 02555dcb96..13364e1980 100644 --- a/types/lib/mixins/properties-changed.d.ts +++ b/types/lib/mixins/properties-changed.d.ts @@ -56,7 +56,7 @@ declare namespace Polymer { * * @param name Name of property */ - typeForProperty(name: string): any; + typeForProperty(name: string): void; } interface PropertiesChanged { @@ -84,7 +84,7 @@ declare namespace Polymer { * * @param property Name of the property */ - _addPropertyToAttributeMap(property: string): any; + _addPropertyToAttributeMap(property: string): void; /** * Defines a property accessor for the given property. diff --git a/types/lib/mixins/properties-mixin.d.ts b/types/lib/mixins/properties-mixin.d.ts index a5ed6a966f..566cd68633 100644 --- a/types/lib/mixins/properties-mixin.d.ts +++ b/types/lib/mixins/properties-mixin.d.ts @@ -53,7 +53,7 @@ declare namespace Polymer { * accessors exist on the element prototype. This method is called by * `finalize` and finalizes the class constructor. */ - _finalizeClass(): any; + _finalizeClass(): void; } interface PropertiesMixin { diff --git a/types/lib/mixins/property-accessors.d.ts b/types/lib/mixins/property-accessors.d.ts index 186536e1dc..b4c738aca7 100644 --- a/types/lib/mixins/property-accessors.d.ts +++ b/types/lib/mixins/property-accessors.d.ts @@ -24,14 +24,14 @@ declare namespace Polymer { * For basic usage of this mixin: * * - Declare attributes to observe via the standard `static get observedAttributes()`. Use - * `dash-case` attribute names to represent `camelCase` property names. + * `dash-case` attribute names to represent `camelCase` property names. * - Implement the `_propertiesChanged` callback on the class. - * - Call `MyClass.createPropertiesForAttributes()` **once** on the class to generate - * property accessors for each observed attribute. This must be called before the first + * - Call `MyClass.createPropertiesForAttributes()` **once** on the class to generate + * property accessors for each observed attribute. This must be called before the first * instance is created, for example, by calling it before calling `customElements.define`. * It can also be called lazily from the element's `constructor`, as long as it's guarded so * that the call is only made once, when the first instance is created. - * - Call `this._enableProperties()` in the element's `connectedCallback` to enable + * - Call `this._enableProperties()` in the element's `connectedCallback` to enable * the accessors. * * Any `observedAttributes` will automatically be diff --git a/types/lib/mixins/property-effects.d.ts b/types/lib/mixins/property-effects.d.ts index da3239df3c..572674abe3 100644 --- a/types/lib/mixins/property-effects.d.ts +++ b/types/lib/mixins/property-effects.d.ts @@ -46,7 +46,7 @@ declare namespace Polymer { * whereas the default when using `PropertyAccessors` standalone is to be * async by default. */ - function PropertyEffects {}>(base: T): T & PropertyEffectsConstructor & Polymer.TemplateStampConstructor & Polymer.PropertyAccessorsConstructor; + function PropertyEffects {}>(base: T): T & PropertyEffectsConstructor & Polymer.TemplateStampConstructor & Polymer.PropertyAccessorsConstructor & Polymer.PropertiesChangedConstructor; interface PropertyEffectsConstructor { new(...args: any[]): PropertyEffects; diff --git a/types/util/minimalDocument.d.ts b/types/util/minimalDocument.d.ts deleted file mode 100644 index 6b08817411..0000000000 --- a/types/util/minimalDocument.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -/** - * DO NOT EDIT - * - * This file was automatically generated by - * https://github.com/Polymer/gen-typescript-declarations - * - * To modify these typings, edit the source file(s): - * util/minimalDocument.js - */ - -declare class MinimalDocTransform { - _transform(file: any, enc: any, cb: any): any; -}