Skip to content

Point union in typescript is not helpful #69

@dagda1

Description

@dagda1

Hi,

I have just upgraded to the latest version and the type definition for Point has changed to a union which is not helpful.

type Point = { x: number; y: number } | [number, number];

For every union that is created, I have to use type narrowing to determine what it is if the inference cannot work it out.

It was perfect before:

type Point = { x: number; y: number }

I would have a new type for the tuple.

Would you be open to a PR that reverted this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions