fix eslint

This commit is contained in:
Simon Siefke
2023-07-27 17:39:15 +02:00
parent 72c51b19a5
commit b225b9a710
2 changed files with 10 additions and 10 deletions
+7 -7
View File
@@ -1,9 +1,9 @@
export interface StyleSheet {
export interface IStyleSheet {
dispose: () => void;
setCss: (value: string) => void;
}
const createCssStyleSheet = (): StyleSheet => {
const createCssStyleSheet = (): IStyleSheet => {
const sheet = new CSSStyleSheet();
document.adoptedStyleSheets.push(sheet);
return {
@@ -13,12 +13,12 @@ const createCssStyleSheet = (): StyleSheet => {
},
setCss(css) {
sheet.replace(css);
},
}
};
};
const createStyleElement = (parent: HTMLElement): StyleSheet => {
const element = document.createElement("style");
const createStyleElement = (parent: HTMLElement): IStyleSheet => {
const element = document.createElement('style');
parent.append(element);
return {
dispose() {
@@ -26,11 +26,11 @@ const createStyleElement = (parent: HTMLElement): StyleSheet => {
},
setCss(css) {
element.textContent = css;
},
}
};
};
export const createStyle = (parent: HTMLElement): StyleSheet => {
export const createStyle = (parent: HTMLElement): IStyleSheet => {
try {
return createCssStyleSheet();
} catch {