// Generated by scripts/generate.mjs — do not edit by hand. /** A locale with a prebuilt bundle under `bundles/`. */ export type Locale = | "ar" | "bg" | "cs" | "da" | "de" | "el" | "en" | "es" | "fi" | "fr" | "he" | "hu" | "it" | "ja" | "ko" | "nl" | "no" | "pl" | "pt" | "ro" | "ru" | "sv" | "tr" | "vi" | "zh" /** 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 { key: AllergenKey group: AllergenGroup /** True for a specific member of a multi-member group (each cereal, each nut). */ isMember: boolean icon: IconName /** Short label, e.g. "Weizen". */ name: string /** Legal group sentence. Render ONCE per group, members listed beneath. */ declaration: string description: string } /** A Menuella Declaration with its labels already resolved for one locale. */ export interface Declaration { key: DeclarationKey category: DeclarationCategory icon: IconName name: string description: string } /** * One locale's bundle — the shape of `bundles/.json`. * * Import it directly; there is no loader to call: * ```ts * import type { Disclosures } from "@menuella/food-safety" * import data from "@menuella/food-safety/bundles/de.json" * const disclosures = data as Disclosures * ``` */ export interface Disclosures { locale: Locale fallbackLocale: "en" allergens: Allergen[] declarations: 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. */ fallbacks: 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 /** * Every disclosure for a locale, ready to render. * * Hand it the locale your app already resolved — `useLocale()` from next-intl, * `Astro.currentLocale`, whatever you use. This does NOT do i18n: it will not * sniff the browser, negotiate, or quietly fall back. * * @throws if the locale has no bundle. */ export declare function getDisclosures(locale: Locale | (string & {})): Disclosures