@@ -113,6 +113,8 @@ import {
113113 RoomMemberEventHandlerMap ,
114114 RoomStateEvent ,
115115 RoomStateEventHandlerMap ,
116+ INotificationsResponse ,
117+ IFilterResponse ,
116118} from "./matrix" ;
117119import {
118120 CrossSigningKey ,
@@ -132,6 +134,7 @@ import { Room } from "./models/room";
132134import {
133135 IAddThreePidOnlyBody ,
134136 IBindThreePidBody ,
137+ IContextResponse ,
135138 ICreateRoomOpts ,
136139 IEventSearchOpts ,
137140 IGuestAccessOpts ,
@@ -5245,7 +5248,7 @@ export class MatrixClient extends TypedEventEmitter<EmittedEvents, ClientEventHa
52455248 }
52465249
52475250 // TODO: we should implement a backoff (as per scrollback()) to deal more nicely with HTTP errors.
5248- const res = await this . http . authedRequest < any > ( undefined , Method . Get , path , params ) ; // TODO types
5251+ const res = await this . http . authedRequest < IContextResponse > ( undefined , Method . Get , path , params ) ;
52495252 if ( ! res . event ) {
52505253 throw new Error ( "'event' not in '/context' result - homeserver too old?" ) ;
52515254 }
@@ -5424,7 +5427,7 @@ export class MatrixClient extends TypedEventEmitter<EmittedEvents, ClientEventHa
54245427 params . from = token ;
54255428 }
54265429
5427- promise = this . http . authedRequest < any > ( // TODO types
5430+ promise = this . http . authedRequest < INotificationsResponse > (
54285431 undefined , Method . Get , path , params , undefined ,
54295432 ) . then ( async ( res ) => {
54305433 const token = res . next_token ;
@@ -6101,15 +6104,13 @@ export class MatrixClient extends TypedEventEmitter<EmittedEvents, ClientEventHa
61016104 const path = utils . encodeUri ( "/user/$userId/filter" , {
61026105 $userId : this . credentials . userId ,
61036106 } ) ;
6104- // TODO types
6105- return this . http . authedRequest < any > ( undefined , Method . Post , path , undefined , content ) . then ( ( response ) => {
6106- // persist the filter
6107- const filter = Filter . fromJson (
6108- this . credentials . userId , response . filter_id , content ,
6109- ) ;
6110- this . store . storeFilter ( filter ) ;
6111- return filter ;
6112- } ) ;
6107+ return this . http . authedRequest < IFilterResponse > ( undefined , Method . Post , path , undefined , content )
6108+ . then ( ( response ) => {
6109+ // persist the filter
6110+ const filter = Filter . fromJson ( this . credentials . userId , response . filter_id , content ) ;
6111+ this . store . storeFilter ( filter ) ;
6112+ return filter ;
6113+ } ) ;
61136114 }
61146115
61156116 /**
0 commit comments