chore(types): even more types

This commit is contained in:
Max Baumann
2020-12-13 21:11:23 +01:00
parent dde6b44005
commit 7b27de279b
4 changed files with 9 additions and 8 deletions

View File

@@ -31,7 +31,7 @@ export interface SkipNoticeState {
noticeTitle: string; noticeTitle: string;
messages: string[]; messages: string[];
messageOnClick: (event: React.MouseEvent) => any; messageOnClick: (event: React.MouseEvent) => unknown;
countdownTime: number; countdownTime: number;
maxCountdownTime: () => number; maxCountdownTime: () => number;
@@ -56,7 +56,7 @@ class SkipNoticeComponent extends React.Component<SkipNoticeProps, SkipNoticeSta
amountOfPreviousNotices: number; amountOfPreviousNotices: number;
audio: HTMLAudioElement; audio: HTMLAudioElement;
idSuffix: any; idSuffix: string;
noticeRef: React.MutableRefObject<NoticeComponent>; noticeRef: React.MutableRefObject<NoticeComponent>;
categoryOptionRef: React.RefObject<HTMLSelectElement>; categoryOptionRef: React.RefObject<HTMLSelectElement>;

View File

@@ -10,7 +10,7 @@ export interface SubmissionNoticeProps {
// Contains functions and variables from the content script needed by the skip notice // Contains functions and variables from the content script needed by the skip notice
contentContainer: ContentContainer; contentContainer: ContentContainer;
callback: () => any; callback: () => unknown;
closeListener: () => void closeListener: () => void
} }
@@ -25,7 +25,7 @@ class SubmissionNoticeComponent extends React.Component<SubmissionNoticeProps, S
// Contains functions and variables from the content script needed by the skip notice // Contains functions and variables from the content script needed by the skip notice
contentContainer: ContentContainer; contentContainer: ContentContainer;
callback: () => any; callback: () => unknown;
noticeRef: React.MutableRefObject<NoticeComponent>; noticeRef: React.MutableRefObject<NoticeComponent>;
timeEditRefs: React.RefObject<SponsorTimeEditComponent>[]; timeEditRefs: React.RefObject<SponsorTimeEditComponent>[];

View File

@@ -1456,7 +1456,7 @@ function submitSponsorTimes() {
//send the message to the background js //send the message to the background js
//called after all the checks have been made that it's okay to do so //called after all the checks have been made that it's okay to do so
async function sendSubmitMessage(){ async function sendSubmitMessage(): Promise<void> {
//add loading animation //add loading animation
(<HTMLImageElement> document.getElementById("submitImage")).src = chrome.extension.getURL("icons/PlayerUploadIconSponsorBlocker256px.png"); (<HTMLImageElement> document.getElementById("submitImage")).src = chrome.extension.getURL("icons/PlayerUploadIconSponsorBlocker256px.png");
document.getElementById("submitButton").style.animation = "rotate 1s 0s infinite"; document.getElementById("submitButton").style.animation = "rotate 1s 0s infinite";

View File

@@ -2,18 +2,19 @@ import * as React from "react";
import * as ReactDOM from "react-dom"; import * as ReactDOM from "react-dom";
import SubmissionNoticeComponent from "../components/SubmissionNoticeComponent"; import SubmissionNoticeComponent from "../components/SubmissionNoticeComponent";
import { ContentContainer } from "../types";
class SubmissionNotice { class SubmissionNotice {
// Contains functions and variables from the content script needed by the skip notice // Contains functions and variables from the content script needed by the skip notice
contentContainer: () => any; contentContainer: () => unknown;
callback: () => any; callback: () => unknown;
noticeRef: React.MutableRefObject<SubmissionNoticeComponent>; noticeRef: React.MutableRefObject<SubmissionNoticeComponent>;
noticeElement: HTMLDivElement; noticeElement: HTMLDivElement;
constructor(contentContainer: () => any, callback: () => any) { constructor(contentContainer: ContentContainer, callback: () => unknown) {
this.noticeRef = React.createRef(); this.noticeRef = React.createRef();
this.contentContainer = contentContainer; this.contentContainer = contentContainer;