Comply with noImplicitAny (#9940)

* Stash noImplicitAny work

* Stash

* Fix imports

* Iterate

* Fix tests

* Delint

* Fix tests
This commit is contained in:
Michael Telatynski 2023-02-13 11:39:16 +00:00 committed by GitHub
parent ac7f69216e
commit 61a63e47f4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
359 changed files with 1621 additions and 1353 deletions

View file

@ -35,13 +35,15 @@ const PowerLabel: Record<PowerStatus, string> = {
[PowerStatus.Moderator]: _td("Mod"),
};
const PRESENCE_CLASS = {
export type PresenceState = "offline" | "online" | "unavailable";
const PRESENCE_CLASS: Record<PresenceState, string> = {
offline: "mx_EntityTile_offline",
online: "mx_EntityTile_online",
unavailable: "mx_EntityTile_unavailable",
};
function presenceClassForMember(presenceState: string, lastActiveAgo: number, showPresence: boolean): string {
function presenceClassForMember(presenceState: PresenceState, lastActiveAgo: number, showPresence: boolean): string {
if (showPresence === false) {
return "mx_EntityTile_online_beenactive";
}
@ -67,7 +69,7 @@ interface IProps {
title?: string;
avatarJsx?: JSX.Element; // <BaseAvatar />
className?: string;
presenceState?: string;
presenceState?: PresenceState;
presenceLastActiveAgo?: number;
presenceLastTs?: number;
presenceCurrentlyActive?: boolean;
@ -104,7 +106,7 @@ export default class EntityTile extends React.PureComponent<IProps, IState> {
}
public render(): JSX.Element {
const mainClassNames = {
const mainClassNames: Record<string, boolean> = {
mx_EntityTile: true,
mx_EntityTile_noHover: this.props.suppressOnHover,
};