Skip to content

Get union of all possible return types of a function #20350

Closed

Description

For example:

type F = () => number | string
type G = returnof F // number | string

If there is interest, I will write up a proposal.

Note that this is distinct from #6606, which gives a return type given parameter types.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    SuggestionAn idea for TypeScript

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions