@oguzhnatly/react-native-image-manipulator 1.0.2 → 1.0.5
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/CHANGELOG.md +12 -0
- package/README.md +6 -2
- package/android/src/main/AndroidManifest.xml +1 -5
- package/android/src/main/java/com/reactnativeimagemanipulator/RNImageManipulatorModule.java +1 -1
- package/android/src/main/java/com/reactnativeimagemanipulator/RNImageManipulatorPackage.java +1 -1
- package/build/index.d.ts +29 -0
- package/build/index.js +4 -0
- package/build/index.js.map +1 -0
- package/index.d.ts +26 -35
- package/index.ts +7 -0
- package/package.json +22 -3
- package/react-native-image-manipulator.podspec +1 -1
- package/tsconfig.json +25 -0
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
|
@@ -4,9 +4,13 @@
|
|
|
4
4
|
### OR
|
|
5
5
|
`$ yarn add @oguzhnatly/react-native-image-manipulator`
|
|
6
6
|
|
|
7
|
+
### Pod installation
|
|
8
|
+
|
|
9
|
+
`$ cd ios && pod install`
|
|
10
|
+
|
|
7
11
|
### Mostly automatic installation
|
|
8
12
|
|
|
9
|
-
`$ react-native link react-native-image-manipulator`
|
|
13
|
+
`$ react-native link @oguzhnatly/react-native-image-manipulator`
|
|
10
14
|
|
|
11
15
|
### Manual installation
|
|
12
16
|
|
|
@@ -21,7 +25,7 @@
|
|
|
21
25
|
|
|
22
26
|
1. Open up `android/app/src/main/java/[...]/MainActivity.java`
|
|
23
27
|
|
|
24
|
-
- Add `import com.
|
|
28
|
+
- Add `import com.oguzhnatly.rnimagemanipulator.RNImageManipulatorPackage;` to the imports at the top of the file
|
|
25
29
|
- Add `new RNImageManipulatorPackage()` to the list returned by the `getPackages()` method
|
|
26
30
|
|
|
27
31
|
2. Append the following lines to `android/settings.gradle`:
|
package/build/index.d.ts
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export declare type RNImageManipulatorResult = {
|
|
2
|
+
uri: string;
|
|
3
|
+
width: number;
|
|
4
|
+
height: number;
|
|
5
|
+
base64?: string;
|
|
6
|
+
};
|
|
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
|
+
};
|
|
28
|
+
export default RNImageManipulator;
|
|
29
|
+
|
package/build/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAE7C,MAAM,EAAE,kBAAkB,EAAE,GAAG,aAAa,CAAC;AAS7C,eAAe,kBAAkB,CAAC","sourcesContent":["import { NativeModules } from \"react-native\";\n\nconst { RNImageManipulator } = NativeModules;\n\nexport type RNImageManipulatorResult = {\n uri: string;\n width: number;\n height: number;\n base64?: string;\n};\n\nexport default RNImageManipulator;\n"]}
|
package/index.d.ts
CHANGED
|
@@ -1,35 +1,26 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
format?: 'jpeg' | 'png';
|
|
28
|
-
base64?: boolean;
|
|
29
|
-
},
|
|
30
|
-
callback: (uri: string) => void,
|
|
31
|
-
): Promise<ImageResult>;
|
|
32
|
-
|
|
33
|
-
export default RNImageManipulator;
|
|
34
|
-
}
|
|
35
|
-
|
|
1
|
+
import {RNImageManipulatorResult as ImageResult} from './index';
|
|
2
|
+
|
|
3
|
+
export declare type RNImageManipulatorResult = ImageResult;
|
|
4
|
+
|
|
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/index.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,10 +1,29 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oguzhnatly/react-native-image-manipulator",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.5",
|
|
4
4
|
"description": "ImageManipulator for react native without Expo and Unimodules. Based on Expo ImageManipulator",
|
|
5
|
-
"main": "index.js",
|
|
5
|
+
"main": "build/index.js",
|
|
6
6
|
"author": "oguzhnatly",
|
|
7
7
|
"homepage": "https://github.com/oguzhnatly/react-native-image-manipulator",
|
|
8
8
|
"license": "MIT",
|
|
9
|
-
"typings": "index.d.ts"
|
|
9
|
+
"typings": "build/index.d.ts",
|
|
10
|
+
"keywords": [
|
|
11
|
+
"react-native",
|
|
12
|
+
"react",
|
|
13
|
+
"rotate",
|
|
14
|
+
"flip",
|
|
15
|
+
"image",
|
|
16
|
+
"manipulator",
|
|
17
|
+
"react-native-rotate-image",
|
|
18
|
+
"react-native-flip-image",
|
|
19
|
+
"react-native-image-manipulator"
|
|
20
|
+
],
|
|
21
|
+
"scripts": {
|
|
22
|
+
"build": "tsc"
|
|
23
|
+
},
|
|
24
|
+
"dependencies": {},
|
|
25
|
+
"devDependencies": {
|
|
26
|
+
"react-native": "^0.68.0",
|
|
27
|
+
"typescript": "^4.6.3"
|
|
28
|
+
}
|
|
10
29
|
}
|
|
@@ -3,7 +3,7 @@ require 'json'
|
|
|
3
3
|
package = JSON.parse(File.read(File.join(__dir__, 'package.json')))
|
|
4
4
|
|
|
5
5
|
Pod::Spec.new do |s|
|
|
6
|
-
s.name =
|
|
6
|
+
s.name = "react-native-image-manipulator"
|
|
7
7
|
s.version = package['version']
|
|
8
8
|
s.summary = package['description']
|
|
9
9
|
s.license = package['license']
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "esnext",
|
|
4
|
+
"lib": ["dom", "esnext"],
|
|
5
|
+
"jsx": "react-native",
|
|
6
|
+
"moduleResolution": "node",
|
|
7
|
+
"esModuleInterop": true,
|
|
8
|
+
"allowSyntheticDefaultImports": true,
|
|
9
|
+
"typeRoots": [
|
|
10
|
+
"./ts-declarations",
|
|
11
|
+
"node_modules/@types"
|
|
12
|
+
],
|
|
13
|
+
"sourceMap": true,
|
|
14
|
+
"declaration": true,
|
|
15
|
+
"inlineSources": true,
|
|
16
|
+
"strictNullChecks": true,
|
|
17
|
+
"strictPropertyInitialization": true,
|
|
18
|
+
"strictFunctionTypes": true,
|
|
19
|
+
"skipLibCheck": true,
|
|
20
|
+
"noImplicitThis": true,
|
|
21
|
+
"noImplicitReturns": true,
|
|
22
|
+
"outDir": "./build"
|
|
23
|
+
},
|
|
24
|
+
"include": ["."]
|
|
25
|
+
}
|