mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2024-11-20 03:25:52 +01:00
convert ReplayDetectionEntry to typescript
This commit is contained in:
parent
d6e243321b
commit
b55930f084
@ -14,11 +14,24 @@ See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
import type {TimelineEvent} from "../../../storage/types";
|
||||
|
||||
export class ReplayDetectionEntry {
|
||||
constructor(sessionId, messageIndex, event) {
|
||||
public readonly sessionId: string;
|
||||
public readonly messageIndex: number;
|
||||
public readonly event: TimelineEvent;
|
||||
|
||||
constructor(sessionId: string, messageIndex: number, event: TimelineEvent) {
|
||||
this.sessionId = sessionId;
|
||||
this.messageIndex = messageIndex;
|
||||
this.eventId = event.event_id;
|
||||
this.timestamp = event.origin_server_ts;
|
||||
this.event = event;
|
||||
}
|
||||
|
||||
get eventId(): string {
|
||||
return this.event.event_id;
|
||||
}
|
||||
|
||||
get timestamp(): number {
|
||||
return this.event.origin_server_ts;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user