Skip to content

Commit 1daf9e1

Browse files
committed
Update polyfills to work with the updated version of TypeScript.
1 parent 326bb37 commit 1daf9e1

File tree

5 files changed

+7
-7
lines changed

5 files changed

+7
-7
lines changed

packages/custom-elements/ts_src/custom-elements.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ function installPolyfill() {
4343
const customElements = new CustomElementRegistry(internals);
4444

4545
// 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;
4747

4848
Object.defineProperty(window, 'customElements', {
4949
configurable: true,

packages/formdata-event/ts_src/environment/event.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
* additional IP rights grant found at http://polymer.github.io/PATENTS.txt
1010
*/
1111

12-
export const constructor = window.Event;
12+
export const constructor: typeof Event = window.Event;
1313

1414
export const prototype = constructor.prototype;
1515

packages/formdata-event/ts_src/wrappers/event.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,11 @@ export const getEventPropagationImmediatelyStopped = (e: Event) => {
3737
// const s = new SpecialEvent("type");
3838
// console.assert(s instanceof SpecialEvent); // fails in Safari 13.1
3939
// ```
40-
export const Event: typeof window.Event = (function Event(
40+
export const Event: typeof EventConstructor = (function Event(
4141
this: Event,
4242
type: string,
4343
eventInit: EventInit = {}
44-
) {
44+
): Event {
4545
let _this;
4646
// When running in a browser where Event isn't constructible (e.g. IE11) this
4747
// throws and we fall back to the old `createEvent` API.
@@ -53,7 +53,7 @@ export const Event: typeof window.Event = (function Event(
5353
}
5454
Object.setPrototypeOf(_this, Object.getPrototypeOf(this));
5555
return _this;
56-
} as Function) as typeof window.Event;
56+
} as unknown) as typeof EventConstructor;
5757

5858
prepareWrapper(Event, EventConstructor, EventPrototype);
5959

packages/webcomponentsjs/ts_src/platform/custom-event.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ if (!window.Event || (isIE && typeof window.Event !== 'function')) {
6060

6161
// CustomEvent constructor shim
6262
if (!window.CustomEvent || (isIE && typeof window.CustomEvent !== 'function')) {
63-
window['CustomEvent'] = ((<T extends unknown>(
63+
window['CustomEvent'] = ((<T>(
6464
inType: string,
6565
params?: CustomEventInit<T>
6666
) => {

packages/webcomponentsjs/ts_src/platform/es6-misc.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
export {};
1313

1414
if (!Array.from) {
15-
Array.from = <T extends unknown>(object: ArrayLike<T>): Array<T> => {
15+
Array.from = <T>(object: ArrayLike<T>): Array<T> => {
1616
return [].slice.call(object);
1717
};
1818
}

0 commit comments

Comments
 (0)