Skip to content

Support conditional types for "condition" and "branch" #1955

Open
@pokey

Description

@pokey

In the following code:

export type SpokenFormMap = {
    readonly [K in number | string]: K extends number
    ? string
    : number;
};

We'd like K extends number to be "condition", and string and number to each be a "branch".

Metadata

Metadata

Assignees

No one assigned

    Labels

    lang-typescriptTypeScript/JavaScript grammar support

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions