gristlabs / ts-interface-checker

Runtime library to validate data against TypeScript interfaces.
Apache License 2.0
323 stars 18 forks source link

TypeOperator not supported by ts-interface-builder: keyof SomeInterface #54

Open TomascpMarques opened 3 years ago

TomascpMarques commented 3 years ago

TL;DR

Be able to use field: keyof SomeInterface as an interfaces field type, without needing to export custom types.

What's the issue?

Using keyof SomeInterface, as an interface field, typethrows out an error : Node TypeOperator not supported by ts-interface-builder: keyof IUser

What happened?

So I was defining a new interface, and in one of the fields I defined the as field: keyof IUser, and when I ran the: npx ts-interface-builder foo.ts it gave me the previously mentioned error.

What did you try to fix the issue?

After the error message, I used the Type suites, exported the type, rewrote the previous error producing code using the exported type, and it does not work, it builds, but still throws out an error.

What do you want?

Be able to use field: keyof OtherInterface directly, pretty pls

P.S

I'm loving your package, eases my development experience tremendously, loving it <3