Files
TREK/client/src/repo/placePictureRepo.ts
T
Maurice 31dba65906 fix: the last red checks after the tour, home and place picture merges
A GPX file that mixes routes and tracks gives each its own text: the pieces
are matched to the reader's rows by kind, routes first as the reader gives
them, where they were paired by index and a route got a track's points. The
place pictures reach the network through a small repo instead of the api
module, the wanderer parity case and the tool catalog test allow wanderer,
and the knip and theme baselines follow the lower counts.
2026-10-23 22:40:14 +02:00

31 lines
1.1 KiB
TypeScript

import type { MapsPlaceEnrichmentResult } from '@trek/shared';
import { fetchImageAsBlob } from '../api/authUrl';
import { mapsApi } from '../api/client';
/** What the sources are asked for one place: where it is, what it is called, in which language. */
interface PlaceEnrichmentQuery {
placeId?: string;
lat: number;
lng: number;
name: string;
lang?: string;
details?: Record<string, unknown>;
}
/**
* The pictures a place can be given: the sources' photos and the images
* attached to it. Online only by nature, and nothing here is cached on the
* device; the session cache for enrichment lives with the planner view.
*/
export const placePictureRepo = {
/** The sources' pictures and description for a place, as the maps route answers them. */
enrichment(query: PlaceEnrichmentQuery, signal?: AbortSignal): Promise<MapsPlaceEnrichmentResult> {
return mapsApi.placeEnrichment(query, signal);
},
/** An attached image as an object URL the view can show; empty when it could not be read. */
attachedImage(url: string): Promise<string> {
return fetchImageAsBlob(url);
},
};