simplify color events

This commit is contained in:
Jörg Breitbart
2021-11-08 17:17:39 +01:00
parent 1c5f24a707
commit 54375713bc
7 changed files with 291 additions and 217 deletions
+12 -9
View File
@@ -348,17 +348,20 @@ export interface IWindowOptions {
setWinLines?: boolean;
}
export interface IColorEventColor {
index: number;
color: [number, number, number] | '?';
// color events from common, used for OSC 4/10/11
export const enum ColorIndex {
FOREGROUND = 256,
BACKGROUND = 257
}
export interface IColorReportRequest {
index: ColorIndex;
color?: IColorRGB;
}
export interface IColorSetRequest extends IColorReportRequest {
color: IColorRGB;
}
export type IColorEvent = (IColorReportRequest | IColorSetRequest)[];
/**
* Event fired for OSC 4 command - to change ANSI color based on its index.
*/
export interface IColorEvent {
requests: IColorEventColor[];
}
/**
* Calls the parser and handles actions generated by the parser.