type FunctionArguments any> = T extends (...args: infer A) => any ? A : never; // Example Usage: function greet(name: string, age: number, isActive: boolean): string { return `Hello ${name}, you are ${age} and ${isActive ? 'active' : 'inactive'}.`; } type GreetArgs = FunctionArguments; // [name: string, age: number, isActive: boolean] const args: GreetArgs = ['Alice', 30, true]; // const invalidArgs: GreetArgs = ['Bob', '25', false]; // Type error: Argument of type 'string' is not assignable to parameter of type 'number'. class MyClass { method(x: number, y: string) { return `${x}-${y}`; } } type MyMethodArgs = FunctionArguments; // [x: number, y: string]