i'm using react and typescript i have a interface that i define my types in that.in this file i have a onClick prop.this accepted a function as value.my problem is how can i define function overloads for my onclick prop.eg:onClick:()=>void | (number)=>void ETC. this is my interface file.in other words i want my onClick prop like my color prop can accept union type.
import React from "react";
export interface IButtonText {
children: React.ReactNode;
leadingIcon: React.ReactNode;
className: string;
color: 'primary' | 'secondary';
onClick: ()=>void;
}