@oguzhnatly/react-native-image-manipulator 1.0.4 → 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 CHANGED
@@ -1,3 +1,7 @@
1
+ ## 1.0.5
2
+
3
+ - Typescript module declarations improved.
4
+
1
5
  ## 1.0.4
2
6
 
3
7
  - Typescript module declarations improved and Pod Errors fixed.
@@ -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,4 @@
1
+ import { NativeModules } from "react-native";
2
+ const { RNImageManipulator } = NativeModules;
3
+ export default RNImageManipulator;
4
+ //# sourceMappingURL=index.js.map
@@ -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,14 +1,9 @@
1
- declare module '@oguzhnatly/react-native-image-manipulator' {
2
- import React from 'react';
1
+ import {RNImageManipulatorResult as ImageResult} from './index';
3
2
 
4
- export type ImageResult = {
5
- uri: string;
6
- width: number;
7
- height: number;
8
- base64?: string;
9
- };
3
+ export declare type RNImageManipulatorResult = ImageResult;
10
4
 
11
- export function manipulate(
5
+ declare const RNImageManipulator: {
6
+ manipulate: (
12
7
  uri: string,
13
8
  actions: Array<{
14
9
  resize?: {width?: number; height?: number};
@@ -26,5 +21,6 @@ declare module '@oguzhnatly/react-native-image-manipulator' {
26
21
  format?: 'jpeg' | 'png';
27
22
  base64?: boolean;
28
23
  },
29
- ): Promise<ImageResult>;
30
- }
24
+ ) => Promise<RNImageManipulatorResult>;
25
+ };
26
+ export default RNImageManipulator;
package/index.ts CHANGED
@@ -2,4 +2,11 @@ import { NativeModules } from "react-native";
2
2
 
3
3
  const { RNImageManipulator } = NativeModules;
4
4
 
5
+ export type RNImageManipulatorResult = {
6
+ uri: string;
7
+ width: number;
8
+ height: number;
9
+ base64?: string;
10
+ };
11
+
5
12
  export default RNImageManipulator;
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@oguzhnatly/react-native-image-manipulator",
3
- "version": "1.0.4",
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
10
  "keywords": [
11
11
  "react-native",
12
12
  "react",
@@ -18,6 +18,9 @@
18
18
  "react-native-flip-image",
19
19
  "react-native-image-manipulator"
20
20
  ],
21
+ "scripts": {
22
+ "build": "tsc"
23
+ },
21
24
  "dependencies": {},
22
25
  "devDependencies": {
23
26
  "react-native": "^0.68.0",
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
+ }