import type { ChatCompletionChunk } from "openai/resources/chat/completions"; import { type StreamCompletionMetadata } from "@use-crux/core/adapter"; import type { OpenAIChatRequest } from "./types"; /** Extract a text delta from an OpenAI chat-completion stream chunk. */ export declare function openAITextDelta(chunk: unknown): string | undefined; /** Compile-time alias used by native chat stream bindings. */ export type OpenAIChatStreamChunk = ChatCompletionChunk; /** Stream wrapper that normalizes mid-stream provider iteration errors. */ export declare class OpenAIChatStream implements AsyncIterable { #private; constructor(raw: AsyncIterable); [Symbol.asyncIterator](): AsyncIterator; } /** Wrap a raw OpenAI chat stream so mid-stream errors are provider-normalized. */ export declare function createOpenAIStreamCapture(raw: AsyncIterable): OpenAIChatStream; /** Reconstruct exact completion facts from consumed OpenAI chat chunks. */ export declare function openAIStreamCompletion(chunks: readonly unknown[], request?: OpenAIChatRequest): Promise;