@umituz/react-native-ai-generation-content 1.17.228 → 1.17.229
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 +1 -1
- package/src/presentation/hooks/base/use-dual-image-feature.ts +4 -4
- package/src/presentation/hooks/base/use-image-with-prompt-feature.ts +4 -4
- package/src/presentation/hooks/base/utils/feature-state.factory.ts +1 -1
- package/src/presentation/layouts/types/.npmignore.tmp +0 -0
- package/src/presentation/layouts/types/layout-props.ts +1 -1
package/package.json
CHANGED
|
@@ -121,10 +121,10 @@ export function useDualImageFeature(
|
|
|
121
121
|
return;
|
|
122
122
|
}
|
|
123
123
|
|
|
124
|
-
const result = await executeProcess({
|
|
124
|
+
const result = await executeProcess<FeatureProcessResult>({
|
|
125
125
|
canProcess: () => !!state.firstImageUri && !!state.secondImageUri,
|
|
126
|
-
setError: (error) => setState((prev) => ({ ...prev, error })),
|
|
127
|
-
setProcessing: (isProcessing) => setState((prev) => ({ ...prev, isProcessing })),
|
|
126
|
+
setError: (error: string | null) => setState((prev) => ({ ...prev, error })),
|
|
127
|
+
setProcessing: (isProcessing: boolean) => setState((prev) => ({ ...prev, isProcessing })),
|
|
128
128
|
onError: config.onError,
|
|
129
129
|
processFn: () =>
|
|
130
130
|
config.processRequest({
|
|
@@ -132,7 +132,7 @@ export function useDualImageFeature(
|
|
|
132
132
|
secondImageUri: state.secondImageUri!,
|
|
133
133
|
onProgress: (progress) => setState((prev) => ({ ...prev, progress })),
|
|
134
134
|
}),
|
|
135
|
-
onSuccess: (result) => {
|
|
135
|
+
onSuccess: (result: FeatureProcessResult) => {
|
|
136
136
|
if (result.outputUrl) {
|
|
137
137
|
setState((prev) => ({ ...prev, processedUrl: result.outputUrl ?? null }));
|
|
138
138
|
config.onSuccess?.(result.outputUrl);
|
|
@@ -114,14 +114,14 @@ export function useImageWithPromptFeature(
|
|
|
114
114
|
return;
|
|
115
115
|
}
|
|
116
116
|
|
|
117
|
-
const result = await executeProcess({
|
|
117
|
+
const result = await executeProcess<FeatureProcessResult>({
|
|
118
118
|
canProcess: () => {
|
|
119
119
|
if (!state.imageUri) return false;
|
|
120
120
|
if (config.requirePrompt) return !!state.prompt.trim();
|
|
121
121
|
return true;
|
|
122
122
|
},
|
|
123
|
-
setError: (error) => setState((prev) => ({ ...prev, error })),
|
|
124
|
-
setProcessing: (isProcessing) => setState((prev) => ({ ...prev, isProcessing })),
|
|
123
|
+
setError: (error: string | null) => setState((prev) => ({ ...prev, error })),
|
|
124
|
+
setProcessing: (isProcessing: boolean) => setState((prev) => ({ ...prev, isProcessing })),
|
|
125
125
|
onError: config.onError,
|
|
126
126
|
processFn: () =>
|
|
127
127
|
config.processRequest({
|
|
@@ -129,7 +129,7 @@ export function useImageWithPromptFeature(
|
|
|
129
129
|
prompt: state.prompt.trim(),
|
|
130
130
|
onProgress: (progress) => setState((prev) => ({ ...prev, progress })),
|
|
131
131
|
}),
|
|
132
|
-
onSuccess: (result) => {
|
|
132
|
+
onSuccess: (result: FeatureProcessResult) => {
|
|
133
133
|
if (result.outputUrl) {
|
|
134
134
|
setState((prev) => ({ ...prev, processedUrl: result.outputUrl ?? null }));
|
|
135
135
|
config.onSuccess?.(result.outputUrl);
|
|
@@ -79,7 +79,7 @@ export async function executeProcess<TResult>({
|
|
|
79
79
|
processFn,
|
|
80
80
|
onSuccess,
|
|
81
81
|
onProgress,
|
|
82
|
-
}: ProcessHandlerParams<
|
|
82
|
+
}: ProcessHandlerParams<TResult>): Promise<TResult | null> {
|
|
83
83
|
if (!canProcess()) {
|
|
84
84
|
return null;
|
|
85
85
|
}
|
|
File without changes
|
|
@@ -7,7 +7,7 @@ import type { ReactNode } from "react";
|
|
|
7
7
|
import type {
|
|
8
8
|
BaseSingleImageHookReturn,
|
|
9
9
|
BaseDualImageHookReturn,
|
|
10
|
-
} from "
|
|
10
|
+
} from "../../../features/image-to-image/domain/types";
|
|
11
11
|
import type {
|
|
12
12
|
ModalTranslations,
|
|
13
13
|
BaseLayoutTranslations,
|