Conform more of the codebase to strict types (#11162)

This commit is contained in:
Michael Telatynski 2023-06-29 12:17:05 +01:00 committed by GitHub
parent 9c7d935aae
commit 95283d21bb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 36 additions and 31 deletions

View file

@ -29,9 +29,11 @@ const DIALOG_CONTAINER_ID = "mx_Dialog_Container";
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;
}>;
export type ComponentType =
| React.ComponentType<{
onFinished(...args: any): void;
}>
| React.ComponentType<any>;
// Generic type which returns the props of the Modal component with the onFinished being optional.
export type ComponentProps<C extends ComponentType> = Defaultize<