From 7b27de279b1dd7af3f8db0ec3ea496190d3c10b8 Mon Sep 17 00:00:00 2001 From: Max Baumann Date: Sun, 13 Dec 2020 21:11:23 +0100 Subject: [PATCH] chore(types): even more types --- src/components/SkipNoticeComponent.tsx | 4 ++-- src/components/SubmissionNoticeComponent.tsx | 4 ++-- src/content.ts | 2 +- src/render/SubmissionNotice.tsx | 7 ++++--- 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/src/components/SkipNoticeComponent.tsx b/src/components/SkipNoticeComponent.tsx index 63084c7c..5618c907 100644 --- a/src/components/SkipNoticeComponent.tsx +++ b/src/components/SkipNoticeComponent.tsx @@ -31,7 +31,7 @@ export interface SkipNoticeState { noticeTitle: string; messages: string[]; - messageOnClick: (event: React.MouseEvent) => any; + messageOnClick: (event: React.MouseEvent) => unknown; countdownTime: number; maxCountdownTime: () => number; @@ -56,7 +56,7 @@ class SkipNoticeComponent extends React.Component; categoryOptionRef: React.RefObject; diff --git a/src/components/SubmissionNoticeComponent.tsx b/src/components/SubmissionNoticeComponent.tsx index 80ab5253..c6aae60a 100644 --- a/src/components/SubmissionNoticeComponent.tsx +++ b/src/components/SubmissionNoticeComponent.tsx @@ -10,7 +10,7 @@ export interface SubmissionNoticeProps { // Contains functions and variables from the content script needed by the skip notice contentContainer: ContentContainer; - callback: () => any; + callback: () => unknown; closeListener: () => void } @@ -25,7 +25,7 @@ class SubmissionNoticeComponent extends React.Component any; + callback: () => unknown; noticeRef: React.MutableRefObject; timeEditRefs: React.RefObject[]; diff --git a/src/content.ts b/src/content.ts index 87b24552..07c2b477 100644 --- a/src/content.ts +++ b/src/content.ts @@ -1456,7 +1456,7 @@ function submitSponsorTimes() { //send the message to the background js //called after all the checks have been made that it's okay to do so -async function sendSubmitMessage(){ +async function sendSubmitMessage(): Promise { //add loading animation ( document.getElementById("submitImage")).src = chrome.extension.getURL("icons/PlayerUploadIconSponsorBlocker256px.png"); document.getElementById("submitButton").style.animation = "rotate 1s 0s infinite"; diff --git a/src/render/SubmissionNotice.tsx b/src/render/SubmissionNotice.tsx index 2d600f56..8c267854 100644 --- a/src/render/SubmissionNotice.tsx +++ b/src/render/SubmissionNotice.tsx @@ -2,18 +2,19 @@ import * as React from "react"; import * as ReactDOM from "react-dom"; import SubmissionNoticeComponent from "../components/SubmissionNoticeComponent"; +import { ContentContainer } from "../types"; class SubmissionNotice { // Contains functions and variables from the content script needed by the skip notice - contentContainer: () => any; + contentContainer: () => unknown; - callback: () => any; + callback: () => unknown; noticeRef: React.MutableRefObject; noticeElement: HTMLDivElement; - constructor(contentContainer: () => any, callback: () => any) { + constructor(contentContainer: ContentContainer, callback: () => unknown) { this.noticeRef = React.createRef(); this.contentContainer = contentContainer;