In the playground :
import { reflect } from 'typescript-rtti';
namespace shape {
export interface Shape {
bar: string
}
// export const foo = 42;
}
const sh = reflect<shape.Shape>().as('interface').reflectedInterface;
console.log(sh.getProperty('bar')?.type ?? '<NOT FOUND>')
This gives the following output :
=============
Caught error: Type has kind undefined, expected interface
TypeError: Type has kind undefined, expected interface
This is because the namespace is NOT in the value space ; however, if you uncomment the other export, the namespace is in the value space and it doesn't fail any longer
In the playground :
This gives the following output :
This is because the
namespaceis NOT in the value space ; however, if you uncomment the other export, the namespace is in the value space and it doesn't fail any longer