editia-core
Version:
Core services and utilities for Editia applications - Authentication, Monetization, Video Generation Types, and Database Management
118 lines • 3.24 kB
TypeScript
/**
* Shared video generation types
* Consolidated from mobile and server-primary to eliminate duplication
*/
import type { Brand } from '../types/compatibility';
import type { Language, VideoRequestStatus, CaptionPlacement, TranscriptEffect } from './constants';
export type VideoId = Brand<string, 'VideoId'>;
export type ScriptId = Brand<string, 'ScriptId'>;
export type UserId = Brand<string, 'UserId'>;
export type GenerationJobId = Brand<string, 'GenerationJobId'>;
export type HexColor = Brand<string, 'HexColor'>;
export interface VideoType {
id: VideoId;
title: string;
description: string;
upload_url: string;
tags: string[];
user_id: UserId;
created_at: string;
updated_at: string;
duration_seconds: number | null;
thumbnail_url?: string;
file_size?: number;
processing_status?: VideoRequestStatus;
analysis_data?: unknown;
analysis_status?: VideoRequestStatus;
}
export interface CaptionConfiguration {
enabled: boolean;
presetId?: string;
placement: CaptionPlacement;
transcriptColor?: HexColor;
transcriptEffect?: TranscriptEffect;
}
export interface VideoEditorialProfile {
persona_description: string;
tone_of_voice: string;
audience: string;
style_notes: string;
examples?: string;
}
export interface EnhancedGeneratedVideoType {
id: string;
title: string;
description: string;
render_url: string;
thumbnail_url?: string;
duration_seconds: number;
file_size?: number;
created_at: string;
render_status: VideoRequestStatus;
script_id?: ScriptId;
prompt?: string;
error_message?: string;
}
export interface VideoGenerationRequest {
scriptId?: ScriptId;
prompt: string;
selectedVideoIds: VideoId[];
captionConfig: CaptionConfiguration;
editorialProfile: VideoEditorialProfile;
outputLanguage: Language;
userId: UserId;
}
export interface VideoGenerationResult {
jobId: GenerationJobId;
status: VideoRequestStatus;
message: string;
estimatedDuration?: number;
}
export interface VideoRequest {
id: GenerationJobId;
user_id: UserId;
script_id?: ScriptId;
prompt: string;
selected_videos: VideoId[];
caption_config: CaptionConfiguration;
editorial_profile: VideoEditorialProfile;
output_language: Language;
status: VideoRequestStatus;
created_at: string;
updated_at: string;
error_message?: string;
video_url?: string;
thumbnail_url?: string;
}
export interface ApiResponse<T = unknown> {
success: boolean;
data?: T;
error?: string;
status: number;
}
export interface VideoStatusResponse {
id: GenerationJobId;
status: VideoRequestStatus;
progress?: number;
error_message?: string;
video_url?: string;
thumbnail_url?: string;
updated_at: string;
}
export interface ScenePlan {
id: string;
startTime: number;
endTime: number;
duration: number;
text: string;
videoId: VideoId;
}
export interface TemplateValidationResult {
isValid: boolean;
warnings: string[];
errors: string[];
captionsEnabled: boolean;
totalDuration: number;
requiredDuration: number;
}
//# sourceMappingURL=types.d.ts.map