Parameters<F> gives you the tuple of a function’s arguments, and ReturnType<F> gives the result type. This lets you wire higher-order helpers to existing functions without repeating types.
function add(a: number, b: number) {
return a + b;
}
type A = Parameters<typeof add>; // [number, number]
type R = ReturnType<typeof add>; // number
Call a function using its extracted parameters and return its extracted result.