Use TypeScript Compiler API for Creating Interfaces, Types, and Functions
Is your feature request related to a problem? Please describe.
Yes, currently we are dealing with strings to create interfaces, types, and functions, which is non-ideal and error-prone. It also makes it harder to use TypeScript's type-checking capabilities.
Describe the solution you'd like
We should use the TypeScript Compiler API to create interfaces, types, and functions. Specifically, we should utilize createFunctionDeclaration, createTypeAliasDeclaration, and other relevant factory functions.
Describe alternatives you've considered
There shouldn't be any alternative to this.
Additional context
The following file needs to be updated:
packages/code-generator/functions.ts
Checklist
[x] Add unit tests for the new implementation.
[x] Migrate existing string-based code generation to use TypeScript Compiler API.
Use TypeScript Compiler API for Creating Interfaces, Types, and Functions
Is your feature request related to a problem? Please describe. Yes, currently we are dealing with strings to create interfaces, types, and functions, which is non-ideal and error-prone. It also makes it harder to use TypeScript's type-checking capabilities.
Describe the solution you'd like We should use the TypeScript Compiler API to create interfaces, types, and functions. Specifically, we should utilize
createFunctionDeclaration
,createTypeAliasDeclaration
, and other relevant factory functions.Describe alternatives you've considered There shouldn't be any alternative to this.
Additional context The following file needs to be updated:
packages/code-generator/functions.ts
Checklist