Skip to content

Commit

Permalink
update types
Browse files Browse the repository at this point in the history
  • Loading branch information
Steven Orvell committed Feb 21, 2018
1 parent 5bc45ce commit 1fd5f9c
Show file tree
Hide file tree
Showing 18 changed files with 36 additions and 88 deletions.
10 changes: 0 additions & 10 deletions types/externs/closure-types.d.ts

This file was deleted.

10 changes: 0 additions & 10 deletions types/externs/polymer-externs.d.ts

This file was deleted.

10 changes: 0 additions & 10 deletions types/externs/polymer-internal-shared-types.d.ts

This file was deleted.

10 changes: 0 additions & 10 deletions types/externs/webcomponents-externs.d.ts

This file was deleted.

18 changes: 0 additions & 18 deletions types/gulpfile.d.ts

This file was deleted.

2 changes: 1 addition & 1 deletion types/lib/elements/array-selector.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<T extends new (...args: any[]) => {}>(base: T): T & ArraySelectorMixinConstructor & Polymer.ElementMixinConstructor;
function ArraySelectorMixin<T extends new (...args: any[]) => {}>(base: T): T & ArraySelectorMixinConstructor & Polymer.ElementMixinConstructor & Polymer.PropertyEffectsConstructor & Polymer.TemplateStampConstructor & Polymer.PropertyAccessorsConstructor & Polymer.PropertiesChangedConstructor & Polymer.PropertiesMixinConstructor;

interface ArraySelectorMixinConstructor {
new(...args: any[]): ArraySelectorMixin;
Expand Down
13 changes: 13 additions & 0 deletions types/lib/elements/dom-module.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;

/**
Expand Down
2 changes: 1 addition & 1 deletion types/lib/legacy/legacy-element-mixin.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<T extends new (...args: any[]) => {}>(base: T): T & LegacyElementMixinConstructor & Polymer.ElementMixinConstructor & Polymer.GestureEventListenersConstructor;
function LegacyElementMixin<T extends new (...args: any[]) => {}>(base: T): T & LegacyElementMixinConstructor & Polymer.ElementMixinConstructor & Polymer.PropertyEffectsConstructor & Polymer.TemplateStampConstructor & Polymer.PropertyAccessorsConstructor & Polymer.PropertiesChangedConstructor & Polymer.PropertiesMixinConstructor & Polymer.GestureEventListenersConstructor;

interface LegacyElementMixinConstructor {
new(...args: any[]): LegacyElementMixin;
Expand Down
4 changes: 4 additions & 0 deletions types/lib/legacy/mutable-data-behavior.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -128,4 +130,6 @@ declare namespace Polymer {
*/
_shouldPropertyChange(property: string, value: any, old: any): boolean;
}

const OptionalMutableDataBehavior: object;
}
2 changes: 2 additions & 0 deletions types/lib/legacy/templatizer-behavior.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,4 +111,6 @@ declare namespace Polymer {
*/
modelForElement(el: HTMLElement|null): TemplateInstanceBase|null;
}

const Templatizer: object;
}
2 changes: 1 addition & 1 deletion types/lib/mixins/dir-mixin.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ declare namespace Polymer {
* - Changing `dir` at runtime is supported.
* - Opting out of the global direction styling is permanent
*/
function DirMixin<T extends new (...args: any[]) => {}>(base: T): T & DirMixinConstructor & Polymer.PropertyAccessorsConstructor;
function DirMixin<T extends new (...args: any[]) => {}>(base: T): T & DirMixinConstructor & Polymer.PropertyAccessorsConstructor & Polymer.PropertiesChangedConstructor;

interface DirMixinConstructor {
new(...args: any[]): DirMixin;
Expand Down
10 changes: 5 additions & 5 deletions types/lib/mixins/disable-upgrade-mixin.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
2 changes: 1 addition & 1 deletion types/lib/mixins/element-mixin.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ declare namespace Polymer {
* `observedAttributes` implementation will automatically return an array
* of dash-cased attributes based on `properties`)
*/
function ElementMixin<T extends new (...args: any[]) => {}>(base: T): T & ElementMixinConstructor & Polymer.PropertyEffectsConstructor & Polymer.PropertiesMixinConstructor;
function ElementMixin<T extends new (...args: any[]) => {}>(base: T): T & ElementMixinConstructor & Polymer.PropertyEffectsConstructor & Polymer.TemplateStampConstructor & Polymer.PropertyAccessorsConstructor & Polymer.PropertiesChangedConstructor & Polymer.PropertiesMixinConstructor;

interface ElementMixinConstructor {
new(...args: any[]): ElementMixin;
Expand Down
4 changes: 2 additions & 2 deletions types/lib/mixins/properties-changed.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ declare namespace Polymer {
*
* @param name Name of property
*/
typeForProperty(name: string): any;
typeForProperty(name: string): void;
}

interface PropertiesChanged {
Expand Down Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion types/lib/mixins/properties-mixin.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
8 changes: 4 additions & 4 deletions types/lib/mixins/property-accessors.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion types/lib/mixins/property-effects.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ declare namespace Polymer {
* whereas the default when using `PropertyAccessors` standalone is to be
* async by default.
*/
function PropertyEffects<T extends new (...args: any[]) => {}>(base: T): T & PropertyEffectsConstructor & Polymer.TemplateStampConstructor & Polymer.PropertyAccessorsConstructor;
function PropertyEffects<T extends new (...args: any[]) => {}>(base: T): T & PropertyEffectsConstructor & Polymer.TemplateStampConstructor & Polymer.PropertyAccessorsConstructor & Polymer.PropertiesChangedConstructor;

interface PropertyEffectsConstructor {
new(...args: any[]): PropertyEffects;
Expand Down
13 changes: 0 additions & 13 deletions types/util/minimalDocument.d.ts

This file was deleted.

0 comments on commit 1fd5f9c

Please sign in to comment.