46 lines
1023 B
TypeScript
46 lines
1023 B
TypeScript
/**
|
|
* Application Port: ILiveryCompositor
|
|
*
|
|
* Defines interface for livery image composition.
|
|
* Infrastructure will provide image processing implementation.
|
|
*/
|
|
|
|
import type { LiveryDecal } from '../../domain/value-objects/LiveryDecal';
|
|
|
|
export interface CompositionResult {
|
|
success: boolean;
|
|
composedImageUrl?: string;
|
|
error?: string;
|
|
timestamp: Date;
|
|
}
|
|
|
|
export interface ILiveryCompositor {
|
|
/**
|
|
* Composite a livery by layering decals on base image
|
|
*/
|
|
composeLivery(
|
|
baseImageUrl: string,
|
|
decals: LiveryDecal[]
|
|
): Promise<CompositionResult>;
|
|
|
|
/**
|
|
* Generate a livery pack (.zip) for all drivers in a season
|
|
*/
|
|
generateLiveryPack(
|
|
seasonId: string,
|
|
liveryData: Array<{
|
|
driverId: string;
|
|
driverName: string;
|
|
carId: string;
|
|
composedImageUrl: string;
|
|
}>
|
|
): Promise<Buffer>;
|
|
|
|
/**
|
|
* Validate livery image (check for logos/text)
|
|
*/
|
|
validateLiveryImage(imageUrl: string): Promise<{
|
|
isValid: boolean;
|
|
violations?: string[];
|
|
}>;
|
|
} |