/** * Placeholder allow-controls resolver — runs after `runRecipePush`'s * IR loop to register each recipe's rendering with the SXA placeholder * slots it declares compatibility with. * * Why this lives outside the IR pipeline: scai's IR ops target items * by recipe-internal refKey or known content-tree path. Placeholder * Settings items are looked up by their `Placeholder Key` *field * value*, which the compiler can't know in advance — different * tenants name their placeholder items differently while sharing the * same key. So this step does a runtime walk of the configured roots * and matches by field, then updates `Allowed Controls` directly via * the Authoring API. * * Idempotent: existing entries on `Allowed Controls` are preserved; * we only append IDs that aren't already there. Safe to re-run. */ import type { AuthoringApiClient } from "../api/client.js"; import type { Recipe } from "../schema/recipe.js"; export interface PlaceholderAllowResult { /** Number of placeholder items whose Allowed Controls field was updated. */ patched: number; /** Number of `(placeholder, rendering)` pairs added across all updates. */ totalAdded: number; /** Recipe handles whose rendering item couldn't be resolved on the tenant. */ unresolvedRecipeHandles: string[]; /** Recipe placeholder keys with no matching Placeholder item under any root. */ unmatchedPlaceholderKeys: string[]; } export interface PlaceholderAllowOptions { client: AuthoringApiClient; recipes: readonly Recipe[]; renderingsRoot: string; placeholderSettingsRoots: readonly string[]; /** When false, plan but do not write. */ apply: boolean; /** Per-update progress hook. Called with placeholder path + how many entries were added. */ onUpdate?: (placeholderPath: string, added: number) => void; } /** * Resolve every component-template recipe's `placeholders` declarations * against the tenant and append the recipe's rendering itemId to each * matching `Allowed Controls` field. Returns a summary so callers can * surface the resolver's reach in their command output. * * Failure modes (each surfaced in the result, none fatal): * - Rendering item missing on tenant → recipe handle in * `unresolvedRecipeHandles`; that recipe's placeholders are skipped. * - Placeholder key never matched → key in `unmatchedPlaceholderKeys`; * other matches still apply. */ export declare const applyPlaceholderAllowControls: (options: PlaceholderAllowOptions) => Promise;