mirror of
https://github.com/wavetermdev/xterm.js.git
synced 2026-08-05 13:43:48 -07:00
fix eslint
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user