downlevel-dts icon indicating copy to clipboard operation
downlevel-dts copied to clipboard

downlevel template literal types

Open Hotell opened this issue 3 years ago • 0 comments

there is missing support for template literal types introduced in TS 4.1

Current Behaviour

export declare type Greeting = `hello ${World}`
declare type World = 'world'

↓↓↓ downlevel-dts ↓↓↓

export declare type Greeting = `hello ${World}`
declare type World = 'world'

Expected Behaviour

export declare type Greeting = `hello ${World}`
declare type World = 'world'

↓↓↓ downlevel-dts ↓↓↓

// Good enough
export declare type Greeting = string
// This would be awesome
export declare type Greeting = `hello world`
declare type World = 'world'

Hotell avatar Mar 21 '22 19:03 Hotell