@umituz/react-native-ai-generation-content 1.12.4 → 1.12.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (67) hide show
  1. package/package.json +29 -6
  2. package/src/domains/creations/application/services/CreationsService.ts +71 -0
  3. package/src/domains/creations/domain/entities/Creation.ts +51 -0
  4. package/src/domains/creations/domain/entities/index.ts +6 -0
  5. package/src/domains/creations/domain/repositories/ICreationsRepository.ts +23 -0
  6. package/src/domains/creations/domain/repositories/index.ts +5 -0
  7. package/src/domains/creations/domain/services/ICreationsStorageService.ts +13 -0
  8. package/src/domains/creations/domain/value-objects/CreationsConfig.ts +76 -0
  9. package/src/domains/creations/domain/value-objects/index.ts +12 -0
  10. package/src/domains/creations/index.ts +84 -0
  11. package/src/domains/creations/infrastructure/adapters/createRepository.ts +54 -0
  12. package/src/domains/creations/infrastructure/adapters/index.ts +5 -0
  13. package/src/domains/creations/infrastructure/repositories/CreationsRepository.ts +233 -0
  14. package/src/domains/creations/infrastructure/repositories/index.ts +8 -0
  15. package/src/domains/creations/infrastructure/services/CreationsStorageService.ts +48 -0
  16. package/src/domains/creations/presentation/components/CreationCard.tsx +136 -0
  17. package/src/domains/creations/presentation/components/CreationDetail/DetailActions.tsx +76 -0
  18. package/src/domains/creations/presentation/components/CreationDetail/DetailHeader.tsx +81 -0
  19. package/src/domains/creations/presentation/components/CreationDetail/DetailImage.tsx +41 -0
  20. package/src/domains/creations/presentation/components/CreationDetail/DetailStory.tsx +67 -0
  21. package/src/domains/creations/presentation/components/CreationDetail/index.ts +4 -0
  22. package/src/domains/creations/presentation/components/CreationImageViewer.tsx +43 -0
  23. package/src/domains/creations/presentation/components/CreationThumbnail.tsx +63 -0
  24. package/src/domains/creations/presentation/components/CreationsGrid.tsx +75 -0
  25. package/src/domains/creations/presentation/components/CreationsHomeCard.tsx +176 -0
  26. package/src/domains/creations/presentation/components/EmptyState.tsx +75 -0
  27. package/src/domains/creations/presentation/components/FilterBottomSheet.tsx +158 -0
  28. package/src/domains/creations/presentation/components/FilterChips.tsx +105 -0
  29. package/src/domains/creations/presentation/components/GalleryHeader.tsx +106 -0
  30. package/src/domains/creations/presentation/components/index.ts +19 -0
  31. package/src/domains/creations/presentation/hooks/index.ts +7 -0
  32. package/src/domains/creations/presentation/hooks/useCreations.ts +33 -0
  33. package/src/domains/creations/presentation/hooks/useCreationsFilter.ts +70 -0
  34. package/src/domains/creations/presentation/hooks/useDeleteCreation.ts +51 -0
  35. package/src/domains/creations/presentation/screens/CreationDetailScreen.tsx +71 -0
  36. package/src/domains/creations/presentation/screens/CreationsGalleryScreen.tsx +217 -0
  37. package/src/domains/creations/presentation/screens/index.ts +5 -0
  38. package/src/domains/creations/presentation/utils/filterUtils.ts +52 -0
  39. package/src/domains/creations/types.d.ts +107 -0
  40. package/src/domains/face-detection/domain/constants/faceDetectionConstants.ts +16 -0
  41. package/src/domains/face-detection/domain/entities/FaceDetection.ts +19 -0
  42. package/src/domains/face-detection/index.ts +26 -0
  43. package/src/domains/face-detection/infrastructure/analyzers/faceAnalyzer.ts +36 -0
  44. package/src/domains/face-detection/infrastructure/validators/faceValidator.ts +52 -0
  45. package/src/domains/face-detection/presentation/components/FaceValidationStatus.tsx +111 -0
  46. package/src/domains/face-detection/presentation/hooks/useFaceDetection.ts +58 -0
  47. package/src/domains/feature-background/domain/entities/background.types.ts +77 -0
  48. package/src/domains/feature-background/domain/entities/component.types.ts +96 -0
  49. package/src/domains/feature-background/domain/entities/config.types.ts +41 -0
  50. package/src/domains/feature-background/domain/entities/index.ts +31 -0
  51. package/src/domains/feature-background/index.ts +72 -0
  52. package/src/domains/feature-background/infrastructure/constants/index.ts +5 -0
  53. package/src/domains/feature-background/infrastructure/constants/prompts.constants.ts +15 -0
  54. package/src/domains/feature-background/presentation/components/BackgroundFeature.tsx +145 -0
  55. package/src/domains/feature-background/presentation/components/ComparisonSlider.tsx +199 -0
  56. package/src/domains/feature-background/presentation/components/ErrorDisplay.tsx +58 -0
  57. package/src/domains/feature-background/presentation/components/FeatureHeader.tsx +80 -0
  58. package/src/domains/feature-background/presentation/components/GenerateButton.tsx +86 -0
  59. package/src/domains/feature-background/presentation/components/ImagePicker.tsx +136 -0
  60. package/src/domains/feature-background/presentation/components/ModeSelector.tsx +78 -0
  61. package/src/domains/feature-background/presentation/components/ProcessingModal.tsx +113 -0
  62. package/src/domains/feature-background/presentation/components/PromptInput.tsx +142 -0
  63. package/src/domains/feature-background/presentation/components/ResultDisplay.tsx +123 -0
  64. package/src/domains/feature-background/presentation/components/index.ts +16 -0
  65. package/src/domains/feature-background/presentation/hooks/index.ts +7 -0
  66. package/src/domains/feature-background/presentation/hooks/useBackgroundFeature.ts +118 -0
  67. package/src/index.ts +18 -0
