You've already forked matrix-js-sdk
mirror of
https://github.com/matrix-org/matrix-js-sdk.git
synced 2025-11-26 17:03:12 +03:00
Update eslint-plugin-matrix-org and improve visibilities & types (#2887)
This commit is contained in:
committed by
GitHub
parent
e085609572
commit
c0f7df8c3b
@@ -169,7 +169,7 @@ class SlidingList {
|
||||
* Construct a new sliding list.
|
||||
* @param {MSC3575List} list The range, sort and filter values to use for this list.
|
||||
*/
|
||||
constructor(list: MSC3575List) {
|
||||
public constructor(list: MSC3575List) {
|
||||
this.replaceList(list);
|
||||
}
|
||||
|
||||
@@ -373,7 +373,7 @@ export class SlidingSync extends TypedEventEmitter<SlidingSyncEvent, SlidingSync
|
||||
* @param {MatrixClient} client The client to use for /sync calls.
|
||||
* @param {number} timeoutMS The number of milliseconds to wait for a response.
|
||||
*/
|
||||
constructor(
|
||||
public constructor(
|
||||
private readonly proxyBaseUrl: string,
|
||||
lists: MSC3575List[],
|
||||
private roomSubscriptionInfo: MSC3575RoomSubscription,
|
||||
@@ -391,7 +391,7 @@ export class SlidingSync extends TypedEventEmitter<SlidingSyncEvent, SlidingSync
|
||||
* useCustomSubscription.
|
||||
* @param sub The subscription information.
|
||||
*/
|
||||
public addCustomSubscription(name: string, sub: MSC3575RoomSubscription) {
|
||||
public addCustomSubscription(name: string, sub: MSC3575RoomSubscription): void {
|
||||
this.customSubscriptions.set(name, sub);
|
||||
}
|
||||
|
||||
@@ -402,7 +402,7 @@ export class SlidingSync extends TypedEventEmitter<SlidingSyncEvent, SlidingSync
|
||||
* @param name The name of the subscription. If this name is unknown, the default subscription
|
||||
* will be used.
|
||||
*/
|
||||
public useCustomSubscription(roomId: string, name: string) {
|
||||
public useCustomSubscription(roomId: string, name: string): void {
|
||||
this.roomIdToCustomSubscription.set(roomId, name);
|
||||
// unconfirm this subscription so a resend() will send it up afresh.
|
||||
this.confirmedRoomSubscriptions.delete(roomId);
|
||||
@@ -574,7 +574,7 @@ export class SlidingSync extends TypedEventEmitter<SlidingSyncEvent, SlidingSync
|
||||
this.emit(SlidingSyncEvent.Lifecycle, state, resp, err);
|
||||
}
|
||||
|
||||
private shiftRight(listIndex: number, hi: number, low: number) {
|
||||
private shiftRight(listIndex: number, hi: number, low: number): void {
|
||||
// l h
|
||||
// 0,1,2,3,4 <- before
|
||||
// 0,1,2,2,3 <- after, hi is deleted and low is duplicated
|
||||
@@ -588,7 +588,7 @@ export class SlidingSync extends TypedEventEmitter<SlidingSyncEvent, SlidingSync
|
||||
}
|
||||
}
|
||||
|
||||
private shiftLeft(listIndex: number, hi: number, low: number) {
|
||||
private shiftLeft(listIndex: number, hi: number, low: number): void {
|
||||
// l h
|
||||
// 0,1,2,3,4 <- before
|
||||
// 0,1,3,4,4 <- after, low is deleted and hi is duplicated
|
||||
@@ -602,7 +602,7 @@ export class SlidingSync extends TypedEventEmitter<SlidingSyncEvent, SlidingSync
|
||||
}
|
||||
}
|
||||
|
||||
private removeEntry(listIndex: number, index: number) {
|
||||
private removeEntry(listIndex: number, index: number): void {
|
||||
// work out the max index
|
||||
let max = -1;
|
||||
for (const n in this.lists[listIndex].roomIndexToRoomId) {
|
||||
@@ -618,7 +618,7 @@ export class SlidingSync extends TypedEventEmitter<SlidingSyncEvent, SlidingSync
|
||||
delete this.lists[listIndex].roomIndexToRoomId[max];
|
||||
}
|
||||
|
||||
private addEntry(listIndex: number, index: number) {
|
||||
private addEntry(listIndex: number, index: number): void {
|
||||
// work out the max index
|
||||
let max = -1;
|
||||
for (const n in this.lists[listIndex].roomIndexToRoomId) {
|
||||
@@ -747,7 +747,7 @@ export class SlidingSync extends TypedEventEmitter<SlidingSyncEvent, SlidingSync
|
||||
return d.promise;
|
||||
}
|
||||
|
||||
private resolveTransactionDefers(txnId?: string) {
|
||||
private resolveTransactionDefers(txnId?: string): void {
|
||||
if (!txnId) {
|
||||
return;
|
||||
}
|
||||
@@ -811,7 +811,7 @@ export class SlidingSync extends TypedEventEmitter<SlidingSyncEvent, SlidingSync
|
||||
/**
|
||||
* Start syncing with the server. Blocks until stopped.
|
||||
*/
|
||||
public async start() {
|
||||
public async start(): Promise<void> {
|
||||
this.abortController = new AbortController();
|
||||
|
||||
let currentPos: string | undefined;
|
||||
|
||||
Reference in New Issue
Block a user