Fix buffer decoration onRender, start using internal decoration

This commit is contained in:
Daniel Imms
2022-03-14 15:24:53 -07:00
parent 7dc3332b05
commit c8d1266f0a
8 changed files with 70 additions and 54 deletions
+9 -3
View File
@@ -3,7 +3,7 @@
* @license MIT
*/
import { IEvent } from 'common/EventEmitter';
import { IEvent, IEventEmitter } from 'common/EventEmitter';
import { IBuffer, IBufferSet } from 'common/buffer/Types';
import { IDecPrivateModes, ICoreMouseEvent, CoreMouseEncoding, ICoreMouseProtocol, CoreMouseEventType, ICharset, IWindowOptions, IModes, IAttributeData, ScrollSource, IDisposable } from 'common/Types';
import { createDecorator } from 'common/services/ServiceRegistry';
@@ -300,8 +300,14 @@ export interface IUnicodeVersionProvider {
readonly version: string;
wcwidth(ucs: number): 0 | 1 | 2;
}
export const IDecorationService = createDecorator<IDecorationService>('DecorationService');
export interface IDecorationService extends IDisposable {
readonly onDecorationRegistered: IEvent<IDecorationOptions>;
readonly onDecorationRemoved: IEvent<IDecoration>;
readonly onDecorationRegistered: IEvent<IInternalDecoration>;
readonly onDecorationRemoved: IEvent<IInternalDecoration>;
registerDecoration(decorationOptions: IDecorationOptions): IDecoration | undefined;
}
export interface IInternalDecoration extends IDecoration {
readonly options: IDecorationOptions;
readonly onRenderEmitter: IEventEmitter<HTMLElement>;
}