forked from DefinitelyTyped/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebcomponents.js.d.ts
62 lines (50 loc) · 1.54 KB
/
webcomponents.js.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
// Type definitions for webcomponents.js 0.6.0
// Project: https://github.com/webcomponents/webcomponentsjs
// Definitions by: Adi Dahiya <https://github.com/adidahiya>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
declare namespace webcomponents {
export interface CustomElementInit {
prototype: HTMLElement;
extends?: string;
}
export interface CustomElementConstructor {
new(): HTMLElement;
}
export interface CustomElementsPolyfill {
hasNative: boolean;
flags: any;
ready: boolean;
useNative: boolean;
}
export interface HTMLImportsPolyfill {
IMPORT_LINK_TYPE: string;
isIE: boolean;
flags: any;
ready: boolean;
rootDocument: Document;
useNative: boolean;
whenReady(callback: () => void): void;
}
export interface ShadowRootPolyfill extends DocumentFragment {
innerHTML: string;
host: Element;
}
export interface Polyfill {
flags: any;
}
}
declare module "webcomponents.js" {
export = webcomponents;
}
interface Element {
createShadowRoot(): webcomponents.ShadowRootPolyfill;
shadowRoot?: webcomponents.ShadowRootPolyfill;
}
interface Document {
registerElement(name: string, prototype: webcomponents.CustomElementInit): webcomponents.CustomElementConstructor;
}
interface Window {
CustomElements: webcomponents.CustomElementsPolyfill;
HTMLImports: webcomponents.HTMLImportsPolyfill;
WebComponents: webcomponents.Polyfill;
}