I have a MY_FILE.ts
file like that:
const someFunction = (param: MY_NAMESPACE.PARAM) : boolean => { // DO SOMETHING };
The param type is accessed through a namespace
called MY_NAMESPACE
that I declare
on a MY_NAMESPACE.d.ts
file. Like this:
src/MY_NAMESPACE.d.ts
declare namespace MY_NAMESPACE {
type PARAM: SOME_TYPE
}
I need to run that MY_FILE.ts
file, which contains a script.
This works fine:
npx babel-node src/MY_FILE.ts --extensions ".ts"
And this does not work (and I expected it to work just fine):
npx ts-node src/MY_FILE.ts
I get this error: error TS2503: Cannot find namespace MY_NAMESPACE
Note: In my real case, the MY_NAMESPACE
is called TYPES
.
How can I make it work with ts-node
?