@umituz/react-native-ai-generation-content 1.17.162 → 1.17.163

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@umituz/react-native-ai-generation-content",
3
- "version": "1.17.162",
3
+ "version": "1.17.163",
4
4
  "description": "Provider-agnostic AI generation orchestration for React Native",
5
5
  "main": "src/index.ts",
6
6
  "types": "src/index.ts",
@@ -120,8 +120,8 @@ export { useCreationPersistence } from "./presentation/hooks/useCreationPersiste
120
120
  export type {
121
121
  UseCreationPersistenceConfig,
122
122
  UseCreationPersistenceReturn,
123
- ProcessingStartData,
124
- ProcessingResult,
123
+ BaseProcessingStartData,
124
+ BaseProcessingResult,
125
125
  } from "./presentation/hooks/useCreationPersistence";
126
126
 
127
127
  // =============================================================================
@@ -18,6 +18,6 @@ export { useCreationPersistence } from "./useCreationPersistence";
18
18
  export type {
19
19
  UseCreationPersistenceConfig,
20
20
  UseCreationPersistenceReturn,
21
- ProcessingStartData,
22
- ProcessingResult,
21
+ BaseProcessingStartData,
22
+ BaseProcessingResult,
23
23
  } from "./useCreationPersistence";
@@ -21,29 +21,27 @@ export interface UseCreationPersistenceConfig {
21
21
  }
22
22
 
23
23
  /**
24
- * Generic processing start data - all features must have creationId
24
+ * Base processing start data - all features must have creationId
25
25
  */
26
- export interface ProcessingStartData {
26
+ export interface BaseProcessingStartData {
27
27
  readonly creationId: string;
28
- readonly [key: string]: unknown;
29
28
  }
30
29
 
31
30
  /**
32
- * Generic processing result - all features should have creationId
31
+ * Base processing result - all features should have creationId
33
32
  */
34
- export interface ProcessingResult {
33
+ export interface BaseProcessingResult {
35
34
  readonly creationId?: string;
36
35
  readonly imageUrl?: string;
37
36
  readonly videoUrl?: string;
38
- readonly [key: string]: unknown;
39
37
  }
40
38
 
41
39
  /**
42
- * Return type for useCreationPersistence
40
+ * Return type for useCreationPersistence - uses generic callbacks
43
41
  */
44
42
  export interface UseCreationPersistenceReturn {
45
- readonly onProcessingStart: (data: ProcessingStartData) => void;
46
- readonly onProcessingComplete: (result: ProcessingResult) => void;
43
+ readonly onProcessingStart: <T extends BaseProcessingStartData>(data: T) => void;
44
+ readonly onProcessingComplete: <T extends BaseProcessingResult>(result: T) => void;
47
45
  readonly onError: (error: string, creationId?: string) => void;
48
46
  }
49
47
 
@@ -71,7 +69,7 @@ export function useCreationPersistence(
71
69
  );
72
70
 
73
71
  const onProcessingStart = useCallback(
74
- (data: ProcessingStartData) => {
72
+ <T extends BaseProcessingStartData>(data: T) => {
75
73
  if (!userId) return;
76
74
 
77
75
  const { creationId, ...rest } = data;
@@ -83,7 +81,7 @@ export function useCreationPersistence(
83
81
  createdAt: new Date(),
84
82
  isShared: false,
85
83
  isFavorite: false,
86
- metadata: rest,
84
+ metadata: rest as Record<string, unknown>,
87
85
  };
88
86
 
89
87
  repository.create(userId, creation);
@@ -93,7 +91,7 @@ export function useCreationPersistence(
93
91
  );
94
92
 
95
93
  const onProcessingComplete = useCallback(
96
- (result: ProcessingResult) => {
94
+ <T extends BaseProcessingResult>(result: T) => {
97
95
  if (!userId || !result.creationId) return;
98
96
 
99
97
  const uri = result.imageUrl || result.videoUrl || "";