Typehinting function with two possible call signatures