Reputation: 1921
I have a Typescript definition ./src/@types/moduleA/moduleA.d.ts
which contains:
declare module 'moduleA' {
export interface Transaction {...}
}
And I want to use it in another type definition file ./src/@types/moduleB/moduleB.d.ts
like this:
///<reference path="../moduleA/moduleA.d.ts" />
declare module 'moduleB' {
export class MyClass {
constructor(private transaction: Transaction) {}
}
}
But I'm getting Cannot find name 'Transaction'.ts
.
Why? Do I have to import it as well?
Thank you
Upvotes: 5
Views: 2316
Reputation: 1921
So for anyone searching:
only import { Transaction } from 'moduleA';
should be used.
Upvotes: 4