Update types to match js-sdk --strict mode (#9528)

Co-authored-by: Michael Weimann <michaelw@matrix.org>
pull/28788/head^2
Michael Telatynski 2022-11-03 12:50:07 +00:00 committed by GitHub
parent 3330d5a634
commit 5f540eb25c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 6 additions and 6 deletions

View File

@ -64,7 +64,7 @@ interface IProps {
continueText?: string; continueText?: string;
continueKind?: string; continueKind?: string;
// callback // callback
makeRequest(auth: IAuthData): Promise<IAuthData>; makeRequest(auth: IAuthData | null): Promise<IAuthData>;
// callback called when the auth process has finished, // callback called when the auth process has finished,
// successfully or unsuccessfully. // successfully or unsuccessfully.
// @param {boolean} status True if the operation requiring // @param {boolean} status True if the operation requiring
@ -199,7 +199,7 @@ export default class InteractiveAuthComponent extends React.Component<IProps, IS
}); });
}; };
private requestCallback = (auth: IAuthData, background: boolean): Promise<IAuthData> => { private requestCallback = (auth: IAuthData | null, background: boolean): Promise<IAuthData> => {
// This wrapper just exists because the js-sdk passes a second // This wrapper just exists because the js-sdk passes a second
// 'busy' param for backwards compat. This throws the tests off // 'busy' param for backwards compat. This throws the tests off
// so discard it here. // so discard it here.

View File

@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
import { AuthType, createClient } from 'matrix-js-sdk/src/matrix'; import { AuthType, createClient, IAuthData } from 'matrix-js-sdk/src/matrix';
import React, { Fragment, ReactNode } from 'react'; import React, { Fragment, ReactNode } from 'react';
import { MatrixClient } from "matrix-js-sdk/src/client"; import { MatrixClient } from "matrix-js-sdk/src/client";
import classNames from "classnames"; import classNames from "classnames";
@ -443,7 +443,7 @@ export default class Registration extends React.Component<IProps, IState> {
}); });
}; };
private makeRegisterRequest = auth => { private makeRegisterRequest = (auth: IAuthData | null) => {
const registerParams = { const registerParams = {
username: this.state.formVals.username, username: this.state.formVals.username,
password: this.state.formVals.password, password: this.state.formVals.password,

View File

@ -115,7 +115,7 @@ export default class DeactivateAccountDialog extends React.Component<IProps, ISt
this.setState({ errStr: _t("There was a problem communicating with the server. Please try again.") }); this.setState({ errStr: _t("There was a problem communicating with the server. Please try again.") });
}; };
private onUIAuthComplete = (auth: IAuthData): void => { private onUIAuthComplete = (auth: IAuthData | null): void => {
// XXX: this should be returning a promise to maintain the state inside the state machine correct // XXX: this should be returning a promise to maintain the state inside the state machine correct
// but given that a deactivation is followed by a local logout and all object instances being thrown away // but given that a deactivation is followed by a local logout and all object instances being thrown away
// this isn't done. // this isn't done.

View File

@ -39,7 +39,7 @@ describe('<IncomingLegacyCallToast />', () => {
const mockRoom = new Room('!room:server.org', mockClient, userId); const mockRoom = new Room('!room:server.org', mockClient, userId);
mockClient.deviceId = deviceId; mockClient.deviceId = deviceId;
const call = new MatrixCall({ client: mockClient }); const call = new MatrixCall({ client: mockClient, roomId: mockRoom.roomId });
const defaultProps = { const defaultProps = {
call, call,
}; };