From a645cebb49465bdef96f1e56684f3d64bcdc6cad Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Mon, 12 Jul 2021 09:02:46 +0100 Subject: [PATCH] Fix setTimeout/setInterval typing --- src/CallHandler.tsx | 2 +- src/CountlyAnalytics.ts | 4 ++-- src/DecryptionFailureTracker.ts | 4 ++-- src/components/structures/MatrixChat.tsx | 2 +- src/components/structures/RoomDirectory.tsx | 2 +- src/components/structures/ScrollPanel.tsx | 2 +- src/components/views/dialogs/InviteDialog.tsx | 2 +- src/components/views/rooms/Autocomplete.tsx | 2 +- .../views/settings/tabs/user/AppearanceUserSettingsTab.tsx | 2 +- src/components/views/toasts/VerificationRequestToast.tsx | 2 +- src/utils/Timer.ts | 2 +- 11 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/CallHandler.tsx b/src/CallHandler.tsx index 6e1e6ce83a..a0adee6b8d 100644 --- a/src/CallHandler.tsx +++ b/src/CallHandler.tsx @@ -154,7 +154,7 @@ export default class CallHandler extends EventEmitter { private supportsPstnProtocol = null; private pstnSupportPrefixed = null; // True if the server only support the prefixed pstn protocol private supportsSipNativeVirtual = null; // im.vector.protocol.sip_virtual and im.vector.protocol.sip_native - private pstnSupportCheckTimer: NodeJS.Timeout; // number actually because we're in the browser + private pstnSupportCheckTimer: number; // For rooms we've been invited to, true if they're from virtual user, false if we've checked and they aren't. private invitedRoomsAreVirtual = new Map(); private invitedRoomCheckInProgress = false; diff --git a/src/CountlyAnalytics.ts b/src/CountlyAnalytics.ts index a75c578536..72b0462bcd 100644 --- a/src/CountlyAnalytics.ts +++ b/src/CountlyAnalytics.ts @@ -364,8 +364,8 @@ export default class CountlyAnalytics { private initTime = CountlyAnalytics.getTimestamp(); private firstPage = true; - private heartbeatIntervalId: NodeJS.Timeout; - private activityIntervalId: NodeJS.Timeout; + private heartbeatIntervalId: number; + private activityIntervalId: number; private trackTime = true; private lastBeat: number; private storedDuration = 0; diff --git a/src/DecryptionFailureTracker.ts b/src/DecryptionFailureTracker.ts index d40574a6db..df306a54f5 100644 --- a/src/DecryptionFailureTracker.ts +++ b/src/DecryptionFailureTracker.ts @@ -46,8 +46,8 @@ export class DecryptionFailureTracker { }; // Set to an interval ID when `start` is called - public checkInterval: NodeJS.Timeout = null; - public trackInterval: NodeJS.Timeout = null; + public checkInterval: number = null; + public trackInterval: number = null; // Spread the load on `Analytics` by tracking at a low frequency, `TRACK_INTERVAL_MS`. static TRACK_INTERVAL_MS = 60000; diff --git a/src/components/structures/MatrixChat.tsx b/src/components/structures/MatrixChat.tsx index d692b0fa7f..aa31a9faf4 100644 --- a/src/components/structures/MatrixChat.tsx +++ b/src/components/structures/MatrixChat.tsx @@ -251,7 +251,7 @@ export default class MatrixChat extends React.PureComponent { private pageChanging: boolean; private tokenLogin?: boolean; private accountPassword?: string; - private accountPasswordTimer?: NodeJS.Timeout; + private accountPasswordTimer?: number; private focusComposer: boolean; private subTitleStatus: string; private prevWindowWidth: number; diff --git a/src/components/structures/RoomDirectory.tsx b/src/components/structures/RoomDirectory.tsx index ac5d113ee6..ad7a1868de 100644 --- a/src/components/structures/RoomDirectory.tsx +++ b/src/components/structures/RoomDirectory.tsx @@ -78,7 +78,7 @@ export default class RoomDirectory extends React.Component { private readonly startTime: number; private unmounted = false; private nextBatch: string = null; - private filterTimeout: NodeJS.Timeout; + private filterTimeout: number; private protocols: Protocols; constructor(props) { diff --git a/src/components/structures/ScrollPanel.tsx b/src/components/structures/ScrollPanel.tsx index df885575df..1d16755106 100644 --- a/src/components/structures/ScrollPanel.tsx +++ b/src/components/structures/ScrollPanel.tsx @@ -187,7 +187,7 @@ export default class ScrollPanel extends React.Component { private fillRequestWhileRunning: boolean; private scrollState: IScrollState; private preventShrinkingState: IPreventShrinkingState; - private unfillDebouncer: NodeJS.Timeout; + private unfillDebouncer: number; private bottomGrowth: number; private pages: number; private heightUpdateInProgress: boolean; diff --git a/src/components/views/dialogs/InviteDialog.tsx b/src/components/views/dialogs/InviteDialog.tsx index 0edcfd2894..c9475d4849 100644 --- a/src/components/views/dialogs/InviteDialog.tsx +++ b/src/components/views/dialogs/InviteDialog.tsx @@ -370,7 +370,7 @@ export default class InviteDialog extends React.PureComponent void; - private debounceTimer: NodeJS.Timeout = null; // actually number because we're in the browser + private debounceTimer: number = null; // actually number because we're in the browser private editorRef = createRef(); private unmounted = false; diff --git a/src/components/views/rooms/Autocomplete.tsx b/src/components/views/rooms/Autocomplete.tsx index 8fbecbe722..6b5edcf91b 100644 --- a/src/components/views/rooms/Autocomplete.tsx +++ b/src/components/views/rooms/Autocomplete.tsx @@ -55,7 +55,7 @@ interface IState { export default class Autocomplete extends React.PureComponent { autocompleter: Autocompleter; queryRequested: string; - debounceCompletionsRequest: NodeJS.Timeout; + debounceCompletionsRequest: number; private containerRef = createRef(); constructor(props) { diff --git a/src/components/views/settings/tabs/user/AppearanceUserSettingsTab.tsx b/src/components/views/settings/tabs/user/AppearanceUserSettingsTab.tsx index f04c2f13ae..17aa9e5561 100644 --- a/src/components/views/settings/tabs/user/AppearanceUserSettingsTab.tsx +++ b/src/components/views/settings/tabs/user/AppearanceUserSettingsTab.tsx @@ -75,7 +75,7 @@ interface IState extends IThemeState { export default class AppearanceUserSettingsTab extends React.Component { private readonly MESSAGE_PREVIEW_TEXT = _t("Hey you. You're the best!"); - private themeTimer: NodeJS.Timeout; + private themeTimer: number; constructor(props: IProps) { super(props); diff --git a/src/components/views/toasts/VerificationRequestToast.tsx b/src/components/views/toasts/VerificationRequestToast.tsx index 75254d7c62..45f1464b0e 100644 --- a/src/components/views/toasts/VerificationRequestToast.tsx +++ b/src/components/views/toasts/VerificationRequestToast.tsx @@ -44,7 +44,7 @@ interface IState { @replaceableComponent("views.toasts.VerificationRequestToast") export default class VerificationRequestToast extends React.PureComponent { - private intervalHandle: NodeJS.Timeout; + private intervalHandle: number; constructor(props) { super(props); diff --git a/src/utils/Timer.ts b/src/utils/Timer.ts index 2317ed934b..38703c1299 100644 --- a/src/utils/Timer.ts +++ b/src/utils/Timer.ts @@ -26,7 +26,7 @@ Once a timer is finished or aborted, it can't be started again a new one through `clone()` or `cloneIfRun()`. */ export default class Timer { - private timerHandle: NodeJS.Timeout; + private timerHandle: number; private startTs: number; private promise: Promise; private resolve: () => void;