@@ -0,0 +1,107 @@
1
+ /**
2
+ * Type declarations for external modules
3
+ */
4
+
5
+ declare module "@umituz/react-native-firestore" {
6
+ import type { Firestore } from "firebase/firestore";
7
+
8
+ export class BaseRepository {
9
+ protected getDb(): Firestore | null;
10
+ protected getDbOrThrow(): Firestore;
11
+ protected isDbInitialized(): boolean;
12
+ protected isQuotaError(error: unknown): boolean;
13
+ protected handleQuotaError(error: unknown): never;
14
+ protected executeWithQuotaHandling<T>(
15
+ operation: () => Promise<T>,
16
+ ): Promise<T>;
17
+ protected trackRead(
18
+ collection: string,
19
+ count: number,
20
+ cached: boolean,
21
+ ): void;
22
+ protected trackWrite(
23
+ collection: string,
24
+ docId: string,
25
+ count: number,
26
+ ): void;
27
+ protected trackDelete(
28
+ collection: string,
29
+ docId: string,
30
+ count: number,
31
+ ): void;
32
+ destroy(): void;
33
+ }
34
+
35
+ export function getFirestore(): Firestore | null;
36
+ export function initializeFirestore(app: unknown): void;
37
+ export function isFirestoreInitialized(): boolean;
38
+ }
39
+
40
+ declare module "@umituz/react-native-design-system" {
41
+ import type { FC, ReactNode } from "react";
42
+ import type { StyleProp, ViewStyle, TextStyle } from "react-native";
43
+
44
+ export interface DesignTokens {
45
+ colors: {
46
+ primary: string;
47
+ secondary: string;
48
+ error: string;
49
+ warning: string;
50
+ success: string;
51
+ backgroundPrimary: string;
52
+ backgroundSecondary: string;
53
+ surface: string;
54
+ textPrimary: string;
55
+ textSecondary: string;
56
+ textInverse: string;
57
+ border: string;
58
+ [key: string]: string;
59
+ };
60
+ spacing: {
61
+ xs: number;
62
+ sm: number;
63
+ md: number;
64
+ lg: number;
65
+ xl: number;
66
+ xxl: number;
67
+ [key: string]: number;
68
+ };
69
+ typography: {
70
+ headingLarge: TextStyle;
71
+ headingMedium: TextStyle;
72
+ headingSmall: TextStyle;
73
+ bodyLarge: TextStyle;
74
+ bodyMedium: TextStyle;
75
+ bodySmall: TextStyle;
76
+ [key: string]: TextStyle;
77
+ };
78
+ }
79
+
80
+ export function useAppDesignTokens(): DesignTokens;
81
+
82
+ export interface AtomicTextProps {
83
+ children?: ReactNode;
84
+ style?: StyleProp<TextStyle>;
85
+ }
86
+ export const AtomicText: FC<AtomicTextProps>;
87
+
88
+ export interface AtomicIconProps {
89
+ name: string;
90
+ size?: "xs" | "sm" | "md" | "lg" | "xl";
91
+ color?: string;
92
+ }
93
+ export const AtomicIcon: FC<AtomicIconProps>;
94
+ }
95
+
96
+ declare module "@umituz/react-native-sharing" {
97
+ export interface ShareOptions {
98
+ dialogTitle?: string;
99
+ mimeType?: string;
100
+ }
101
+
102
+ export interface UseSharingResult {
103
+ share: (uri: string, options?: ShareOptions) => Promise<void>;
104
+ }
105
+
106
+ export function useSharing(): UseSharingResult;
107
+ }
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Face Detection Constants
3
+ */
4
+
5
+ export const FACE_DETECTION_CONFIG = {
6
+ minConfidence: 0.5,
7
+ } as const;
8
+
9
+ export const FACE_DETECTION_PROMPTS = {
10
+ analyze: `Look at this image and check if there is a human face visible.
11
+ Reply with ONLY this JSON (no markdown, no explanation):
12
+ {"hasFace": true, "confidence": 0.9, "reason": "face visible"}
13
+
14
+ If no face is visible:
15
+ {"hasFace": false, "confidence": 0.1, "reason": "no face found"}`,
16
+ } as const;
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Face Detection Types
3
+ */
4
+
5
+ export interface FaceDetectionResult {
6
+ hasFace: boolean;
7
+ confidence: number;
8
+ message: string;
9
+ }
10
+
11
+ export interface FaceValidationState {
12
+ isValidating: boolean;
13
+ result: FaceDetectionResult | null;
14
+ error: string | null;
15
+ }
16
+
17
+ export interface FaceDetectionConfig {
18
+ minConfidence: number;
19
+ }
@@ -0,0 +1,26 @@
1
+ /**
2
+ * React Native AI Face Detection - Public API
3
+ *
4
+ * AI-powered face detection for React Native apps using Gemini Vision
5
+ */
6
+
7
+ export type {
8
+ FaceDetectionResult,
9
+ FaceValidationState,
10
+ FaceDetectionConfig,
11
+ } from "./domain/entities/FaceDetection";
12
+
13
+ export { FACE_DETECTION_CONFIG, FACE_DETECTION_PROMPTS } from "./domain/constants/faceDetectionConstants";
14
+
15
+ export {
16
+ isValidFace,
17
+ parseDetectionResponse,
18
+ createFailedResult,
19
+ createSuccessResult,
20
+ } from "./infrastructure/validators/faceValidator";
21
+
22
+ export { analyzeImageForFace } from "./infrastructure/analyzers/faceAnalyzer";
23
+
24
+ export { useFaceDetection } from "./presentation/hooks/useFaceDetection";
25
+
26
+ export { FaceValidationStatus } from "./presentation/components/FaceValidationStatus";
@@ -0,0 +1,36 @@
1
+ /**
2
+ * Face Analyzer
3
+ *
4
+ * Analyzes images for face presence using Gemini AI.
5
+ */
6
+
7
+ import { geminiProviderService } from "@umituz/react-native-ai-gemini-provider";
8
+ import type { FaceDetectionResult } from "../../domain/entities/FaceDetection";
9
+ import { FACE_DETECTION_PROMPTS } from "../../domain/constants/faceDetectionConstants";
10
+ import {
11
+ parseDetectionResponse,
12
+ createFailedResult,
13
+ } from "../validators/faceValidator";
14
+
15
+ export const analyzeImageForFace = async (
16
+ base64Image: string,
17
+ ): Promise<FaceDetectionResult> => {
18
+ try {
19
+ const result = await geminiProviderService.run<{ text: string }>(
20
+ "gemini-2.0-flash-exp",
21
+ {
22
+ prompt: FACE_DETECTION_PROMPTS.analyze,
23
+ image_url: base64Image,
24
+ },
25
+ );
26
+
27
+ if (!result.text) {
28
+ return createFailedResult("No response from AI");
29
+ }
30
+
31
+ return parseDetectionResponse(result.text);
32
+ } catch (error) {
33
+ const message = error instanceof Error ? error.message : "Analysis failed";
34
+ return createFailedResult(message);
35
+ }
36
+ };
@@ -0,0 +1,52 @@
1
+ /**
2
+ * Face Validator
3
+ *
4
+ * Pure functions for validating face detection results.
5
+ */
6
+
7
+ import type { FaceDetectionResult } from "../../domain/entities/FaceDetection";
8
+ import { FACE_DETECTION_CONFIG } from "../../domain/constants/faceDetectionConstants";
9
+
10
+ export const isValidFace = (result: FaceDetectionResult): boolean => {
11
+ return (
12
+ result.hasFace && result.confidence >= FACE_DETECTION_CONFIG.minConfidence
13
+ );
14
+ };
15
+
16
+ export const parseDetectionResponse = (
17
+ response: string,
18
+ ): FaceDetectionResult => {
19
+ try {
20
+ let cleaned = response.replace(/```json\n?/g, "").replace(/```\n?/g, "");
21
+ cleaned = cleaned.trim();
22
+
23
+ const jsonMatch = cleaned.match(/\{[\s\S]*\}/);
24
+ if (!jsonMatch) {
25
+ return createFailedResult("Invalid response format");
26
+ }
27
+
28
+ const parsed = JSON.parse(jsonMatch[0]);
29
+
30
+ return {
31
+ hasFace: Boolean(parsed.hasFace),
32
+ confidence: Number(parsed.confidence) || 0,
33
+ message: String(parsed.reason || ""),
34
+ };
35
+ } catch (error) {
36
+ return createFailedResult("Failed to parse response");
37
+ }
38
+ };
39
+
40
+ export const createFailedResult = (message: string): FaceDetectionResult => ({
41
+ hasFace: false,
42
+ confidence: 0,
43
+ message,
44
+ });
45
+
46
+ export const createSuccessResult = (
47
+ confidence: number,
48
+ ): FaceDetectionResult => ({
49
+ hasFace: true,
50
+ confidence,
51
+ message: "Face detected successfully",
52
+ });
@@ -0,0 +1,111 @@
1
+ /**
2
+ * FaceValidationStatus Component
3
+ *
4
+ * Displays face validation status with appropriate styling.
5
+ */
6
+
7
+ import React from "react";
8
+ import { View, StyleSheet, ActivityIndicator } from "react-native";
9
+ import {
10
+ AtomicText,
11
+ AtomicIcon,
12
+ useAppDesignTokens,
13
+ } from "@umituz/react-native-design-system";
14
+ import { useLocalization } from "@umituz/react-native-localization";
15
+ import type { FaceValidationState } from "../../domain/entities/FaceDetection";
16
+ import { isValidFace } from "../../infrastructure/validators/faceValidator";
17
+
18
+ interface FaceValidationStatusProps {
19
+ state: FaceValidationState;
20
+ }
21
+
22
+ export const FaceValidationStatus: React.FC<FaceValidationStatusProps> = ({
23
+ state,
24
+ }) => {
25
+ const tokens = useAppDesignTokens();
26
+ const { t } = useLocalization();
27
+
28
+ if (state.isValidating) {
29
+ return (
30
+ <View
31
+ style={[styles.container, { backgroundColor: tokens.colors.surface }]}
32
+ >
33
+ <ActivityIndicator size="small" color={tokens.colors.primary} />
34
+ <AtomicText
35
+ style={[styles.text, { color: tokens.colors.textSecondary }]}
36
+ >
37
+ {t("faceDetection.analyzing")}
38
+ </AtomicText>
39
+ </View>
40
+ );
41
+ }
42
+
43
+ if (state.error) {
44
+ return (
45
+ <View
46
+ style={[
47
+ styles.container,
48
+ { backgroundColor: tokens.colors.errorContainer },
49
+ ]}
50
+ >
51
+ <AtomicIcon
52
+ name="alert-circle"
53
+ size={16}
54
+ customColor={tokens.colors.error}
55
+ />
56
+ <AtomicText style={[styles.text, { color: tokens.colors.error }]}>
57
+ {t("faceDetection.error")}
58
+ </AtomicText>
59
+ </View>
60
+ );
61
+ }
62
+
63
+ if (!state.result) {
64
+ return null;
65
+ }
66
+
67
+ const valid = isValidFace(state.result);
68
+
69
+ return (
70
+ <View
71
+ style={[
72
+ styles.container,
73
+ {
74
+ backgroundColor: valid
75
+ ? tokens.colors.successContainer
76
+ : tokens.colors.errorContainer,
77
+ },
78
+ ]}
79
+ >
80
+ <AtomicIcon
81
+ name={valid ? "checkmark-circle" : "close-circle"}
82
+ size={16}
83
+ customColor={valid ? tokens.colors.success : tokens.colors.error}
84
+ />
85
+ <AtomicText
86
+ style={[
87
+ styles.text,
88
+ { color: valid ? tokens.colors.success : tokens.colors.error },
89
+ ]}
90
+ >
91
+ {valid ? t("faceDetection.success") : t("faceDetection.noFace")}
92
+ </AtomicText>
93
+ </View>
94
+ );
95
+ };
96
+
97
+ const styles = StyleSheet.create({
98
+ container: {
99
+ flexDirection: "row",
100
+ alignItems: "center",
101
+ paddingHorizontal: 12,
102
+ paddingVertical: 6,
103
+ borderRadius: 8,
104
+ gap: 6,
105
+ marginTop: 8,
106
+ },
107
+ text: {
108
+ fontSize: 12,
109
+ fontWeight: "500",
110
+ },
111
+ });
@@ -0,0 +1,58 @@
1
+ /**
2
+ * useFaceDetection Hook
3
+ *
4
+ * React hook for face detection functionality.
5
+ */
6
+
7
+ import { useState, useCallback } from "react";
8
+ import type {
9
+ FaceValidationState,
10
+ FaceDetectionResult,
11
+ } from "../../domain/entities/FaceDetection";
12
+ import { analyzeImageForFace } from "../../infrastructure/analyzers/faceAnalyzer";
13
+ import { isValidFace } from "../../infrastructure/validators/faceValidator";
14
+
15
+ interface UseFaceDetectionReturn {
16
+ state: FaceValidationState;
17
+ validateImage: (base64Image: string) => Promise<FaceDetectionResult>;
18
+ isValid: boolean;
19
+ reset: () => void;
20
+ }
21
+
22
+ const initialState: FaceValidationState = {
23
+ isValidating: false,
24
+ result: null,
25
+ error: null,
26
+ };
27
+
28
+ export const useFaceDetection = (): UseFaceDetectionReturn => {
29
+ const [state, setState] = useState<FaceValidationState>(initialState);
30
+
31
+ const validateImage = useCallback(async (base64Image: string) => {
32
+ setState({ isValidating: true, result: null, error: null });
33
+
34
+ try {
35
+ const result = await analyzeImageForFace(base64Image);
36
+ setState({ isValidating: false, result, error: null });
37
+ return result;
38
+ } catch (error) {
39
+ const message =
40
+ error instanceof Error ? error.message : "Validation failed";
41
+ setState({ isValidating: false, result: null, error: message });
42
+ throw error;
43
+ }
44
+ }, []);
45
+
46
+ const reset = useCallback(() => {
47
+ setState(initialState);
48
+ }, []);
49
+
50
+ const isValid = state.result ? isValidFace(state.result) : false;
51
+
52
+ return {
53
+ state,
54
+ validateImage,
55
+ isValid,
56
+ reset,
57
+ };
58
+ };
@@ -0,0 +1,77 @@
1
+ /**
2
+ * Background Feature Types
3
+ * @description Core type definitions for background feature
4
+ */
5
+
6
+ /**
7
+ * Studio mode for background operations
8
+ */
9
+ export type StudioMode =
10
+ | "transparent"
11
+ | "remove-object"
12
+ | "replace-object"
13
+ | "relight"
14
+ | "creative-scene"
15
+ | "enhance"
16
+ | "clean-white"
17
+ | "portrait-blur";
18
+
19
+ /**
20
+ * Background processing request input
21
+ */
22
+ export interface BackgroundProcessRequest {
23
+ readonly imageUri: string;
24
+ readonly prompt?: string;
25
+ readonly mode?: StudioMode;
26
+ readonly mask?: string;
27
+ }
28
+
29
+ /**
30
+ * Background processing result
31
+ */
32
+ export interface BackgroundProcessResult {
33
+ readonly success: boolean;
34
+ readonly imageUrl?: string;
35
+ readonly error?: string;
36
+ readonly requestId?: string;
37
+ }
38
+
39
+ /**
40
+ * Background feature state
41
+ */
42
+ export interface BackgroundFeatureState {
43
+ readonly imageUri: string | null;
44
+ readonly prompt: string;
45
+ readonly processedUrl: string | null;
46
+ readonly isProcessing: boolean;
47
+ readonly progress: number;
48
+ readonly error: string | null;
49
+ readonly mode: StudioMode;
50
+ }
51
+
52
+ /**
53
+ * Sample prompt configuration
54
+ */
55
+ export interface SamplePrompt {
56
+ readonly id: string;
57
+ readonly text: string;
58
+ }
59
+
60
+ /**
61
+ * Studio mode configuration
62
+ */
63
+ export interface StudioModeConfig {
64
+ readonly id: StudioMode;
65
+ readonly icon: string;
66
+ readonly requiresPrompt?: boolean;
67
+ readonly requiresMask?: boolean;
68
+ }
69
+
70
+ /**
71
+ * Comparison view state
72
+ */
73
+ export interface ComparisonState {
74
+ readonly originalUri: string | null;
75
+ readonly processedUri: string | null;
76
+ readonly position: number;
77
+ }
@@ -0,0 +1,96 @@
1
+ /**
2
+ * Component Props Types
3
+ * @description Props definitions for background feature components
4
+ */
5
+
6
+ import type { ImageSourcePropType } from "react-native";
7
+ import type { SamplePrompt, StudioMode, StudioModeConfig } from "./background.types";
8
+
9
+ /**
10
+ * Image picker component props
11
+ */
12
+ export interface ImagePickerProps {
13
+ readonly imageUri: string | null;
14
+ readonly isProcessing: boolean;
15
+ readonly onSelectImage: () => void;
16
+ readonly placeholderText?: string;
17
+ }
18
+
19
+ /**
20
+ * Prompt input component props
21
+ */
22
+ export interface PromptInputProps {
23
+ readonly value: string;
24
+ readonly onChangeText: (text: string) => void;
25
+ readonly isProcessing: boolean;
26
+ readonly label?: string;
27
+ readonly placeholder?: string;
28
+ readonly samplePrompts?: readonly SamplePrompt[];
29
+ readonly samplePromptsLabel?: string;
30
+ }
31
+
32
+ /**
33
+ * Generate button component props
34
+ */
35
+ export interface GenerateButtonProps {
36
+ readonly isDisabled: boolean;
37
+ readonly isProcessing: boolean;
38
+ readonly onPress: () => void;
39
+ readonly buttonText?: string;
40
+ }
41
+
42
+ /**
43
+ * Result display component props
44
+ */
45
+ export interface ResultDisplayProps {
46
+ readonly imageUrl: string | null;
47
+ readonly isProcessing: boolean;
48
+ readonly onSave: () => void;
49
+ readonly onReset: () => void;
50
+ readonly saveButtonText?: string;
51
+ readonly resetButtonText?: string;
52
+ }
53
+
54
+ /**
55
+ * Error display component props
56
+ */
57
+ export interface ErrorDisplayProps {
58
+ readonly error: string | null;
59
+ }
60
+
61
+ /**
62
+ * Processing modal component props
63
+ */
64
+ export interface ProcessingModalProps {
65
+ readonly visible: boolean;
66
+ readonly progress?: number;
67
+ readonly title?: string;
68
+ }
69
+
70
+ /**
71
+ * Feature header component props
72
+ */
73
+ export interface FeatureHeaderProps {
74
+ readonly heroImage?: ImageSourcePropType;
75
+ readonly description?: string;
76
+ }
77
+
78
+ /**
79
+ * Mode selector component props
80
+ */
81
+ export interface ModeSelectorProps {
82
+ readonly activeMode: StudioMode;
83
+ readonly onModeChange: (mode: StudioMode) => void;
84
+ readonly isProcessing: boolean;
85
+ readonly modes: readonly StudioModeConfig[];
86
+ }
87
+
88
+ /**
89
+ * Comparison slider component props
90
+ */
91
+ export interface ComparisonSliderProps {
92
+ readonly originalUri: string;
93
+ readonly processedUri: string;
94
+ readonly beforeLabel?: string;
95
+ readonly afterLabel?: string;
96
+ }
@@ -0,0 +1,41 @@
1
+ /**
2
+ * Configuration Types
3
+ * @description Configuration interfaces for background feature
4
+ */
5
+
6
+ import type {
7
+ BackgroundProcessRequest,
8
+ BackgroundProcessResult,
9
+ StudioMode,
10
+ } from "./background.types";
11
+
12
+ /**
13
+ * Process request callback parameters
14
+ */
15
+ export interface ProcessRequestParams extends BackgroundProcessRequest {
16
+ readonly onProgress?: (progress: number) => void;
17
+ }
18
+
19
+ /**
20
+ * Background feature configuration
21
+ */
22
+ export interface BackgroundFeatureConfig {
23
+ readonly onProcess: (
24
+ params: ProcessRequestParams
25
+ ) => Promise<BackgroundProcessResult>;
26
+ readonly onSave?: (imageUrl: string) => Promise<void>;
27
+ readonly onError?: (error: Error) => void;
28
+ readonly onSuccess?: (result: BackgroundProcessResult) => void;
29
+ readonly defaultMode?: StudioMode;
30
+ }
31
+
32
+ /**
33
+ * Hook configuration
34
+ */
35
+ export interface UseBackgroundFeatureConfig {
36
+ readonly processRequest: (
37
+ params: ProcessRequestParams
38
+ ) => Promise<BackgroundProcessResult>;
39
+ readonly onSelectImage?: () => Promise<string | null>;
40
+ readonly defaultMode?: StudioMode;
41
+ }
@@ -0,0 +1,31 @@
1
+ /**
2
+ * Domain Entities Export
3
+ */
4
+
5
+ export type {
6
+ BackgroundProcessRequest,
7
+ BackgroundProcessResult,
8
+ BackgroundFeatureState,
9
+ SamplePrompt,
10
+ StudioMode,
11
+ StudioModeConfig,
12
+ ComparisonState,
13
+ } from "./background.types";
14
+
15
+ export type {
16
+ ImagePickerProps,
17
+ PromptInputProps,
18
+ GenerateButtonProps,
19
+ ResultDisplayProps,
20
+ ErrorDisplayProps,
21
+ ProcessingModalProps,
22
+ FeatureHeaderProps,
23
+ ModeSelectorProps,
24
+ ComparisonSliderProps,
25
+ } from "./component.types";
26
+
27
+ export type {
28
+ ProcessRequestParams,
29
+ BackgroundFeatureConfig,
30
+ UseBackgroundFeatureConfig,
31
+ } from "./config.types";