import type { AdaptiveAction, AdaptiveCard } from '../models.js'; import { ActionMode, ActionStyle, AssociatedInputs } from '../enums.js'; import { TeamsDataBuilder } from './TeamsDataBuilder.js'; import { TeamsSubmitPropertiesBuilder } from './TeamsSubmitPropertiesBuilder.js'; /** * Fluent builder for {@link AdaptiveAction} instances. * * Call one of the action-type methods first (`openUrl`, `submit`, etc.) * then chain modifiers, then call `build()`. */ export declare class ActionBuilder { private action; private dataSet; private teamsDataSet; private teamsSubmitTypedSet; private teamsSubmitRawSet; /** Sets the action type to OpenUrl. @param url The URL to open. @param title Optional button title. @returns The builder instance for method chaining. */ openUrl(url: string, title?: string): this; /** Sets the action type to Submit. @param title Optional button title. @returns The builder instance for method chaining. */ submit(title?: string): this; /** Sets the action type to ShowCard. @param title Optional button title. @returns The builder instance for method chaining. */ showCard(title?: string): this; /** Sets the action type to ToggleVisibility. @param title Optional button title. @returns The builder instance for method chaining. */ toggleVisibility(title?: string): this; /** Sets the action type to Execute (Universal Action Model). @param title Optional button title. @returns The builder instance for method chaining. */ execute(title?: string): this; /** Ensures an action type has been set before modifying properties. @throws Error if no action type has been selected. */ private ensureActionTypeSet; /** Sets the unique identifier for the action. @param id The unique identifier. @returns The builder instance for method chaining. */ withId(id: string): this; /** Sets the button title. @param title The button label text. @returns The builder instance for method chaining. */ withTitle(title: string): this; /** Sets the icon URL displayed on the button. @param iconUrl The icon URL. @returns The builder instance for method chaining. */ withIconUrl(iconUrl: string): this; /** Sets the visual style of the action button. @param style The action style. @returns The builder instance for method chaining. */ withStyle(style: ActionStyle): this; /** Sets whether the action is enabled. @param isEnabled True to enable the action. @returns The builder instance for method chaining. */ withIsEnabled(isEnabled: boolean): this; /** Sets the tooltip shown on hover. @param tooltip The tooltip text. @returns The builder instance for method chaining. */ withTooltip(tooltip: string): this; /** Sets the action mode (primary or secondary). @param mode The action mode. @returns The builder instance for method chaining. */ withMode(mode: ActionMode): this; /** Sets the feature requirements for the action. @param key The feature name. @param version The minimum required version. @returns The builder instance for method chaining. */ withRequires(key: string, version: string): this; /** Sets the fallback behavior when the action is unsupported. @param fallback The fallback value ('drop' or an action). @returns The builder instance for method chaining. */ withFallback(fallback: 'drop' | AdaptiveAction): this; /** Sets the data payload (for Submit or Execute actions). @param data The data to submit. @returns The builder instance for method chaining. @throws Error if WithTeamsData or WithTeamsTaskFetch was already called. */ withData(data: unknown): this; /** Sets which inputs are included when the action is submitted (for Submit or Execute actions). @param associatedInputs The associated inputs option. @returns The builder instance for method chaining. */ withAssociatedInputs(associatedInputs: AssociatedInputs): this; /** Sets the verb for an Execute action. @param verb The command verb. @returns The builder instance for method chaining. */ withVerb(verb: string): this; /** Sets the card to reveal for a ShowCard action. @param card The embedded AdaptiveCard. @returns The builder instance for method chaining. */ withCard(card: AdaptiveCard): this; /** Adds a target element to toggle for a ToggleVisibility action. @param elementId The ID of the element to toggle. @param isVisible Optional forced visibility state. @returns The builder instance for method chaining. */ addTargetElement(elementId: string, isVisible?: boolean): this; /** Sets the action data to `{ msteams: { type: 'task/fetch' } }` for Submit actions. @returns The builder instance for method chaining. @throws Error if not a Submit action or if withData was already called. */ withTeamsTaskFetch(): this; /** Configures a Teams-specific data payload with msteams properties and/or custom data. Only available on Submit actions. @param configure A callback to configure the TeamsDataBuilder. @returns The builder instance for method chaining. @throws Error if not a Submit action or if withData was already called. */ withTeamsData(configure: (b: TeamsDataBuilder) => void): this; /** Configures Teams submit feedback properties (e.g. hide feedback). Only available on Submit actions. @param configure A callback to configure the TeamsSubmitPropertiesBuilder. @returns The builder instance for method chaining. @throws Error if not a Submit action or if withTeamsSubmitRaw was already called. */ withTeamsSubmitFeedback(configure: (b: TeamsSubmitPropertiesBuilder) => void): this; /** Sets the Teams action-level msteams property from a raw object (escape hatch). Only available on Submit actions. @param value The raw msteams properties object. @returns The builder instance for method chaining. @throws Error if not a Submit action or if withTeamsSubmitFeedback was already called. */ withTeamsSubmitRaw(value: Record): this; private ensureSubmitOnly; private ensureNoDataConflict; /** Builds and returns the configured action. @returns The configured AdaptiveAction instance. @throws Error if no action type has been set. */ build(): AdaptiveAction; } //# sourceMappingURL=ActionBuilder.d.ts.map