seedance-video-sdk
Version:
Seedance AI Video Generation SDK - Create professional videos from text and images using ByteDance's advanced AI technology
93 lines • 2.62 kB
TypeScript
import { VideoResolution, AspectRatio, TaskStatus } from '../types';
/**
* Utility functions for Seedance Video SDK
*/
/**
* Convert video resolution to dimensions
*/
export declare function getResolutionDimensions(resolution: VideoResolution): {
width: number;
height: number;
};
/**
* Calculate video dimensions based on resolution and aspect ratio
*/
export declare function calculateVideoDimensions(resolution: VideoResolution, aspectRatio: AspectRatio): {
width: number;
height: number;
};
/**
* Validate video generation parameters
*/
export declare function validateVideoParams(params: {
duration?: number;
resolution?: VideoResolution;
frameRate?: number;
}): {
isValid: boolean;
errors: string[];
};
/**
* Format file size in human readable format
*/
export declare function formatFileSize(bytes: number): string;
/**
* Format duration in human readable format
*/
export declare function formatDuration(seconds: number): string;
/**
* Get status color for UI components
*/
export declare function getStatusColor(status: TaskStatus): string;
/**
* Get status display text
*/
export declare function getStatusText(status: TaskStatus): string;
/**
* Estimate video file size based on parameters
*/
export declare function estimateVideoSize(duration: number, resolution: VideoResolution, frameRate?: number): number;
/**
* Generate a unique task ID (for client-side tracking)
*/
export declare function generateTaskId(): string;
/**
* Check if a URL is valid
*/
export declare function isValidUrl(url: string): boolean;
/**
* Check if a file is a valid image
*/
export declare function isValidImageFile(file: File): boolean;
/**
* Get file extension from filename
*/
export declare function getFileExtension(filename: string): string;
/**
* Convert File to base64 string
*/
export declare function fileToBase64(file: File): Promise<string>;
/**
* Debounce function for API calls
*/
export declare function debounce<T extends (...args: any[]) => any>(func: T, wait: number): (...args: Parameters<T>) => void;
/**
* Retry function with exponential backoff
*/
export declare function retry<T>(fn: () => Promise<T>, options?: {
retries?: number;
delay?: number;
backoff?: number;
}): Promise<T>;
/**
* Create a progress tracker for long-running operations
*/
export declare class ProgressTracker {
private callbacks;
private _progress;
get progress(): number;
setProgress(progress: number): void;
onProgress(callback: (progress: number) => void): () => void;
reset(): void;
}
//# sourceMappingURL=index.d.ts.map