UNPKG

name-suggestion-index

Version:

Canonical common brand names for OpenStreetMap

31 lines 1.62 kB
import type { Presets } from '@openstreetmap/id-tagging-schema'; import type { DissolvedMap, NsiData, NsiPath, IDPreset, WikidataMap } from './types.ts'; /** Options for {@link buildIDPresets}. */ export interface BuildIDPresetsOptions { /** The id-tagging-schema source presets dictionary (the `presets` field of `presets.json`). */ sourcePresets: Presets; /** Map of QID → wikidata info, used to source preset `imageURL` values. */ wikidata?: WikidataMap; /** Map of NSI item id → dissolved record. Items present here become non-searchable. */ dissolved?: DissolvedMap; } /** Result of {@link buildIDPresets}. */ export interface BuildIDPresetsResult { /** The generated iD/Rapid presets, keyed by `<presetID>/<itemID>`. */ presets: Record<string, IDPreset>; /** Sorted list of NSI `tree/key/value` paths for which no source iD preset was found. */ missing: NsiPath[]; } /** * Build iD/Rapid presets from NSI data. * * This is a pure function: it does no I/O, performs no console output, and does not * mutate any of its inputs. Suitable for use in browser-based downstream projects * that fetch the NSI data on-the-fly. * * @param data - NSI category data indexed by `tree/key/value` path (the `_nsi.path` cache, or `nsi.json`'s `nsi` field) * @param opts - Sources for id-tagging-schema presets, wikidata logos, and dissolutions * @returns the generated presets plus a list of paths missing a source iD preset */ export declare function buildIDPresets(data: NsiData, opts: BuildIDPresetsOptions): BuildIDPresetsResult; //# sourceMappingURL=presets_id.d.ts.map