fix ts lint error by making methods abstract

This commit is contained in:
Bruno Windels 2021-08-18 18:15:03 +02:00
parent e1481f2947
commit 4b5f5ddffa
2 changed files with 7 additions and 15 deletions

View File

@ -22,20 +22,15 @@ interface FragmentIdComparer {
compare: (a: number, b: number) => number compare: (a: number, b: number) => number
} }
export class BaseEntry { export abstract class BaseEntry {
protected _fragmentIdComparer: FragmentIdComparer constructor(
protected readonly _fragmentIdComparer: FragmentIdComparer
constructor(fragmentIdComparer: FragmentIdComparer) { ) {
this._fragmentIdComparer = fragmentIdComparer;
} }
get fragmentId(): number { abstract get fragmentId(): number;
throw new Error("unimplemented"); abstract get entryIndex(): number;
} abstract updateFrom(other: BaseEntry): void;
get entryIndex(): number {
throw new Error("unimplemented");
}
compare(otherEntry: BaseEntry): number { compare(otherEntry: BaseEntry): number {
if (this.fragmentId === otherEntry.fragmentId) { if (this.fragmentId === otherEntry.fragmentId) {
@ -53,6 +48,4 @@ export class BaseEntry {
asEventKey(): EventKey { asEventKey(): EventKey {
return new EventKey(this.fragmentId, this.entryIndex); return new EventKey(this.fragmentId, this.entryIndex);
} }
updateFrom(other: BaseEntry) {}
} }

View File

@ -33,7 +33,6 @@ export class EventEntry extends BaseEventEntry {
} }
updateFrom(other) { updateFrom(other) {
super.updateFrom(other);
if (other._decryptionResult && !this._decryptionResult) { if (other._decryptionResult && !this._decryptionResult) {
this._decryptionResult = other._decryptionResult; this._decryptionResult = other._decryptionResult;
} }