You've already forked matrix-js-sdk
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:
committed by
GitHub
parent
75674d961a
commit
29e54806a4
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user