From 4b5f5ddffa56484bf678087c8086debdc60e86ad Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Wed, 18 Aug 2021 18:15:03 +0200 Subject: [PATCH] fix ts lint error by making methods abstract --- src/matrix/room/timeline/entries/BaseEntry.ts | 21 +++++++------------ .../room/timeline/entries/EventEntry.js | 1 - 2 files changed, 7 insertions(+), 15 deletions(-) diff --git a/src/matrix/room/timeline/entries/BaseEntry.ts b/src/matrix/room/timeline/entries/BaseEntry.ts index c592ecb6..1ef6a863 100644 --- a/src/matrix/room/timeline/entries/BaseEntry.ts +++ b/src/matrix/room/timeline/entries/BaseEntry.ts @@ -22,20 +22,15 @@ interface FragmentIdComparer { compare: (a: number, b: number) => number } -export class BaseEntry { - protected _fragmentIdComparer: FragmentIdComparer - - constructor(fragmentIdComparer: FragmentIdComparer) { - this._fragmentIdComparer = fragmentIdComparer; +export abstract class BaseEntry { + constructor( + protected readonly _fragmentIdComparer: FragmentIdComparer + ) { } - get fragmentId(): number { - throw new Error("unimplemented"); - } - - get entryIndex(): number { - throw new Error("unimplemented"); - } + abstract get fragmentId(): number; + abstract get entryIndex(): number; + abstract updateFrom(other: BaseEntry): void; compare(otherEntry: BaseEntry): number { if (this.fragmentId === otherEntry.fragmentId) { @@ -53,6 +48,4 @@ export class BaseEntry { asEventKey(): EventKey { return new EventKey(this.fragmentId, this.entryIndex); } - - updateFrom(other: BaseEntry) {} } diff --git a/src/matrix/room/timeline/entries/EventEntry.js b/src/matrix/room/timeline/entries/EventEntry.js index 55219cd6..89d3f379 100644 --- a/src/matrix/room/timeline/entries/EventEntry.js +++ b/src/matrix/room/timeline/entries/EventEntry.js @@ -33,7 +33,6 @@ export class EventEntry extends BaseEventEntry { } updateFrom(other) { - super.updateFrom(other); if (other._decryptionResult && !this._decryptionResult) { this._decryptionResult = other._decryptionResult; }