[UwU] Remove unused types, fix Disqus types (#622)

This PR removes two TS types that were unused, and fixes various Disqus
typings
This commit is contained in:
Corbin Crutchley
2023-07-24 12:04:21 -07:00
committed by GitHub
4 changed files with 9 additions and 20 deletions

7
src/types/disqus.d.ts vendored Normal file
View File

@@ -0,0 +1,7 @@
export {};
declare global {
interface Window {
reloadDisqus: () => void;
}
}

9
src/types/ffg.d.ts vendored
View File

@@ -1,9 +0,0 @@
export {};
declare global {
interface Window {
rafThrottle<T extends (...props: any[]) => any>(
callback: T
): (...args: any[]) => void;
}
}

View File

@@ -1,6 +0,0 @@
declare module "gatsby-remark-embedder/dist/transformers/Twitch.js" {
import { Transformer } from "@remark-embedder/core";
const transformer: Transformer<any>;
export = transformer;
}

View File

@@ -2,7 +2,7 @@ const COLOR_MODE_STORAGE_KEY = "currentTheme";
export const themeToggle = () => { export const themeToggle = () => {
const themeToggleBtn: HTMLElement = document.querySelector( const themeToggleBtn: HTMLElement = document.querySelector(
"#theme-toggle-button" "#theme-toggle-button",
); );
if (!themeToggleBtn) return; if (!themeToggleBtn) return;
const darkIconEl: HTMLElement = document.querySelector("#dark-icon"); const darkIconEl: HTMLElement = document.querySelector("#dark-icon");
@@ -16,10 +16,7 @@ export const themeToggle = () => {
lightIconEl.style.display = "none"; lightIconEl.style.display = "none";
darkIconEl.style.display = null; darkIconEl.style.display = null;
} }
setTimeout( setTimeout(() => window.reloadDisqus && window.reloadDisqus(), 100);
() => (window as any).reloadDisqus && (window as any).reloadDisqus(),
100
);
} }
// TODO: Migrate to `classList` // TODO: Migrate to `classList`