import type { LanguageModelV2FunctionTool, LanguageModelV2ProviderDefinedTool, LanguageModelV2ToolChoice } from '@ai-sdk/provider-v5';
import type { Schema, TextStreamPart, Tool, ToolChoice, ToolSet, UIMessage } from 'ai-v5';
export declare function convertFullStreamChunkToUIMessageStream({ part, messageMetadataValue, sendReasoning, sendSources, onError, sendStart, sendFinish, responseMessageId, }: {
    part: TextStreamPart<ToolSet>;
    messageMetadataValue?: any;
    sendReasoning?: boolean;
    sendSources?: boolean;
    onError: (error: any) => string;
    sendStart?: boolean;
    sendFinish?: boolean;
    responseMessageId?: string;
}): {
    type: "abort";
} | {
    providerMetadata?: import("@ai-sdk/provider-v5").SharedV2ProviderMetadata | undefined;
    type: string;
    id: string;
    mediaType?: undefined;
    url?: undefined;
    toolCallId?: undefined;
    inputTextDelta?: undefined;
    errorText?: undefined;
} | {
    providerMetadata?: import("@ai-sdk/provider-v5").SharedV2ProviderMetadata | undefined;
    type: string;
    id: string;
    delta: string;
    mediaType?: undefined;
    url?: undefined;
    toolCallId?: undefined;
    inputTextDelta?: undefined;
    errorText?: undefined;
} | {
    type: string;
    mediaType: string;
    url: string;
    toolCallId?: undefined;
    inputTextDelta?: undefined;
    errorText?: undefined;
} | {
    providerMetadata?: import("@ai-sdk/provider-v5").SharedV2ProviderMetadata | undefined;
    type: string;
    sourceId: string;
    url: string;
    title: string | undefined;
    mediaType?: undefined;
    toolCallId?: undefined;
    inputTextDelta?: undefined;
    errorText?: undefined;
} | {
    providerMetadata?: import("@ai-sdk/provider-v5").SharedV2ProviderMetadata | undefined;
    type: string;
    sourceId: string;
    mediaType: string;
    title: string;
    filename: string | undefined;
    url?: undefined;
    toolCallId?: undefined;
    inputTextDelta?: undefined;
    errorText?: undefined;
} | {
    dynamic?: boolean | undefined;
    providerExecuted?: boolean | undefined;
    type: string;
    toolCallId: string;
    toolName: string;
    mediaType?: undefined;
    url?: undefined;
    inputTextDelta?: undefined;
    errorText?: undefined;
} | {
    type: string;
    toolCallId: string;
    inputTextDelta: string;
    mediaType?: undefined;
    url?: undefined;
    errorText?: undefined;
} | {
    dynamic?: boolean | undefined;
    providerMetadata?: import("@ai-sdk/provider-v5").SharedV2ProviderMetadata | undefined;
    providerExecuted?: boolean | undefined;
    type: string;
    toolCallId: string;
    toolName: string;
    input: any;
    mediaType?: undefined;
    url?: undefined;
    inputTextDelta?: undefined;
    errorText?: undefined;
} | {
    dynamic?: boolean | undefined;
    providerExecuted?: boolean | undefined;
    type: string;
    toolCallId: string;
    output: any;
    mediaType?: undefined;
    url?: undefined;
    inputTextDelta?: undefined;
    errorText?: undefined;
} | {
    dynamic?: boolean | undefined;
    providerExecuted?: boolean | undefined;
    type: string;
    toolCallId: string;
    errorText: string;
    mediaType?: undefined;
    url?: undefined;
    inputTextDelta?: undefined;
} | {
    type: string;
    errorText: string;
    mediaType?: undefined;
    url?: undefined;
    toolCallId?: undefined;
    inputTextDelta?: undefined;
} | {
    messageId?: string | undefined;
    messageMetadata?: any;
    type: string;
    mediaType?: undefined;
    url?: undefined;
    toolCallId?: undefined;
    inputTextDelta?: undefined;
    errorText?: undefined;
} | undefined;
export declare function getResponseUIMessageId({ originalMessages, responseMessageId, }: {
    originalMessages: UIMessage[] | undefined;
    responseMessageId: string | any;
}): any;
export type ConsumeStreamOptions = {
    onError?: (error: unknown) => void;
};
export type ValidationResult<T> = {
    success: true;
    value: T;
} | {
    success: false;
    error: Error;
};
/**
 * Safely validates the types of an unknown object using a schema.
 * Based on @ai-sdk/provider-utils safeValidateTypes
 */
export declare function safeValidateTypes<OBJECT>({ value, schema, }: {
    value: unknown;
    schema: Schema<OBJECT>;
}): Promise<ValidationResult<OBJECT>>;
export declare function consumeStream({ stream, onError, }: {
    stream: ReadableStream;
    onError?: (error: unknown) => void;
}): Promise<void>;
export declare function prepareToolsAndToolChoice<TOOLS extends Record<string, Tool>>({ tools, toolChoice, activeTools, }: {
    tools: TOOLS | undefined;
    toolChoice: ToolChoice<TOOLS> | undefined;
    activeTools: Array<keyof TOOLS> | undefined;
}): {
    tools: Array<LanguageModelV2FunctionTool | LanguageModelV2ProviderDefinedTool> | undefined;
    toolChoice: LanguageModelV2ToolChoice | undefined;
};
/**
 * Delayed promise. It is only constructed once the value is accessed.
 * This is useful to avoid unhandled promise rejections when the promise is created
 * but not accessed.
 */
export declare class DelayedPromise<T> {
    status: {
        type: 'pending';
    } | {
        type: 'resolved';
        value: T;
    } | {
        type: 'rejected';
        error: unknown;
    };
    private _promise;
    private _resolve;
    private _reject;
    get promise(): Promise<T>;
    resolve(value: T): void;
    reject(error: unknown): void;
}
//# sourceMappingURL=compat.d.ts.map