import { VideoGenerationOptions, VideoJobResult, VideoStatusResult, VideoUrlResult } from '../../types.js'; /** * Configuration for video adapter instances * * @experimental Video generation is an experimental feature and may change. */ export interface VideoAdapterConfig { apiKey?: string; baseUrl?: string; timeout?: number; maxRetries?: number; headers?: Record; } /** * Video adapter interface with pre-resolved generics. * * An adapter is created by a provider function: `provider('model')` → `adapter` * All type resolution happens at the provider call site, not in this interface. * * @experimental Video generation is an experimental feature and may change. * * Generic parameters: * - TModel: The specific model name (e.g., 'sora-2') * - TProviderOptions: Provider-specific options (already resolved) * - TModelProviderOptionsByName: Map from model name to its specific provider options * - TModelSizeByName: Map from model name to its supported sizes */ export interface VideoAdapter, TModelProviderOptionsByName extends Record = Record, TModelSizeByName extends Record = Record> { /** Discriminator for adapter kind - used to determine API shape */ readonly kind: 'video'; /** Adapter name identifier */ readonly name: string; /** The model this adapter is configured for */ readonly model: TModel; /** * @internal Type-only properties for inference. Not assigned at runtime. */ '~types': { providerOptions: TProviderOptions; modelProviderOptionsByName: TModelProviderOptionsByName; modelSizeByName: TModelSizeByName; }; /** * Create a new video generation job. * Returns a job ID that can be used to poll for status and retrieve the video. */ createVideoJob: (options: VideoGenerationOptions) => Promise; /** * Get the current status of a video generation job. */ getVideoStatus: (jobId: string) => Promise; /** * Get the URL to download/view the generated video. * Should only be called after status is 'completed'. */ getVideoUrl: (jobId: string) => Promise; } /** * A VideoAdapter with any/unknown type parameters. * Useful as a constraint in generic functions and interfaces. */ export type AnyVideoAdapter = VideoAdapter; /** * Abstract base class for video generation adapters. * Extend this class to implement a video adapter for a specific provider. * * @experimental Video generation is an experimental feature and may change. * * Generic parameters match VideoAdapter - all pre-resolved by the provider function. */ export declare abstract class BaseVideoAdapter, TModelProviderOptionsByName extends Record = Record, TModelSizeByName extends Record = Record> implements VideoAdapter { readonly kind: "video"; abstract readonly name: string; readonly model: TModel; '~types': { providerOptions: TProviderOptions; modelProviderOptionsByName: TModelProviderOptionsByName; modelSizeByName: TModelSizeByName; }; protected config: VideoAdapterConfig; constructor(config: VideoAdapterConfig | undefined, model: TModel); abstract createVideoJob(options: VideoGenerationOptions): Promise; abstract getVideoStatus(jobId: string): Promise; abstract getVideoUrl(jobId: string): Promise; protected generateId(): string; }