rrdelaney / ReasonablyTyped

:diamond_shape_with_a_dot_inside: Converts Flow and TypeScript definitions to Reason interfaces
https://rrdelaney.github.io/ReasonablyTyped/
MIT License
518 stars 24 forks source link

Exact object types #27

Closed rrdelaney closed 7 years ago

rrdelaney commented 7 years ago

Flow object types are "open" in Reason terms. There is a way of defining a "closed" types in Flow, using exact object types.

Thanks to @bbqbaron for bringing this up 😄

Example

declare type t = {| foo: string, bar: number |}

should transform to an closed object type:

type t = Js.t {. foo : string, bar : float};