mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-09-09 11:13:57 +08:00
fixed definition files for polymer (description on app router and any
types)
This commit is contained in:
@@ -10,10 +10,6 @@ class AbstractPolymerElement implements PolymerElement {
|
||||
asyncFire(eventName: string, details?: any, targetNode?: any, bubbles?: boolean, cancelable?: boolean): void { }
|
||||
|
||||
cancelUnbindAll(): void { }
|
||||
|
||||
// these are mix in API's.. hacky way to deal with them at the moment.
|
||||
resizableAttachedHandler;
|
||||
resizableDetachedHandler;
|
||||
}
|
||||
|
||||
class AbstractWebComponent extends AbstractPolymerElement {
|
||||
@@ -30,11 +26,10 @@ class AbstractWebComponent extends AbstractPolymerElement {
|
||||
}
|
||||
}
|
||||
|
||||
function registerWebComponent(webComponentClass: Function, ...mixins): void {
|
||||
function registerWebComponent(webComponentClass: Function, ...mixins: any[]): void {
|
||||
|
||||
// we need a flat object, without prototype in order to polymer to work on our components
|
||||
var flattenedComponent = {};
|
||||
var poly_func = ["async", "job", "fire", "asyncFire", "cancelUnbindAll"];
|
||||
var flattenedComponent: any = {};
|
||||
if (mixins) {
|
||||
// apply mixins
|
||||
mixins.forEach(mixin => {
|
||||
@@ -47,7 +42,8 @@ function registerWebComponent(webComponentClass: Function, ...mixins): void {
|
||||
}
|
||||
var webComponent: AbstractWebComponent = new (<any>webComponentClass)();
|
||||
for (var i in webComponent) {
|
||||
if (!_.contains(poly_func, i)) {
|
||||
// do not include polymer functions
|
||||
if (i != "async" && i != "job" && i != "fire" && i != "asyncFire" && i != "cancelUnbindAll") {
|
||||
flattenedComponent[i] = webComponent[i];
|
||||
}
|
||||
}
|
||||
|
||||
Vendored
+5
@@ -1,3 +1,8 @@
|
||||
// Type definitions for app-router
|
||||
// Project: https://github.com/erikringsmuth/app-router
|
||||
// Definitions by: Louis Grignon <https://github.com/lgrignon>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
declare module PolymerComponents {
|
||||
module App {
|
||||
export interface Router extends HTMLElement {
|
||||
|
||||
Vendored
+4
-4
@@ -22,16 +22,16 @@ interface PolymerElement {
|
||||
|
||||
interface Polymer {
|
||||
|
||||
importElements(node: Node, callback: Function);
|
||||
importElements(node: Node, callback: Function): void;
|
||||
import(url: string, callback?: () => void): void;
|
||||
|
||||
mixin(target: any, ...obj1): any;
|
||||
mixin(target: any, ...mixins: any[]): any;
|
||||
waitingFor(): Array<string>;
|
||||
// should be an "integer" for milliseconds
|
||||
forceReady(timeout: number): void;
|
||||
|
||||
(tag_name: string, prototype: PolymerElement): void;
|
||||
(tag_name: string, prototype: any): void;
|
||||
(tagName: string, prototype: PolymerElement): void;
|
||||
(tagName: string, prototype: any): void;
|
||||
(prototype: PolymerElement): void;
|
||||
(): void;
|
||||
// hacks for mixins
|
||||
|
||||
Reference in New Issue
Block a user