1
0
mirror of https://github.com/matrix-org/matrix-react-sdk.git synced 2025-12-04 03:22:43 +03:00

Make more of the codebase conform to strict types (#10859)

This commit is contained in:
Michael Telatynski
2023-05-12 09:49:37 +01:00
committed by GitHub
parent 6f58dd49e3
commit f758cbd38a
46 changed files with 111 additions and 105 deletions

View File

@@ -666,7 +666,7 @@ class TimelinePanel extends React.Component<IProps, IState> {
private onRoomTimeline = (
ev: MatrixEvent,
room: Room | undefined,
toStartOfTimeline: boolean,
toStartOfTimeline: boolean | undefined,
removed: boolean,
data: IRoomTimelineData,
): void => {
@@ -769,7 +769,7 @@ class TimelinePanel extends React.Component<IProps, IState> {
});
};
private onRoomTimelineReset = (room: Room, timelineSet: EventTimelineSet): void => {
private onRoomTimelineReset = (room: Room | undefined, timelineSet: EventTimelineSet): void => {
if (timelineSet !== this.props.timelineSet) return;
if (this.canResetTimeline()) {
@@ -873,7 +873,7 @@ class TimelinePanel extends React.Component<IProps, IState> {
this.forceUpdate();
};
private onLocalEchoUpdated = (ev: MatrixEvent, room: Room, oldEventId: string): void => {
private onLocalEchoUpdated = (ev: MatrixEvent, room: Room, oldEventId?: string): void => {
if (this.unmounted) return;
// ignore events for other rooms
@@ -921,7 +921,7 @@ class TimelinePanel extends React.Component<IProps, IState> {
this.forceUpdate();
};
private onSync = (clientSyncState: SyncState, prevState: SyncState, data: object): void => {
private onSync = (clientSyncState: SyncState, prevState: SyncState | null, data?: object): void => {
if (this.unmounted) return;
this.setState({ clientSyncState });
};