Skip to content

Commit

Permalink
Regenerate types.
Browse files Browse the repository at this point in the history
  • Loading branch information
aomarks committed Jul 26, 2018
1 parent 50ba80b commit 7f68ab5
Show file tree
Hide file tree
Showing 17 changed files with 8,974 additions and 7,106 deletions.
2 changes: 1 addition & 1 deletion externs/closure-types.js
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ Polymer_TemplateStamp.prototype._addMethodEventListenerToNode = function(node, e
*/
Polymer_TemplateStamp.prototype._addEventListenerToNode = function(node, eventName, handler){};
/**
* @param {Node} node Node to remove event listener from
* @param {!Node} node Node to remove event listener from
* @param {string} eventName Name of event
* @param {function (!Event): void} handler Listener function to remove
* @return {void}
Expand Down
15,876 changes: 8,885 additions & 6,991 deletions package-lock.json

Large diffs are not rendered by default.

150 changes: 75 additions & 75 deletions types/extra-types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,131 +7,131 @@
// Types from "externs/polymer-externs.js"

interface PolymerElementPropertiesMeta {
type?: Function;
value?: any;
readOnly?: boolean;
computed?: string;
reflectToAttribute?: boolean;
notify?: boolean;
observer?: string|((val: any, old: any) => void);
type?: Function;
value?: any;
readOnly?: boolean;
computed?: string;
reflectToAttribute?: boolean;
notify?: boolean;
observer?: string|((val: any, old: any) => void);
}

type PolymerElementProperties = {
[key: string]: PolymerElementPropertiesMeta | Function;
[key: string]: PolymerElementPropertiesMeta|Function;
};

// TODO Document these properties.
interface PolymerInit {
is: string;
extends?: string;
properties?: PolymerElementProperties;
observers?: string[];
template?: HTMLTemplateElement|string;
hostAttributes?: {[key: string]: any};
listeners?: {[key: string]: string};
is: string;
extends?: string;
properties?: PolymerElementProperties;
observers?: string[];
template?: HTMLTemplateElement|string;
hostAttributes?: {[key: string]: any};
listeners?: {[key: string]: string};
}

// Types from "externs/polymer-internal-shared-types.js"

interface StampedTemplate extends DocumentFragment {
__noInsertionPoint: boolean;
nodeList: Node[];
$: {[key: string]: Node};
templateInfo?: TemplateInfo;
__noInsertionPoint: boolean;
nodeList: Node[];
$: {[key: string]: Node};
templateInfo?: TemplateInfo;
}

interface NodeInfo {
id: string;
events: {name: string, value: string}[];
hasInsertionPoint: boolean;
templateInfo: TemplateInfo;
parentInfo: NodeInfo;
parentIndex: number;
infoIndex: number;
bindings: Binding[];
id: string;
events: {name: string, value: string}[];
hasInsertionPoint: boolean;
templateInfo: TemplateInfo;
parentInfo: NodeInfo;
parentIndex: number;
infoIndex: number;
bindings: Binding[];
}

interface TemplateInfo {
nodeInfoList: NodeInfo[];
nodeList: Node[];
stripWhitespace: boolean;
hasInsertionPoint?: boolean;
hostProps: Object;
propertyEffects: Object;
nextTemplateInfo?: TemplateInfo;
previousTemplateInfo?: TemplateInfo;
childNodes: Node[];
wasPreBound: boolean;
nodeInfoList: NodeInfo[];
nodeList: Node[];
stripWhitespace: boolean;
hasInsertionPoint?: boolean;
hostProps: Object;
propertyEffects: Object;
nextTemplateInfo?: TemplateInfo;
previousTemplateInfo?: TemplateInfo;
childNodes: Node[];
wasPreBound: boolean;
}

interface LiteralBindingPart {
literal: string;
compoundIndex?: number;
literal: string;
compoundIndex?: number;
}

interface MethodArg {
literal: boolean;
name: string;
value: string|number;
rootProperty?: string;
structured?: boolean;
wildcard?: boolean;
literal: boolean;
name: string;
value: string|number;
rootProperty?: string;
structured?: boolean;
wildcard?: boolean;
}

interface MethodSignature {
methodName: string;
static: boolean;
args: MethodArg[];
dynamicFn?: boolean;
methodName: string;
static: boolean;
args: MethodArg[];
dynamicFn?: boolean;
}

interface ExpressionBindingPart {
mode: string;
negate: boolean;
source: string;
dependencies: Array<MethodArg|string>;
customEvent: boolean;
signature: Object|null;
event: string;
mode: string;
negate: boolean;
source: string;
dependencies: Array<MethodArg|string>;
customEvent: boolean;
signature: Object|null;
event: string;
}

type BindingPart = LiteralBindingPart|ExpressionBindingPart;

interface Binding {
kind: string;
target: string;
parts: BindingPart[];
literal?: string;
isCompound: boolean;
listenerEvent?: string;
listenerNegate?: boolean;
kind: string;
target: string;
parts: BindingPart[];
literal?: string;
isCompound: boolean;
listenerEvent?: string;
listenerNegate?: boolean;
}

interface AsyncInterface {
run: (fn: Function, delay?: number) => number;
cancel: (handle: number) => void;
run: (fn: Function, delay?: number) => number;
cancel: (handle: number) => void;
}

// Types from "lib/utils/gestures.html"

interface GestureRecognizer {
reset: () => void;
mousedown?: (e: MouseEvent) => void;
mousemove?: (e: MouseEvent) => void;
mouseup?: (e: MouseEvent) => void;
touchstart?: (e: TouchEvent) => void;
touchmove?: (e: TouchEvent) => void;
touchend?: (e: TouchEvent) => void;
click?: (e: MouseEvent) => void;
reset: () => void;
mousedown?: (e: MouseEvent) => void;
mousemove?: (e: MouseEvent) => void;
mouseup?: (e: MouseEvent) => void;
touchstart?: (e: TouchEvent) => void;
touchmove?: (e: TouchEvent) => void;
touchend?: (e: TouchEvent) => void;
click?: (e: MouseEvent) => void;
}

/**
* Not defined in the TypeScript DOM library.
* See https://developer.mozilla.org/en-US/docs/Web/API/IdleDeadline
*/
interface IdleDeadline {
didTimeout: boolean;
timeRemaining(): number;
didTimeout: boolean;
timeRemaining(): number;
}

/**
Expand Down
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 @@ -35,7 +35,7 @@ declare namespace Polymer {
new(...args: any[]): ArraySelectorMixin;
}

interface ArraySelectorMixin {
interface ArraySelectorMixin extends Polymer.ElementMixin, Polymer.PropertyEffects, Polymer.TemplateStamp, Polymer.PropertyAccessors, Polymer.PropertiesChanged, Polymer.PropertiesMixin {

/**
* An array containing items from which selection will be made.
Expand Down
2 changes: 1 addition & 1 deletion types/lib/elements/dom-bind.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ declare namespace Polymer {
Polymer.PropertyEffects(
Polymer.OptionalMutableData(
Polymer.GestureEventListeners(
Polymer.Element))) {
HTMLElement))) {
attributeChangedCallback(): void;
connectedCallback(): void;
disconnectedCallback(): void;
Expand Down
2 changes: 1 addition & 1 deletion types/lib/elements/dom-repeat.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -210,8 +210,8 @@ declare namespace Polymer {
*/
targetFramerate: number|null|undefined;
readonly _targetFrameTime: number|null|undefined;
disconnectedCallback(): void;
connectedCallback(): void;
disconnectedCallback(): void;

/**
* Forces the element to render its content. Normally rendering is
Expand Down
20 changes: 0 additions & 20 deletions types/lib/legacy/class.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,23 +93,3 @@ declare namespace Polymer {
*/
function Class(info: PolymerInit): {new(): HTMLElement};
}

