convert ReplayDetectionEntry to typescript
This commit is contained in:
parent
d6e243321b
commit
b55930f084
1 changed files with 16 additions and 3 deletions
|
@ -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;
|
||||
}
|
||||
}
|
Reference in a new issue