Files
gridpilot.gg/packages/racing/application/ports/ILiveryStorage.ts
2025-12-10 00:38:59 +01:00

39 lines
783 B
TypeScript

/**
* Application Port: ILiveryStorage
*
* Defines interface for livery image storage.
* Infrastructure will provide cloud storage adapter.
*/
export interface UploadResult {
success: boolean;
imageUrl?: string;
error?: string;
timestamp: Date;
}
export interface ILiveryStorage {
/**
* Upload a livery image
*/
upload(
imageData: Buffer | string,
fileName: string,
metadata?: Record<string, unknown>
): Promise<UploadResult>;
/**
* Download a livery image
*/
download(imageUrl: string): Promise<Buffer>;
/**
* Delete a livery image
*/
delete(imageUrl: string): Promise<void>;
/**
* Generate a signed URL for temporary access
*/
generateSignedUrl(imageUrl: string, expiresInSeconds: number): Promise<string>;
}