Skip to content

Commit

Permalink
Upgrade to bs-platform 7.2.0 (facebook#666)
Browse files Browse the repository at this point in the history
* Bump bs-platform to 7.2.0

* Record as objects

* Update src/apis/NetInfo.md

Co-Authored-By: Max Thirouin <[email protected]>

* Update src/apis/CameraRoll.re

Co-Authored-By: Max Thirouin <[email protected]>

* Update documentation file VirtualizedSectionList

* Update documentation files

* Add missing bs.meth decorator

* Documentation fixes

* Documentation fixes

* Documentation updates

Co-authored-by: Max Thirouin <[email protected]>
  • Loading branch information
Arnarkari93 and MoOx authored Apr 10, 2020
1 parent 055faef commit 8a229a9
Show file tree
Hide file tree
Showing 56 changed files with 560 additions and 669 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"release": "npmpub"
},
"devDependencies": {
"bs-platform": "^5.0.4",
"bs-platform": "^7.2.0",
"husky": "^1.3.1",
"lint-staged": "^10.1.1",
"npm-run-all": "^3.0.0",
Expand Down
5 changes: 2 additions & 3 deletions src/apis/AccessibilityInfo.re
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
type announcementResult = {
.
"announcement": string,
"success": bool,
announcement: string,
success: bool,
};

[@bs.scope "AccessibilityInfo"] [@bs.module "react-native"]
Expand Down
2 changes: 1 addition & 1 deletion src/apis/ActionSheetIOS.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ external shareOptions:
shareOptions =
"";
type error = {. "stack": option(string)};
type error = {stack: option(string)};
[@bs.module "react-native"] [@bs.scope "ActionSheetIOS"]
external showShareActionSheetWithOptions:
Expand Down
8 changes: 3 additions & 5 deletions src/apis/ActionSheetIOS.re
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ external options:
~tintColor: Color.t=?,
unit
) =>
options =
"";
options;

[@bs.module "react-native"] [@bs.scope "ActionSheetIOS"]
external showActionSheetWithOptions: (options, int => unit) => unit =
Expand All @@ -27,10 +26,9 @@ external shareOptions:
~excludedActivityTypes: array(string)=?,
unit
) =>
shareOptions =
"";
shareOptions;

type error = {. "stack": option(string)};
type error = {stack: option(string)};

