File tree Expand file tree Collapse file tree 5 files changed +7
-7
lines changed
webcomponentsjs/ts_src/platform Expand file tree Collapse file tree 5 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -43,7 +43,7 @@ function installPolyfill() {
43
43
const customElements = new CustomElementRegistry ( internals ) ;
44
44
45
45
// The main document is associated with the global registry.
46
- document . __CE_registry = ( customElements as unknown ) as CustomElementRegistry ;
46
+ ( document . __CE_registry as unknown ) = customElements ;
47
47
48
48
Object . defineProperty ( window , 'customElements' , {
49
49
configurable : true ,
Original file line number Diff line number Diff line change 9
9
* additional IP rights grant found at http://polymer.github.io/PATENTS.txt
10
10
*/
11
11
12
- export const constructor = window . Event ;
12
+ export const constructor : typeof Event = window . Event ;
13
13
14
14
export const prototype = constructor . prototype ;
15
15
Original file line number Diff line number Diff line change @@ -37,11 +37,11 @@ export const getEventPropagationImmediatelyStopped = (e: Event) => {
37
37
// const s = new SpecialEvent("type");
38
38
// console.assert(s instanceof SpecialEvent); // fails in Safari 13.1
39
39
// ```
40
- export const Event : typeof window . Event = ( function Event (
40
+ export const Event : typeof EventConstructor = ( function Event (
41
41
this : Event ,
42
42
type : string ,
43
43
eventInit : EventInit = { }
44
- ) {
44
+ ) : Event {
45
45
let _this ;
46
46
// When running in a browser where Event isn't constructible (e.g. IE11) this
47
47
// throws and we fall back to the old `createEvent` API.
@@ -53,7 +53,7 @@ export const Event: typeof window.Event = (function Event(
53
53
}
54
54
Object . setPrototypeOf ( _this , Object . getPrototypeOf ( this ) ) ;
55
55
return _this ;
56
- } as Function ) as typeof window . Event ;
56
+ } as unknown ) as typeof EventConstructor ;
57
57
58
58
prepareWrapper ( Event , EventConstructor , EventPrototype ) ;
59
59
Original file line number Diff line number Diff line change @@ -60,7 +60,7 @@ if (!window.Event || (isIE && typeof window.Event !== 'function')) {
60
60
61
61
// CustomEvent constructor shim
62
62
if ( ! window . CustomEvent || ( isIE && typeof window . CustomEvent !== 'function' ) ) {
63
- window [ 'CustomEvent' ] = ( ( < T extends unknown > (
63
+ window [ 'CustomEvent' ] = ( ( < T > (
64
64
inType : string ,
65
65
params ?: CustomEventInit < T >
66
66
) => {
Original file line number Diff line number Diff line change 12
12
export { } ;
13
13
14
14
if ( ! Array . from ) {
15
- Array . from = < T extends unknown > ( object : ArrayLike < T > ) : Array < T > => {
15
+ Array . from = < T > ( object : ArrayLike < T > ) : Array < T > => {
16
16
return [ ] . slice . call ( object ) ;
17
17
} ;
18
18
}
You can’t perform that action at this time.
0 commit comments