joarwilk / flowgen

Generate flowtype definition files from TypeScript
Other
657 stars 87 forks source link

Add missing flow utils #201

Open sekoyo opened 11 months ago

sekoyo commented 11 months ago

Most of the utils which were not converted from TS are now natively supported in Flow.

I had to update the spread test as you can see, using spread for inexact object types now fails: Flow Playground

new:

Pick: https://flow.org/en/docs/types/utilities/#toc-pick Exclude: https://flow.org/en/docs/types/utilities/#toc-exclude Extract: https://flow.org/en/docs/types/utilities/#toc-extract

now natively supported:

Omit: https://flow.org/en/docs/types/utilities/#toc-omit Partial: https://flow.org/en/docs/types/utilities/#toc-partial Required: https://flow.org/en/docs/types/utilities/#toc-required

this + default generic arguments are supported so don't need to be removed

replace deprecated $ElementType and $PropertyType with indexed access types T[K]

https://flow.org/en/docs/types/utilities/#toc-propertytype https://flow.org/en/docs/types/utilities/#toc-elementtype

sekoyo commented 11 months ago

P.S. Guards are also supported - https://flow.org/en/docs/types/type-guards/ though not sure how to do this one, I don't know where the code is that's removing it