Skip to content

Commit 57caa91

Browse files
sgnycknitt
authored andcommitted
Define type for onOrientationChange callback (#465)
1 parent f1ca5ce commit 57caa91

6 files changed

Lines changed: 22 additions & 2 deletions

File tree

‎reason-react-native/src/components/Modal.bs.js‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,8 @@ var NativeElement$ReactNative = require("../elements/NativeElement.bs.js");
44

55
var Orientation = 0;
66

7+
var OrientationChange = 0;
8+
79
exports.Orientation = Orientation;
10+
exports.OrientationChange = OrientationChange;
811
/* NativeElement-ReactNative Not a pure module */

‎reason-react-native/src/components/Modal.md‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ wip: true
88
include NativeElement;
99
1010
module Orientation = Modal_Orientation;
11+
module OrientationChange = Modal_OrientationChange;
1112
1213
[@react.component] [@bs.module "react-native"]
1314
external make:
@@ -17,7 +18,7 @@ external make:
1718
~animationType: [@bs.string] [ | `none | `slide | `fade]=?,
1819
~hardwareAccelerated: bool=?,
1920
~onDismiss: unit => unit=?,
20-
~onOrientationChange: unit => unit=?,
21+
~onOrientationChange: Event.syntheticEvent({. "orientation": OrientationChange.t}) => unit=?,
2122
~onRequestClose: unit => unit=?,
2223
~onShow: unit => unit=?,
2324
~presentationStyle: [@bs.string] [

‎reason-react-native/src/components/Modal.re‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
include NativeElement;
22

33
module Orientation = Modal_Orientation;
4+
module OrientationChange = Modal_OrientationChange;
45

56
[@react.component] [@bs.module "react-native"]
67
external make:
@@ -10,7 +11,7 @@ external make:
1011
~animationType: [@bs.string] [ | `none | `slide | `fade]=?,
1112
~hardwareAccelerated: bool=?,
1213
~onDismiss: unit => unit=?,
13-
~onOrientationChange: unit => unit=?,
14+
~onOrientationChange: Event.syntheticEvent({. "orientation": OrientationChange.t}) => unit=?,
1415
~onRequestClose: unit => unit=?,
1516
~onShow: unit => unit=?,
1617
~presentationStyle: [@bs.string] [
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: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
type t = string;
2+
3+
[@bs.inline]
4+
let landscape = "landscape";
5+
6+
[@bs.inline]
7+
let portrait = "portrait";
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
type t;
2+
3+
[@bs.inline "landscape"]
4+
let landscape: t;
5+
6+
[@bs.inline "portrait"]
7+
let portrait: t;

0 commit comments

Comments
 (0)