Vite + TypeScript PWA that mirrors the Android app's core features: - Pre-processed shelter data (build-time UTM33N→WGS84 conversion) - Leaflet map with shelter markers, user location, and offline tiles - Canvas compass arrow (ported from DirectionArrowView.kt) - IndexedDB shelter cache with 7-day staleness check - Service worker with CacheFirst tiles and precached app shell - i18n for en, nb, nn (ported from Android strings.xml) - iOS/Android compass handling with low-pass filter - Respects user map interaction (no auto-snap on pan/zoom) - Build revision cache-breaker for reliable SW updates Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
30 lines
1.2 KiB
TypeScript
30 lines
1.2 KiB
TypeScript
import { RawSourceMap } from 'source-map';
|
|
/**
|
|
* Adapted from https://github.com/nsams/sourcemap-aware-replace, with modern
|
|
* JavaScript updates, along with additional properties copied from originalMap.
|
|
*
|
|
* @param {Object} options
|
|
* @param {string} options.jsFilename The name for the file whose contents
|
|
* correspond to originalSource.
|
|
* @param {Object} options.originalMap The sourcemap for originalSource,
|
|
* prior to any replacements.
|
|
* @param {string} options.originalSource The source code, prior to any
|
|
* replacements.
|
|
* @param {string} options.replaceString A string to swap in for searchString.
|
|
* @param {string} options.searchString A string in originalSource to replace.
|
|
* Only the first occurrence will be replaced.
|
|
* @return {{source: string, map: string}} An object containing both
|
|
* originalSource with the replacement applied, and the modified originalMap.
|
|
*
|
|
* @private
|
|
*/
|
|
export declare function replaceAndUpdateSourceMap({ jsFilename, originalMap, originalSource, replaceString, searchString, }: {
|
|
jsFilename: string;
|
|
originalMap: RawSourceMap;
|
|
originalSource: string;
|
|
replaceString: string;
|
|
searchString: string;
|
|
}): Promise<{
|
|
map: string;
|
|
source: string;
|
|
}>;
|