Move applicationCursor into core service
This commit is contained in:
@@ -5,8 +5,16 @@
|
||||
|
||||
import { ICoreService, IOptionsService, IBufferService } from 'common/services/Services';
|
||||
import { EventEmitter, IEvent } from 'common/EventEmitter';
|
||||
import { IDecPrivateModes } from 'common/Types';
|
||||
import { clone } from 'common/Clone';
|
||||
|
||||
const DEFAULT_DEC_PRIVATE_MODES: IDecPrivateModes = Object.freeze({
|
||||
applicationCursorKeys: false
|
||||
});
|
||||
|
||||
export class CoreService implements ICoreService {
|
||||
public decPrivateModes: IDecPrivateModes;
|
||||
|
||||
private _onData = new EventEmitter<string>();
|
||||
public get onData(): IEvent<string> { return this._onData.event; }
|
||||
private _onUserInput = new EventEmitter<void>();
|
||||
@@ -18,6 +26,11 @@ export class CoreService implements ICoreService {
|
||||
private readonly _bufferService: IBufferService,
|
||||
private readonly _optionsService: IOptionsService
|
||||
) {
|
||||
this.decPrivateModes = clone(DEFAULT_DEC_PRIVATE_MODES);
|
||||
}
|
||||
|
||||
public reset(): void {
|
||||
|
||||
}
|
||||
|
||||
public triggerDataEvent(data: string, wasUserInput: boolean = false): void {
|
||||
|
||||
Vendored
+5
@@ -5,6 +5,7 @@
|
||||
|
||||
import { IEvent } from 'common/EventEmitter';
|
||||
import { IBuffer, IBufferSet } from 'common/buffer/Types';
|
||||
import { IDecPrivateModes } from 'common/Types';
|
||||
|
||||
export interface IBufferService {
|
||||
readonly cols: number;
|
||||
@@ -19,9 +20,13 @@ export interface IBufferService {
|
||||
}
|
||||
|
||||
export interface ICoreService {
|
||||
readonly decPrivateModes: IDecPrivateModes;
|
||||
|
||||
readonly onData: IEvent<string>;
|
||||
readonly onUserInput: IEvent<void>;
|
||||
|
||||
reset(): void;
|
||||
|
||||
/**
|
||||
* Triggers the onData event in the public API.
|
||||
* @param data The data that is being emitted.
|
||||
|
||||
Reference in New Issue
Block a user