Skip to content

Commit 97dfb49

Browse files
committed
tsc build added.
1 parent 09fcca7 commit 97dfb49

10 files changed

Lines changed: 6098 additions & 45 deletions

File tree

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 1.0.4
2+
3+
- Typescript module declarations improved and Pod Errors fixed.
4+
15
## 1.0.3
26

37
- Errors fixed.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525

2626
1. Open up `android/app/src/main/java/[...]/MainActivity.java`
2727

28-
- Add `import com.reactnativeimagemanipulator.RNImageManipulatorPackage;` to the imports at the top of the file
28+
- Add `import com.oguzhnatly.rnimagemanipulator.RNImageManipulatorPackage;` to the imports at the top of the file
2929
- Add `new RNImageManipulatorPackage()` to the list returned by the `getPackages()` method
3030

3131
2. Append the following lines to `android/settings.gradle`:
Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1 @@
1-
2-
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3-
package="com.reactnativeimagemanipulator">
4-
5-
</manifest>
1+
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.oguzhnatly.rnimagemanipulator"></manifest>

android/src/main/java/com/reactnativeimagemanipulator/RNImageManipulatorModule.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.reactnativeimagemanipulator;
1+
package com.oguzhnatly.rnimagemanipulator;
22

33
import android.graphics.Bitmap;
44
import android.graphics.Matrix;

android/src/main/java/com/reactnativeimagemanipulator/RNImageManipulatorPackage.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
package com.reactnativeimagemanipulator;
2+
package com.oguzhnatly.rnimagemanipulator;
33

44
import java.util.Arrays;
55
import java.util.Collections;

index.d.ts

Lines changed: 22 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,23 @@
1-
declare module '@oguzhnatly/react-native-image-manipulator' {
2-
import React from 'react';
3-
import RNImageManipulator from './index';
4-
5-
export type ImageResult = {
6-
uri: string;
7-
width: number;
8-
height: number;
9-
base64?: string;
1+
import {RNImageManipulatorResult} from './index';
2+
3+
export declare type ImageResult = RNImageManipulatorResult;
4+
5+
export declare function manipulate(
6+
uri: string,
7+
actions: Array<{
8+
resize?: {width?: number; height?: number};
9+
rotate?: number;
10+
flip?: {vertical?: boolean; horizontal?: boolean};
11+
crop?: {
12+
originX?: number;
13+
originY?: number;
14+
width?: number;
15+
height?: number;
1016
};
11-
12-
export function manipulate(
13-
uri: string,
14-
actions: Array<{
15-
resize?: {width?: number; height?: number};
16-
rotate?: number;
17-
flip?: {vertical?: boolean; horizontal?: boolean};
18-
crop?: {
19-
originX?: number;
20-
originY?: number;
21-
width?: number;
22-
height?: number;
23-
};
24-
}>,
25-
saveOptions: {
26-
compress?: number;
27-
format?: 'jpeg' | 'png';
28-
base64?: boolean;
29-
},
30-
callback: (uri: string) => void,
31-
): Promise<ImageResult>;
32-
33-
export default RNImageManipulator;
34-
}
35-
17+
}>,
18+
saveOptions: {
19+
compress?: number;
20+
format?: 'jpeg' | 'png';
21+
base64?: boolean;
22+
},
23+
): Promise<RNImageManipulatorResult>;

index.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,11 @@ import { NativeModules } from "react-native";
22

33
const { RNImageManipulator } = NativeModules;
44

5+
export type RNImageManipulatorResult = {
6+
uri: string;
7+
width: number;
8+
height: number;
9+
base64?: string;
10+
};
11+
512
export default RNImageManipulator;

0 commit comments

Comments
 (0)