hnc-rn-image-overlay 1.0.4 → 1.0.6
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/index.ts +12 -17
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -1,24 +1,19 @@
|
|
|
1
|
-
import { NativeModules } from
|
|
1
|
+
import { NativeModules } from "react-native";
|
|
2
2
|
|
|
3
3
|
interface ImageOverlayModuleInterface {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
imagePath: string,
|
|
12
|
-
textLines: string[]
|
|
13
|
-
): Promise<string>;
|
|
4
|
+
/**
|
|
5
|
+
* Add overlay and text watermark to an image
|
|
6
|
+
* @param imagePath - Absolute path to the input image
|
|
7
|
+
* @param textLines - Array of text strings to render on the overlay
|
|
8
|
+
* @returns Promise that resolves to the output image path
|
|
9
|
+
*/
|
|
10
|
+
addOverlayAndText(imagePath: string, textLines: string[]): Promise<string>;
|
|
14
11
|
}
|
|
15
12
|
|
|
16
|
-
const {
|
|
13
|
+
const { ImageOverlay } = NativeModules;
|
|
17
14
|
|
|
18
|
-
if (!
|
|
19
|
-
|
|
20
|
-
'ImageOverlayModule is not available. Make sure you have linked the library properly and rebuilt your app.'
|
|
21
|
-
);
|
|
15
|
+
if (!ImageOverlay) {
|
|
16
|
+
throw new Error("ImageOverlayModule is not available. Make sure you have linked the library properly and rebuilt your app.");
|
|
22
17
|
}
|
|
23
18
|
|
|
24
|
-
export default
|
|
19
|
+
export default ImageOverlay as ImageOverlayModuleInterface;
|