Fix tsconfigs, IDisposable, and add comments
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
},
|
||||
"main": "lib/xterm-addon-clipboard.js",
|
||||
"types": "typings/xterm-addon-clipboard.d.ts",
|
||||
"repository": "https://github.com/xtermjs/xterm.js",
|
||||
"repository": "https://github.com/xtermjs/xterm.js/tree/master/addons/xterm-addon-clipboard",
|
||||
"license": "MIT",
|
||||
"keywords": [
|
||||
"terminal",
|
||||
|
||||
@@ -4,18 +4,17 @@
|
||||
*/
|
||||
|
||||
import { ClipboardProvider } from './ClipboardProvider';
|
||||
import { IClipboardProvider, ITerminalAddon, Terminal } from 'xterm';
|
||||
import { IClipboardProvider, IDisposable, ITerminalAddon, Terminal } from 'xterm';
|
||||
|
||||
export class ClipboardAddon implements ITerminalAddon {
|
||||
private _terminal: Terminal | undefined;
|
||||
private _disposable: IDisposable | undefined;
|
||||
constructor(private _provider: IClipboardProvider = new ClipboardProvider()) {}
|
||||
|
||||
public activate(terminal: Terminal): void {
|
||||
this._terminal = terminal;
|
||||
terminal.registerClipboardProvider(this._provider);
|
||||
this._disposable = terminal.registerClipboardProvider(this._provider);
|
||||
}
|
||||
|
||||
public dispose(): void {
|
||||
this._terminal?.deregisterClipboardProvider();
|
||||
return this._disposable?.dispose();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"target": "es2017",
|
||||
"target": "es2021",
|
||||
"sourceMap": true,
|
||||
"outDir": "../out",
|
||||
"rootDir": ".",
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"target": "es2015",
|
||||
"target": "es2021",
|
||||
"lib": [
|
||||
"es2015"
|
||||
"es2021"
|
||||
],
|
||||
"rootDir": ".",
|
||||
"outDir": "../out-test",
|
||||
@@ -19,4 +19,4 @@
|
||||
"./**/*",
|
||||
"../../../typings/xterm.d.ts"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user