Add types for styleElements object

pull/28217/head
Florian Duros 2022-09-27 10:58:19 +02:00
parent 54b79c7667
commit be8e44e17e
No known key found for this signature in database
GPG Key ID: 9700AA5870258A0B
1 changed files with 2 additions and 2 deletions

View File

@ -237,8 +237,8 @@ export async function setTheme(theme?: string): Promise<void> {
// look for the stylesheet elements.
// styleElements is a map from style name to HTMLLinkElement.
const styleElements = Object.create(null);
const themes = Array.from(document.querySelectorAll('[data-mx-theme]'));
const styleElements: Record<string, HTMLLinkElement> = Object.create(null);
const themes = Array.from(document.querySelectorAll<HTMLLinkElement>('[data-mx-theme]'));
themes.forEach(theme => {
styleElements[theme.attributes['data-mx-theme'].value.toLowerCase()] = theme;
});