declare class PolymerGenerated {
created(): void;
_registered(): void;
_applyListeners(): void;
_ensureAttributes(): void;
ready(): void;
attached(): void;
detached(): void;

/**
* Implements native Custom Elements `attributeChangedCallback` to
* set an attribute value to a property via `_attributeToProperty`.
*
* @param name Name of attribute that changed
* @param old Old attribute value
* @param value New attribute value
*/
attributeChanged(name: string, old: string|null, value: string|null): void;
}
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 @@ -32,7 +32,7 @@ declare namespace Polymer {
new(...args: any[]): LegacyElementMixin;
}

interface LegacyElementMixin {
interface LegacyElementMixin extends Polymer.ElementMixin, Polymer.PropertyEffects, Polymer.TemplateStamp, Polymer.PropertyAccessors, Polymer.PropertiesChanged, Polymer.PropertiesMixin, Polymer.GestureEventListeners {
isAttached: boolean;
_debouncers: {[key: string]: Function|null};

Expand Down
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 @@ -44,7 +44,7 @@ declare namespace Polymer {
_replaceDirInCssText(text: string): string;
}

interface DirMixin {
interface DirMixin extends Polymer.PropertyAccessors, Polymer.PropertiesChanged {
ready(): void;
connectedCallback(): void;
disconnectedCallback(): void;
Expand Down
2 changes: 1 addition & 1 deletion types/lib/mixins/disable-upgrade-mixin.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ declare namespace Polymer {
new(...args: any[]): DisableUpgradeMixin;
}

interface 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;
Expand Down
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 @@ -132,7 +132,7 @@ declare namespace Polymer {
_finalizeTemplate(is: string): void;
}

interface ElementMixin {
interface ElementMixin extends Polymer.PropertyEffects, Polymer.TemplateStamp, Polymer.PropertyAccessors, Polymer.PropertiesChanged, Polymer.PropertiesMixin {
_template: HTMLTemplateElement|null;
_importPath: string;
rootPath: string;
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 @@ -56,7 +56,7 @@ declare namespace Polymer {
_finalizeClass(): void;
}

interface PropertiesMixin {
interface PropertiesMixin extends Polymer.PropertiesChanged {

/**
* Overrides `PropertiesChanged` method and adds a call to
Expand Down
2 changes: 1 addition & 1 deletion types/lib/mixins/property-accessors.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ declare namespace Polymer {
createPropertiesForAttributes(): void;
}

interface PropertyAccessors {
interface PropertyAccessors extends Polymer.PropertiesChanged {

/**
* Overrides PropertiesChanged implementation to save existing prototype
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 @@ -290,7 +290,7 @@ declare namespace Polymer {
_evaluateBinding(inst: this|null, part: BindingPart|null, path: string, props: object|null, oldProps: object|null, hasPaths: boolean): any;
}

interface PropertyEffects {
interface PropertyEffects extends Polymer.TemplateStamp, Polymer.PropertyAccessors, Polymer.PropertiesChanged {
readonly PROPERTY_EFFECT_TYPES: any;

/**
Expand Down
2 changes: 1 addition & 1 deletion types/lib/mixins/strict-binding-parser.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,6 @@ declare namespace Polymer {
_parseBindings(text: string, templateInfo: object|null): BindingPart[]|null;
}

interface StrictBindingParser {
interface StrictBindingParser extends Polymer.PropertyEffects, Polymer.TemplateStamp, Polymer.PropertyAccessors, Polymer.PropertiesChanged {
}
}
2 changes: 1 addition & 1 deletion types/lib/mixins/template-stamp.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,6 @@ declare namespace Polymer {
* @param eventName Name of event
* @param handler Listener function to remove
*/
_removeEventListenerFromNode(node: Node|null, eventName: string, handler: (p0: Event) => void): void;
_removeEventListenerFromNode(node: Node, eventName: string, handler: (p0: Event) => void): void;
}
}
8 changes: 1 addition & 7 deletions types/lib/utils/templatize.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

declare class TemplateInstanceBase extends
Polymer.PropertyEffects(
Polymer.Element) {
Object) {

/**
* Find the parent model of this template instance. The parent model
Expand Down Expand Up @@ -76,12 +76,6 @@ declare class TemplateInstanceBase extends
dispatchEvent(event: Event|null): boolean;
}

declare namespace templateInfo {

class templatizeTemplateClass {
}
}

declare namespace Polymer {

/**
Expand Down

0 comments on commit 7f68ab5

Please sign in to comment.