TypeScript Version: 3.0.0-dev.20180601
Search Terms: declaration import types
Code
src/one/two/export.ts:
import*asCSSfrom'csstype';exportconstuse=(f: CSS.Properties['fontWeight'])=>f;
src/one/two/consumer.ts:
import{use}from"./export";exportconstasdf=use;Expected behavior:
consumer.d.ts has something like
exportdeclareconstasdf: (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.
exportdeclareconstasdf: (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
TypeScript Version: 3.0.0-dev.20180601
Search Terms: declaration import types
Code
src/one/two/export.ts:
src/one/two/consumer.ts:
Expected behavior:
consumer.d.ts has something like
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.
Playground Link: N/A
Related Issues:#24556, but csstype does specify a types key in package.json