This question is not directly related to Kendo UI but more about TypeScript namespace declarations.
I'm trying to import some interfaces from Kendo UI library. Structure of index.d.ts of Kendo UI is like below:
declare namespace kendo.ui {
class Draggable extends kendo.ui.Widget { ... }
interface DraggableEvent { ... }
// ... other declarations
}
Now I import this declaration in my TypeScript file as below:
import '@progress/kendo-ui';
Strangely, in my TypeScript file, I can only see the class and function declarations, none of the interfaces are visible from outside of the namespace.
This is how my tsconfig.json is configured:
{
"compilerOptions": {
"lib": [
"dom",
"es5",
"es2015",
"es2015.promise"
],
"module": "es2015",
"moduleResolution": "node",
"strict": false,
"target": "es2015",
"sourceMap": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"allowSyntheticDefaultImports": true
}
}
I tried adding export
keyword before some of the interface declarations to no avail.
Can someone please explain what's going on here?