import type { PhotoTypeFilter } from '../filters/searchFilters'; import type { NormalizedPhoto } from '../providers/model'; import type { LngLat } from './geometry'; import { type ViewDirection, type Viewpoint } from './viewpoints'; export type RankPhotosOptions = { /** Reference time for age filter + recency score (ms). */ now: number; /** Drop photos older than this (ms). */ maxAgeMs?: number; /** Drop photos farther than this from the viewpoint. */ maxDistanceMeters?: number; /** Flat photos must point within this many degrees of the wanted direction. */ maxFlatAngleDeg?: number; /** * App photo-type filter. Flat photos are preferred over panos (a flat photo's heading is part of * "this photo looks that way") unless only `pano` is allowed. */ photoTypes?: PhotoTypeFilter[]; /** Candidates kept per direction. */ limit?: number; }; export type PhotoCandidate = { photo: NormalizedPhoto; /** Lower is better. */ score: number; distanceMeters: number; /** Heading difference to the wanted direction; 0 for panos (the viewer turns to the bearing). */ angleDiff: number; ageYears: number | null; }; export type ViewSuggestion = { direction: ViewDirection; viewpoint: Viewpoint; candidates: PhotoCandidate[]; }; export declare const scorePhotoForDirection: (photo: NormalizedPhoto, viewpoint: Viewpoint, direction: ViewDirection, options: RankPhotosOptions) => PhotoCandidate | null; export declare const rankPhotosForDirection: (photos: NormalizedPhoto[], viewpoint: Viewpoint, direction: ViewDirection, options: RankPhotosOptions) => PhotoCandidate[]; /** One suggestion per viewpoint × direction, in viewpoint order. */ export declare const buildViewSuggestions: (viewpoints: Viewpoint[], photosForViewpoint: (viewpoint: Viewpoint) => NormalizedPhoto[], options: RankPhotosOptions) => ViewSuggestion[]; export type RankPhotosLookingAtOptions = Pick & { /** A flat photo's heading must point within this many degrees of the place. Default 35. */ maxFlatAngleDeg?: number; }; export type PhotoLookingAt = PhotoCandidate & { /** From the photo to the place, for `lookAtBearing`. */ bearingToPlace: number; }; /** * The photos that see `place`, best first: flat photos near it whose heading points at it, and * 360° photos near it. Compare `rankPhotosForDirection`, which answers "photos that look north * here" and not "who sees this spot". A flat photo closer than a few metres always counts. */ export declare const rankPhotosLookingAt: (place: LngLat, photos: NormalizedPhoto[], options: RankPhotosLookingAtOptions) => PhotoLookingAt[]; /** Years → ms, for `maxAgeMs`. */ export declare const yearsToMs: (years: number) => number;