ref(TS) Improve TS (#13365)

Change some any types to the correct types
This commit is contained in:
Robert Pintilii
2023-05-17 13:05:47 +03:00
committed by GitHub
parent 61e9cacceb
commit 06b67dcf44
21 changed files with 87 additions and 41 deletions

View File

@@ -102,7 +102,15 @@ export default function ToolboxButtonWithIcon(props: IProps) {
iconId
} = props;
const iconProps: any = {};
const iconProps: {
ariaControls?: string;
ariaExpanded?: boolean;
containerId?: string;
onClick?: (e?: React.MouseEvent) => void;
onKeyDown?: Function;
role?: string;
tabIndex?: number;
} = {};
let className = '';
if (iconDisabled) {
@@ -110,7 +118,7 @@ export default function ToolboxButtonWithIcon(props: IProps) {
= 'settings-button-small-icon settings-button-small-icon--disabled';
} else {
className = 'settings-button-small-icon';
iconProps.onClick = (e: React.MouseEvent) => {
iconProps.onClick = (e?: React.MouseEvent) => {
if (typeof APP !== 'undefined' && notifyMode) {
APP.API.notifyToolbarButtonClicked(
buttonKey, notifyMode === NOTIFY_CLICK_MODE.PREVENT_AND_NOTIFY

View File

@@ -119,7 +119,14 @@ export default function ToolboxButtonWithPopup(props: IProps) {
);
}
const iconProps: any = {};
const iconProps: {
ariaControls?: string;
ariaExpanded?: boolean;
className?: string;
containerId?: string;
role?: string;
tabIndex?: number;
} = {};
if (iconDisabled) {
iconProps.className