/**
* Seedance Video SDK Types
* Official TypeScript definitions for Seedance AI Video Generation API
*/
///
export interface SeedanceConfig {
/** Your Seedance API key */
apiKey: string;
/** API base URL (optional, defaults to official endpoint) */
baseURL?: string;
/** Request timeout in milliseconds (default: 30000) */
timeout?: number;
/** Enable debug logging */
debug?: boolean;
}
export interface VideoGenerationRequest {
/** Text prompt for video generation */
prompt: string;
/** Optional image input for image-to-video generation */
image?: File | string | Buffer;
/** Video duration in seconds (default: 5) */
duration?: number;
/** Video resolution */
resolution?: VideoResolution;
/** Video style/model to use */
style?: VideoStyle;
/** Aspect ratio */
aspectRatio?: AspectRatio;
/** Frame rate (fps) */
frameRate?: number;
/** Additional generation parameters */
parameters?: GenerationParameters;
}
export interface GenerationParameters {
/** Motion intensity (0-1) */
motionIntensity?: number;
/** Seed for reproducible results */
seed?: number;
/** Number of inference steps */
steps?: number;
/** Guidance scale */
guidanceScale?: number;
/** Enable multi-shot narrative */
multiShot?: boolean;
}
export type VideoResolution = '480p' | '720p' | '1080p' | '4K';
export type VideoStyle = 'realistic' | 'anime' | 'cartoon' | 'cinematic' | 'artistic';
export type AspectRatio = '16:9' | '9:16' | '1:1' | '4:3' | '3:4';
export interface VideoGenerationResponse {
/** Unique task ID */
taskId: string;
/** Current task status */
status: TaskStatus;
/** Progress percentage (0-100) */
progress: number;
/** Generated video URL (available when completed) */
videoUrl?: string;
/** Thumbnail URL */
thumbnailUrl?: string;
/** Error message if failed */
error?: string;
/** Estimated completion time */
estimatedTime?: number;
/** Creation timestamp */
createdAt: string;
/** Last updated timestamp */
updatedAt: string;
}
export type TaskStatus = 'pending' | 'processing' | 'completed' | 'failed' | 'cancelled';
export interface VideoTask {
id: string;
status: TaskStatus;
progress: number;
prompt: string;
videoUrl?: string;
thumbnailUrl?: string;
duration: number;
resolution: VideoResolution;
style: VideoStyle;
createdAt: string;
updatedAt: string;
error?: string;
}
export interface PaginatedResponse {
data: T[];
total: number;
page: number;
pageSize: number;
hasNext: boolean;
hasPrev: boolean;
}
export interface VideoListOptions {
page?: number;
pageSize?: number;
status?: TaskStatus;
sortBy?: 'createdAt' | 'updatedAt' | 'progress';
sortOrder?: 'asc' | 'desc';
}
export interface WebhookConfig {
url: string;
events: WebhookEvent[];
secret?: string;
}
export type WebhookEvent = 'task.created' | 'task.processing' | 'task.completed' | 'task.failed';
export interface WebhookPayload {
event: WebhookEvent;
taskId: string;
task: VideoTask;
timestamp: string;
}
export interface SeedanceError {
code: string;
message: string;
details?: any;
}
export interface UploadResponse {
url: string;
fileId: string;
}
export interface QuotaInfo {
used: number;
total: number;
remaining: number;
resetDate: string;
}
export interface UserInfo {
id: string;
email: string;
plan: 'free' | 'pro' | 'business' | 'enterprise';
quota: QuotaInfo;
createdAt: string;
}
export interface VideoPlayerProps {
src: string;
poster?: string;
controls?: boolean;
autoplay?: boolean;
loop?: boolean;
muted?: boolean;
className?: string;
onLoadStart?: () => void;
onLoadedData?: () => void;
onError?: (error: Error) => void;
}
export interface VideoGeneratorProps {
apiKey: string;
onVideoGenerated?: (video: VideoTask) => void;
onError?: (error: SeedanceError) => void;
className?: string;
showAdvancedOptions?: boolean;
defaultStyle?: VideoStyle;
defaultResolution?: VideoResolution;
}
export interface ProgressIndicatorProps {
progress: number;
status: TaskStatus;
estimatedTime?: number;
className?: string;
showPercentage?: boolean;
showStatus?: boolean;
}
//# sourceMappingURL=index.d.ts.map