import { NormalizedUIElement, NormalizedUINode } from "../ir.js"; import { AdaptiveCardResult, TeamsAdaptiveCard, TeamsCardElement, TeamsConversionWarning, ToAdaptiveCardOptions } from "./types.js"; //#region src/teams/toAdaptiveCard.d.ts /** Shared mutable conversion state threaded through one top-level conversion. */ export interface ConversionContext { readonly warnings: TeamsConversionWarning[]; usedInputIds: Set; } /** * Converts a child whose output is thrown away, and reports whether anything * was lost with it. A scratch context keeps the ids it claims out of the card, * where they would rename a control that survives; only its `dropped` warnings * are forwarded, because those describe the tree the caller wrote, while a * clamp or a rename would describe content never delivered. */ export declare const discardedChild: (child: NormalizedUINode, context: ConversionContext, depth: number) => boolean; export declare function convertElement(element: NormalizedUIElement, context: ConversionContext, depth: number): TeamsCardElement[]; /** * Walks a normalized sequence into card body elements. Nested arrays are * flattened into one flat sibling sequence first (via {@link normalizedList}), * so a `Divider`/`Fact`/`Button` run merges correctly even when the model * wrapped some of its siblings in their own array. Consecutive `Fact` * siblings merge into one FactSet and consecutive `Button` siblings merge * into one ActionSet; a `Divider`/`Spacer` emits nothing itself but sets * `separator`/`spacing` on the next emitted sibling (a trailing or orphan * one is dropped silently, since there is no sibling left to carry it). * `depth` advances by exactly one per element-nesting level: this call does * not itself add a level, since flattening a sibling array or converting a * sibling element is not a descent; only a container's own recursive * `convertSequence(children, depth + 1)` call is. */ export declare function convertSequence(node: NormalizedUINode | undefined, context: ConversionContext, depth: number): TeamsCardElement[]; /** Builds a full card (schema envelope plus body) from an already-normalized root, checking the soft payload budget. */ export declare function convertRootToCard(root: NormalizedUINode | readonly NormalizedUINode[], context: ConversionContext): TeamsAdaptiveCard; /** * Converts a generative-ui tree into a Microsoft Teams Adaptive Card and * non-fatal conversion warnings. Sizes, weights, and colors map to Adaptive * Card's semantic enums rather than raw values. An Input/Select/RadioGroup/ * Checkbox/DatePicker whose id would be the reserved {@link RESERVED_INPUT_ID} * is renamed with a warning (see `decodeSubmitData`). Never throws: an * unknown `$type` is skipped with a "dropped" warning, and a malformed input * resolves to an empty card plus a "dropped" warning instead of throwing. */ export declare function toAdaptiveCard(node: unknown, _options?: ToAdaptiveCardOptions): AdaptiveCardResult; //#endregion //# sourceMappingURL=toAdaptiveCard.d.ts.map