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
+3 -3
View File
@@ -13,7 +13,7 @@ import { color } from 'common/Color';
import { EventEmitter } from 'common/EventEmitter';
import { Disposable, toDisposable } from 'common/Lifecycle';
import { IBufferService, IInstantiationService, IOptionsService } from 'common/services/Services';
import { createStyle, StyleSheet } from "./StyleSheet";
import { createStyle, IStyleSheet } from './StyleSheet';
const TERMINAL_CLASS_PREFIX = 'xterm-dom-renderer-owner-';
const ROW_CONTAINER_CLASS = 'xterm-rows';
@@ -33,8 +33,8 @@ export class DomRenderer extends Disposable implements IRenderer {
private _rowFactory: DomRendererRowFactory;
private _terminalClass: number = nextTerminalId++;
private _themeStyle!: StyleSheet;
private _dimensionsStyle!: StyleSheet;
private _themeStyle!: IStyleSheet;
private _dimensionsStyle!: IStyleSheet;
private _rowContainer: HTMLElement;
private _rowElements: HTMLElement[] = [];
private _selectionContainer: HTMLElement;
+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 {