Improve types and add bellStyle/bellSound
This commit is contained in:
@@ -140,6 +140,8 @@ namespace methods_core {
|
|||||||
const r16: number = t.getOption('scrollback');
|
const r16: number = t.getOption('scrollback');
|
||||||
const r17: [number, number] = t.getOption('geometry');
|
const r17: [number, number] = t.getOption('geometry');
|
||||||
const r18: (data: string) => void = t.getOption('handler');
|
const r18: (data: string) => void = t.getOption('handler');
|
||||||
|
const r19: string = t.getOption('bellSound');
|
||||||
|
const r20: string = t.getOption('bellStyle');
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
const t: Terminal = new Terminal();
|
const t: Terminal = new Terminal();
|
||||||
@@ -161,6 +163,11 @@ namespace methods_core {
|
|||||||
t.setOption('scrollback', 1);
|
t.setOption('scrollback', 1);
|
||||||
t.setOption('geometry', [1, 1]);
|
t.setOption('geometry', [1, 1]);
|
||||||
t.setOption('handler', (data: string) => console.log(data));
|
t.setOption('handler', (data: string) => console.log(data));
|
||||||
|
t.setOption('bellSound', 'foo');
|
||||||
|
t.setOption('bellStyle', 'none');
|
||||||
|
t.setOption('bellStyle', 'visual');
|
||||||
|
t.setOption('bellStyle', 'sound');
|
||||||
|
t.setOption('bellStyle', 'both');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
namespace scrolling {
|
namespace scrolling {
|
||||||
|
|||||||
+1
-1
@@ -149,7 +149,7 @@ const DEFAULT_OPTIONS: ITerminalOptions = {
|
|||||||
cursorBlink: false,
|
cursorBlink: false,
|
||||||
cursorStyle: 'block',
|
cursorStyle: 'block',
|
||||||
bellSound: BellSound,
|
bellSound: BellSound,
|
||||||
bellStyle: null,
|
bellStyle: 'none',
|
||||||
scrollback: 1000,
|
scrollback: 1000,
|
||||||
screenKeys: false,
|
screenKeys: false,
|
||||||
debug: false,
|
debug: false,
|
||||||
|
|||||||
Vendored
+14
-2
@@ -290,7 +290,7 @@ declare module 'xterm' {
|
|||||||
* Retrieves an option's value from the terminal.
|
* Retrieves an option's value from the terminal.
|
||||||
* @param key The option key.
|
* @param key The option key.
|
||||||
*/
|
*/
|
||||||
getOption(key: 'cursorStyle' | 'termName'): string;
|
getOption(key: 'bellSound' | 'bellStyle' | 'cursorStyle' | 'termName'): string;
|
||||||
/**
|
/**
|
||||||
* Retrieves an option's value from the terminal.
|
* Retrieves an option's value from the terminal.
|
||||||
* @param key The option key.
|
* @param key The option key.
|
||||||
@@ -322,7 +322,19 @@ declare module 'xterm' {
|
|||||||
* @param key The option key.
|
* @param key The option key.
|
||||||
* @param value The option value.
|
* @param value The option value.
|
||||||
*/
|
*/
|
||||||
setOption(key: 'cursorStyle' | 'termName', value: string): void;
|
setOption(key: 'termName' | 'bellSound', value: string): void;
|
||||||
|
/**
|
||||||
|
* Sets an option on the terminal.
|
||||||
|
* @param key The option key.
|
||||||
|
* @param value The option value.
|
||||||
|
*/
|
||||||
|
setOption(key: 'bellStyle', value: 'none' | 'visual' | 'sound' | 'both'): void;
|
||||||
|
/**
|
||||||
|
* Sets an option on the terminal.
|
||||||
|
* @param key The option key.
|
||||||
|
* @param value The option value.
|
||||||
|
*/
|
||||||
|
setOption(key: 'cursorStyle', value: 'block' | 'underline' | 'bar'): void;
|
||||||
/**
|
/**
|
||||||
* Sets an option on the terminal.
|
* Sets an option on the terminal.
|
||||||
* @param key The option key.
|
* @param key The option key.
|
||||||
|
|||||||
Reference in New Issue
Block a user