Conform more of the codebase to strictNullChecks (#10731)

This commit is contained in:
Michael Telatynski 2023-04-28 09:45:36 +01:00 committed by GitHub
parent 9f8113eabd
commit 1281c0746b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
40 changed files with 147 additions and 119 deletions

View file

@ -30,7 +30,7 @@ const STATIC_DIALOG_CONTAINER_ID = "mx_Dialog_StaticContainer";
// Type which accepts a React Component which looks like a Modal (accepts an onFinished prop)
export type ComponentType = React.ComponentType<{
onFinished?(...args: any): void;
onFinished(...args: any): void;
}>;
// Generic type which returns the props of the Modal component with the onFinished being optional.
@ -135,7 +135,7 @@ export class ModalManager extends TypedEventEmitter<ModalManagerEvent, HandlerMa
}
public appendDialog<C extends ComponentType>(
Element: React.ComponentType,
Element: C,
props?: ComponentProps<C>,
className?: string,
): IHandle<C> {
@ -157,7 +157,7 @@ export class ModalManager extends TypedEventEmitter<ModalManagerEvent, HandlerMa
}
private buildModal<C extends ComponentType>(
prom: Promise<React.ComponentType>,
prom: Promise<C>,
props?: ComponentProps<C>,
className?: string,
options?: IOptions<C>,
@ -301,7 +301,7 @@ export class ModalManager extends TypedEventEmitter<ModalManagerEvent, HandlerMa
}
private appendDialogAsync<C extends ComponentType>(
prom: Promise<React.ComponentType>,
prom: Promise<C>,
props?: ComponentProps<C>,
className?: string,
): IHandle<C> {