mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2025-12-12 06:27:14 +03:00
refactor(types): add PageElements type
This commit is contained in:
11
src/popup.ts
11
src/popup.ts
@@ -37,6 +37,8 @@ class MessageHandler {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
//make this a function to allow this to run on the content page
|
||||
async function runThePopup(messageListener?: MessageListener): Promise<void> {
|
||||
const messageHandler = new MessageHandler(messageListener);
|
||||
@@ -45,7 +47,14 @@ async function runThePopup(messageListener?: MessageListener): Promise<void> {
|
||||
|
||||
await utils.wait(() => Config.config !== null);
|
||||
|
||||
const PageElements: any = {};
|
||||
type InputPageElements = {
|
||||
whitelistToggle?: HTMLInputElement,
|
||||
toggleSwitch?: HTMLInputElement,
|
||||
usernameInput?: HTMLInputElement,
|
||||
};
|
||||
type PageElements = { [key: string]: HTMLElement } & InputPageElements
|
||||
|
||||
const PageElements: PageElements = {};
|
||||
|
||||
[
|
||||
"sponsorblockPopup",
|
||||
|
||||
Reference in New Issue
Block a user