Skip to content

Commit 291c994

Browse files
committed
Typescript module declarations improved.
1 parent acbc1de commit 291c994

4 files changed

Lines changed: 51 additions & 23 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.5
2+
3+
- Typescript module declarations improved.
4+
15
## 1.0.4
26

37
- Typescript module declarations improved and Pod Errors fixed.

build/index.d.ts

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,29 @@
1-
declare const RNImageManipulator: any;
21
export declare type RNImageManipulatorResult = {
32
uri: string;
43
width: number;
54
height: number;
65
base64?: string;
76
};
7+
declare const RNImageManipulator: {
8+
manipulate: (
9+
uri: string,
10+
actions: Array<{
11+
resize?: {width?: number; height?: number};
12+
rotate?: number;
13+
flip?: {vertical?: boolean; horizontal?: boolean};
14+
crop?: {
15+
originX?: number;
16+
originY?: number;
17+
width?: number;
18+
height?: number;
19+
};
20+
}>,
21+
saveOptions: {
22+
compress?: number;
23+
format?: 'jpeg' | 'png';
24+
base64?: boolean;
25+
},
26+
) => Promise<RNImageManipulatorResult>;
27+
};
828
export default RNImageManipulator;
29+

index.d.ts

Lines changed: 24 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,26 @@
1-
import {RNImageManipulatorResult} from './index';
1+
import {RNImageManipulatorResult as ImageResult} from './index';
22

3-
export declare type ImageResult = RNImageManipulatorResult;
3+
export declare type RNImageManipulatorResult = ImageResult;
44

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;
16-
};
17-
}>,
18-
saveOptions: {
19-
compress?: number;
20-
format?: 'jpeg' | 'png';
21-
base64?: boolean;
22-
},
23-
): Promise<RNImageManipulatorResult>;
5+
declare const RNImageManipulator: {
6+
manipulate: (
7+
uri: string,
8+
actions: Array<{
9+
resize?: {width?: number; height?: number};
10+
rotate?: number;
11+
flip?: {vertical?: boolean; horizontal?: boolean};
12+
crop?: {
13+
originX?: number;
14+
originY?: number;
15+
width?: number;
16+
height?: number;
17+
};
18+
}>,
19+
saveOptions: {
20+
compress?: number;
21+
format?: 'jpeg' | 'png';
22+
base64?: boolean;
23+
},
24+
) => Promise<RNImageManipulatorResult>;
25+
};
26+
export default RNImageManipulator;

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@oguzhnatly/react-native-image-manipulator",
3-
"version": "1.0.4",
3+
"version": "1.0.5",
44
"description": "ImageManipulator for react native without Expo and Unimodules. Based on Expo ImageManipulator",
55
"main": "build/index.js",
66
"author": "oguzhnatly",

0 commit comments

Comments
 (0)