I have following imports (in the same TS source file):
import {Vector as sourceVector} from "ol/source";
import {Vector} from "ol/layer";
Here is how Vector is exported in ol/source:
export { default as Vector } from './source/Vector';
And ol/layer:
export { default as Vector } from './layer/Vector';
Is it possible to refactor imports somehow so it will look like this:
import {Vector as source.Vector} from "ol/source";
import {Vector as layer.Vector} from "ol/layer";
Unfortunately I don't have any control over ol/source and ol/layer and I can't affect their design decisions and naming conventions. I have to import and use both types in the same source code:
ngAfterViewInit(): void {
const markerSource = new sourceVector({});
this.map = new Map({
layers: [
new TileLayer({
source: new OSM(),
}),
new Vector({ source: markerSource }),
],
view: new View({
center: fromLonLat([11.57548, 48.137552]),
zoom: 13,
}),
target: this.myMap.nativeElement,
});