Support events with 2 args

This will allow higher perf events by avoiding object creation
This commit is contained in:
Daniel Imms
2019-12-18 09:59:33 +11:00
parent 929914da5d
commit 94f5c37884
2 changed files with 18 additions and 18 deletions
+3 -3
View File
@@ -336,8 +336,8 @@ declare module 'xterm' {
* An event that can be listened to.
* @returns an `IDisposable` to stop listening.
*/
export interface IEvent<T> {
(listener: (e: T) => any): IDisposable;
export interface IEvent<T, U = void> {
(listener: (arg1: T, arg2: U) => any): IDisposable;
}
/**
@@ -444,7 +444,7 @@ declare module 'xterm' {
* Currently this is only used for a certain type of mouse reports that
* happen to be not UTF-8 compatible.
* The event value is a JS string, pass it to the underlying pty as
* binary data, e.g. `pty.write(Buffer.from(data, 'binary'))`.
* binary data, e.g. `pty.write(Buffer.from(data, 'binary'))`.
* @returns an `IDisposable` to stop listening.
*/
onBinary: IEvent<string>;