-
Notifications
You must be signed in to change notification settings - Fork 227
Update typescript to v4.7 #2408
Conversation
@@ -1,7 +1,7 @@ | |||
import {set} from './utilities'; | |||
|
|||
export interface NavigatorWithConnection extends Navigator { | |||
connection: { | |||
connection: Navigator['connection'] & { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As of TS 4.4 the connection key now exists on Navigator, so extend from that and mock out the keys that are required because of this.
// According to the spec the max value timeRemaining can return is 50 | ||
const MAX_TIME_REMAINING = 50; | ||
|
||
function fallbackQueueingFunction(cb: IdleCallback) { | ||
function fallbackQueueingFunction(cb: IdleRequestCallback) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As of TS 4.4 requestIdleCallback
and cancelIdleCallback
keys exist on TS's definition of Window so we don't need to augment it here anymore.
|
||
extendedWindow.cancelIdleCallback = | ||
extendedWindow.cancelIdleCallback || (window as any).clearImmediate; | ||
export {}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file no longer contains an import
so we need something to tell TS/babel "this file is authored in the esmodules style"
Description
Update typescript to v4.7.4.
useUnknownInCatchVariables: false
to override strict mode. Enabling this new strict mode option (which would be the case because we setstrict:true
) causes lots of errors. On order to focus on the update, let's disable it for now and we can go back to fixing this up as part of Enable tsconfig strict mode options #1815.