flow icon indicating copy to clipboard operation
flow copied to clipboard

Bridge the syntax gap between _Flow_ and _TypeScript_

Open Conaclos opened this issue 1 year ago • 6 comments

Proposal

The goal of this proposal is to improve interoperability between Flow and TypeScript.

  • [ ] Allow export declare as an alias of declare export
  • [x] Add unknown type as an alias of mixed
  • [x] Add undefined type as an alias of void
  • [x] Add readonly as an alias of + in object type and interface. e.g. type Person = { readonly name: string }.
  • [x] Add in, out as aliases of - and + for type parameter variance
  • [x] Add extends as an alias of : for type parameter bounds. e.g. function f<A extends string>(a:A){}.
  • [x] Add never type as an alias of empty
  • [x] Add type guards (x: unknown) => x is X
  • [x] Add as type assertion as an alias of (:)
  • [x] Add keyof T as an alias of $Keys<T>
  • [x] Add readonly arrays readonly string[]
  • [x] Add readonly tuples readonly [string, number]
  • [X] Add Readonly, ReadonlyArray, ReadonlySet, ReadonlyMap, Record<K, V> as aliases of $ReadOnly, $ReadOnlyArray, $ReadOnlySet, $ReadOnlyMap, { [key: K]: V }
  • [x] Add Partial, Required utility types

Use case

I would like to use Flow. However, it is hard to give up all TypeScript tooling. More interoperability could help to use Flow.

Conaclos avatar Jan 24 '23 12:01 Conaclos