import type OpenAI from "openai"; import type { ImageGenCompletedEvent } from "openai/resources/images"; import type { StreamImage, StreamImageResult } from "@use-crux/core"; import { type OpenAIImageStreamExtra, type OpenAIImageStreamInput } from "./image-streaming-options"; export type { OpenAIImageStreamExtra } from "./image-streaming-options"; /** Payload-free metadata copied from the exact OpenAI terminal event. */ export type OpenAIImageStreamMetadata = Omit; /** Exact completed result of an OpenAI Images API stream. */ export type OpenAIStreamImageResult = StreamImageResult; /** * Genuine single-output OpenAI image stream attached to a bound adapter. * * Complete partial images replace the prior preview for `outputIndex: 0`. * Enforcing output-media Safety evaluates each complete preview before * publication and releases final media only after terminal validation. Every * `fullStream` reader replays the same in-memory events; returning from one * reader only detaches it, while `cancel()` aborts the operation. The first * published event commits routing. The final event and `completion.image` * share the same guarded asset, and Crux never persists either implicitly. * * @example * ```ts * const result = await openai.streamImage({ * model: 'gpt-image-2', * prompt: 'A quiet canal at sunrise', * extra: { partial_images: 2 }, * }) * * for await (const event of result.fullStream) { * if (event.type === 'image-preview') render(event.image) * } * ``` */ export type OpenAIStreamImage = StreamImage; /** Define native OpenAI Images API streaming mechanics. */ export declare function createOpenAIImageStreamingOperation(client: OpenAI): import("@use-crux/core/adapter").StreamingOperationDefinition>; }>, OpenAI.Images.ImageGenStreamEvent, OpenAI.Images.ImageGenCompletedEvent, { type: "image-preview"; image: import("@use-crux/core").Asset; outputIndex: number; sequence: number; }, import("@use-crux/core/adapter").GenerateImagePayload, never>, { kind: "image"; count: number; }>;