diff --git a/src/types/api.ts b/src/types/api.ts new file mode 100644 index 00000000..082672b3 --- /dev/null +++ b/src/types/api.ts @@ -0,0 +1,44 @@ +/** + * API Types + * + * Request and response types for API routes including + * image generation and LLM text generation. + */ + +import type { AspectRatio, Resolution, ModelType } from "./models"; +import type { LLMProvider, LLMModelType } from "./providers"; + +// API Request/Response types for Image Generation +export interface GenerateRequest { + images: string[]; // Now supports multiple images + prompt: string; + aspectRatio?: AspectRatio; + resolution?: Resolution; // Only for Nano Banana Pro + model?: ModelType; + useGoogleSearch?: boolean; // Only for Nano Banana Pro +} + +export interface GenerateResponse { + success: boolean; + image?: string; + video?: string; + videoUrl?: string; // For large videos, return URL directly + contentType?: "image" | "video"; + error?: string; +} + +// API Request/Response types for LLM Text Generation +export interface LLMGenerateRequest { + prompt: string; + images?: string[]; + provider: LLMProvider; + model: LLMModelType; + temperature?: number; + maxTokens?: number; +} + +export interface LLMGenerateResponse { + success: boolean; + text?: string; + error?: string; +} diff --git a/src/types/index.ts b/src/types/index.ts index 42f91f61..a98a6cc4 100644 --- a/src/types/index.ts +++ b/src/types/index.ts @@ -1,53 +1,15 @@ -// Re-export all types from domain files +/** + * Type Index + * + * Central re-export hub for all application types. + * Import from domain files for type definitions. + */ + +// Domain re-exports export * from "./annotation"; export * from "./nodes"; export * from "./providers"; export * from "./models"; export * from "./workflow"; - -// Import types for use in this file -import type { ProviderType, LLMProvider, LLMModelType } from "./providers"; -import type { AspectRatio, Resolution, ModelType } from "./models"; - -// Recently used models tracking -export interface RecentModel { - provider: ProviderType; - modelId: string; - displayName: string; - timestamp: number; -} - -// API Request/Response types for Image Generation -export interface GenerateRequest { - images: string[]; // Now supports multiple images - prompt: string; - aspectRatio?: AspectRatio; - resolution?: Resolution; // Only for Nano Banana Pro - model?: ModelType; - useGoogleSearch?: boolean; // Only for Nano Banana Pro -} - -export interface GenerateResponse { - success: boolean; - image?: string; - video?: string; - videoUrl?: string; // For large videos, return URL directly - contentType?: "image" | "video"; - error?: string; -} - -// API Request/Response types for LLM Text Generation -export interface LLMGenerateRequest { - prompt: string; - images?: string[]; - provider: LLMProvider; - model: LLMModelType; - temperature?: number; - maxTokens?: number; -} - -export interface LLMGenerateResponse { - success: boolean; - text?: string; - error?: string; -} +export * from "./api"; +export * from "./quickstart"; diff --git a/src/types/providers.ts b/src/types/providers.ts index 5c099cf4..f6122ce7 100644 --- a/src/types/providers.ts +++ b/src/types/providers.ts @@ -37,3 +37,11 @@ export type LLMModelType = | "gemini-3-pro-preview" | "gpt-4.1-mini" | "gpt-4.1-nano"; + +// Recently used models tracking +export interface RecentModel { + provider: ProviderType; + modelId: string; + displayName: string; + timestamp: number; +}