import { type OperationIr } from "../ir/operations.js"; import { type DictionaryRecipe } from "../schema/recipe.js"; import { type CompileContext } from "./shared.js"; /** * Compile a `DictionaryRecipe` to an Operation IR. * * Lands ONE Dictionary Folder item at * `/Dictionary//` plus ONE Dictionary Entry * child per `phrases[*]` key. Each Entry carries: * * - The `Key` field — equals the phrase key (stable identifier * consuming components reference). Shared field. * - The `Phrase` field — versioned: one item version per locale * present on the phrase (`primaryLocale` from `defaultValue`, * plus every locale in `phrases[*].translations`). When * `context.availableLanguages` is set (Sites API `listLanguages`), * translation locales are filtered to the environment's languages — * the dictionary installs exactly the brand's languages and never * adds a version in a locale the tenant doesn't have. The primary * locale is always emitted. * - A `__Help text` (description) shared field — optional, sourced * from `phrases[*].description`. Translator-facing context only. * * **Host-site resolution.** By default a dictionary has NO `site` and * installs into the deploy's TARGET site — the compiler composes * `/sitecore/content/` (the * `/` from the active env profile), the same * location pages and enums install into. No in-set `SiteRecipe` is * required. When `recipe.site` IS set (the shared-site override), it * points at a `SiteRecipe`; the compile context's `crossRecipeSitePaths` * / `sitesByHandle` resolves that handle to the host site's * `/` shape (same logic * `compileSiteRecipe`'s `resolveSiteContentTreePath` uses). Either way, * an unresolvable target yields an INPUT_INVALID with a targeted hint. * * **Why `Dictionary Folder` + `Dictionary Entry` templates use * `ref-path` `templateOf`.** Sub-milestone A's introspection focused * on Module / SiteTemplate GUIDs; the Dictionary template GUIDs were * NOT captured. Using path-based template refs keeps the compile * honest (no guessed GUIDs) and shifts verification to first-push * integration time — the executor resolves the path once via * `getItemsByPaths` and substitutes the actual GUID before issuing * CreateItem. * * **Phrase-key stability contract.** The recipe's `phrases` key (and * the Entry item's `Key` field) is the stable identifier. Renaming a * key breaks every consuming component (registry-side `TextSource` * refs + Sitecore field values that pinned the key). Add new keys * freely; never repurpose an existing one for a different meaning. */ export declare function compileDictionaryRecipe(input: DictionaryRecipe, context: CompileContext): OperationIr;