Skip to content

Flow type helpers #2710

Open
Open

Description

Flow offer some nice type helpers in his recent versions, while some of them are already addressed by typescript, some could perhaps be helpful.
Here are extracted comments from flow source just for inspiration.

  • $Either<...T> is the union of types ...T
  • $All<...T> is the intersection of types ...T
  • $Supertype acts as any over supertypes of T
  • $Subtype acts as any over subtypes of T
  • $Shape matches the shape of T
  • $Diff<T,S>
  • $Enum is the set of keys of T
  • $Record is the type of objects whose keys are those of T
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    Needs ProposalThis issue needs a plan that clarifies the finer details of how it could be implemented.SuggestionAn idea for TypeScript

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions