1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-11-25 05:23:13 +03:00

Improve typing for MatrixEvent::getContent generic (#2252)

This commit is contained in:
Michael Telatynski
2022-03-21 16:22:21 +00:00
committed by GitHub
parent 75674d961a
commit 29e54806a4

View File

@@ -478,7 +478,7 @@ export class MatrixEvent extends TypedEventEmitter<EmittedEvents, MatrixEventHan
*
* @return {Object} The event content JSON, or an empty object.
*/
public getContent<T = IContent>(): T {
public getContent<T extends IContent = IContent>(): T {
if (this._localRedactionEvent) {
return {} as T;
} else if (this._replacingEvent) {