Skip to content

Emitted declaration file is missing import on enum type #26969

@mattmccutchen

Description

@mattmccutchen

From https://stackoverflow.com/q/52216570.

TypeScript Version: master (cbde861)

Search Terms: enum declaration emit missing import

Code

// enum.ts
export enum AnimalEnum { Cat = "Cat" }
export const defaultAnimal = AnimalEnum.Cat;

// main.ts
import { defaultAnimal } from "./enum";
export const myAnimal = defaultAnimal;

Expected behavior: main.d.ts contains:

export declare const myAnimal = import("./enum").AnimalEnum.Cat;

Actual behavior: main.d.ts contains:

export declare const myAnimal = AnimalEnum.Cat;

Playground Link: N/A, multiple files

Related Issues: None found

Metadata

Metadata

Assignees

Labels

BugA bug in TypeScriptDomain: Declaration EmitThe issue relates to the emission of d.ts files

Type

No type
No fields configured for issues without a type.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions