I tried to export an interface in a NgModule-declaration and export and getting this error already in the editor (Visual Studio Code): [ts] \'MyInterface\' only refers
You cannot export an interface. You can only export:
NgModule is an angular concept and should not be confused with a typescript module. To make a third party, who uses your module, able to use your interface, you should create a .d.ts definition file with your module.
If you want to use a interface inside another NgModule of yours, you should just use:
import {InterfaceName} from 'path/to/ngmodule/to/interface';
Also, do not put an interface in the declarations array, this is only used for pipes/components/directives.
If you want your interface to be usable outside of an library, you should add it to the export of your index.ts:
export {InterfaceName} from 'path/to/ngmodule/to/interface';