@@ -1403,7 +1403,7 @@ export class MatrixClient extends TypedEventEmitter<EmittedEvents, ClientEventHa
1403
1403
*
1404
1404
* @return {?string } MXID for the logged-in user, or null if not logged in
1405
1405
*/
1406
- public getUserId ( ) : string {
1406
+ public getUserId ( ) : string | null {
1407
1407
if ( this . credentials && this . credentials . userId ) {
1408
1408
return this . credentials . userId ;
1409
1409
}
@@ -1425,7 +1425,7 @@ export class MatrixClient extends TypedEventEmitter<EmittedEvents, ClientEventHa
1425
1425
* Get the local part of the current user ID e.g. "foo" in "@foo:bar".
1426
1426
* @return {?string } The user ID localpart or null.
1427
1427
*/
1428
- public getUserIdLocalpart ( ) : string {
1428
+ public getUserIdLocalpart ( ) : string | null {
1429
1429
if ( this . credentials && this . credentials . userId ) {
1430
1430
return this . credentials . userId . split ( ":" ) [ 0 ] . substring ( 1 ) ;
1431
1431
}
@@ -1480,7 +1480,7 @@ export class MatrixClient extends TypedEventEmitter<EmittedEvents, ClientEventHa
1480
1480
* @param {string } roomId The room the call is to be placed in.
1481
1481
* @return {MatrixCall } the call or null if the browser doesn't support calling.
1482
1482
*/
1483
- public createCall ( roomId : string ) : MatrixCall {
1483
+ public createCall ( roomId : string ) : MatrixCall | null {
1484
1484
return createNewMatrixCall ( this , roomId ) ;
1485
1485
}
1486
1486
@@ -1788,7 +1788,7 @@ export class MatrixClient extends TypedEventEmitter<EmittedEvents, ClientEventHa
1788
1788
*
1789
1789
* @return {module:crypto/deviceinfo } device or null
1790
1790
*/
1791
- public getStoredDevice ( userId : string , deviceId : string ) : DeviceInfo {
1791
+ public getStoredDevice ( userId : string , deviceId : string ) : DeviceInfo | null {
1792
1792
if ( ! this . crypto ) {
1793
1793
throw new Error ( "End-to-end encryption disabled" ) ;
1794
1794
}
@@ -3313,7 +3313,7 @@ export class MatrixClient extends TypedEventEmitter<EmittedEvents, ClientEventHa
3313
3313
* @return {?User } A user or null if there is no data store or the user does
3314
3314
* not exist.
3315
3315
*/
3316
- public getUser ( userId : string ) : User {
3316
+ public getUser ( userId : string ) : User | null {
3317
3317
return this . store . getUser ( userId ) ;
3318
3318
}
3319
3319
@@ -6823,7 +6823,7 @@ export class MatrixClient extends TypedEventEmitter<EmittedEvents, ClientEventHa
6823
6823
* Get the access token associated with this account.
6824
6824
* @return {?String } The access_token or null
6825
6825
*/
6826
- public getAccessToken ( ) : string {
6826
+ public getAccessToken ( ) : string | null {
6827
6827
return this . http . opts . accessToken || null ;
6828
6828
}
6829
6829
@@ -8915,7 +8915,7 @@ export class MatrixClient extends TypedEventEmitter<EmittedEvents, ClientEventHa
8915
8915
* @param {string } roomId The room ID to get a tree space reference for.
8916
8916
* @returns {MSC3089TreeSpace } The tree space, or null if not a tree space.
8917
8917
*/
8918
- public unstableGetFileTreeSpace ( roomId : string ) : MSC3089TreeSpace {
8918
+ public unstableGetFileTreeSpace ( roomId : string ) : MSC3089TreeSpace | null {
8919
8919
const room = this . getRoom ( roomId ) ;
8920
8920
if ( room ?. getMyMembership ( ) !== 'join' ) return null ;
8921
8921
0 commit comments