TypeScript Function That Generates a Schema with Dynamic Fields and Maintains Correct Return Types
I’m trying to create a TypeScript function that takes configuration parameters and generates a schema with some default fields. However, I’m struggling to get the correct return type for the function. Specifically, the autocomplete doesn’t show the fields created from the parameters. Here’s an example of what I’m trying to achieve:
Any suggestions or examples would be greatly appreciated!
Thanks in advance!
0 Replies