/** * Callback function signature for handling incoming binding invocations. * * This callback is invoked when the Dapr sidecar receives a message from an input binding. * The handler receives the binding data and must process it asynchronously, returning * void or a response value. If the handler throws an error, the binding invocation fails. * * @param data - The message payload from the binding. Can be any type depending on the binding component. * @returns Promise that resolves when binding processing is complete. Can return void or any response value. * * @see {@link https://dapr.io/docs/developing-applications/building-blocks/bindings/ | Dapr Input/Output Bindings} * * @example * ```typescript * // Simple binding handler * const bindingHandler: TypeDaprBindingCallback = async (data) => { * console.log("Received binding data:", data); * if (typeof data === 'string') { * const parsed = JSON.parse(data); * await processOrder(parsed); * } * }; * * // Register with server * server.binding.subscribe("kafka-binding", bindingHandler); * ``` */ export type TypeDaprBindingCallback = (data: any) => Promise;