Im creating an ambient module to supplement missing typings. I can create a typings.d.ts
file and when I import it in other locations of the code everything works great except the return type of doSomething
is any
. In an attempt to fix this I imported the proper type from a known library into the typings.d.ts
this supplies the proper type to the ambient module.
For some reason when I do this, the import
statements of the ambient module break.
typings.d.ts
import { Tree } from '@otherLib/core' /// <=== Adding this breaks the ambient declaration below
declare module '@lib/missingTypings' {
export function doSomething(message: string): Tree
}
In the above example I'd like to provide the proper return type of Tree
from another library.