Skip to content

Commit

Permalink
[www] work around tsc error
Browse files Browse the repository at this point in the history
tsc was failing with:
    TS2589: Type instantiation is excessively deep and possibly infinite

So I added a simpler type here.
  • Loading branch information
michaelkirk committed Jan 20, 2024
1 parent a4393c6 commit e077a8f
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion services/frontend/www-app/src/components/BaseMap.vue
Original file line number Diff line number Diff line change
Expand Up @@ -195,12 +195,22 @@ export const baseMapPromise = new Promise<BaseMapInterface>((resolver) => {
baseMapPromiseResolver = resolver;
});
// tsc was failing with:
// TS2589: Type instantiation is excessively deep and possibly infinite
// So I added a simpler type here.
// If we need, we can expose more of the maplibre-gl.Marker methods or
// maybe a future version of TSC will be smart enough to deal with reverting
// this.
interface SimpleMarker {
remove: () => void;
}
export default defineComponent({
name: 'BaseMap',
data: function (): {
flyToOptions?: FlyToOptions;
boundsToFit?: LngLatBoundsLike;
markers: Map<string, Marker>;
markers: Map<string, SimpleMarker>;
layers: string[];
loaded: boolean;
touchHandlers: Map<BaseMapEventType, Array<BaseMapEventHandler>>;
Expand Down

0 comments on commit e077a8f

Please sign in to comment.