Conform more code to strictNullChecks (#10374)

* Apply `strictNullChecks` to `src/components/views/room_settings/*`

* Restore tsconfig.json

* Conform more code to `strictNullChecks`

* Iterate

* Update matrix-widget-api

* Conform more code to `strictNullChecks`
This commit is contained in:
Michael Telatynski 2023-03-16 11:07:29 +00:00 committed by GitHub
parent 9c816bb720
commit 1c9ea423c9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
44 changed files with 223 additions and 179 deletions

View file

@ -47,7 +47,7 @@ export default class HistoryManager {
this.removedSinceLastPush = false;
}
private shouldPush(inputType: string, diff: IDiff): boolean {
private shouldPush(inputType?: string, diff?: IDiff): boolean {
// right now we can only push a step after
// the input has been applied to the model,
// so we can't push the state before something happened.
@ -102,7 +102,7 @@ export default class HistoryManager {
}
// needs to persist parts and caret position
public tryPush(model: EditorModel, caret: Caret, inputType: string, diff: IDiff): boolean {
public tryPush(model: EditorModel, caret: Caret, inputType?: string, diff?: IDiff): boolean {
// ignore state restoration echos.
// these respect the inputType values of the input event,
// but are actually passed in from MessageEditor calling model.reset()

View file

@ -171,7 +171,7 @@ export default class EditorModel {
this._autoComplete = null;
this.autoCompletePartIdx = null;
}
this.updateCallback(caret, inputType);
this.updateCallback?.(caret, inputType);
}
/**