This repository has been archived by the owner on Jan 11, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathglobal.d.ts
97 lines (79 loc) · 2.31 KB
/
global.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
declare module '*.scss' {
const _: string;
export default _;
};
declare module '*.css' {
const _: string;
export default _;
};
declare module '*.json';
declare module '*.gif';
// Skate
declare module 'core-js';
declare namespace JSX {
interface IntrinsicElement extends ShadyCSS.IntrinsicElements {
}
}
declare namespace ShadyCSS {
interface IntrinsicElements {
'custom-style': HTMLElement,
}
interface ShadyCssStatic {
prepareTemplate( template: HTMLTemplateElement, elementName: string, typeExtension?: string ),
applyStyle( host: HTMLElement, overrideProps?: { [ propName: string ]: string } ),
updateStyles( properties?: { [ propName: string ]: string } ),
}
}
// Custom Elements
interface ElementCreationOptions {
is: string;
}
interface Window {
ShadyCSS: ShadyCSS.ShadyCssStatic,
}
interface Document {
createElement( name: string, options: ElementCreationOptions ): HTMLElement;
createElement( tagName: 'slot' ): HTMLSlotElement;
}
interface HTMLElement extends OnConnectedCallback, OnDisconnectedCallback, OnAdoptedCallback, OnAttributeChangedCallback {
// // shadow DOM API
// shadowRoot: HTMLElement,
// attachShadow( { mode:string } ): HTMLElement,
// assignedNodes( { flatten }?:{flatten?: boolean} ): NodeList,
// assignedSlot: string|void,
// @FIXME remove this once https://github.com/skatejs/skatejs/pull/1022 is merged
role?: string,
}
interface HasAttributes {
readonly observedAttributes: string[] | void;
}
interface OnConnectedCallback {
connectedCallback(): void;
}
interface OnDisconnectedCallback {
disconnectedCallback(): void;
}
interface OnAdoptedCallback {
adoptedCallback( oldDocument: any, newDocument: any ): void;
}
interface OnAttributeChangedCallback {
attributeChangedCallback( name: string, oldValue: any, newValue: any ): void;
}
// ShadowDom
interface Text {
readonly assignedSlot: HTMLSlotElement | null;
}
interface EventInit {
scoped?: boolean; // default false
}
interface Event {
deepPath(): EventTarget[];
readonly scoped: boolean;
}
interface Document {
createElement( tagName: 'slot' ): HTMLSlotElement;
}
// Tests
// we are not using Chai anymore. We use Expect which has Jest style assertions
// @TODO remove this once all test are refactored to use `expect` instead of chai
declare var expect: Chai.ExpectStatic;