ref: Improve TS state (#12125)

Create IStateful interface
Use IState interface everywhere
Remove unnecessary @ts-ignore
This commit is contained in:
Robert Pintilii
2022-09-05 14:24:13 +03:00
committed by GitHub
parent 271ea8315b
commit 17008237dc
41 changed files with 139 additions and 116 deletions

View File

@@ -5,6 +5,8 @@ import type { Dispatch } from 'redux';
// @ts-ignore
import { connect } from '../../../../../connection';
import { IState } from '../../../app/types';
import { IConfig } from '../../../base/config/configType';
// @ts-ignore
import { toJid } from '../../../base/connection/functions';
// @ts-ignore
@@ -34,7 +36,7 @@ interface Props extends WithTranslation {
/**
* The server hosts specified in the global config.
*/
_configHosts: Object,
_configHosts: IConfig['hosts'],
/**
* Indicates if the dialog should display "connecting" status message.
@@ -295,7 +297,7 @@ class LoginDialog extends Component<Props, State> {
* @private
* @returns {Props}
*/
function mapStateToProps(state: any) {
function mapStateToProps(state: IState) {
const {
error: authenticateAndUpgradeRoleError,
progress,