Option one is to do as your told by the compiler and export both:
export class Album {
label: Album.AlbumLabel;
}
export namespace Album {
export class AlbumLabel { }
}
Option two is a shimmy variable, but you have a naming dilemma:
class Album {
label: Album.AlbumLabel;
}
namespace Album {
export class AlbumLabel { }
}
export const NameMe = Album;
The first option is a better choice (I reckon).
Imports
If you want to import AlbumLabel directly, don't nest it. It's in a module already, so have the module export Album and AlbumLabel.
If you keep the nesting you have to use either:
import { Album } from './component.js';
const a = new Album.AlbumLabel();
Or introduce a local name:
import { Album } from './component.js';
const AlbumLabel = Album.AlbumLabel;
const a = new AlbumLabel();
Here's the example that allows import { AlbumLabel } from './album';
export class Album {
label: AlbumLabel;
}
export class AlbumLabel { }
export namespace Album { ... }?export class Albumand I only should doexport namespace Album?