Skip to content

Commit 87eba0d

Browse files
sgnyMoOx
authored andcommitted
Add zero-cost bindings for the ImageEditor API (#368)
1 parent 795de11 commit 87eba0d

2 files changed

Lines changed: 39 additions & 0 deletions

File tree

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
type source;
2+
3+
external fromRequired: Packager.required => source = "%identity";
4+
external fromUriSource: string => source = "%identity";
5+
6+
type offset;
7+
8+
[@bs.obj] external offset: (~x: int, ~y: int) => offset = "";
9+
10+
type size;
11+
12+
[@bs.obj] external size: (~width: int, ~height: int) => size = "";
13+
14+
type cropData;
15+
16+
[@bs.obj]
17+
external cropData:
18+
(
19+
~offset: offset,
20+
~size: size,
21+
~displaySize: size=?,
22+
~resizeMode: [@bs.string] [ | `contain | `cover | `stretch]=?,
23+
unit
24+
) =>
25+
cropData =
26+
"";
27+
28+
[@bs.module "react-native"] [@bs.scope "ImageEditor"]
29+
external cropImage:
30+
(
31+
~uri: source,
32+
~cropData: cropData,
33+
~success: string => unit,
34+
~failure: (~code: int, ~message: string) => unit,
35+
unit
36+
) =>
37+
unit =
38+
"cropImage";

0 commit comments

Comments
 (0)