-
Notifications
You must be signed in to change notification settings - Fork 13.2k
Closed
Labels
BugA bug in TypeScriptA bug in TypeScriptDomain: Declaration EmitThe issue relates to the emission of d.ts filesThe issue relates to the emission of d.ts filesFixedA PR has been merged for this issueA PR has been merged for this issue
Milestone
Description
TypeScript Version: 3.0.0-dev.20180601
Search Terms: declaration import types
Code
src/one/two/export.ts:
import * as CSS from 'csstype';
export const use = (f: CSS.Properties['fontWeight']) => f;src/one/two/consumer.ts:
import { use } from "./export";
export const asdf = use ;Expected behavior:
consumer.d.ts has something like
export declare const asdf: (f: import("csstype/index").FontWeightProperty) => import("csstype/index").FontWeightProperty;Actual behavior:
It has relative paths to node_modules, based on the source file's location at compile time. This places an assumption on the location of the d.ts file when it's consumed externally.
export declare const asdf: (f: import("../../../node_modules/csstype/index").FontWeightProperty) => import("../../../node_modules/csstype/index").FontWeightProperty;Playground Link: N/A
Related Issues: #24556, but csstype does specify a types key in package.json
esamattis, vovkasm, osdiab, styu, ksaldana1 and 8 more
Metadata
Metadata
Assignees
Labels
BugA bug in TypeScriptA bug in TypeScriptDomain: Declaration EmitThe issue relates to the emission of d.ts filesThe issue relates to the emission of d.ts filesFixedA PR has been merged for this issueA PR has been merged for this issue