[@bs.module "react-native"] [@bs.scope "ActionSheetIOS"]
external showShareActionSheetWithOptions:
Expand Down
34 changes: 14 additions & 20 deletions src/apis/Animated.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ wip: true
```reason
module Animation = {
type t;
type endResult = {. "finished": bool};
type endResult = {finished: bool};
type endCallback = endResult => unit;
[@bs.send]
external start: (t, ~endCallback: endCallback=?, unit) => unit = "start";
Expand Down Expand Up @@ -42,8 +42,7 @@ module ValueAnimations = (Val: Value) => {
~iterations: int=?,
unit
) =>
config =
"";
config;
[@bs.module "react-native"] [@bs.scope "Animated"]
external decay: (Val.t, config) => Animation.t = "decay";
Expand Down Expand Up @@ -78,8 +77,7 @@ module ValueAnimations = (Val: Value) => {
~iterations: int=?,
unit
) =>
config =
"";
config;
[@bs.module "react-native"] [@bs.scope "Animated"]
external spring: (Val.t, config) => Animation.t = "spring";
Expand All @@ -106,8 +104,7 @@ module ValueAnimations = (Val: Value) => {
~iterations: int=?,
unit
) =>
config =
"";
config;
[@bs.module "react-native"] [@bs.scope "Animated"]
external timing: (Val.t, config) => Animation.t = "timing";
Expand All @@ -132,8 +129,8 @@ module Interpolation = {
~extrapolateRight: [@bs.string] [ | `extend | `clamp | `identity]=?,
unit
) =>
config =
"";
config;
[@bs.send] external interpolate: (value('a), config) => t = "interpolate";
};
Expand Down Expand Up @@ -202,17 +199,15 @@ module ValueXY = {
};
});
[@bs.obj] external jsValue: (~x: float, ~y: float) => jsValue = "";
[@bs.obj] external jsValue: (~x: float, ~y: float) => jsValue;
type translateTransform = {
.
"translateX": Value.t,
"translateY": Value.t,
translateX: Value.t,
translateY: Value.t,
};
type layout = {
.
"left": Value.t,
"top": Value.t,
left: Value.t,
top: Value.t,
};
[@bs.new] [@bs.scope "Animated"] [@bs.module "react-native"]
external create: jsValue => t = "ValueXY";
Expand All @@ -228,15 +223,15 @@ external sequence: array(Animation.t) => Animation.t = "sequence";
[@bs.module "react-native"] [@bs.scope "Animated"]
external parallel:
(array(Animation.t), {. "stopTogether": bool}) => Animation.t =
(array(Animation.t), {stopTogether: bool}) => Animation.t =
"parallel";
[@bs.module "react-native"] [@bs.scope "Animated"]
external stagger: (float, array(Animation.t)) => Animation.t = "stagger";
type loopConfig;
[@bs.obj] external loopConfig: (~iterations: int) => loopConfig = "";
[@bs.obj] external loopConfig: (~iterations: int) => loopConfig;
// multiple externals
[@bs.module "react-native"] [@bs.scope "Animated"]
Expand All @@ -249,8 +244,7 @@ external loopWithConfig: (Animation.t, loopConfig) => Animation.t = "loop";
type eventOptions('a);
[@bs.obj]
external eventOptions:
(~listener: 'a=?, ~useNativeDriver: bool, unit) => eventOptions('a) =
"";
(~listener: 'a=?, ~useNativeDriver: bool, unit) => eventOptions('a);
// multiple externals
[@bs.module "react-native"] [@bs.scope "Animated"]
Expand Down
35 changes: 14 additions & 21 deletions src/apis/Animated.re
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module Animation = {
type t;
type endResult = {. "finished": bool};
type endResult = {finished: bool};
type endCallback = endResult => unit;
[@bs.send]
external start: (t, ~endCallback: endCallback=?, unit) => unit = "start";
Expand Down Expand Up @@ -36,8 +36,7 @@ module ValueAnimations = (Val: Value) => {
~iterations: int=?,
unit
) =>
config =
"";
config;

[@bs.module "react-native"] [@bs.scope "Animated"]
external decay: (Val.t, config) => Animation.t = "decay";
Expand Down Expand Up @@ -72,8 +71,7 @@ module ValueAnimations = (Val: Value) => {
~iterations: int=?,
unit
) =>
config =
"";
config;

[@bs.module "react-native"] [@bs.scope "Animated"]
external spring: (Val.t, config) => Animation.t = "spring";
Expand All @@ -100,8 +98,7 @@ module ValueAnimations = (Val: Value) => {
~iterations: int=?,
unit
) =>
config =
"";
config;

[@bs.module "react-native"] [@bs.scope "Animated"]
external timing: (Val.t, config) => Animation.t = "timing";
Expand All @@ -126,8 +123,7 @@ module Interpolation = {
~extrapolateRight: [@bs.string] [ | `extend | `clamp | `identity]=?,
unit
) =>
config =
"";
config;
[@bs.send] external interpolate: (value('a), config) => t = "interpolate";
};

Expand Down Expand Up @@ -204,17 +200,15 @@ module ValueXY = {
type addListenerCallback = jsValue => unit;
});

[@bs.obj] external jsValue: (~x: float, ~y: float) => jsValue = "";
[@bs.obj] external jsValue: (~x: float, ~y: float) => jsValue;

type translateTransform = {
.
"translateX": Value.t,
"translateY": Value.t,
translateX: Value.t,
translateY: Value.t,
};
type layout = {
.
"left": Value.t,
"top": Value.t,
left: Value.t,
top: Value.t,
};
[@bs.new] [@bs.scope "Animated"] [@bs.module "react-native"]
external create: jsValue => t = "ValueXY";
Expand All @@ -230,17 +224,17 @@ external delay: float => Animation.t = "delay";
[@bs.module "react-native"] [@bs.scope "Animated"]
external sequence: array(Animation.t) => Animation.t = "sequence";

type parallelPayload = {stopTogether: bool};
[@bs.module "react-native"] [@bs.scope "Animated"]
external parallel:
(array(Animation.t), {. "stopTogether": bool}) => Animation.t =
external parallel: (array(Animation.t), parallelPayload) => Animation.t =
"parallel";

[@bs.module "react-native"] [@bs.scope "Animated"]
external stagger: (float, array(Animation.t)) => Animation.t = "stagger";

type loopConfig;

[@bs.obj] external loopConfig: (~iterations: int) => loopConfig = "";
[@bs.obj] external loopConfig: (~iterations: int) => loopConfig;

// multiple externals
[@bs.module "react-native"] [@bs.scope "Animated"]
Expand All @@ -253,8 +247,7 @@ external loopWithConfig: (Animation.t, loopConfig) => Animation.t = "loop";
type eventOptions('a);
[@bs.obj]
external eventOptions:
(~listener: 'a=?, ~useNativeDriver: bool, unit) => eventOptions('a) =
"";
(~listener: 'a=?, ~useNativeDriver: bool, unit) => eventOptions('a);

// multiple externals
[@bs.module "react-native"] [@bs.scope "Animated"]
Expand Down
10 changes: 4 additions & 6 deletions src/apis/AppRegistry.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,19 +33,17 @@ external appConfig:
~section: bool=?,
unit
) =>
appConfig =
"";
appConfig;
type runnable('a) = {
.
"component": Js.Nullable.t(componentProvider('a)),
"run": appParameters => unit,
[@bs.meth] "run": appParameters => unit,
};
type registry('a) = {
.
"sections": array(section),
"runnables": Js.Dict.t(runnable('a)),
sections: array(section),
runnables: Js.Dict.t(runnable('a)),
};
[@bs.module "react-native"] [@bs.scope "AppRegistry"]
Expand Down
10 changes: 4 additions & 6 deletions src/apis/AppRegistry.re
Original file line number Diff line number Diff line change
Expand Up @@ -26,19 +26,17 @@ external appConfig:
~section: bool=?,
unit
) =>
appConfig =
"";
appConfig;

type runnable('a) = {
.
"component": Js.Nullable.t(componentProvider('a)),
"run": appParameters => unit,
[@bs.meth] "run": appParameters => unit,
};

type registry('a) = {
.
"sections": array(section),
"runnables": Js.Dict.t(runnable('a)),
sections: array(section),
runnables: Js.Dict.t(runnable('a)),
};

[@bs.module "react-native"] [@bs.scope "AppRegistry"]
Expand Down
12 changes: 5 additions & 7 deletions src/apis/DatePickerAndroid.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,13 @@ external options:
~mode: [@bs.string] [ | `calendar | `spinner | `default]=?,
unit
) =>
options =
"";
options;
type response = {
.
"action": action,
"year": int,
"month": int,
"day": int,
action: action,
year: int,
month: int,
day: int,
};
[@bs.module "react-native"] [@bs.scope "DatePickerAndroid"]
Expand Down
12 changes: 5 additions & 7 deletions src/apis/DatePickerAndroid.re
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,13 @@ external options:
~mode: [@bs.string] [ | `calendar | `spinner | `default]=?,
unit
) =>
options =
"";
options;

type response = {
.
"action": action,
"year": int,
"month": int,
"day": int,
action,
year: int,
month: int,
day: int,
};

[@bs.module "react-native"] [@bs.scope "DatePickerAndroid"]
Expand Down
18 changes: 8 additions & 10 deletions src/apis/Dimensions.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,28 +6,26 @@ wip: true

```reason
type displayMetrics = {
.
"width": float,
"height": float,
"scale": float,
"fontScale": float,
width: float,
height: float,
scale: float,
fontScale: float,
};
type handler = {
.
"screen": displayMetrics,
"window": displayMetrics,
screen: displayMetrics,
window: displayMetrics,
};
[@bs.module "react-native"] [@bs.scope "Dimensions"]
external get: ([@bs.string] [ | `window | `screen]) => displayMetrics = "get";
[@bs.module "react-native"] [@bs.scope "Dimensions"]
external addEventListener: ([@bs.string] [ | `change], handler => unit) => unit =
"";
"addEventListener";
[@bs.module "react-native"] [@bs.scope "Dimensions"]
external removeEventListener:
([@bs.string] [ | `change], handler => unit) => unit =
"";
"removeEventListener";
[@bs.module "react-native"]
external useWindowDimensions: unit => displayMetrics = "useWindowDimensions";
Expand Down
Loading

0 comments on commit 8a229a9

Please sign in to comment.