44import { FunctionOptions , FunctionOutput , FunctionResult , FunctionTrigger } from './index' ;
55import { InvocationContext } from './InvocationContext' ;
66
7- export type ServiceBusQueueHandler = ( message : unknown , context : InvocationContext ) => FunctionResult ;
7+ export type ServiceBusQueueHandler = ( messages : unknown , context : InvocationContext ) => FunctionResult ;
88
99export interface ServiceBusQueueFunctionOptions extends ServiceBusQueueTriggerOptions , Partial < FunctionOptions > {
1010 handler : ServiceBusQueueHandler ;
@@ -27,6 +27,11 @@ export interface ServiceBusQueueTriggerOptions {
2727 * `true` if connecting to a [session-aware](https://docs.microsoft.com/azure/service-bus-messaging/message-sessions) queue. Default is `false`
2828 */
2929 isSessionsEnabled ?: boolean ;
30+
31+ /**
32+ * Set to `many` in order to enable batching. If omitted or set to `one`, a single message is passed to the function.
33+ */
34+ cardinality ?: 'many' | 'one' ;
3035}
3136export type ServiceBusQueueTrigger = FunctionTrigger & ServiceBusQueueTriggerOptions ;
3237
@@ -71,6 +76,11 @@ export interface ServiceBusTopicTriggerOptions {
7176 * `true` if connecting to a [session-aware](https://docs.microsoft.com/azure/service-bus-messaging/message-sessions) subscription. Default is `false`
7277 */
7378 isSessionsEnabled ?: boolean ;
79+
80+ /**
81+ * Set to `many` in order to enable batching. If omitted or set to `one`, a single message is passed to the function.
82+ */
83+ cardinality ?: 'many' | 'one' ;
7484}
7585export type ServiceBusTopicTrigger = FunctionTrigger & ServiceBusTopicTriggerOptions ;
7686
0 commit comments