Fix naming issue with serviceBrand

This commit is contained in:
Daniel Imms
2019-07-13 23:45:25 -07:00
parent 358a707835
commit a0e2c9b270
15 changed files with 36 additions and 38 deletions
+2 -2
View File
@@ -7,7 +7,7 @@ import { IEvent, EventEmitter } from 'common/EventEmitter';
import { ICharSizeService, IMouseService } from 'browser/services/Services';
export class MockCharSizeService implements ICharSizeService {
_serviceBrand: any;
serviceBrand: any;
get hasValidSize(): boolean { return this.width > 0 && this.height > 0; }
onCharSizeChange: IEvent<void> = new EventEmitter<void>().event;
constructor(public width: number, public height: number) {}
@@ -15,7 +15,7 @@ export class MockCharSizeService implements ICharSizeService {
}
export class MockMouseService implements IMouseService {
_serviceBrand: any;
serviceBrand: any;
public getCoords(event: {clientX: number, clientY: number}, element: HTMLElement, colCount: number, rowCount: number, isSelection?: boolean): [number, number] | undefined {
throw new Error('Not implemented');
}
+1 -1
View File
@@ -8,7 +8,7 @@ import { IEvent, EventEmitter } from 'common/EventEmitter';
import { ICharSizeService } from 'browser/services/Services';
export class CharSizeService implements ICharSizeService {
_serviceBrand: any;
serviceBrand: any;
public width: number = 0;
public height: number = 0;
+1 -1
View File
@@ -7,7 +7,7 @@ import { ICharSizeService, IRenderService, IMouseService } from './Services';
import { getCoords, getRawByteCoords } from 'browser/input/Mouse';
export class MouseService implements IMouseService {
_serviceBrand: any;
serviceBrand: any;
constructor(
@IRenderService private readonly _renderService: IRenderService,
+1 -1
View File
@@ -14,7 +14,7 @@ import { IOptionsService } from 'common/services/Services';
import { ICharSizeService, IRenderService } from 'browser/services/Services';
export class RenderService extends Disposable implements IRenderService {
_serviceBrand: any;
serviceBrand: any;
private _renderDebouncer: RenderDebouncer;
private _screenDprMonitor: ScreenDprMonitor;
+1 -1
View File
@@ -67,7 +67,7 @@ export const enum SelectionMode {
* when the selection is ready to be redrawn (on an animation frame).
*/
export class SelectionService implements ISelectionService {
_serviceBrand: any;
serviceBrand: any;
protected _model: SelectionModel;
+5 -5
View File
@@ -11,7 +11,7 @@ import { createDecorator } from 'common/services/ServiceRegistry';
export const ICharSizeService = createDecorator<ICharSizeService>('CharSizeService');
export interface ICharSizeService {
_serviceBrand: any;
serviceBrand: any;
readonly width: number;
readonly height: number;
@@ -24,7 +24,7 @@ export interface ICharSizeService {
export const IMouseService = createDecorator<IMouseService>('MouseService');
export interface IMouseService {
_serviceBrand: any;
serviceBrand: any;
getCoords(event: {clientX: number, clientY: number}, element: HTMLElement, colCount: number, rowCount: number, isSelection?: boolean): [number, number] | undefined;
getRawByteCoords(event: MouseEvent, element: HTMLElement, colCount: number, rowCount: number): { x: number, y: number } | undefined;
@@ -32,7 +32,7 @@ export interface IMouseService {
export const IRenderService = createDecorator<IRenderService>('RenderService');
export interface IRenderService {
_serviceBrand: any;
serviceBrand: any;
onDimensionsChange: IEvent<IRenderDimensions>;
onRender: IEvent<{ start: number, end: number }>;
@@ -60,7 +60,7 @@ export interface IRenderService {
export const ISelectionService = createDecorator<ISelectionService>('SelectionService');
export interface ISelectionService {
_serviceBrand: any;
serviceBrand: any;
readonly selectionText: string;
readonly hasSelection: boolean;
@@ -88,7 +88,7 @@ export interface ISelectionService {
export const ISoundService = createDecorator<ISoundService>('SoundService');
export interface ISoundService {
_serviceBrand: any;
serviceBrand: any;
playBellSound(): void;
}
+1 -1
View File
@@ -7,7 +7,7 @@ import { IOptionsService } from 'common/services/Services';
import { ISoundService } from 'browser/services/Services';
export class SoundService implements ISoundService {
_serviceBrand: any;
serviceBrand: any;
private static _audioContext: AudioContext;
+5 -5
View File
@@ -12,7 +12,7 @@ import { BufferSet } from 'common/buffer/BufferSet';
import { IDecPrivateModes } from 'common/Types';
export class MockBufferService implements IBufferService {
_serviceBrand: any;
serviceBrand: any;
public get buffer(): IBuffer { return this.buffers.active; }
public buffers: IBufferSet = {} as any;
constructor(
@@ -30,7 +30,7 @@ export class MockBufferService implements IBufferService {
}
export class MockCoreService implements ICoreService {
_serviceBrand: any;
serviceBrand: any;
decPrivateModes: IDecPrivateModes = {} as any;
onData: IEvent<string> = new EventEmitter<string>().event;
onUserInput: IEvent<void> = new EventEmitter<void>().event;
@@ -39,7 +39,7 @@ export class MockCoreService implements ICoreService {
}
export class MockDirtyRowService implements IDirtyRowService {
_serviceBrand: any;
serviceBrand: any;
start: number = 0;
end: number = 0;
clearRange(): void {}
@@ -49,7 +49,7 @@ export class MockDirtyRowService implements IDirtyRowService {
}
export class MockLogService implements ILogService {
_serviceBrand: any;
serviceBrand: any;
debug(message: any, ...optionalParams: any[]): void {}
info(message: any, ...optionalParams: any[]): void {}
warn(message: any, ...optionalParams: any[]): void {}
@@ -57,7 +57,7 @@ export class MockLogService implements ILogService {
}
export class MockOptionsService implements IOptionsService {
_serviceBrand: any;
serviceBrand: any;
options: ITerminalOptions = clone(DEFAULT_OPTIONS);
onOptionChange: IEvent<string> = new EventEmitter<string>().event;
constructor(testOptions?: IPartialTerminalOptions) {
+1 -1
View File
@@ -11,7 +11,7 @@ export const MINIMUM_COLS = 2; // Less than 2 can mess with wide chars
export const MINIMUM_ROWS = 1;
export class BufferService implements IBufferService {
_serviceBrand: any;
serviceBrand: any;
public cols: number;
public rows: number;
+1 -1
View File
@@ -13,7 +13,7 @@ const DEFAULT_DEC_PRIVATE_MODES: IDecPrivateModes = Object.freeze({
});
export class CoreService implements ICoreService {
_serviceBrand: any;
serviceBrand: any;
public decPrivateModes: IDecPrivateModes;
+1 -1
View File
@@ -6,7 +6,7 @@
import { IBufferService, IDirtyRowService } from 'common/services/Services';
export class DirtyRowService implements IDirtyRowService {
_serviceBrand: any;
serviceBrand: any;
private _start!: number;
private _end!: number;
+1 -1
View File
@@ -37,7 +37,7 @@ const optionsKeyToLogLevel: { [key: string]: LogLevel } = {
const LOG_PREFIX = 'xterm.js: ';
export class LogService implements ILogService {
_serviceBrand: any;
serviceBrand: any;
private _logLevel!: LogLevel;
+1 -1
View File
@@ -56,7 +56,7 @@ export const DEFAULT_OPTIONS: ITerminalOptions = Object.freeze({
const CONSTRUCTOR_ONLY_OPTIONS = ['cols', 'rows'];
export class OptionsService implements IOptionsService {
_serviceBrand: any;
serviceBrand: any;
public options: ITerminalOptions;
+14 -14
View File
@@ -10,7 +10,7 @@ import { createDecorator } from 'common/services/ServiceRegistry';
export const IBufferService = createDecorator<IBufferService>('BufferService');
export interface IBufferService {
_serviceBrand: any;
serviceBrand: any;
readonly cols: number;
readonly rows: number;
@@ -25,7 +25,7 @@ export interface IBufferService {
export const ICoreService = createDecorator<ICoreService>('CoreService');
export interface ICoreService {
_serviceBrand: any;
serviceBrand: any;
readonly decPrivateModes: IDecPrivateModes;
@@ -47,7 +47,7 @@ export interface ICoreService {
export const IDirtyRowService = createDecorator<IDirtyRowService>('DirtyRowService');
export interface IDirtyRowService {
_serviceBrand: any;
serviceBrand: any;
readonly start: number;
readonly end: number;
@@ -64,39 +64,39 @@ export interface IServiceIdentifier<T> {
}
export interface IConstructorSignature0<T> {
new(...services: { _serviceBrand: any; }[]): T;
new(...services: { serviceBrand: any; }[]): T;
}
export interface IConstructorSignature1<A1, T> {
new(first: A1, ...services: { _serviceBrand: any; }[]): T;
new(first: A1, ...services: { serviceBrand: any; }[]): T;
}
export interface IConstructorSignature2<A1, A2, T> {
new(first: A1, second: A2, ...services: { _serviceBrand: any; }[]): T;
new(first: A1, second: A2, ...services: { serviceBrand: any; }[]): T;
}
export interface IConstructorSignature3<A1, A2, A3, T> {
new(first: A1, second: A2, third: A3, ...services: { _serviceBrand: any; }[]): T;
new(first: A1, second: A2, third: A3, ...services: { serviceBrand: any; }[]): T;
}
export interface IConstructorSignature4<A1, A2, A3, A4, T> {
new(first: A1, second: A2, third: A3, fourth: A4, ...services: { _serviceBrand: any; }[]): T;
new(first: A1, second: A2, third: A3, fourth: A4, ...services: { serviceBrand: any; }[]): T;
}
export interface IConstructorSignature5<A1, A2, A3, A4, A5, T> {
new(first: A1, second: A2, third: A3, fourth: A4, fifth: A5, ...services: { _serviceBrand: any; }[]): T;
new(first: A1, second: A2, third: A3, fourth: A4, fifth: A5, ...services: { serviceBrand: any; }[]): T;
}
export interface IConstructorSignature6<A1, A2, A3, A4, A5, A6, T> {
new(first: A1, second: A2, third: A3, fourth: A4, fifth: A5, sixth: A6, ...services: { _serviceBrand: any; }[]): T;
new(first: A1, second: A2, third: A3, fourth: A4, fifth: A5, sixth: A6, ...services: { serviceBrand: any; }[]): T;
}
export interface IConstructorSignature7<A1, A2, A3, A4, A5, A6, A7, T> {
new(first: A1, second: A2, third: A3, fourth: A4, fifth: A5, sixth: A6, seventh: A7, ...services: { _serviceBrand: any; }[]): T;
new(first: A1, second: A2, third: A3, fourth: A4, fifth: A5, sixth: A6, seventh: A7, ...services: { serviceBrand: any; }[]): T;
}
export interface IConstructorSignature8<A1, A2, A3, A4, A5, A6, A7, A8, T> {
new(first: A1, second: A2, third: A3, fourth: A4, fifth: A5, sixth: A6, seventh: A7, eigth: A8, ...services: { _serviceBrand: any; }[]): T;
new(first: A1, second: A2, third: A3, fourth: A4, fifth: A5, sixth: A6, seventh: A7, eigth: A8, ...services: { serviceBrand: any; }[]): T;
}
export const IInstantiationService = createDecorator<IInstantiationService>('InstantiationService');
@@ -116,7 +116,7 @@ export interface IInstantiationService {
export const ILogService = createDecorator<ILogService>('LogService');
export interface ILogService {
_serviceBrand: any;
serviceBrand: any;
debug(message: any, ...optionalParams: any[]): void;
info(message: any, ...optionalParams: any[]): void;
@@ -126,7 +126,7 @@ export interface ILogService {
export const IOptionsService = createDecorator<IOptionsService>('OptionsService');
export interface IOptionsService {
_serviceBrand: any;
serviceBrand: any;
readonly options: ITerminalOptions;
-2
View File
@@ -94,8 +94,6 @@
{"type": "member", "modifiers": ["private"], "format": "camelCase", "leadingUnderscore": "require"},
{"type": "variable", "modifiers": ["const"], "format": ["camelCase", "UPPER_CASE"]},
{"type": "variable", "modifiers": ["const", "export"], "filter": "^I.+Service$", "format": "PascalCase", "prefix": "I"},
{"type": "member", "filter": "^_serviceBrand$", "leadingUnderscore": "require"},
{"type": "property", "filter": "^_serviceBrand$", "leadingUnderscore": "require"},
{"type": "interface", "prefix": "I"}
],
"no-else-after-return": {