joarwilk / flowgen

Generate flowtype definition files from TypeScript
Other
658 stars 78 forks source link

Add missing flow utils #201

Open sekoyo opened 1 year ago

sekoyo commented 1 year 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 1 year 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