Fix explicit access

This commit is contained in:
Daniel Imms
2020-04-14 06:23:11 -07:00
parent a5ebb6d98c
commit 9817754f92
31 changed files with 303 additions and 303 deletions
@@ -11,7 +11,7 @@ import { Terminal } from 'public/Terminal';
import { SerializeAddon } from 'SerializeAddon';
class TestTerminal extends Terminal {
writeSync(data: string): void {
public writeSync(data: string): void {
(this as any)._core.writeSync(data);
}
}
@@ -15,7 +15,7 @@ function constrain(value: number, low: number, high: number): number {
abstract class BaseSerializeHandler {
constructor(private _buffer: IBuffer) { }
serialize(startRow: number, endRow: number): string {
public serialize(startRow: number, endRow: number): string {
// we need two of them to flip between old and new cell
const cell1 = this._buffer.getNullCell();
const cell2 = this._buffer.getNullCell();
@@ -15,7 +15,7 @@ export class WebLinkProvider implements ILinkProvider {
}
provideLink(position: IBufferCellPosition, callback: (link: ILink | undefined) => void): void {
public provideLink(position: IBufferCellPosition, callback: (link: ILink | undefined) => void): void {
callback(LinkComputer.computeLink(position, this._regex, this._terminal, this._handler));
}
}
+1 -1
View File
@@ -34,7 +34,7 @@ function getLines(term: TestTerminal, limit: number = term.rows): string[] {
}
class TestInputHandler extends InputHandler {
get curAttrData(): IAttributeData { return (this as any)._curAttrData; }
public get curAttrData(): IAttributeData { return (this as any)._curAttrData; }
}
describe('InputHandler', () => {
+3 -3
View File
@@ -137,15 +137,15 @@ class DECRQSS implements IDcsHandler {
private _optionsService: IOptionsService
) { }
hook(params: IParams): void {
public hook(params: IParams): void {
this._data = new Uint32Array(0);
}
put(data: Uint32Array, start: number, end: number): void {
public put(data: Uint32Array, start: number, end: number): void {
this._data = concat(this._data, data.subarray(start, end));
}
unhook(success: boolean): void {
public unhook(success: boolean): void {
if (!success) {
this._data = new Uint32Array(0);
return;
+3 -3
View File
@@ -1416,14 +1416,14 @@ class TestLinkifier extends Linkifier {
}
class TestMouseZoneManager implements IMouseZoneManager {
dispose(): void {
public dispose(): void {
}
public clears: number = 0;
public zones: IMouseZone[] = [];
add(zone: IMouseZone): void {
public add(zone: IMouseZone): void {
this.zones.push(zone);
}
clearAll(): void {
public clearAll(): void {
this.clears++;
}
}
+166 -166
View File
File diff suppressed because it is too large Load Diff
+3 -3
View File
@@ -24,14 +24,14 @@ class TestLinkifier extends Linkifier {
}
class TestMouseZoneManager implements IMouseZoneManager {
dispose(): void {
public dispose(): void {
}
public clears: number = 0;
public zones: IMouseZone[] = [];
add(zone: IMouseZone): void {
public add(zone: IMouseZone): void {
this.zones.push(zone);
}
clearAll(): void {
public clearAll(): void {
this.clears++;
}
}
+26 -26
View File
@@ -9,15 +9,15 @@ import { IRenderDimensions, IRenderer, CharacterJoinerHandler } from 'browser/re
import { IColorSet } from 'browser/Types';
export class MockCharSizeService implements ICharSizeService {
serviceBrand: any;
get hasValidSize(): boolean { return this.width > 0 && this.height > 0; }
onCharSizeChange: IEvent<void> = new EventEmitter<void>().event;
public serviceBrand: any;
public get hasValidSize(): boolean { return this.width > 0 && this.height > 0; }
public onCharSizeChange: IEvent<void> = new EventEmitter<void>().event;
constructor(public width: number, public height: number) {}
measure(): void {}
public measure(): void {}
}
export class MockMouseService implements IMouseService {
serviceBrand: any;
public 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');
}
@@ -28,11 +28,11 @@ export class MockMouseService implements IMouseService {
}
export class MockRenderService implements IRenderService {
serviceBrand: any;
onDimensionsChange: IEvent<IRenderDimensions> = new EventEmitter<IRenderDimensions>().event;
onRender: IEvent<{ start: number, end: number }, void> = new EventEmitter<{ start: number, end: number }>().event;
onRefreshRequest: IEvent<{ start: number, end: number}, void> = new EventEmitter<{ start: number, end: number }>().event;
dimensions: IRenderDimensions = {
public serviceBrand: any;
public onDimensionsChange: IEvent<IRenderDimensions> = new EventEmitter<IRenderDimensions>().event;
public onRender: IEvent<{ start: number, end: number }, void> = new EventEmitter<{ start: number, end: number }>().event;
public onRefreshRequest: IEvent<{ start: number, end: number}, void> = new EventEmitter<{ start: number, end: number }>().event;
public dimensions: IRenderDimensions = {
scaledCharWidth: 0,
scaledCharHeight: 0,
scaledCellWidth: 0,
@@ -46,52 +46,52 @@ export class MockRenderService implements IRenderService {
actualCellWidth: 0,
actualCellHeight: 0
};
refreshRows(start: number, end: number): void {
public refreshRows(start: number, end: number): void {
throw new Error('Method not implemented.');
}
resize(cols: number, rows: number): void {
public resize(cols: number, rows: number): void {
throw new Error('Method not implemented.');
}
changeOptions(): void {
public changeOptions(): void {
throw new Error('Method not implemented.');
}
setRenderer(renderer: IRenderer): void {
public setRenderer(renderer: IRenderer): void {
throw new Error('Method not implemented.');
}
setColors(colors: IColorSet): void {
public setColors(colors: IColorSet): void {
throw new Error('Method not implemented.');
}
onDevicePixelRatioChange(): void {
public onDevicePixelRatioChange(): void {
throw new Error('Method not implemented.');
}
onResize(cols: number, rows: number): void {
public onResize(cols: number, rows: number): void {
throw new Error('Method not implemented.');
}
onCharSizeChanged(): void {
public onCharSizeChanged(): void {
throw new Error('Method not implemented.');
}
onBlur(): void {
public onBlur(): void {
throw new Error('Method not implemented.');
}
onFocus(): void {
public onFocus(): void {
throw new Error('Method not implemented.');
}
onSelectionChanged(start: [number, number], end: [number, number], columnSelectMode: boolean): void {
public onSelectionChanged(start: [number, number], end: [number, number], columnSelectMode: boolean): void {
throw new Error('Method not implemented.');
}
onCursorMove(): void {
public onCursorMove(): void {
throw new Error('Method not implemented.');
}
clear(): void {
public clear(): void {
throw new Error('Method not implemented.');
}
registerCharacterJoiner(handler: CharacterJoinerHandler): number {
public registerCharacterJoiner(handler: CharacterJoinerHandler): number {
throw new Error('Method not implemented.');
}
deregisterCharacterJoiner(joinerId: number): boolean {
public deregisterCharacterJoiner(joinerId: number): boolean {
throw new Error('Method not implemented.');
}
dispose(): void {
public dispose(): void {
throw new Error('Method not implemented.');
}
}
+2 -2
View File
@@ -36,8 +36,8 @@ export class TextRenderLayer extends BaseRenderLayer {
characterJoinerRegistry: ICharacterJoinerRegistry,
alpha: boolean,
rendererId: number,
readonly bufferService: IBufferService,
readonly optionsService: IOptionsService
bufferService: IBufferService,
optionsService: IOptionsService
) {
super(container, 'text', zIndex, alpha, colors, rendererId, bufferService, optionsService);
this._state = new GridCache<CharData>();
+3 -3
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;
public serviceBrand: any;
public width: number = 0;
public height: number = 0;
@@ -20,8 +20,8 @@ export class CharSizeService implements ICharSizeService {
public get onCharSizeChange(): IEvent<void> { return this._onCharSizeChange.event; }
constructor(
readonly document: Document,
readonly parentElement: HTMLElement,
document: Document,
parentElement: HTMLElement,
@IOptionsService private readonly _optionsService: IOptionsService
) {
this._measureStrategy = new DomMeasureStrategy(document, parentElement, this._optionsService);
+1 -1
View File
@@ -6,7 +6,7 @@
import { ICoreBrowserService } from './Services';
export class CoreBrowserService implements ICoreBrowserService {
serviceBrand: any;
public serviceBrand: any;
constructor(
private _textarea: HTMLTextAreaElement
+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;
public 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;
public 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;
public serviceBrand: any;
protected _model: SelectionModel;
+2 -2
View File
@@ -7,11 +7,11 @@ import { IOptionsService } from 'common/services/Services';
import { ISoundService } from 'browser/services/Services';
export class SoundService implements ISoundService {
serviceBrand: any;
public serviceBrand: any;
private static _audioContext: AudioContext;
static get audioContext(): AudioContext | null {
public static get audioContext(): AudioContext | null {
if (!SoundService._audioContext) {
const audioContextCtor: typeof AudioContext = (<any>window).AudioContext || (<any>window).webkitAudioContext;
if (!audioContextCtor) {
+52 -52
View File
@@ -13,7 +13,7 @@ import { IDecPrivateModes, ICoreMouseEvent, CoreMouseEventType, ICharset } from
import { UnicodeV6 } from 'common/input/UnicodeV6';
export class MockBufferService implements IBufferService {
serviceBrand: any;
public serviceBrand: any;
public get buffer(): IBuffer { return this.buffers.active; }
public buffers: IBufferSet = {} as any;
constructor(
@@ -23,86 +23,86 @@ export class MockBufferService implements IBufferService {
) {
this.buffers = new BufferSet(optionsService, this);
}
resize(cols: number, rows: number): void {
public resize(cols: number, rows: number): void {
this.cols = cols;
this.rows = rows;
}
reset(): void {}
public reset(): void {}
}
export class MockCoreMouseService implements ICoreMouseService {
activeEncoding: string = '';
activeProtocol: string = '';
addEncoding(name: string): void {}
addProtocol(name: string): void {}
reset(): void {}
triggerMouseEvent(event: ICoreMouseEvent): boolean { return false; }
onProtocolChange: IEvent<CoreMouseEventType> = new EventEmitter<CoreMouseEventType>().event;
explainEvents(events: CoreMouseEventType): {[event: string]: boolean} {
public activeEncoding: string = '';
public activeProtocol: string = '';
public addEncoding(name: string): void {}
public addProtocol(name: string): void {}
public reset(): void {}
public triggerMouseEvent(event: ICoreMouseEvent): boolean { return false; }
public onProtocolChange: IEvent<CoreMouseEventType> = new EventEmitter<CoreMouseEventType>().event;
public explainEvents(events: CoreMouseEventType): {[event: string]: boolean} {
throw new Error('Method not implemented.');
}
}
export class MockCharsetService implements ICharsetService {
serviceBrand: any;
charset: ICharset | undefined;
glevel: number = 0;
charsets: ReadonlyArray<ICharset> = [];
reset(): void {}
setgLevel(g: number): void {}
setgCharset(g: number, charset: ICharset): void {}
public serviceBrand: any;
public charset: ICharset | undefined;
public glevel: number = 0;
public charsets: ReadonlyArray<ICharset> = [];
public reset(): void {}
public setgLevel(g: number): void {}
public setgCharset(g: number, charset: ICharset): void {}
}
export class MockCoreService implements ICoreService {
serviceBrand: any;
isCursorInitialized: boolean = false;
isCursorHidden: boolean = false;
isFocused: boolean = false;
decPrivateModes: IDecPrivateModes = {
public serviceBrand: any;
public isCursorInitialized: boolean = false;
public isCursorHidden: boolean = false;
public isFocused: boolean = false;
public decPrivateModes: IDecPrivateModes = {
applicationCursorKeys: false,
applicationKeypad: false,
origin: false,
wraparound: true
};
onData: IEvent<string> = new EventEmitter<string>().event;
onUserInput: IEvent<void> = new EventEmitter<void>().event;
onBinary: IEvent<string> = new EventEmitter<string>().event;
reset(): void {}
triggerDataEvent(data: string, wasUserInput?: boolean): void {}
triggerBinaryEvent(data: string): void {}
public onData: IEvent<string> = new EventEmitter<string>().event;
public onUserInput: IEvent<void> = new EventEmitter<void>().event;
public onBinary: IEvent<string> = new EventEmitter<string>().event;
public reset(): void {}
public triggerDataEvent(data: string, wasUserInput?: boolean): void {}
public triggerBinaryEvent(data: string): void {}
}
export class MockDirtyRowService implements IDirtyRowService {
serviceBrand: any;
start: number = 0;
end: number = 0;
clearRange(): void {}
markDirty(y: number): void {}
markRangeDirty(y1: number, y2: number): void {}
markAllDirty(): void {}
public serviceBrand: any;
public start: number = 0;
public end: number = 0;
public clearRange(): void {}
public markDirty(y: number): void {}
public markRangeDirty(y1: number, y2: number): void {}
public markAllDirty(): void {}
}
export class MockLogService implements ILogService {
serviceBrand: any;
debug(message: any, ...optionalParams: any[]): void {}
info(message: any, ...optionalParams: any[]): void {}
warn(message: any, ...optionalParams: any[]): void {}
error(message: any, ...optionalParams: any[]): void {}
public serviceBrand: any;
public debug(message: any, ...optionalParams: any[]): void {}
public info(message: any, ...optionalParams: any[]): void {}
public warn(message: any, ...optionalParams: any[]): void {}
public error(message: any, ...optionalParams: any[]): void {}
}
export class MockOptionsService implements IOptionsService {
serviceBrand: any;
options: ITerminalOptions = clone(DEFAULT_OPTIONS);
onOptionChange: IEvent<string> = new EventEmitter<string>().event;
public serviceBrand: any;
public options: ITerminalOptions = clone(DEFAULT_OPTIONS);
public onOptionChange: IEvent<string> = new EventEmitter<string>().event;
constructor(testOptions?: IPartialTerminalOptions) {
if (testOptions) {
Object.keys(testOptions).forEach(key => this.options[key] = (<any>testOptions)[key]);
}
}
setOption<T>(key: string, value: T): void {
public setOption<T>(key: string, value: T): void {
throw new Error('Method not implemented.');
}
getOption<T>(key: string): T {
public getOption<T>(key: string): T {
throw new Error('Method not implemented.');
}
}
@@ -110,14 +110,14 @@ export class MockOptionsService implements IOptionsService {
// defaults to V6 always to keep tests passing
export class MockUnicodeService implements IUnicodeService {
private _provider = new UnicodeV6();
register(provider: IUnicodeVersionProvider): void {
public register(provider: IUnicodeVersionProvider): void {
throw new Error('Method not implemented.');
}
versions: string[] = [];
activeVersion: string = '';
onChange: IEvent<string> = new EventEmitter<string>().event;
wcwidth = (codepoint: number): number => this._provider.wcwidth(codepoint);
getStringCellWidth(s: string): number {
public versions: string[] = [];
public activeVersion: string = '';
public onChange: IEvent<string> = new EventEmitter<string>().event;
public wcwidth = (codepoint: number): number => this._provider.wcwidth(codepoint);
public getStringCellWidth(s: string): number {
throw new Error('Method not implemented.');
}
}
+3 -3
View File
@@ -7,15 +7,15 @@ import { IAttributeData, IColorRGB } from 'common/Types';
import { Attributes, FgFlags, BgFlags } from 'common/buffer/Constants';
export class AttributeData implements IAttributeData {
static toColorRGB(value: number): IColorRGB {
public static toColorRGB(value: number): IColorRGB {
return [
value >>> Attributes.RED_SHIFT & 255,
value >>> Attributes.GREEN_SHIFT & 255,
value & 255
];
}
static fromColorRGB(value: IColorRGB): number {
public static fromColorRGB(value: IColorRGB): number {
return (value[0] & 255) << Attributes.RED_SHIFT | (value[1] & 255) << Attributes.GREEN_SHIFT | value[2] & 255;
}
+2 -2
View File
@@ -64,7 +64,7 @@ export class StringToUtf32 {
* the provided input data does not exceed the size of `target`.
* Returns the number of written codepoints in `target`.
*/
decode(input: string, target: Uint32Array): number {
public decode(input: string, target: Uint32Array): number {
const length = input.length;
if (!length) {
@@ -132,7 +132,7 @@ export class Utf8ToUtf32 {
* the provided data chunk does not exceed the size of `target`.
* Returns the number of written codepoints in `target`.
*/
decode(input: Uint8Array, target: Uint32Array): number {
public decode(input: Uint8Array, target: Uint32Array): number {
const length = input.length;
if (!length) {
+3 -3
View File
@@ -55,13 +55,13 @@ function identifier(id: IFunctionIdentifier): number {
class TestHandler implements IDcsHandler {
constructor(public output: any[], public msg: string, public returnFalse: boolean = false) {}
hook(params: IParams): void {
public hook(params: IParams): void {
this.output.push([this.msg, 'HOOK', params.toArray()]);
}
put(data: Uint32Array, start: number, end: number): void {
public put(data: Uint32Array, start: number, end: number): void {
this.output.push([this.msg, 'PUT', utf32ToString(data, start, end)]);
}
unhook(success: boolean): void | boolean {
public unhook(success: boolean): void | boolean {
this.output.push([this.msg, 'UNHOOK', success]);
if (this.returnFalse) {
return false;

Some files were not shown because too many files have changed in this diff Show More