Convert interfaces and type definitions to Morphic and io-ts definitions. Careful, code is a prototype. May cause serious harm to eyes, including but not limited to: Eye bleeds.
Currently writes files to the specified path + .IO.ts and .MO.ts
yarn
yarn start /somewhere/some.interface.d.ts
yarn start /somewhere/some.interface.d.ts Sometype SomeInterface someOthertype SomeOtherInterface
-
We currently do not follow imports. Make sure all necessary types are within the same file, or you will have to process each imported file separately
-
We currently do not fully sort the definitions. Make sure you re-order the them to follow proper variable definition rules of JS.
-
We currently do not support dynamic types, ie the ones generated from ReturnType However you can generate d.ts files via
tsc
with enabled declarations option. you can then extract the definition from the function return signature into a Type or Interface. and then process the file with this tool.
-
Ability to convert dynamic type definitions... ie, the ones generated from ReturnType See Notes section for how to handle this.
-
improve ordering, not fix all cyclic issues, but reduce hassle to resolve them.
-
Only export if the type was exported in the original