Open sadym-chromium opened 10 months ago
@jrandolf would it be possible to wrap each time a enum is called like ${<ENUM>}
so that way TypeScript interprets it as a union of string literals.
We did that for events in chromium-bidi
https://github.com/GoogleChromeLabs/chromium-bidi/pull/1891 .
Currently, when there is an enum is declared in the spec, the generated result is not compilable.
network.SameSite
.Generated type:
Generated parser:
Using type and parser together:
Expected behavior: the script above is compiled. Actual behavior:
error TS2820: Type '"qValue1"' is not assignable to type 'qEnum'. Did you mean 'qEnum.qValue2'?