import type { Prettify } from '../types/types.js'; import type { GeometryType } from './geometryTypes.js'; import type { NumericValuePromptFormat, OpeningHoursValuePromptFormat, ValuePromptFormat } from './valuePromptFormats.js'; export type RedirectMapping = { from: string; to: string; }; export type SignStateType = Prettify<(TrafficSignType & { recodgnizedSign: true; matchdByAlternativeKey?: string; svgName: string; }) | (ModifierSignType & { recodgnizedSign: true; matchdByAlternativeKey?: string; svgName: string; }) | (UnkownSignType & { recodgnizedSign: false; matchdByAlternativeKey?: string; svgName: null; })>; export type SignType = TrafficSignType | ModifierSignType; export type UnkownSignType = { osmValuePart: string; signId: null; signValue: string; kind: 'traffic_sign' | 'exception_modifier' | 'condition_modifier'; descriptiveName: string; redirects?: never; }; export type TrafficSignType = SharedId & SharedContent & { kind: 'traffic_sign'; signValue?: number; valuePrompt?: ValuePrompt; tagRecommendationsByGeometry: TagRecommendationsTrafficSign; } & SharedComments & SharedQuestions & SharedCompatibility & SharedCatalogue & SharedIdentifiyingTags & SharedImage & SharedTaggingSuggestionsQa; export type ModifierSignType = Prettify | ValuePrompt; tagRecommendationsByGeometry: TagRecommendationsModifierSign; } & SharedComments & SharedQuestions & SharedCompatibility & SharedCatalogue & SharedIdentifiyingTags & SharedImage & SharedTaggingSuggestionsQa>; type SharedId = { osmValuePart: string; signId: string; redirects?: RedirectMapping[]; }; type SharedContent = { name: string; /** Human-readable label; omit when it would duplicate `name` or `signId`. */ descriptiveName?: string; description: string | null; }; type SharedCompatibility = { compatibility?: { canReceiveModifiers?: boolean; /** @desc Value of `signId` */ incompatibleModifiers?: string[]; /** Modifier `signId` → ISO date `YYYY-MM-DD` when combination QA marked OK */ confirmedModifiers?: Record; }; }; export declare const trafficSignCatalogueCategories: readonly ["traffic_sign", "object_sign", "surface_sign", "hazard_sign", "signpost", "speed"]; export declare const modifierSignCatalogueCategories: readonly ["exception_modifier", "condition_modifier", "direction_modifier"]; export type TrafficSignCatalogueCategory = (typeof trafficSignCatalogueCategories)[number]; export type ModifierSignCatalogueCategory = (typeof modifierSignCatalogueCategories)[number]; /** Sign-picker section order; must list every catalogue category exactly once. */ export declare const signCategories: readonly ["traffic_sign", "exception_modifier", "condition_modifier", "direction_modifier", "speed", "hazard_sign", "surface_sign", "object_sign", "signpost"]; export type SignCategory = (typeof signCategories)[number]; export declare const signFocusTags: readonly ["bike_foot", "parking", "highway"]; export type SignFocusTag = (typeof signFocusTags)[number]; export declare const catalogueFocusViews: readonly ["default", "bike_foot", "parking", "highway"]; export type CatalogueFocusView = (typeof catalogueFocusViews)[number]; /** Listed in tab. `'highlight'` = listed + featured ("Häufig verwendet") in that tab. */ export type CatalogueFocusLevel = true | 'highlight'; /** Per-view catalogue contract. Omit = Standard only (`default: true`, not featured). */ export type CatalogueFocus = Partial> & { /** Only in Alle tab (no Standard / thematic). */ all?: true; }; export declare const focusAreas: readonly ["default", "bike_foot", "parking", "highway", "all"]; export type FocusArea = (typeof focusAreas)[number]; export declare const taggingSuggestionsQaStatuses: readonly ["none"]; export type TaggingSuggestionsQaStatus = (typeof taggingSuggestionsQaStatuses)[number]; type SharedTaggingSuggestionsQa = { taggingSuggestionsQa?: TaggingSuggestionsQaStatus; }; type TagRecommendationsNone = 'none'; export type TagRecommendationTag = { key: string; value: string; }; export type OptionalTagGuidance = { /** BCP-47 language of the guidance text (e.g. `de`, `en`). */ lang?: string; comment: string; link?: string; }; /** Optional tags only, or tags plus decision guidance for the UI. */ export type OptionalTagsRecommendation = TagRecommendationTag[] | { tags: TagRecommendationTag[]; guidance?: OptionalTagGuidance; }; export type OptionalTagsBySignEntry = { tags: Map; guidance?: OptionalTagGuidance; }; export type TagRecommendationsTrafficSignObject = { geometries: GeometryType[]; highwayValues?: string[]; accessTags?: TagRecommendationTag[]; uniqueTags?: (TagRecommendationTag | { key: string; /** @description Format: `"FOO:"` will result in `"FOO:30"` for `signValue=30` */ valueTemplate?: `${string}$` | `$${string}` | `${string}$${string}`; })[]; /** Tags that may apply in some cases; shown separately in the UI (see issue #119). */ optionalTags?: OptionalTagsRecommendation; conditionalTags?: TagRecommendationTag[]; comments?: SignComentType[]; }; export type TagRecommendationsModifierSignObject = { geometries: GeometryType[]; highwayValues?: string[]; accessTags?: TagRecommendationTag[]; modifierValue?: string; uniqueTags?: TagRecommendationTag[]; optionalTags?: OptionalTagsRecommendation; modifierValueFromValuePrompt?: boolean; comments?: SignComentType[]; }; export type TagRecommendationByGeometry = TagRecommendationsTrafficSignObject; export type ModifierTagRecommendationByGeometry = TagRecommendationsModifierSignObject; export type TagRecommendationsTrafficSign = TagRecommendationsNone | TagRecommendationsTrafficSignObject[]; export type TagRecommendationsModifierSign = TagRecommendationsNone | TagRecommendationsModifierSignObject[]; type SharedCatalogue = { catalogue: { signCategory: T; focus?: CatalogueFocus; }; }; export type ValuePrompt = { prompt: string; defaultValue: string; format: T; }; export type SignComentType = { tagReference?: string | null; important?: true | undefined; /** BCP-47 language of the comment text (e.g. `de`, `en`). */ lang?: string; comment: string; }; type SharedComments = { comments?: SignComentType[]; }; export declare const QUESTION_NIL_ANSWER_ID: "nil"; export type QuestionAnswerTag = TagRecommendationTag; export type QuestionAnswer = { answerId: string; answerI18nKey: string; /** OSM tags applied when this answer is selected (omit for nil / highway-only answers). */ tags?: QuestionAnswerTag[]; /** OSM tags removed when this answer is selected (e.g. implicit on chosen highway class). */ removeTags?: QuestionAnswerTag[]; /** When set, this answer selects a single `highway=*` value (used by highway-class questions). */ highwayValue?: string; /** Geometries where this answer applies. Falls back to question, then sign recommendations. */ geometries?: GeometryType[]; /** Optional external reference (e.g. OSM wiki) shown beside the answer label. */ referenceUrl?: string; }; export type SignQuestion = { questionId: string; questionI18nKey: string; /** Suggested initial answer for tag output; user can always pick `nil`. */ defaultAnswerId?: string | null; /** When true, resolved answer replaces `highwayValues` from recommendations. */ affectsHighway?: boolean; /** Geometries where any answer applies. Falls back to sign recommendations. */ geometries?: GeometryType[]; answers: QuestionAnswer[]; }; /** Selected answers keyed by sign `osmValuePart`, then `questionId` → `answerId`. */ export type QuestionAnswersBySign = Record>; type SharedQuestions = { /** * Discrete tagging choices (sidepath, surface colour, highway class, …). * Use `valuePrompt` for free-form / numeric input instead. */ questions?: SignQuestion[]; }; type SharedIdentifiyingTags = { identifyingTags?: { key: string; value: string; }[]; }; type SharedImageLicence = 'Public Domain' | 'CC-0'; export type SignImageSourceRemote = { kind: 'remote'; sourceUrl: string; licence: SharedImageLicence; }; export type SignImageSourceLocal = { kind: 'local'; sourceLocalPath: string; licence: SharedImageLicence; }; /** Wiki SVG unavailable; no bundled asset expected. */ export type SignImage = SignImageSourceRemote | SignImageSourceLocal | 'missing'; type SharedImage = { image: SignImage; }; export {}; //# sourceMappingURL=TrafficSignDataTypes.d.ts.map