Ensure types are checked in demo, fix errors, emit to out-demo
Part of #5509
This commit is contained in:
@@ -3,10 +3,7 @@
|
||||
* @license MIT
|
||||
*/
|
||||
|
||||
/// <reference path="../../typings/xterm.d.ts"/>
|
||||
|
||||
import type { Terminal } from '@xterm/xterm';
|
||||
import type { AddonCollection } from 'types';
|
||||
|
||||
export interface ITabConfig {
|
||||
id: string;
|
||||
@@ -28,7 +25,7 @@ export class ControlBar {
|
||||
private _resizeMode: 'none' | 'horizontal' | 'vertical' | 'corner' = 'none';
|
||||
|
||||
private readonly _tabContainer: HTMLElement;
|
||||
private readonly _tabs: Map<string, { button: HTMLButtonElement; content: HTMLElement }> = new Map();
|
||||
private readonly _tabs: Map<string, { button: HTMLButtonElement, content: HTMLElement }> = new Map();
|
||||
private _activeTabId: string | null = null;
|
||||
|
||||
constructor(sidebar: HTMLElement, tabContainer: HTMLElement, tabs: ITabConfig[]) {
|
||||
@@ -152,7 +149,7 @@ export class ControlBar {
|
||||
}
|
||||
}
|
||||
|
||||
public registerWindow<T extends IControlWindow>(window: T, options?: { afterId?: string; hidden?: boolean; smallTab?: boolean }): T {
|
||||
public registerWindow<T extends IControlWindow>(window: T, options?: { afterId?: string, hidden?: boolean, smallTab?: boolean }): T {
|
||||
// Create button
|
||||
const button = document.createElement('button');
|
||||
button.id = `${window.id}button`;
|
||||
|
||||
@@ -3,13 +3,10 @@
|
||||
* @license MIT
|
||||
*/
|
||||
|
||||
/// <reference path="../../../typings/xterm.d.ts"/>
|
||||
|
||||
import type { Terminal } from '@xterm/xterm';
|
||||
import { BaseWindow } from './baseWindow';
|
||||
import type { IControlWindow } from '../controlBar';
|
||||
import type { AddonCollection } from 'types';
|
||||
import type { IImageAddonOptions } from '@xterm/addon-image';
|
||||
import type { AddonCollection } from '../../types';
|
||||
|
||||
export class AddonsWindow extends BaseWindow implements IControlWindow {
|
||||
public readonly id = 'addons';
|
||||
@@ -277,4 +274,4 @@ function htmlSerializeButtonHandler(term: Terminal, addons: AddonCollection): vo
|
||||
document.execCommand('copy');
|
||||
document.removeEventListener('copy', listener);
|
||||
document.getElementById('htmlserialize-output-result').innerText = 'Copied to clipboard';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,27 +3,25 @@
|
||||
* @license MIT
|
||||
*/
|
||||
|
||||
/// <reference path="../../../typings/xterm.d.ts"/>
|
||||
|
||||
import type { AddonCollection } from '../../types';
|
||||
import type { IControlWindow } from '../controlBar';
|
||||
import type { Terminal } from '@xterm/xterm';
|
||||
|
||||
export abstract class BaseWindow implements IControlWindow {
|
||||
protected get _terminal(): Terminal { return this.__terminal; }
|
||||
protected get _terminal(): Terminal { return this._terminalPrivate; }
|
||||
|
||||
constructor(
|
||||
private __terminal: Terminal,
|
||||
protected readonly _addons: AddonCollection,
|
||||
) {
|
||||
constructor(
|
||||
private _terminalPrivate: Terminal,
|
||||
protected readonly _addons: AddonCollection,
|
||||
) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
setTerminal(terminal: Terminal): void {
|
||||
this.__terminal = terminal;
|
||||
}
|
||||
public setTerminal(terminal: Terminal): void {
|
||||
this._terminalPrivate = terminal;
|
||||
}
|
||||
|
||||
abstract id: string;
|
||||
abstract label: string;
|
||||
abstract build(container: HTMLElement): void;
|
||||
}
|
||||
public abstract id: string;
|
||||
public abstract label: string;
|
||||
public abstract build(container: HTMLElement): void;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user