In the declaration of this function, if I remove <IFirst extends {}, ISecond extends {}>, the compiler reports an error; is not the return value the type after the double dot? What's the meaning of <IFirst extends {}, ISecond extends {}> after the name of the function? Why I have to put both <IFirst extends {}, ISecond extends {}> and : IFirst & ISecond on the declaration? I checked the documentation and surfed the Internet, but I cannot find the answer.
function extend<IFirst extends {}, ISecond extends {}>(
IFirst: IFirst,
ISecond: ISecond
): IFirst & ISecond {}