AdaptiveCardsActions class
A class to handle Adaptive Card actions such as executing actions, submitting actions, and performing searches.
Constructors
Adaptive |
Constructs an instance of AdaptiveCardsActions. |
Methods
action |
Registers a handler for the Action.Execute event. |
action |
Registers a handler for the Action.Submit event. |
search(string | Reg |
Registers a handler for the search event. |
Constructor Details
AdaptiveCardsActions<TState>(AgentApplication<TState>)
Constructs an instance of AdaptiveCardsActions.
new AdaptiveCardsActions(app: AgentApplication<TState>)
Parameters
- app
-
AgentApplication<TState>
The Teams application instance.
Method Details
actionExecute<TData>(string | RegExp | Selector | (string | RegExp | Selector)[], (context: TurnContext, state: TState, data: TData) => Promise<string | AdaptiveCard>)
Registers a handler for the Action.Execute event.
function actionExecute<TData>(verb: string | RegExp | Selector | (string | RegExp | Selector)[], handler: (context: TurnContext, state: TState, data: TData) => Promise<string | AdaptiveCard>): AgentApplication<TState>
Parameters
A string, RegExp, RouteSelector, or an array of these to match the action verb.
- handler
-
(context: TurnContext, state: TState, data: TData) => Promise<string | AdaptiveCard>
A function to handle the action execution.
Returns
AgentApplication<TState>
The Teams application instance.
actionSubmit<TData>(string | RegExp | Selector | (string | RegExp | Selector)[], (context: TurnContext, state: TState, data: TData) => Promise<void>)
Registers a handler for the Action.Submit event.
function actionSubmit<TData>(verb: string | RegExp | Selector | (string | RegExp | Selector)[], handler: (context: TurnContext, state: TState, data: TData) => Promise<void>): AgentApplication<TState>
Parameters
A string, RegExp, RouteSelector, or an array of these to match the action verb.
- handler
-
(context: TurnContext, state: TState, data: TData) => Promise<void>
A function to handle the action submission.
Returns
AgentApplication<TState>
The Teams application instance.
search(string | RegExp | Selector | (string | RegExp | Selector)[], (context: TurnContext, state: TState, query: Query<AdaptiveCardsSearchParams>) => Promise<AdaptiveCardSearchResult[]>)
Registers a handler for the search event.
function search(dataset: string | RegExp | Selector | (string | RegExp | Selector)[], handler: (context: TurnContext, state: TState, query: Query<AdaptiveCardsSearchParams>) => Promise<AdaptiveCardSearchResult[]>): AgentApplication<TState>
Parameters
A string, RegExp, RouteSelector, or an array of these to match the dataset.
- handler
-
(context: TurnContext, state: TState, query: Query<AdaptiveCardsSearchParams>) => Promise<AdaptiveCardSearchResult[]>
A function to handle the search query.
Returns
AgentApplication<TState>
The Teams application instance.