import Response from "../util/Response"; import { AxiosProgressEvent, AxiosPromise } from "axios"; export interface SteamCapsuleCropRequest { media_id: string; capsule_type: 'header' | 'small' | 'main' | 'vertical' | 'library' | 'library_header' | 'library_hero' | 'page_background' | 'screenshot' | 'app_icon' | 'shortcut_icon'; crop_x?: number; crop_y?: number; crop_width?: number; crop_height?: number; } export interface SteamCapsuleAnalysisRequest { media_id: string; capsule_type: 'header' | 'small' | 'main' | 'vertical' | 'library' | 'library_header' | 'library_hero' | 'page_background'; game_name?: string; game_genre?: string; } export interface RemoveBackgroundRequest { media_id: string; output_format?: 'png' | 'webp'; } export interface RemoveBackgroundAIRequest { media_id: string; use_ai_analysis?: boolean; } export interface CreateLibraryLogoRequest { media_id: string; target_width?: number; target_height?: number; } export interface ValidateScreenshotRequest { media_id: string; } export interface SteamCapsuleDimensions { width: number; height: number; } export interface SteamCapsuleCropResponse { media: any; download_url: string; dimensions: SteamCapsuleDimensions; capsule_type: string; } export interface CategoryScores { visual_hierarchy: number; title_readability: number; genre_communication: number; brand_identity: number; composition_balance: number; art_style: number; emotional_impact: number; steam_compliance: number; } export interface SteamCapsuleAnalysisResponse { media_id: string; capsule_type: string; dimensions: SteamCapsuleDimensions; overall_score: number; category_scores: CategoryScores; strengths: string[]; improvements: string[]; recommendations: string[]; ai_description: string; guidelines: any; } export interface RemoveBackgroundResponse { success: boolean; message: string; data: any; } export interface RemoveBackgroundAIResponse { success: boolean; message: string; data: any; ai_used: boolean; } export interface CreateLibraryLogoResponse { success: boolean; message: string; data: any; } export interface ScreenshotValidationResponse { success: boolean; valid: boolean; dimensions: SteamCapsuleDimensions; aspect_ratio: number; issues: string[]; recommendations: string[]; } export interface PresignedUrlResponse { upload_url: string; file_path: string; } export interface S3ConfirmRequest { file_path: string; size: number; mime_type: string; title?: string; filename?: string; } /** * Interfaces for the Video Editor Manifest */ export interface VideoEdit { type: 'trim' | 'crop' | 'text' | 'speed' | 'overlay' | 'thumbnail'; params: TrimParams | CropParams | TextParams | SpeedParams | any; } export interface TrimParams { start: number; duration: number; } export interface CropParams { x: number; y: number; width: number; height: number; } export interface TextParams { text: string; x: string | number; y: string | number; fontSize: number; fontColor: string; } export interface SpeedParams { multiplier: number; } export interface VideoProcessRequest { edits: VideoEdit[]; output_format?: 'mp4' | 'webm'; } declare class Media { /** * Upload media content using a File object. * * @see https://api.glitch.fun/api/documentation#/Media%20Route/uploadMedia * * @param file The file object to upload. * @param data Any additional data to pass along to the upload. * * @returns promise */ static uploadFile(file: File, data?: object, params?: Record, onUploadProgress?: (progressEvent: AxiosProgressEvent) => void): AxiosPromise>; /** * Upload media content using a Blob. * * @see https://api.glitch.fun/api/documentation#/Media%20Route/uploadMedia * * @param blob The Blob object to upload. * @param data Any additional data to pass along to the upload. * * @returns promise */ static uploadBlob(blob: Blob, data?: object, params?: Record, onUploadProgress?: (progressEvent: AxiosProgressEvent) => void): AxiosPromise>; /** * Get media details. * * @see https://api.glitch.fun/api/documentation#/Media%20Route/getMedia * * @param id The ID of the media item. * * @returns promise */ static get(media_id: string, params?: Record): AxiosPromise>; /** * Crop and resize an image to Steam capsule dimensions. * * @param request The crop request parameters. * @param params Additional query parameters. * * @returns promise */ static cropSteamCapsule(request: SteamCapsuleCropRequest, params?: Record): AxiosPromise>; /** * Analyze a Steam capsule image using AI. * * @param request The analysis request parameters. * @param params Additional query parameters. * * @returns promise */ static analyzeSteamCapsule(request: SteamCapsuleAnalysisRequest, params?: Record): AxiosPromise>; /** * Remove background from an image to create transparent PNG. * * @param request The background removal request parameters. * @param params Additional query parameters. * * @returns promise */ static removeBackground(request: RemoveBackgroundRequest, params?: Record): AxiosPromise>; /** * Remove background from an image using AI analysis for better results. * * @param request The AI-enhanced background removal request parameters. * @param params Additional query parameters. * * @returns promise */ static removeBackgroundAI(request: RemoveBackgroundAIRequest, params?: Record): AxiosPromise>; /** * Create a Steam Library Logo meeting Steam's requirements. * * @param request The library logo creation request parameters. * @param params Additional query parameters. * * @returns promise */ static createLibraryLogo(request: CreateLibraryLogoRequest, params?: Record): AxiosPromise>; /** * Validate a screenshot against Steam's requirements. * * @param request The screenshot validation request parameters. * @param params Additional query parameters. * * @returns promise */ static validateScreenshot(request: ValidateScreenshotRequest, params?: Record): AxiosPromise>; /** * Get Steam capsule dimensions for a specific type. * * @param capsuleType The type of Steam capsule. * * @returns The dimensions object or null if invalid type. */ static getSteamCapsuleDimensions(capsuleType: string): SteamCapsuleDimensions | null; /** * Get Steam capsule type information and requirements. * * @param capsuleType The type of Steam capsule. * * @returns Information about the capsule type. */ static getSteamCapsuleInfo(capsuleType: string): any; /** * Get Steam screenshot requirements. * * @returns Screenshot requirements object. */ static getSteamScreenshotRequirements(): { minWidth: number; minHeight: number; aspectRatio: number; minCount: number; format: string; content: string; }; /** * Get Steam library logo requirements. * * @returns Library logo requirements object. */ static getSteamLibraryLogoRequirements(): { maxWidth: number; maxHeight: number; format: string; requirement: string; content: string; }; /** * Upload an audio file to TikTok's asset library via our Media controller. * * @param file The audio file (mp3). * @param scheduler_id The ID of the scheduler to provide OAuth context. */ static uploadTikTokMusic(file: File, scheduler_id: string): AxiosPromise>; /** * Generate an S3 Presigned URL for direct upload. * * @param filename The original name of the file. * @param extension The file extension (e.g., 'mp4'). * @param is_public Set to true if the file should be publicly accessible via URL. */ static getPresignedUrl(filename: string, extension: string, is_public?: boolean): AxiosPromise>; /** * Confirm a successful S3 upload and create the database record. * Call this after the direct S3 upload is complete. * * @param data The file metadata (path, size, mime_type). * @returns AxiosPromise containing the created Media resource. */ static confirmS3Upload(data: S3ConfirmRequest): AxiosPromise>; /** * Submit a video for processing (Trim, Crop, Text, etc.) * This triggers a background job on the server. * * @param media_id The UUID of the source video. * @param data The edit manifest containing the array of transformations. * @returns Promise with the pending_media_id. */ static process(media_id: string, data: VideoProcessRequest): AxiosPromise>; } export default Media;