@phucprime/react-native-image-editor 1.0.0
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/LICENSE +201 -0
- package/README.md +247 -0
- package/android/build.gradle +62 -0
- package/android/gradle/wrapper/gradle-wrapper.jar +0 -0
- package/android/gradle/wrapper/gradle-wrapper.properties +5 -0
- package/android/gradlew +240 -0
- package/android/gradlew.bat +91 -0
- package/android/libs/photo-editor-android.jar +0 -0
- package/android/src/main/AndroidManifest.xml +5 -0
- package/android/src/main/java/com/ahmedadeltito/photoeditor/BaseActivity.java +300 -0
- package/android/src/main/java/com/ahmedadeltito/photoeditor/ColorPickerAdapter.java +129 -0
- package/android/src/main/java/com/ahmedadeltito/photoeditor/EmojiAdapter.java +91 -0
- package/android/src/main/java/com/ahmedadeltito/photoeditor/EmojiFragment.java +56 -0
- package/android/src/main/java/com/ahmedadeltito/photoeditor/GalleryUtils.java +73 -0
- package/android/src/main/java/com/ahmedadeltito/photoeditor/ImageAdapter.java +69 -0
- package/android/src/main/java/com/ahmedadeltito/photoeditor/ImageFragment.java +93 -0
- package/android/src/main/java/com/ahmedadeltito/photoeditor/MainActivity.java +29 -0
- package/android/src/main/java/com/ahmedadeltito/photoeditor/MediaActivity.java +95 -0
- package/android/src/main/java/com/ahmedadeltito/photoeditor/PhotoEditorActivity.java +1055 -0
- package/android/src/main/java/com/ahmedadeltito/photoeditor/TranslationService.java +31 -0
- package/android/src/main/java/com/ahmedadeltito/photoeditor/UtilFunctions.java +176 -0
- package/android/src/main/java/com/ahmedadeltito/photoeditor/widget/RealtimeBlurView.java +359 -0
- package/android/src/main/java/com/ahmedadeltito/photoeditor/widget/SlidingUpPanelLayout.java +1527 -0
- package/android/src/main/java/com/ahmedadeltito/photoeditor/widget/ViewDragHelper.java +1466 -0
- package/android/src/main/java/ui/photoeditor/RNPhotoEditorModule.java +108 -0
- package/android/src/main/java/ui/photoeditor/RNPhotoEditorPackage.java +29 -0
- package/android/src/main/res/drawable/above_shadow.xml +7 -0
- package/android/src/main/res/drawable/below_shadow.xml +7 -0
- package/android/src/main/res/drawable/fading_shadow.xml +7 -0
- package/android/src/main/res/drawable/rounded_border_text_view.xml +13 -0
- package/android/src/main/res/drawable-xhdpi/aa.png +0 -0
- package/android/src/main/res/drawable-xhdpi/bb.png +0 -0
- package/android/src/main/res/drawable-xhdpi/c.png +0 -0
- package/android/src/main/res/drawable-xhdpi/cc.png +0 -0
- package/android/src/main/res/drawable-xhdpi/d.png +0 -0
- package/android/src/main/res/drawable-xhdpi/dd.png +0 -0
- package/android/src/main/res/drawable-xhdpi/e.png +0 -0
- package/android/src/main/res/drawable-xhdpi/ee.png +0 -0
- package/android/src/main/res/drawable-xhdpi/i.png +0 -0
- package/android/src/main/res/drawable-xhdpi/j.png +0 -0
- package/android/src/main/res/drawable-xhdpi/k.png +0 -0
- package/android/src/main/res/drawable-xhdpi/l.png +0 -0
- package/android/src/main/res/drawable-xhdpi/m.png +0 -0
- package/android/src/main/res/drawable-xhdpi/n.png +0 -0
- package/android/src/main/res/drawable-xhdpi/o.png +0 -0
- package/android/src/main/res/drawable-xhdpi/p.png +0 -0
- package/android/src/main/res/drawable-xhdpi/q.png +0 -0
- package/android/src/main/res/drawable-xhdpi/r.png +0 -0
- package/android/src/main/res/drawable-xhdpi/s.png +0 -0
- package/android/src/main/res/drawable-xhdpi/t.png +0 -0
- package/android/src/main/res/drawable-xhdpi/u.png +0 -0
- package/android/src/main/res/drawable-xhdpi/v.png +0 -0
- package/android/src/main/res/drawable-xhdpi/w.png +0 -0
- package/android/src/main/res/drawable-xhdpi/x.png +0 -0
- package/android/src/main/res/drawable-xhdpi/y.png +0 -0
- package/android/src/main/res/drawable-xhdpi/z.png +0 -0
- package/android/src/main/res/layout/activity_main.xml +28 -0
- package/android/src/main/res/layout/activity_photo_editor.xml +316 -0
- package/android/src/main/res/layout/add_text_popup_window.xml +47 -0
- package/android/src/main/res/layout/color_picker_item_list.xml +15 -0
- package/android/src/main/res/layout/fragment_main_photo_edit_emoji.xml +11 -0
- package/android/src/main/res/layout/fragment_main_photo_edit_image.xml +10 -0
- package/android/src/main/res/layout/fragment_photo_edit_emoji_item_list.xml +17 -0
- package/android/src/main/res/layout/fragment_photo_edit_image_item_list.xml +16 -0
- package/android/src/main/res/raw/emojioneandroid +0 -0
- package/android/src/main/res/raw/eventtusicons +0 -0
- package/android/src/main/res/raw/font_awesome_solid.otf +0 -0
- package/android/src/main/res/raw/icomoon.ttf +0 -0
- package/android/src/main/res/values/arrays.xml +447 -0
- package/android/src/main/res/values/attrs.xml +30 -0
- package/android/src/main/res/values/colors.xml +21 -0
- package/android/src/main/res/values/dimens.xml +4 -0
- package/android/src/main/res/values/strings.xml +33 -0
- package/android/src/main/res/values/styles.xml +27 -0
- package/ios/RNImageEditor.podspec +26 -0
- package/ios/RNPhotoEditor.h +13 -0
- package/ios/RNPhotoEditor.m +163 -0
- package/ios/RNPhotoEditor.xcodeproj/project.pbxproj +362 -0
- package/lib/index.d.ts +125 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +114 -0
- package/lib/index.js.map +1 -0
- package/package.json +73 -0
- package/react-native-image-editor.podspec +39 -0
- package/src/index.ts +232 -0
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
require "json"
|
|
2
|
+
|
|
3
|
+
package = JSON.parse(File.read(File.join(__dir__, "../package.json")))
|
|
4
|
+
|
|
5
|
+
Pod::Spec.new do |s|
|
|
6
|
+
s.name = "RNImageEditor"
|
|
7
|
+
s.version = package["version"]
|
|
8
|
+
s.summary = package["description"]
|
|
9
|
+
s.description = package["description"]
|
|
10
|
+
s.homepage = package["homepage"]
|
|
11
|
+
s.license = package["license"]
|
|
12
|
+
s.author = package["author"]
|
|
13
|
+
s.source = { :git => "https://github.com/phucprime/react-native-image-editor.git", :tag => s.version }
|
|
14
|
+
|
|
15
|
+
s.platforms = { :ios => "13.0" }
|
|
16
|
+
|
|
17
|
+
s.preserve_paths = "LICENSE", "package.json"
|
|
18
|
+
s.source_files = "**/*.{h,m,mm}"
|
|
19
|
+
s.dependency "iOSPhotoEditor"
|
|
20
|
+
|
|
21
|
+
if respond_to?(:install_modules_dependencies, true)
|
|
22
|
+
install_modules_dependencies(s)
|
|
23
|
+
else
|
|
24
|
+
s.dependency "React-Core"
|
|
25
|
+
end
|
|
26
|
+
end
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
|
|
2
|
+
#if __has_include("RCTBridgeModule.h")
|
|
3
|
+
#import "RCTBridgeModule.h"
|
|
4
|
+
#else
|
|
5
|
+
#import <React/RCTBridgeModule.h>
|
|
6
|
+
#endif
|
|
7
|
+
|
|
8
|
+
#import <UIKit/UIKit.h>
|
|
9
|
+
@import iOSPhotoEditor;
|
|
10
|
+
|
|
11
|
+
@interface RNPhotoEditor : NSObject <RCTBridgeModule, PhotoEditorDelegate>
|
|
12
|
+
|
|
13
|
+
@end
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
|
|
2
|
+
#import "RNPhotoEditor.h"
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
@implementation RNPhotoEditor
|
|
6
|
+
|
|
7
|
+
- (dispatch_queue_t)methodQueue
|
|
8
|
+
{
|
|
9
|
+
return dispatch_get_main_queue();
|
|
10
|
+
}
|
|
11
|
+
RCT_EXPORT_MODULE()
|
|
12
|
+
|
|
13
|
+
NSString *_editImagePath = nil;
|
|
14
|
+
|
|
15
|
+
RCTResponseSenderBlock _onDoneEditing = nil;
|
|
16
|
+
RCTResponseSenderBlock _onCancelEditing = nil;
|
|
17
|
+
|
|
18
|
+
- (void)doneEditingWithImage:(UIImage *)image {
|
|
19
|
+
if (_onDoneEditing == nil) return;
|
|
20
|
+
|
|
21
|
+
NSError* error;
|
|
22
|
+
|
|
23
|
+
BOOL isPNG = [_editImagePath.pathExtension.lowercaseString isEqualToString:@"png"];
|
|
24
|
+
NSString* path = _editImagePath;
|
|
25
|
+
|
|
26
|
+
if ([path containsString:@"file://"]) {
|
|
27
|
+
NSURL *url = [NSURL URLWithString:_editImagePath];
|
|
28
|
+
path = url.path;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
[isPNG ? UIImagePNGRepresentation(image) : UIImageJPEGRepresentation(image, 0.8) writeToFile:path options:NSDataWritingAtomic error:&error];
|
|
32
|
+
|
|
33
|
+
if (error != nil)
|
|
34
|
+
NSLog(@"write error %@", error);
|
|
35
|
+
|
|
36
|
+
_onDoneEditing(@[path]);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
- (void)canceledEditing {
|
|
40
|
+
if (_onCancelEditing == nil) return;
|
|
41
|
+
|
|
42
|
+
_onCancelEditing(@[]);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
RCT_EXPORT_METHOD(Edit:(nonnull NSDictionary *)props onDone:(RCTResponseSenderBlock)onDone onCancel:(RCTResponseSenderBlock)onCancel) {
|
|
46
|
+
|
|
47
|
+
dispatch_async(dispatch_get_main_queue(), ^{
|
|
48
|
+
_editImagePath = [props objectForKey: @"path"];
|
|
49
|
+
|
|
50
|
+
_onDoneEditing = onDone;
|
|
51
|
+
_onCancelEditing = onCancel;
|
|
52
|
+
|
|
53
|
+
PhotoEditorViewController *photoEditor = [[PhotoEditorViewController alloc] initWithNibName:@"PhotoEditorViewController" bundle: [NSBundle bundleForClass:[PhotoEditorViewController class]]];
|
|
54
|
+
// set language
|
|
55
|
+
NSDictionary *languages = [props objectForKey: @"languages"];
|
|
56
|
+
[[TranslationService shared] initTranslations:languages];
|
|
57
|
+
|
|
58
|
+
// Process Image for Editing
|
|
59
|
+
UIImage *image = [UIImage imageWithContentsOfFile:_editImagePath];
|
|
60
|
+
if (image == nil) {
|
|
61
|
+
NSURL *url = [NSURL URLWithString:_editImagePath];
|
|
62
|
+
NSData *data = [NSData dataWithContentsOfURL:url];
|
|
63
|
+
|
|
64
|
+
image = [UIImage imageWithData:data];
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
photoEditor.image = image;
|
|
68
|
+
|
|
69
|
+
// Process Stickers
|
|
70
|
+
NSArray *stickers = [props objectForKey: @"stickers"];
|
|
71
|
+
NSMutableArray *imageStickers = [[NSMutableArray alloc] initWithCapacity:stickers.count];
|
|
72
|
+
|
|
73
|
+
for (NSString *sticker in stickers) {
|
|
74
|
+
[imageStickers addObject: [UIImage imageNamed: sticker]];
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
photoEditor.stickers = imageStickers;
|
|
78
|
+
|
|
79
|
+
//Process Controls
|
|
80
|
+
NSArray *hiddenControls = [props objectForKey: @"hiddenControls"];
|
|
81
|
+
NSMutableArray *passHiddenControls = [[NSMutableArray alloc] initWithCapacity:hiddenControls.count];
|
|
82
|
+
|
|
83
|
+
for (NSString *hiddenControl in hiddenControls) {
|
|
84
|
+
[passHiddenControls addObject: [[NSString alloc] initWithString: hiddenControl]];
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
photoEditor.hiddenControls = passHiddenControls;
|
|
88
|
+
|
|
89
|
+
//Process Colors
|
|
90
|
+
NSArray *colors = [props objectForKey: @"colors"];
|
|
91
|
+
NSMutableArray *passColors = [[NSMutableArray alloc] initWithCapacity:colors.count];
|
|
92
|
+
|
|
93
|
+
for (NSString *color in colors) {
|
|
94
|
+
[passColors addObject: [self colorWithHexString: color]];
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
photoEditor.colors = passColors;
|
|
98
|
+
|
|
99
|
+
// Invoke Editor
|
|
100
|
+
photoEditor.photoEditorDelegate = self;
|
|
101
|
+
|
|
102
|
+
// The default modal presenting is page sheet in ios 13, not full screen
|
|
103
|
+
if (@available(iOS 13, *)) {
|
|
104
|
+
[photoEditor setModalPresentationStyle: UIModalPresentationFullScreen];
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
id<UIApplicationDelegate> app = [[UIApplication sharedApplication] delegate];
|
|
108
|
+
UINavigationController *rootViewController = ((UINavigationController*) app.window.rootViewController);
|
|
109
|
+
|
|
110
|
+
if (rootViewController.presentedViewController) {
|
|
111
|
+
[rootViewController.presentedViewController presentViewController:photoEditor animated:YES completion:nil];
|
|
112
|
+
return;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
[rootViewController presentViewController:photoEditor animated:YES completion:nil];
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
- (CGFloat) colorComponentFrom: (NSString *) string start: (NSUInteger) start length: (NSUInteger) length {
|
|
121
|
+
NSString *substring = [string substringWithRange: NSMakeRange(start, length)];
|
|
122
|
+
NSString *fullHex = length == 2 ? substring : [NSString stringWithFormat: @"%@%@", substring, substring];
|
|
123
|
+
unsigned hexComponent;
|
|
124
|
+
[[NSScanner scannerWithString: fullHex] scanHexInt: &hexComponent];
|
|
125
|
+
return hexComponent / 255.0;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
- (UIColor *) colorWithHexString: (NSString *) hexString {
|
|
129
|
+
NSString *colorString = [[hexString stringByReplacingOccurrencesOfString: @"#" withString: @""] uppercaseString];
|
|
130
|
+
CGFloat alpha, red, blue, green;
|
|
131
|
+
switch ([colorString length]) {
|
|
132
|
+
case 3: // #RGB
|
|
133
|
+
alpha = 1.0f;
|
|
134
|
+
red = [self colorComponentFrom: colorString start: 0 length: 1];
|
|
135
|
+
green = [self colorComponentFrom: colorString start: 1 length: 1];
|
|
136
|
+
blue = [self colorComponentFrom: colorString start: 2 length: 1];
|
|
137
|
+
break;
|
|
138
|
+
case 4: // #ARGB
|
|
139
|
+
alpha = [self colorComponentFrom: colorString start: 0 length: 1];
|
|
140
|
+
red = [self colorComponentFrom: colorString start: 1 length: 1];
|
|
141
|
+
green = [self colorComponentFrom: colorString start: 2 length: 1];
|
|
142
|
+
blue = [self colorComponentFrom: colorString start: 3 length: 1];
|
|
143
|
+
break;
|
|
144
|
+
case 6: // #RRGGBB
|
|
145
|
+
alpha = 1.0f;
|
|
146
|
+
red = [self colorComponentFrom: colorString start: 0 length: 2];
|
|
147
|
+
green = [self colorComponentFrom: colorString start: 2 length: 2];
|
|
148
|
+
blue = [self colorComponentFrom: colorString start: 4 length: 2];
|
|
149
|
+
break;
|
|
150
|
+
case 8: // #AARRGGBB
|
|
151
|
+
alpha = [self colorComponentFrom: colorString start: 0 length: 2];
|
|
152
|
+
red = [self colorComponentFrom: colorString start: 2 length: 2];
|
|
153
|
+
green = [self colorComponentFrom: colorString start: 4 length: 2];
|
|
154
|
+
blue = [self colorComponentFrom: colorString start: 6 length: 2];
|
|
155
|
+
break;
|
|
156
|
+
default:
|
|
157
|
+
return nil;
|
|
158
|
+
}
|
|
159
|
+
return [UIColor colorWithRed: red green: green blue: blue alpha: alpha];
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
|
|
163
|
+
@end
|
|
@@ -0,0 +1,362 @@
|
|
|
1
|
+
// !$*UTF8*$!
|
|
2
|
+
{
|
|
3
|
+
archiveVersion = 1;
|
|
4
|
+
classes = {
|
|
5
|
+
};
|
|
6
|
+
objectVersion = 46;
|
|
7
|
+
objects = {
|
|
8
|
+
|
|
9
|
+
/* Begin PBXBuildFile section */
|
|
10
|
+
40137CF49C59930DA23C79A9 /* Pods_RNPhotoEditor.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 96DD4AC0F5A94CE9A56A7D23 /* Pods_RNPhotoEditor.framework */; };
|
|
11
|
+
B3E7B58A1CC2AC0600A0062D /* RNPhotoEditor.m in Sources */ = {isa = PBXBuildFile; fileRef = B3E7B5891CC2AC0600A0062D /* RNPhotoEditor.m */; };
|
|
12
|
+
CEA2B04A2144EDA200D21235 /* iOSPhotoEditor.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CEA2B0472144EDA000D21235 /* iOSPhotoEditor.framework */; };
|
|
13
|
+
/* End PBXBuildFile section */
|
|
14
|
+
|
|
15
|
+
/* Begin PBXContainerItemProxy section */
|
|
16
|
+
CEA2B0462144EDA000D21235 /* PBXContainerItemProxy */ = {
|
|
17
|
+
isa = PBXContainerItemProxy;
|
|
18
|
+
containerPortal = CEA2B0412144ED9F00D21235 /* Pods.xcodeproj */;
|
|
19
|
+
proxyType = 2;
|
|
20
|
+
remoteGlobalIDString = 3953F4E53224764A2EFC804C7A5E45C0;
|
|
21
|
+
remoteInfo = iOSPhotoEditor;
|
|
22
|
+
};
|
|
23
|
+
CEA2B0482144EDA000D21235 /* PBXContainerItemProxy */ = {
|
|
24
|
+
isa = PBXContainerItemProxy;
|
|
25
|
+
containerPortal = CEA2B0412144ED9F00D21235 /* Pods.xcodeproj */;
|
|
26
|
+
proxyType = 2;
|
|
27
|
+
remoteGlobalIDString = C0D0AA7B71413A07FD24B6841A79DC55;
|
|
28
|
+
remoteInfo = "Pods-RNPhotoEditor";
|
|
29
|
+
};
|
|
30
|
+
/* End PBXContainerItemProxy section */
|
|
31
|
+
|
|
32
|
+
/* Begin PBXCopyFilesBuildPhase section */
|
|
33
|
+
58B511D91A9E6C8500147676 /* CopyFiles */ = {
|
|
34
|
+
isa = PBXCopyFilesBuildPhase;
|
|
35
|
+
buildActionMask = 2147483647;
|
|
36
|
+
dstPath = "include/$(PRODUCT_NAME)";
|
|
37
|
+
dstSubfolderSpec = 16;
|
|
38
|
+
files = (
|
|
39
|
+
);
|
|
40
|
+
runOnlyForDeploymentPostprocessing = 0;
|
|
41
|
+
};
|
|
42
|
+
/* End PBXCopyFilesBuildPhase section */
|
|
43
|
+
|
|
44
|
+
/* Begin PBXFileReference section */
|
|
45
|
+
05DA841703B4CCFEE54B14CD /* Pods-RNPhotoEditor.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RNPhotoEditor.debug.xcconfig"; path = "Pods/Target Support Files/Pods-RNPhotoEditor/Pods-RNPhotoEditor.debug.xcconfig"; sourceTree = "<group>"; };
|
|
46
|
+
134814201AA4EA6300B7C361 /* libRNPhotoEditor.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libRNPhotoEditor.a; sourceTree = BUILT_PRODUCTS_DIR; };
|
|
47
|
+
4715A5625794BA3A83A872C5 /* Pods-RNPhotoEditor.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RNPhotoEditor.release.xcconfig"; path = "Pods/Target Support Files/Pods-RNPhotoEditor/Pods-RNPhotoEditor.release.xcconfig"; sourceTree = "<group>"; };
|
|
48
|
+
96DD4AC0F5A94CE9A56A7D23 /* Pods_RNPhotoEditor.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_RNPhotoEditor.framework; sourceTree = BUILT_PRODUCTS_DIR; };
|
|
49
|
+
B3E7B5881CC2AC0600A0062D /* RNPhotoEditor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RNPhotoEditor.h; sourceTree = "<group>"; };
|
|
50
|
+
B3E7B5891CC2AC0600A0062D /* RNPhotoEditor.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RNPhotoEditor.m; sourceTree = "<group>"; };
|
|
51
|
+
CEA2B0412144ED9F00D21235 /* Pods.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = Pods.xcodeproj; path = Pods/Pods.xcodeproj; sourceTree = "<group>"; };
|
|
52
|
+
/* End PBXFileReference section */
|
|
53
|
+
|
|
54
|
+
/* Begin PBXFrameworksBuildPhase section */
|
|
55
|
+
58B511D81A9E6C8500147676 /* Frameworks */ = {
|
|
56
|
+
isa = PBXFrameworksBuildPhase;
|
|
57
|
+
buildActionMask = 2147483647;
|
|
58
|
+
files = (
|
|
59
|
+
CEA2B04A2144EDA200D21235 /* iOSPhotoEditor.framework in Frameworks */,
|
|
60
|
+
40137CF49C59930DA23C79A9 /* Pods_RNPhotoEditor.framework in Frameworks */,
|
|
61
|
+
);
|
|
62
|
+
runOnlyForDeploymentPostprocessing = 0;
|
|
63
|
+
};
|
|
64
|
+
/* End PBXFrameworksBuildPhase section */
|
|
65
|
+
|
|
66
|
+
/* Begin PBXGroup section */
|
|
67
|
+
134814211AA4EA7D00B7C361 /* Products */ = {
|
|
68
|
+
isa = PBXGroup;
|
|
69
|
+
children = (
|
|
70
|
+
134814201AA4EA6300B7C361 /* libRNPhotoEditor.a */,
|
|
71
|
+
);
|
|
72
|
+
name = Products;
|
|
73
|
+
sourceTree = "<group>";
|
|
74
|
+
};
|
|
75
|
+
58B511D21A9E6C8500147676 = {
|
|
76
|
+
isa = PBXGroup;
|
|
77
|
+
children = (
|
|
78
|
+
B3E7B5881CC2AC0600A0062D /* RNPhotoEditor.h */,
|
|
79
|
+
B3E7B5891CC2AC0600A0062D /* RNPhotoEditor.m */,
|
|
80
|
+
134814211AA4EA7D00B7C361 /* Products */,
|
|
81
|
+
E6FAD135F551FA36DB423079 /* Pods */,
|
|
82
|
+
956042663EE01F6152091375 /* Frameworks */,
|
|
83
|
+
);
|
|
84
|
+
sourceTree = "<group>";
|
|
85
|
+
};
|
|
86
|
+
956042663EE01F6152091375 /* Frameworks */ = {
|
|
87
|
+
isa = PBXGroup;
|
|
88
|
+
children = (
|
|
89
|
+
CEA2B0412144ED9F00D21235 /* Pods.xcodeproj */,
|
|
90
|
+
96DD4AC0F5A94CE9A56A7D23 /* Pods_RNPhotoEditor.framework */,
|
|
91
|
+
);
|
|
92
|
+
name = Frameworks;
|
|
93
|
+
sourceTree = "<group>";
|
|
94
|
+
};
|
|
95
|
+
CEA2B0422144ED9F00D21235 /* Products */ = {
|
|
96
|
+
isa = PBXGroup;
|
|
97
|
+
children = (
|
|
98
|
+
CEA2B0472144EDA000D21235 /* iOSPhotoEditor.framework */,
|
|
99
|
+
CEA2B0492144EDA000D21235 /* Pods_RNPhotoEditor.framework */,
|
|
100
|
+
);
|
|
101
|
+
name = Products;
|
|
102
|
+
sourceTree = "<group>";
|
|
103
|
+
};
|
|
104
|
+
E6FAD135F551FA36DB423079 /* Pods */ = {
|
|
105
|
+
isa = PBXGroup;
|
|
106
|
+
children = (
|
|
107
|
+
05DA841703B4CCFEE54B14CD /* Pods-RNPhotoEditor.debug.xcconfig */,
|
|
108
|
+
4715A5625794BA3A83A872C5 /* Pods-RNPhotoEditor.release.xcconfig */,
|
|
109
|
+
);
|
|
110
|
+
name = Pods;
|
|
111
|
+
sourceTree = "<group>";
|
|
112
|
+
};
|
|
113
|
+
/* End PBXGroup section */
|
|
114
|
+
|
|
115
|
+
/* Begin PBXNativeTarget section */
|
|
116
|
+
58B511DA1A9E6C8500147676 /* RNPhotoEditor */ = {
|
|
117
|
+
isa = PBXNativeTarget;
|
|
118
|
+
buildConfigurationList = 58B511EF1A9E6C8500147676 /* Build configuration list for PBXNativeTarget "RNPhotoEditor" */;
|
|
119
|
+
buildPhases = (
|
|
120
|
+
663DC7DF621CC8E1AD213107 /* [CP] Check Pods Manifest.lock */,
|
|
121
|
+
58B511D71A9E6C8500147676 /* Sources */,
|
|
122
|
+
58B511D81A9E6C8500147676 /* Frameworks */,
|
|
123
|
+
58B511D91A9E6C8500147676 /* CopyFiles */,
|
|
124
|
+
);
|
|
125
|
+
buildRules = (
|
|
126
|
+
);
|
|
127
|
+
dependencies = (
|
|
128
|
+
);
|
|
129
|
+
name = RNPhotoEditor;
|
|
130
|
+
productName = RCTDataManager;
|
|
131
|
+
productReference = 134814201AA4EA6300B7C361 /* libRNPhotoEditor.a */;
|
|
132
|
+
productType = "com.apple.product-type.library.static";
|
|
133
|
+
};
|
|
134
|
+
/* End PBXNativeTarget section */
|
|
135
|
+
|
|
136
|
+
/* Begin PBXProject section */
|
|
137
|
+
58B511D31A9E6C8500147676 /* Project object */ = {
|
|
138
|
+
isa = PBXProject;
|
|
139
|
+
attributes = {
|
|
140
|
+
LastUpgradeCheck = 0830;
|
|
141
|
+
ORGANIZATIONNAME = Facebook;
|
|
142
|
+
TargetAttributes = {
|
|
143
|
+
58B511DA1A9E6C8500147676 = {
|
|
144
|
+
CreatedOnToolsVersion = 6.1.1;
|
|
145
|
+
};
|
|
146
|
+
};
|
|
147
|
+
};
|
|
148
|
+
buildConfigurationList = 58B511D61A9E6C8500147676 /* Build configuration list for PBXProject "RNPhotoEditor" */;
|
|
149
|
+
compatibilityVersion = "Xcode 3.2";
|
|
150
|
+
developmentRegion = English;
|
|
151
|
+
hasScannedForEncodings = 0;
|
|
152
|
+
knownRegions = (
|
|
153
|
+
en,
|
|
154
|
+
);
|
|
155
|
+
mainGroup = 58B511D21A9E6C8500147676;
|
|
156
|
+
productRefGroup = 58B511D21A9E6C8500147676;
|
|
157
|
+
projectDirPath = "";
|
|
158
|
+
projectReferences = (
|
|
159
|
+
{
|
|
160
|
+
ProductGroup = CEA2B0422144ED9F00D21235 /* Products */;
|
|
161
|
+
ProjectRef = CEA2B0412144ED9F00D21235 /* Pods.xcodeproj */;
|
|
162
|
+
},
|
|
163
|
+
);
|
|
164
|
+
projectRoot = "";
|
|
165
|
+
targets = (
|
|
166
|
+
58B511DA1A9E6C8500147676 /* RNPhotoEditor */,
|
|
167
|
+
);
|
|
168
|
+
};
|
|
169
|
+
/* End PBXProject section */
|
|
170
|
+
|
|
171
|
+
/* Begin PBXReferenceProxy section */
|
|
172
|
+
CEA2B0472144EDA000D21235 /* iOSPhotoEditor.framework */ = {
|
|
173
|
+
isa = PBXReferenceProxy;
|
|
174
|
+
fileType = wrapper.framework;
|
|
175
|
+
path = iOSPhotoEditor.framework;
|
|
176
|
+
remoteRef = CEA2B0462144EDA000D21235 /* PBXContainerItemProxy */;
|
|
177
|
+
sourceTree = BUILT_PRODUCTS_DIR;
|
|
178
|
+
};
|
|
179
|
+
CEA2B0492144EDA000D21235 /* Pods_RNPhotoEditor.framework */ = {
|
|
180
|
+
isa = PBXReferenceProxy;
|
|
181
|
+
fileType = wrapper.framework;
|
|
182
|
+
path = Pods_RNPhotoEditor.framework;
|
|
183
|
+
remoteRef = CEA2B0482144EDA000D21235 /* PBXContainerItemProxy */;
|
|
184
|
+
sourceTree = BUILT_PRODUCTS_DIR;
|
|
185
|
+
};
|
|
186
|
+
/* End PBXReferenceProxy section */
|
|
187
|
+
|
|
188
|
+
/* Begin PBXShellScriptBuildPhase section */
|
|
189
|
+
663DC7DF621CC8E1AD213107 /* [CP] Check Pods Manifest.lock */ = {
|
|
190
|
+
isa = PBXShellScriptBuildPhase;
|
|
191
|
+
buildActionMask = 2147483647;
|
|
192
|
+
files = (
|
|
193
|
+
);
|
|
194
|
+
inputPaths = (
|
|
195
|
+
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
|
|
196
|
+
"${PODS_ROOT}/Manifest.lock",
|
|
197
|
+
);
|
|
198
|
+
name = "[CP] Check Pods Manifest.lock";
|
|
199
|
+
outputPaths = (
|
|
200
|
+
"$(DERIVED_FILE_DIR)/Pods-RNPhotoEditor-checkManifestLockResult.txt",
|
|
201
|
+
);
|
|
202
|
+
runOnlyForDeploymentPostprocessing = 0;
|
|
203
|
+
shellPath = /bin/sh;
|
|
204
|
+
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
|
|
205
|
+
showEnvVarsInLog = 0;
|
|
206
|
+
};
|
|
207
|
+
/* End PBXShellScriptBuildPhase section */
|
|
208
|
+
|
|
209
|
+
/* Begin PBXSourcesBuildPhase section */
|
|
210
|
+
58B511D71A9E6C8500147676 /* Sources */ = {
|
|
211
|
+
isa = PBXSourcesBuildPhase;
|
|
212
|
+
buildActionMask = 2147483647;
|
|
213
|
+
files = (
|
|
214
|
+
B3E7B58A1CC2AC0600A0062D /* RNPhotoEditor.m in Sources */,
|
|
215
|
+
);
|
|
216
|
+
runOnlyForDeploymentPostprocessing = 0;
|
|
217
|
+
};
|
|
218
|
+
/* End PBXSourcesBuildPhase section */
|
|
219
|
+
|
|
220
|
+
/* Begin XCBuildConfiguration section */
|
|
221
|
+
58B511ED1A9E6C8500147676 /* Debug */ = {
|
|
222
|
+
isa = XCBuildConfiguration;
|
|
223
|
+
buildSettings = {
|
|
224
|
+
ALWAYS_SEARCH_USER_PATHS = NO;
|
|
225
|
+
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
|
|
226
|
+
CLANG_CXX_LIBRARY = "libc++";
|
|
227
|
+
CLANG_ENABLE_MODULES = YES;
|
|
228
|
+
CLANG_ENABLE_OBJC_ARC = YES;
|
|
229
|
+
CLANG_WARN_BOOL_CONVERSION = YES;
|
|
230
|
+
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
|
231
|
+
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
|
232
|
+
CLANG_WARN_EMPTY_BODY = YES;
|
|
233
|
+
CLANG_WARN_ENUM_CONVERSION = YES;
|
|
234
|
+
CLANG_WARN_INFINITE_RECURSION = YES;
|
|
235
|
+
CLANG_WARN_INT_CONVERSION = YES;
|
|
236
|
+
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
|
237
|
+
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
|
238
|
+
CLANG_WARN_UNREACHABLE_CODE = YES;
|
|
239
|
+
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
|
240
|
+
COPY_PHASE_STRIP = NO;
|
|
241
|
+
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
|
242
|
+
ENABLE_TESTABILITY = YES;
|
|
243
|
+
GCC_C_LANGUAGE_STANDARD = gnu99;
|
|
244
|
+
GCC_DYNAMIC_NO_PIC = NO;
|
|
245
|
+
GCC_NO_COMMON_BLOCKS = YES;
|
|
246
|
+
GCC_OPTIMIZATION_LEVEL = 0;
|
|
247
|
+
GCC_PREPROCESSOR_DEFINITIONS = (
|
|
248
|
+
"DEBUG=1",
|
|
249
|
+
"$(inherited)",
|
|
250
|
+
);
|
|
251
|
+
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
|
|
252
|
+
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
|
253
|
+
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
|
|
254
|
+
GCC_WARN_UNDECLARED_SELECTOR = YES;
|
|
255
|
+
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
|
256
|
+
GCC_WARN_UNUSED_FUNCTION = YES;
|
|
257
|
+
GCC_WARN_UNUSED_VARIABLE = YES;
|
|
258
|
+
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
|
|
259
|
+
MTL_ENABLE_DEBUG_INFO = YES;
|
|
260
|
+
ONLY_ACTIVE_ARCH = YES;
|
|
261
|
+
SDKROOT = iphoneos;
|
|
262
|
+
};
|
|
263
|
+
name = Debug;
|
|
264
|
+
};
|
|
265
|
+
58B511EE1A9E6C8500147676 /* Release */ = {
|
|
266
|
+
isa = XCBuildConfiguration;
|
|
267
|
+
buildSettings = {
|
|
268
|
+
ALWAYS_SEARCH_USER_PATHS = NO;
|
|
269
|
+
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
|
|
270
|
+
CLANG_CXX_LIBRARY = "libc++";
|
|
271
|
+
CLANG_ENABLE_MODULES = YES;
|
|
272
|
+
CLANG_ENABLE_OBJC_ARC = YES;
|
|
273
|
+
CLANG_WARN_BOOL_CONVERSION = YES;
|
|
274
|
+
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
|
275
|
+
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
|
276
|
+
CLANG_WARN_EMPTY_BODY = YES;
|
|
277
|
+
CLANG_WARN_ENUM_CONVERSION = YES;
|
|
278
|
+
CLANG_WARN_INFINITE_RECURSION = YES;
|
|
279
|
+
CLANG_WARN_INT_CONVERSION = YES;
|
|
280
|
+
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
|
281
|
+
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
|
282
|
+
CLANG_WARN_UNREACHABLE_CODE = YES;
|
|
283
|
+
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
|
284
|
+
COPY_PHASE_STRIP = YES;
|
|
285
|
+
ENABLE_NS_ASSERTIONS = NO;
|
|
286
|
+
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
|
287
|
+
GCC_C_LANGUAGE_STANDARD = gnu99;
|
|
288
|
+
GCC_NO_COMMON_BLOCKS = YES;
|
|
289
|
+
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
|
290
|
+
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
|
|
291
|
+
GCC_WARN_UNDECLARED_SELECTOR = YES;
|
|
292
|
+
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
|
293
|
+
GCC_WARN_UNUSED_FUNCTION = YES;
|
|
294
|
+
GCC_WARN_UNUSED_VARIABLE = YES;
|
|
295
|
+
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
|
|
296
|
+
MTL_ENABLE_DEBUG_INFO = NO;
|
|
297
|
+
SDKROOT = iphoneos;
|
|
298
|
+
VALIDATE_PRODUCT = YES;
|
|
299
|
+
};
|
|
300
|
+
name = Release;
|
|
301
|
+
};
|
|
302
|
+
58B511F01A9E6C8500147676 /* Debug */ = {
|
|
303
|
+
isa = XCBuildConfiguration;
|
|
304
|
+
baseConfigurationReference = 05DA841703B4CCFEE54B14CD /* Pods-RNPhotoEditor.debug.xcconfig */;
|
|
305
|
+
buildSettings = {
|
|
306
|
+
HEADER_SEARCH_PATHS = (
|
|
307
|
+
"$(inherited)",
|
|
308
|
+
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,
|
|
309
|
+
"$(SRCROOT)/../../../React/**",
|
|
310
|
+
"$(SRCROOT)/../../react-native/React/**",
|
|
311
|
+
);
|
|
312
|
+
LIBRARY_SEARCH_PATHS = "$(inherited)";
|
|
313
|
+
OTHER_LDFLAGS = "-ObjC";
|
|
314
|
+
PRODUCT_NAME = RNPhotoEditor;
|
|
315
|
+
SKIP_INSTALL = YES;
|
|
316
|
+
SWIFT_VERSION = 4.2;
|
|
317
|
+
};
|
|
318
|
+
name = Debug;
|
|
319
|
+
};
|
|
320
|
+
58B511F11A9E6C8500147676 /* Release */ = {
|
|
321
|
+
isa = XCBuildConfiguration;
|
|
322
|
+
baseConfigurationReference = 4715A5625794BA3A83A872C5 /* Pods-RNPhotoEditor.release.xcconfig */;
|
|
323
|
+
buildSettings = {
|
|
324
|
+
HEADER_SEARCH_PATHS = (
|
|
325
|
+
"$(inherited)",
|
|
326
|
+
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,
|
|
327
|
+
"$(SRCROOT)/../../../React/**",
|
|
328
|
+
"$(SRCROOT)/../../react-native/React/**",
|
|
329
|
+
);
|
|
330
|
+
LIBRARY_SEARCH_PATHS = "$(inherited)";
|
|
331
|
+
OTHER_LDFLAGS = "-ObjC";
|
|
332
|
+
PRODUCT_NAME = RNPhotoEditor;
|
|
333
|
+
SKIP_INSTALL = YES;
|
|
334
|
+
SWIFT_VERSION = 4.2;
|
|
335
|
+
};
|
|
336
|
+
name = Release;
|
|
337
|
+
};
|
|
338
|
+
/* End XCBuildConfiguration section */
|
|
339
|
+
|
|
340
|
+
/* Begin XCConfigurationList section */
|
|
341
|
+
58B511D61A9E6C8500147676 /* Build configuration list for PBXProject "RNPhotoEditor" */ = {
|
|
342
|
+
isa = XCConfigurationList;
|
|
343
|
+
buildConfigurations = (
|
|
344
|
+
58B511ED1A9E6C8500147676 /* Debug */,
|
|
345
|
+
58B511EE1A9E6C8500147676 /* Release */,
|
|
346
|
+
);
|
|
347
|
+
defaultConfigurationIsVisible = 0;
|
|
348
|
+
defaultConfigurationName = Release;
|
|
349
|
+
};
|
|
350
|
+
58B511EF1A9E6C8500147676 /* Build configuration list for PBXNativeTarget "RNPhotoEditor" */ = {
|
|
351
|
+
isa = XCConfigurationList;
|
|
352
|
+
buildConfigurations = (
|
|
353
|
+
58B511F01A9E6C8500147676 /* Debug */,
|
|
354
|
+
58B511F11A9E6C8500147676 /* Release */,
|
|
355
|
+
);
|
|
356
|
+
defaultConfigurationIsVisible = 0;
|
|
357
|
+
defaultConfigurationName = Release;
|
|
358
|
+
};
|
|
359
|
+
/* End XCConfigurationList section */
|
|
360
|
+
};
|
|
361
|
+
rootObject = 58B511D31A9E6C8500147676 /* Project object */;
|
|
362
|
+
}
|
package/lib/index.d.ts
ADDED
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Localization strings for the image editor UI.
|
|
3
|
+
*/
|
|
4
|
+
export interface ImageEditorLanguage {
|
|
5
|
+
/** Title for the "Done" button */
|
|
6
|
+
doneTitle?: string;
|
|
7
|
+
/** Title for the "Save" button */
|
|
8
|
+
saveTitle?: string;
|
|
9
|
+
/** Title for the "Clear All" button */
|
|
10
|
+
clearAllTitle?: string;
|
|
11
|
+
/** Title for the "Camera" option */
|
|
12
|
+
cameraTitle?: string;
|
|
13
|
+
/** Title for the "Gallery" option */
|
|
14
|
+
galleryTitle?: string;
|
|
15
|
+
/** Title for the upload dialog */
|
|
16
|
+
uploadDialogTitle?: string;
|
|
17
|
+
/** Title for the upload picker */
|
|
18
|
+
uploadPickerTitle?: string;
|
|
19
|
+
/** Message shown when directory creation fails */
|
|
20
|
+
directoryCreateFail?: string;
|
|
21
|
+
/** Message requesting media access permissions */
|
|
22
|
+
accessMediaPermissionsMsg?: string;
|
|
23
|
+
/** Label for the "Continue" button */
|
|
24
|
+
continueTxt?: string;
|
|
25
|
+
/** Label for the "Not Now" button */
|
|
26
|
+
notNow?: string;
|
|
27
|
+
/** Message shown when media access is denied */
|
|
28
|
+
mediaAccessDeniedMsg?: string;
|
|
29
|
+
/** Message shown when image save succeeds */
|
|
30
|
+
saveImageSucceed?: string;
|
|
31
|
+
/** Title for the "Eraser" tool */
|
|
32
|
+
eraserTitle?: string;
|
|
33
|
+
}
|
|
34
|
+
/** Editor control types that can be shown or hidden. */
|
|
35
|
+
export type EditorControl = 'text' | 'clear' | 'draw' | 'save' | 'share' | 'sticker' | 'crop';
|
|
36
|
+
/**
|
|
37
|
+
* Configuration options for the image editor.
|
|
38
|
+
*/
|
|
39
|
+
export interface ImageEditorConfig {
|
|
40
|
+
/** Path to the image file to edit (required). */
|
|
41
|
+
path: string;
|
|
42
|
+
/**
|
|
43
|
+
* Array of hex color strings available for drawing and text.
|
|
44
|
+
* @default ['#000000', '#808080', '#a9a9a9', '#FFFFFE', '#0000ff', '#00ff00', '#ff0000', '#ffff00', '#ffa500', '#800080', '#00ffff', '#a52a2a', '#ff00ff']
|
|
45
|
+
*/
|
|
46
|
+
colors?: string[];
|
|
47
|
+
/**
|
|
48
|
+
* Array of sticker image names to show in the sticker picker.
|
|
49
|
+
* Images must be added to native project resources.
|
|
50
|
+
* - iOS: Add to Resources folder
|
|
51
|
+
* - Android: Add to drawable folder
|
|
52
|
+
* @default []
|
|
53
|
+
*/
|
|
54
|
+
stickers?: string[];
|
|
55
|
+
/**
|
|
56
|
+
* Array of editor controls to hide.
|
|
57
|
+
* @default []
|
|
58
|
+
*/
|
|
59
|
+
hiddenControls?: EditorControl[];
|
|
60
|
+
/**
|
|
61
|
+
* Localization strings for the editor UI.
|
|
62
|
+
*/
|
|
63
|
+
languages?: ImageEditorLanguage;
|
|
64
|
+
/**
|
|
65
|
+
* Callback invoked when editing is complete.
|
|
66
|
+
* @param imagePath - The path to the edited image file.
|
|
67
|
+
*/
|
|
68
|
+
onDone?: (imagePath: string) => void;
|
|
69
|
+
/**
|
|
70
|
+
* Callback invoked when editing is cancelled.
|
|
71
|
+
* @param resultCode - The native result code.
|
|
72
|
+
*/
|
|
73
|
+
onCancel?: (resultCode: number) => void;
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* React Native Image Editor - Native photo editing bridge for iOS and Android.
|
|
77
|
+
*
|
|
78
|
+
* @example
|
|
79
|
+
* ```ts
|
|
80
|
+
* import { ImageEditor } from '@phucprime/react-native-image-editor';
|
|
81
|
+
*
|
|
82
|
+
* // Callback-based usage
|
|
83
|
+
* ImageEditor.open({
|
|
84
|
+
* path: '/path/to/image.jpg',
|
|
85
|
+
* onDone: (editedPath) => console.log('Edited:', editedPath),
|
|
86
|
+
* onCancel: () => console.log('Cancelled'),
|
|
87
|
+
* });
|
|
88
|
+
*
|
|
89
|
+
* // Promise-based usage
|
|
90
|
+
* const editedPath = await ImageEditor.edit('/path/to/image.jpg', {
|
|
91
|
+
* colors: ['#ff0000', '#00ff00', '#0000ff'],
|
|
92
|
+
* });
|
|
93
|
+
* ```
|
|
94
|
+
*/
|
|
95
|
+
declare class ImageEditor {
|
|
96
|
+
/**
|
|
97
|
+
* Open the image editor with callback-based API.
|
|
98
|
+
*
|
|
99
|
+
* @param config - Editor configuration options.
|
|
100
|
+
*/
|
|
101
|
+
static open(config: ImageEditorConfig): void;
|
|
102
|
+
/**
|
|
103
|
+
* Edit an image and return a promise with the edited image path.
|
|
104
|
+
*
|
|
105
|
+
* @param path - Path to the image file to edit.
|
|
106
|
+
* @param options - Optional editor configuration (excluding path, onDone, onCancel).
|
|
107
|
+
* @returns Promise that resolves with the edited image path, or rejects if cancelled.
|
|
108
|
+
*/
|
|
109
|
+
static edit(path: string, options?: Omit<ImageEditorConfig, 'path' | 'onDone' | 'onCancel'>): Promise<string>;
|
|
110
|
+
/**
|
|
111
|
+
* @deprecated Use `ImageEditor.open()` instead. This method is kept for backward compatibility.
|
|
112
|
+
*/
|
|
113
|
+
static Edit(config: ImageEditorConfig): void;
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* @deprecated Use `ImageEditor` instead. `PhotoEditor` is an alias kept for backward compatibility.
|
|
117
|
+
*/
|
|
118
|
+
declare const PhotoEditor: typeof ImageEditor;
|
|
119
|
+
export { ImageEditor, PhotoEditor };
|
|
120
|
+
export default ImageEditor;
|
|
121
|
+
/** @deprecated Use `ImageEditorConfig` instead. */
|
|
122
|
+
export type PhotoEditorProps = ImageEditorConfig;
|
|
123
|
+
/** @deprecated Use `ImageEditorLanguage` instead. */
|
|
124
|
+
export type Language = ImageEditorLanguage;
|
|
125
|
+
//# sourceMappingURL=index.d.ts.map
|