Skip to content

Commit

Permalink
fix eslint
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonSiefke committed Jul 27, 2023
1 parent 72c51b1 commit b225b9a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
6 changes: 3 additions & 3 deletions src/browser/renderer/dom/DomRenderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -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;
Expand Down
14 changes: 7 additions & 7 deletions src/browser/renderer/dom/StyleSheet.ts
Original file line number Diff line number Diff line change
@@ -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 {
Expand All @@ -13,24 +13,24 @@ 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() {
element.remove();
},
setCss(css) {
element.textContent = css;
},
}
};
};

export const createStyle = (parent: HTMLElement): StyleSheet => {
export const createStyle = (parent: HTMLElement): IStyleSheet => {
try {
return createCssStyleSheet();
} catch {
Expand Down

0 comments on commit b225b9a

Please sign in to comment.