import type { Chat } from "@ai-sdk/react";
import { Result, StreamTool } from "../../streamTool.js";
/**
 * Listens to messages received in the `chat` object and processes tool calls
 * by streaming them to an executor
 *
 * It also listens to the status and error events of the chat object and handles them
 * appropriately.
 *
 * It also waits for all tool calls to be completed and then adds the results to the chat object.
 *
 * NOTE: listening to the `chat` object + error handling is a bit cumbersome. It might have been
 * cleaner to directly listen to the UIMessageStream. However, for that we'd probably
 * need to wrap the transport or chat object in AIExtension
 *
 * The error handling is currently quite convoluted. To properly test this,
 * you can:
 * a) make sure a tool call fails
 * b) make sure the entire request fails (network error)
 *
 */
export declare function setupToolCallStreaming(streamTools: StreamTool<any>[], chat: Chat<any>, onStart?: () => void, abortSignal?: AbortSignal): Promise<Result<void>>;
