I am currently working on generating function signatures based on a generic readonly object that is inputted. Take a look at the following example:
type input0 = ReadOnly<{x: number, y: number, z: number}>
// generate this type from input0 as a generic
type input0signature = (x: number, y: number, z: number) => void
Here's another example for better understanding:
type input1 = ReadOnly<{id: number, age: number}>
// generate this type from input1 as a generic
type input1signature = (id: number, age: number) => void
It's important to point out that the order and names of the arguments in the generated function signatures must match exactly with those in the inputted type. Also, I specifically do not want to create signatures using spread operators (like tuples or arrays) for the arguments, nor do I want the inputted type to be used as an argument directly, as shown here:
type input1 = ReadOnly<{id: number, age: number}>
// I do NOT want signatures to use the spread operator
type input1signatureTuple = (...args: [number, number]) => void
// And also NOT like this
type input1signatureObject = (arg: input1) => void
Is it possible to achieve this functionality in TypeScript?