import type { NormalizedPhoto } from '../providers/model'; import { type LngLat } from '../viewpoints/geometry'; /** * "Open this place in another imagery service": one opener per service, with a link that works * right away (`locationUrl`) and, where the service can do it, a better one that opens the * nearest image already turned to the place (`lookAtUrl`). * * Unlike `ProviderId`, openers need no coverage data, so services without a public API (infra3D) * fit in too. */ /** Photo providers that have a viewer of their own to open. */ declare const PROVIDER_OPENER_IDS: readonly ["mapillary", "panoramax", "kartaview", "mapilio", "streetside", "vegbilder", "streetview", "lookaround"]; /** Provider ids, plus one id per configured infra3D project (`infra3d:`). */ export type LocationOpenerId = (typeof PROVIDER_OPENER_IDS)[number] | `infra3d:${string}`; /** The place to look at (not where the camera stands): a clicked point, a feature's centroid … */ export type OpenTarget = { lngLat: LngLat; /** Map zoom, for services that open on a map. */ zoom?: number; /** * Show only photos from this day on (`YYYY-MM-DD`). Mapillary only: the other services have no * such link param and ignore it. Throws when it is not a real day. */ dateFrom?: string; }; export type LocationOpener = { id: LocationOpenerId; label: string; color: string; /** `false` when the host config lacks what the service needs. */ isAvailable: () => boolean; /** * `false` when the service has no imagery at the place (Vegbilder outside Norway, an infra3D * project outside its `bbox`); hide the link then. Services without a known area cover all. */ covers: (lngLat: LngLat) => boolean; /** * `true` when the service shows its images only to people with an account (infra3D): everyone * else lands on its login page. Mark such links, e.g. with a lock icon. */ requiresAccount: boolean; /** The service at the place. Synchronous, so it works as an ``. */ locationUrl: (target: OpenTarget) => string; /** * The image nearest to the place, turned to look at it. Needs a request, so open the tab first * (`openLocationInNewTab` does). `null` when there is no such image; use `locationUrl` then. */ lookAtUrl?: (target: OpenTarget, signal?: AbortSignal) => Promise; }; /** * Mapillary web app link to the image that shows the target best, turned to it (360° images: * the `x`/`y`/`zoom` view params; flat images are picked by their heading). */ export declare const mapillaryLookAtUrl: (photos: readonly NormalizedPhoto[], target: LngLat, { dateFrom }?: { dateFrom?: string; }) => string | null; /** Google Maps link to a panorama (from the metadata API), turned to the target. */ export declare const streetViewLookAtUrl: (pano: NormalizedPhoto, target: LngLat) => string; /** * infra3D has no public coverage data, so it is an opener only. Its `lookAt` already means "the * nearest image, turned to this point", so the plain link is the look-at link. */ export declare const infra3dOpeners: () => LocationOpener[]; /** The photo providers' openers. `getLocationOpeners()` adds the infra3D projects. */ export declare const LOCATION_OPENERS: LocationOpener[]; /** All openers: the photo providers, then one per infra3D project of the config. */ export declare const getLocationOpeners: () => LocationOpener[]; /** The openers that have imagery at the place (`covers`) and all they need (`isAvailable`). */ export declare const getLocationOpenersAt: (lngLat: LngLat) => LocationOpener[]; export declare const findLocationOpener: (id: LocationOpenerId) => LocationOpener | undefined; /** * Open a link to another service in a new tab, or in a separate window with * `createStreetImageryConfig({ openLinksIn: 'window' })`. Call it in a click handler. */ export declare const openExternalUrl: (url: string) => void; export declare const openLocationInNewTab: (opener: LocationOpener, target: OpenTarget, { timeoutMs }?: { timeoutMs?: number; }) => void; export {};