forked from DefinitelyTyped/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 0
/
polymer-ts.d.ts
139 lines (138 loc) · 6.19 KB
/
polymer-ts.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
// Type definitions for PolymerTS 0.1.25
// Project: https://github.com/nippur72/PolymerTS
// Definitions by: Louis Grignon <https://github.com/lgrignon/>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
declare namespace polymer {
class PolymerBase extends HTMLElement {
$: any;
$$: any;
root: HTMLElement;
shadyRoot: HTMLElement;
style: CSSStyleDeclaration;
customStyle: {
[property: string]: string;
};
arrayDelete(path: string, item: string | any): any;
async(callback: Function, waitTime?: number): any;
attachedCallback(): void;
attributeFollows(name: string, toElement: HTMLElement, fromElement: HTMLElement): void;
cancelAsync(handle: number): void;
cancelDebouncer(jobName: string): void;
classFollows(name: string, toElement: HTMLElement, fromElement: HTMLElement): void;
create(tag: string, props?: Object): HTMLElement;
debounce(jobName: string, callback: Function, wait?: number): void;
deserialize(value: string, type: any): any;
distributeContent(): void;
domHost(): void;
elementMatches(selector: string, node: Element): any;
fire(type: string, detail?: Object, options?: FireOptions): any;
flushDebouncer(jobName: string): void;
get(path: string | Array<string | number>): any;
getContentChildNodes(slctr: string): any;
getContentChildren(slctr: string): any;
getNativePrototype(tag: string): any;
getPropertyInfo(property: string): any;
importHref(href: string, onload?: Function, onerror?: Function, optAsync?: boolean): any;
instanceTemplate(template: any): any;
isDebouncerActive(jobName: string): any;
linkPaths(to: string, from: string): void;
listen(node: Element, eventName: string, methodName: string): void;
mixin(target: Object, source: Object): void;
notifyPath(path: string, value: any, fromAbove?: any): void;
notifySplices(path: string, splices: {
index: number;
removed: Array<any>;
addedCount: number;
object: Array<any>;
type: "splice";
}): void;
pop(path: string): any;
push(path: string, value: any): any;
reflectPropertyToAttribute(name: string): void;
resolveUrl(url: string): any;
scopeSubtree(container: Element, shouldObserve: boolean): void;
serialize(value: string): any;
serializeValueToAttribute(value: any, attribute: string, node: Element): void;
set(path: string | Array<string | number>, value: any, root?: Object): any;
setScrollDirection(direction: string, node: HTMLElement): void;
shift(path: string, value: any): any;
splice(path: string, start: number, deleteCount: number, ...items: any[]): any;
toggleAttribute(name: string, bool: boolean, node?: HTMLElement): void;
toggleClass(name: string, bool: boolean, node?: HTMLElement): void;
transform(transform: string, node?: HTMLElement): void;
translate3d(x: any, y: any, z: any, node?: HTMLElement): void;
unlinkPaths(path: string): void;
unshift(path: string, value: any): any;
updateStyles(): void;
}
interface dom {
(node: HTMLElement): HTMLElement;
(node: polymer.Base): HTMLElement;
flush(): any;
}
interface FireOptions {
node?: HTMLElement | polymer.Base;
bubbles?: boolean;
cancelable?: boolean;
}
interface Element {
properties?: Object;
listeners?: Object;
behaviors?: Object[];
observers?: String[];
factoryImpl?(...args: any[]): void;
ready?(): void;
created?(): void;
attached?(): void;
detached?(): void;
attributeChanged?(attrName: string, oldVal: any, newVal: any): void;
prototype?: Object;
}
interface PolymerTSElement {
$custom_cons?: FunctionConstructor;
$custom_cons_args?: any[];
template?: string;
style?: string;
}
interface Property {
name?: string;
type?: any;
value?: any;
reflectToAttribute?: boolean;
readOnly?: boolean;
notify?: boolean;
computed?: string;
observer?: string;
}
class Base extends polymer.PolymerBase implements polymer.Element {
static create<T extends polymer.Base>(...args: any[]): T;
static register(): void;
is: string;
}
function createEs6PolymerBase(): void;
function prepareForRegistration(elementClass: Function): polymer.Element;
function createDomModule(definition: polymer.Element): void;
function createElement<T extends polymer.Base>(element: new (...args: any[]) => T): new (...args: any[]) => T;
function createClass<T extends polymer.Base>(element: new (...args: any[]) => T): new (...args: any[]) => T;
function isRegistered(element: polymer.Element): boolean;
}
declare var Polymer: {
(prototype: polymer.Element): FunctionConstructor;
Class(prototype: polymer.Element): Function;
dom: polymer.dom;
appendChild(node: HTMLElement): HTMLElement;
insertBefore(node: HTMLElement, beforeNode: HTMLElement): HTMLElement;
removeChild(node: HTMLElement): HTMLElement;
updateStyles(): void;
Base: any;
};
declare function component(tagname: string, extendsTag?: string): (target: Function) => void;
declare function extend(tagname: string): (target: Function) => void;
declare function template(templateString: string): (target: Function) => void;
declare function style(styleString: string): (target: Function) => void;
declare function hostAttributes(attributes: Object): (target: Function) => void;
declare function property(ob?: polymer.Property): (target: polymer.Element, propertyKey: string) => void;
declare function computed(ob?: polymer.Property): (target: polymer.Element, computedFuncName: string) => void;
declare function listen(eventName: string): (target: polymer.Element, propertyKey: string) => void;
declare function behavior(behaviorObject: any): any;
declare function observe(observedProps: string): (target: polymer.Element, observerFuncName: string) => void;