Khan / flow-to-ts

Convert flow code to typescript
https://flow-to-ts.netlify.com
394 stars 75 forks source link

Convert $Diff<T, U> -> Omit<T, keyof U> #396

Open seansfkelley opened 8 months ago

seansfkelley commented 8 months ago

This is a lossy conversion, since Flow requires that U is an object type and that T (1) has all the keys of U and (2) the corresponding values of T are assignable to those of U. A closer analogue would use OmitStrict instead of Omit (where type OmitStrict<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>) but using the standard Omit means we don't need to add potentially-conflicting definitions elsewhere to import here.