// Generated by scripts/generate.mjs — do not edit by hand. /** A locale with a prebuilt bundle, as a BCP 47 tag. */ export type Locale = | "ar" | "bg" | "cs" | "da" | "de" | "el" | "en" | "es" | "fi" | "fr" | "he" | "hu" | "it" | "ja" | "ko" | "nl" | "no" | "pl" | "pt-BR" | "pt-PT" | "ro" | "ru" | "sv" | "tr" | "vi" | "zh-Hans" | "zh-Hant" /** One of the 28 selectable allergen disclosures. */ export type AllergenKey = | "RYE" | "BARLEY" | "EMMER" | "EINKORN" | "SPELT" | "WHEAT" | "OATS" | "KHORASAN" | "CRUSTACEANS" | "EGGS" | "FISH" | "PEANUTS" | "SOY" | "MILK" | "MACADAMIA" | "ALMONDS" | "BRAZIL_NUTS" | "PECANS" | "PISTACHIOS" | "WALNUTS" | "CASHEWS" | "HAZELNUTS" | "CELERY" | "MUSTARD" | "SESAME" | "SULPHITES" | "LUPINS" | "MOLLUSCS" /** One of the 22 Menuella Declarations. */ export type DeclarationKey = | "COLORING" | "PRESERVATIVES" | "ANTIOXIDANTS" | "NITRITE_CURING_SALT" | "NITRATE" | "NITRITE_CURING_SALT_AND_NITRATE" | "FLAVOR_ENHANCERS" | "PHOSPHATE" | "SULPHURED" | "BLACKENED" | "WAXED" | "SWEETENERS" | "PHENYLALANINE" | "LAXATIVE_WARNING" | "CAFFEINE" | "QUININE" | "CHILD_ATTENTION_WARNING" | "MILK_PROTEIN" | "SURIMI" | "RECONSTITUTED_MEAT" | "RECONSTITUTED_FISH" | "DEFROSTED" /** The 14 EU allergen groups. Display grouping — never selectable. */ export type AllergenGroup = | "CELERY" | "CEREALS" | "CRUSTACEANS" | "EGGS" | "FISH" | "LUPINS" | "MILK" | "MOLLUSCS" | "MUSTARD" | "PEANUTS" | "SESAME" | "SOY" | "SULPHITES" | "TREE_NUTS" /** What kind of declaration an entry is. */ export type DeclarationCategory = | "ADDITIVE" | "BEVERAGE" | "PRODUCT" | "WARNING" /** Basename of an SVG in `icons/` — e.g. "cereals" is `icons/cereals.svg`. */ export type IconName = | "celery" | "cereals" | "crustaceans" | "declarations" | "eggs" | "fish" | "lupins" | "milk" | "molluscs" | "mustard" | "peanuts" | "sesame" | "soy" | "sulphites" | "tree-nuts" /** An allergen with its labels already resolved for one locale. */ export interface Allergen { readonly key: AllergenKey readonly group: AllergenGroup /** True for a specific member of a multi-member group (each cereal, each nut). */ readonly isMember: boolean readonly icon: IconName /** Short label, e.g. "Weizen". */ readonly name: string /** Legal group sentence. Render ONCE per group, members listed beneath. */ readonly declaration: string readonly description: string } /** A Menuella Declaration with its labels already resolved for one locale. */ export interface Declaration { readonly key: DeclarationKey readonly category: DeclarationCategory readonly icon: IconName readonly name: string readonly description: string } /** * One locale's disclosures — the default export of `locales/`, and the * shape of `bundles/.json`. Deeply frozen at runtime. */ export interface Disclosures { readonly locale: L readonly fallbackLocale: "en" readonly allergens: readonly Allergen[] readonly declarations: readonly Declaration[] /** * Fields served from the fallback locale, as "module.KEY.field" — e.g. * "allergens.WHEAT.declaration". Empty when the locale covers everything. * Present so a fallback is inspectable rather than silent. */ readonly fallbacks: readonly string[] } /** One allergen group as it is rendered: the declaration once, members beneath. */ export interface AllergenGroupDisclosure { readonly group: AllergenGroup /** The legal sentence for the whole group. */ readonly declaration: string readonly icon: IconName /** * The specific members the product contains — "Wheat", "Barley". Empty for * a group that has no members (milk, eggs): the declaration says it all. */ readonly members: readonly Allergen[] } /** What {@link resolveDisclosures} returns. */ export interface ResolvedDisclosures { readonly allergens: readonly AllergenGroupDisclosure[] readonly declarations: readonly Declaration[] /** Input keys that are not in this release's vocabulary, in input order. */ readonly unknown: readonly string[] } /** The Menuella footnote codes — the shape of `data/codes.json`. */ export interface Codes { scheme: "MENUELLA" convention: string allergens: Record declarations: Record } export declare const LOCALES: readonly Locale[] export declare const FALLBACK_LOCALE: "en" export declare const ALLERGEN_KEYS: readonly AllergenKey[] export declare const DECLARATION_KEYS: readonly DeclarationKey[] export declare const ALLERGEN_GROUPS: readonly AllergenGroup[] export declare const DECLARATION_CATEGORIES: readonly DeclarationCategory[] export declare const ICON_NAMES: readonly IconName[] export declare const CODE_SCHEME: "MENUELLA" /** * True when the value is a current allergen key. * Retired codes ("A6", "G") return false — use this to find stored rows that * still hold codes. */ export declare function isAllergenKey(value: unknown): value is AllergenKey /** True when the value is a current declaration key. Retired numbers return false. */ export declare function isDeclarationKey(value: unknown): value is DeclarationKey /** True when the value is a locale with a bundle. Exact match: "pt-br" is not. */ export declare function isLocale(value: unknown): value is Locale /** * The disclosures a product carries, arranged the way they must be rendered: * one declaration per allergen group with its members beneath, then the * declarations, then any key this release does not know. */ export declare function resolveDisclosures( disclosures: Disclosures, keys: readonly string[] | ReadonlySet, ): ResolvedDisclosures