import { ObjectId } from "mongoose";
import { IFullUser } from "../users/users.interface";
import { IDataToReturn } from "src/shared/language/language.interface";
import { TSubscriptionError } from "../subscriptions/subscriptions.interface";


export interface IImageHistory {
	_id: string | ObjectId;
	user: string | ObjectId;
	title: string;
	imageUrl: string;

	prompt: string;
	images: string[];
	status: 'loading' | 'success' | 'failed' | 'blocked';
	type: 'text2img' | 'img2img' | 'imgUpscale';
	style_preset: string;
	samples: number;
	model: string;
	finalPrompt: string;
	filterResult: {
		[key: string]: string | boolean;
	};

	createdAt: Date;
	updatedAt: Date;
}

export type IImageModel = string

export interface IGenerateImagePayload {
	user: IFullUser;
	userPrompt?: string;
	prompt: string;
	translatedPrompt: string;
	messageId?: string;
	conversationId?: string;
	regenerate?: boolean;
	edit?: boolean;
	language?: IDataToReturn;
	regenerateMessageId?: string;
	isRegenerate?: boolean;
	checkSubscription?: { canSend: boolean, cause: TSubscriptionError | null };
}

export interface StabilityInterface {
	filePaths: string[];
	type?: 'height' | 'width';
	scale?: any;
	prompt?: string;
	model?: string;
	samples?: number;
	style_preset?: '3d-model' | 'analog-film' | 'anime' | 'cinematic' | 'comic-book' | 'digital-art' | 'enhance' | 'fantasy-art' | 'isometric' | 'line-art' | 'low-poly' | 'modeling-compound' | 'neon-punk' | 'origami' | 'photographic' | 'pixel-art' | 'tile-texture' | string;
	mode?: 'text-to-image' | 'image-to-image';
}

export interface ITextToImagePayload {

	prompt: string;

	samples?: number;
	style_preset?: '3d-model' | 'analog-film' | 'anime' | 'cinematic' | 'comic-book' | 'digital-art' | 'enhance' | 'fantasy-art' | 'isometric' | 'line-art' | 'low-poly' | 'modeling-compound' | 'neon-punk' | 'origami' | 'photographic' | 'pixel-art' | 'tile-texture' | string;
	sampleNumber?: number
	model?: string
}

// for new v3 image generation
export interface IStabilityInterfaceV3 {
	model?: string
	prompt: string;

	samples?: number;
	style_preset?: '3d-model' | 'analog-film' | 'anime' | 'cinematic' | 'comic-book' | 'digital-art' | 'enhance' | 'fantasy-art' | 'isometric' | 'line-art' | 'low-poly' | 'modeling-compound' | 'neon-punk' | 'origami' | 'photographic' | 'pixel-art' | 'tile-texture' | string;
	mode?: 'text-to-image' | 'image-to-image'
	filePaths?: string[];
}