Skip to content

Commit

Permalink
Typescript module declarations improved.
Browse files Browse the repository at this point in the history
  • Loading branch information
oguzhnatly committed Apr 2, 2022
1 parent acbc1de commit 291c994
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 23 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 1.0.5

- Typescript module declarations improved.

## 1.0.4

- Typescript module declarations improved and Pod Errors fixed.
Expand Down
23 changes: 22 additions & 1 deletion build/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,29 @@
declare const RNImageManipulator: any;
export declare type RNImageManipulatorResult = {
uri: string;
width: number;
height: number;
base64?: string;
};
declare const RNImageManipulator: {
manipulate: (
uri: string,
actions: Array<{
resize?: {width?: number; height?: number};
rotate?: number;
flip?: {vertical?: boolean; horizontal?: boolean};
crop?: {
originX?: number;
originY?: number;
width?: number;
height?: number;
};
}>,
saveOptions: {
compress?: number;
format?: 'jpeg' | 'png';
base64?: boolean;
},
) => Promise<RNImageManipulatorResult>;
};
export default RNImageManipulator;

45 changes: 24 additions & 21 deletions index.d.ts
Original file line number Diff line number Diff line change
@@ -1,23 +1,26 @@
import {RNImageManipulatorResult} from './index';
import {RNImageManipulatorResult as ImageResult} from './index';

export declare type ImageResult = RNImageManipulatorResult;
export declare type RNImageManipulatorResult = ImageResult;

export declare function manipulate(
uri: string,
actions: Array<{
resize?: {width?: number; height?: number};
rotate?: number;
flip?: {vertical?: boolean; horizontal?: boolean};
crop?: {
originX?: number;
originY?: number;
width?: number;
height?: number;
};
}>,
saveOptions: {
compress?: number;
format?: 'jpeg' | 'png';
base64?: boolean;
},
): Promise<RNImageManipulatorResult>;
declare const RNImageManipulator: {
manipulate: (
uri: string,
actions: Array<{
resize?: {width?: number; height?: number};
rotate?: number;
flip?: {vertical?: boolean; horizontal?: boolean};
crop?: {
originX?: number;
originY?: number;
width?: number;
height?: number;
};
}>,
saveOptions: {
compress?: number;
format?: 'jpeg' | 'png';
base64?: boolean;
},
) => Promise<RNImageManipulatorResult>;
};
export default RNImageManipulator;
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@oguzhnatly/react-native-image-manipulator",
"version": "1.0.4",
"version": "1.0.5",
"description": "ImageManipulator for react native without Expo and Unimodules. Based on Expo ImageManipulator",
"main": "build/index.js",
"author": "oguzhnatly",
Expand Down

0 comments on commit 291c994

Please sign in to comment.