Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expo 38 SDK #38

Open
wants to merge 13 commits into
base: master
Choose a base branch
from
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*.re linguist-language=Reason
*.rei linguist-language=Reason
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
],
"scripts": {
"format:most": "prettier --write \"**/*.{md,json,js,css}\"",
"format:re": "find ./packages -iname '*.re' | xargs bsrefmt --in-place && find ./packages -iname '*.rei' | xargs bsrefmt -i true --in-place && find ./test -iname '*.re' | xargs bsrefmt --in-place && find ./template -iname '*.re' | xargs bsrefmt --in-place",
"format:re": "find ./packages -iname '*.re' | xargs bsrefmt --in-place && find ./packages -iname '*.rei' | xargs bsrefmt -i true --in-place && find ./packages/test -iname '*.re' | xargs bsrefmt --in-place && find ./packages/template -iname '*.re' | xargs bsrefmt --in-place",
"format": "yarn format:most && yarn format:re",
"watch": "run-p watch:reason-expo watch:test",
"watch:reason-expo": "cd packages/reason-expo && yarn watch",
Expand Down
16 changes: 8 additions & 8 deletions packages/reason-expo/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "reason-expo",
"description": "ReasonML bindings for Expo",
"version": "37.0.0",
"version": "38.0.0",
"scripts": {
"build": "bsb -make-world",
"watch": "bsb -make-world -w",
Expand All @@ -24,18 +24,18 @@
},
"devDependencies": {
"babel-preset-expo": "^8.1.0",
"bs-platform": "^7.3.2",
"expo": "^37.0.0",
"reason-react": "^0.8.0",
"react-native": "https://github.com/expo/react-native/archive/sdk-37.0.1.tar.gz"
"bs-platform": "^8.2.0",
"expo": "^38.0.0",
"reason-react": "^0.9.0",
"react-native": "https://github.com/expo/react-native/archive/sdk-38.0.2.tar.gz"
},
"bugs": "https://github.com/fiberjw/reason-expo/issues",
"peerDependencies": {
"expo": "^37.0.0",
"expo": "^38.0.0",
"react": "^16.9.0",
"react-dom": "^16.8.1",
"reason-react": "^0.8.0",
"react-native": "https://github.com/expo/react-native/archive/sdk-37.0.1.tar.gz",
"reason-react-native": "^0.61.1"
"react-native": "https://github.com/expo/react-native/archive/sdk-38.0.2.tar.gz",
"reason-react-native": "^0.62.3"
}
}
2 changes: 1 addition & 1 deletion packages/reason-expo/src/Accelerometer.re
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ external addListener: (location => unit) => eventSubscription = "addListener";
external removeAllListeners: unit => unit = "removeAllListeners";

[@bs.module "expo-sensors"] [@bs.scope "Accelerometer"]
external setUpdateInterval: int => unit = "setUpdateInterval";
external setUpdateInterval: int => unit = "setUpdateInterval";
44 changes: 44 additions & 0 deletions packages/reason-expo/src/ActionSheet.re
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
module Provider = {
[@bs.module "@expo/react-native-action-sheet"] [@react.component]
external make: (~children: React.element) => React.element =
"ActionSheetProvider";
};

type actionSheetOptions = {
title: option(string),
message: option(string),
options: array(string),
destructiveButtonIndex: int,
cancelButtonIndex: option(int),
};

type handleAction = int => unit;

type useActionSheet = {
showActionSheetWithOptions: (actionSheetOptions, handleAction) => unit,
};

[@bs.module "@expo/react-native-action-sheet"]
external useActionSheet: unit => useActionSheet = "useActionSheet";

let useActionSheetRe = () => {
let {showActionSheetWithOptions} = useActionSheet();

let showActionSheetWithOptionsRe =
(
~title: option(string)=?,
~message: option(string)=?,
~onSelect: handleAction,
~options: array(string),
~destructiveButtonIndex: int,
~cancelButtonIndex: option(int)=?,
(),
) => {
showActionSheetWithOptions(
{title, message, options, destructiveButtonIndex, cancelButtonIndex},
onSelect,
);
};

showActionSheetWithOptionsRe;
};
2 changes: 1 addition & 1 deletion packages/reason-expo/src/AdMob.re
Original file line number Diff line number Diff line change
Expand Up @@ -83,4 +83,4 @@ module AdMobRewarded = {
external requestAdAsync: unit => Js.Promise.t(unit) = "requestAdAsync";
[@bs.module "expo-ads-admob"] [@bs.scope "AdMobRewarded"]
external showAdAsync: unit => Js.Promise.t(unit) = "showAdAsync";
};
};
2 changes: 1 addition & 1 deletion packages/reason-expo/src/Amplitude.re
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ external logEventWithProperties: (string, 'a) => unit =
"logEventWithProperties";

[@bs.module "expo-analytics-amplitude"]
external setGroup: (string, array(string)) => unit = "setGroup";
external setGroup: (string, array(string)) => unit = "setGroup";
2 changes: 1 addition & 1 deletion packages/reason-expo/src/AppLoading.re
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ external make:
~children: React.element=?
) =>
React.element =
"AppLoading";
"AppLoading";
2 changes: 1 addition & 1 deletion packages/reason-expo/src/Asset.re
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ external loadAsync:
"loadAsync";

[@bs.module "expo-asset"] [@bs.scope "Asset"]
external fromModule: ReactNative.Packager.required => t = "fromModule";
external fromModule: ReactNative.Packager.required => t = "fromModule";
2 changes: 1 addition & 1 deletion packages/reason-expo/src/AuthSession.re
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,4 @@ external startAsync: options => Js.Promise.t(result('paramType, 'eventType)) =
external dismiss: unit => unit = "dismiss";

[@bs.module "expo"] [@bs.scope "AuthSession"]
external getRedirectUrl: unit => string = "getRedirectUrl";
external getRedirectUrl: unit => string = "getRedirectUrl";
9 changes: 6 additions & 3 deletions packages/reason-expo/src/BackgroundFetch.re
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,13 @@ module Result = {
external getStatusAsync: unit => Js.Promise.t(Status.t) = "getStatusAsync";

[@bs.module "expo-background-fetch"]
external registerTaskAsync: string => Js.Promise.t(unit) = "registerTaskAsync";
external registerTaskAsync: string => Js.Promise.t(unit) =
"registerTaskAsync";

[@bs.module "expo-background-fetch"]
external unregisterTaskAsync: string => Js.Promise.t(unit) = "unregisterTaskAsync";
external unregisterTaskAsync: string => Js.Promise.t(unit) =
"unregisterTaskAsync";

[@bs.module "expo-background-fetch"]
external setMinimumIntervalAsync: float => Js.Promise.t(unit) = "setMinimumIntervalAsync";
external setMinimumIntervalAsync: float => Js.Promise.t(unit) =
"setMinimumIntervalAsync";
2 changes: 1 addition & 1 deletion packages/reason-expo/src/BarCodeScanner.re
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,4 @@ let props =
};

[@bs.module "expo-barcode-scanner"] [@react.component]
external make: props => React.element = "BarCodeScanner";
external make: props => React.element = "BarCodeScanner";
4 changes: 2 additions & 2 deletions packages/reason-expo/src/BlurView.re
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
[@bs.module "expo-blur"] [@react.component]
external make:
(
~tint: [@bs.string] [ | `default | `light | `dark]=?,
~tint: [ | `default | `light | `dark]=?,
baransu marked this conversation as resolved.
Show resolved Hide resolved
~intensity: float=?,
~style: ReactNative.Style.t=?,
~children: React.element=?
) =>
React.element =
"BlurView";
"BlurView";
2 changes: 1 addition & 1 deletion packages/reason-expo/src/Brightness.re
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ external setSystemBrightnessAsync: float => unit = "setSystemBrightnessAsync";

[@bs.module "expo-brightness"]
external getSystemBrightnessAsync: unit => Js.Promise.t(float) =
"getSystemBrightnessAsync";
"getSystemBrightnessAsync";
28 changes: 11 additions & 17 deletions packages/reason-expo/src/Calendar.re
Original file line number Diff line number Diff line change
Expand Up @@ -262,14 +262,14 @@ type attendee = {
isCurrentUser: option(bool),
};
/* {
.
id: string,
email: string,
name: string,
role: AttendeeRole.t,
status: AttendeeStatus.t,
_type: string,
} */
.
id: string,
email: string,
name: string,
role: AttendeeRole.t,
status: AttendeeStatus.t,
_type: string,
} */

// [@bs.deriving abstract]
type source = {
Expand Down Expand Up @@ -486,17 +486,11 @@ external deleteEventAsync: deleteEventAsyncProps => Js.Promise.t(unit) =

[@bs.module "expo-calendar"]
external getAttendeesForEventAsync:
(string, instanceStartDate) =>
Js.Promise.t(array(attendee)) =
(string, instanceStartDate) => Js.Promise.t(array(attendee)) =
"getAttendeesForEventAsync";

[@bs.module "expo-calendar"]
external createAttendeeAsync:
(
string,
attendee
) =>
Js.Promise.t(string) =
external createAttendeeAsync: (string, attendee) => Js.Promise.t(string) =
"createAttendeeAsync";

[@bs.module "expo-calendar"]
Expand Down Expand Up @@ -586,4 +580,4 @@ external getSourcesAsync: unit => Js.Promise.t(array(source)) =
external getSourceAsync: string => Js.Promise.t(source) = "getSourceAsync";

[@bs.module "expo-calendar"]
external openEventInCalendar: string => unit = "openEventInCalendar";
external openEventInCalendar: string => unit = "openEventInCalendar";
67 changes: 13 additions & 54 deletions packages/reason-expo/src/Camera.re
Original file line number Diff line number Diff line change
Expand Up @@ -110,69 +110,29 @@ type face = {
bounds,
}
and bounds = {
origin,
origin: xy,
size,
rollAngle: float,
yawAngle: float,
smilingProbability: Js.nullable(float),
leftEarPosition,
rightEarPosition,
leftEyePosition,
leftEarPosition: xy,
rightEarPosition: xy,
leftEyePosition: xy,
leftEyeOpenProbability: Js.nullable(float),
rightEyePosition,
rightEyePosition: xy,
rightEyeOpenProbability: Js.nullable(float),
leftCheekPosition,
rightCheekPosition,
mouthPosition,
leftMouthPosition,
rightMouthPosition,
noseBasePosition,
}
and origin = {
x: float,
y: float,
leftCheekPosition: xy,
rightCheekPosition: xy,
mouthPosition: xy,
leftMouthPosition: xy,
rightMouthPosition: xy,
noseBasePosition: xy,
}
and size = {
width: float,
height: float,
}
and leftEarPosition = {
x: float,
y: float,
}
and rightEarPosition = {
x: float,
y: float,
}
and leftEyePosition = {
x: float,
y: float,
}
and rightEyePosition = {
x: float,
y: float,
}
and leftCheekPosition = {
x: float,
y: float,
}
and rightCheekPosition = {
x: float,
y: float,
}
and mouthPosition = {
x: float,
y: float,
}
and leftMouthPosition = {
x: float,
y: float,
}
and rightMouthPosition = {
x: float,
y: float,
}
and noseBasePosition = {
and xy = {
baransu marked this conversation as resolved.
Show resolved Hide resolved
x: float,
y: float,
};
Expand All @@ -189,7 +149,6 @@ type faceDetectionClassifications =
| All
| None;

// [@bs.deriving abstract]
type barCodeScannerSettings = {
barCodeTypes: array(string),
useCamera2Api: bool,
Expand Down Expand Up @@ -275,4 +234,4 @@ let props =
};

[@bs.module "expo-camera"] [@react.component]
external make: props => React.element = "Camera" /* external make: 'a => React.element = "Camera"*/;
external make: props => React.element = "Camera";
3 changes: 2 additions & 1 deletion packages/reason-expo/src/Constants.re
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ type updates = {fallbackToCacheTimeout: int};
type manifest = {
assetBundlePatterns: array(string),
bundleUrl: string,
debuggerHost: string,
releaseChannel: Js.Undefined.t(string),
baransu marked this conversation as resolved.
Show resolved Hide resolved
debuggerHost: Js.Undefined.t(string),
developer,
env: Js.t({.}),
hostUri: string,
Expand Down
2 changes: 1 addition & 1 deletion packages/reason-expo/src/Contacts.re
Original file line number Diff line number Diff line change
Expand Up @@ -411,4 +411,4 @@ external getDefaultContainerIdAsync: unit => Js.Promise.t(string) =

[@bs.module "expo-contacts"]
external getContainersAsync: containerQuery => Js.Promise.t(array(container)) =
"getContainersAsync";
"getContainersAsync";
2 changes: 1 addition & 1 deletion packages/reason-expo/src/Crypto.re
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,4 @@ type cryptoDigestOptions = {encoding: CryptoEncoding.t};
external digestStringAsync:
(CryptoDigestAlgorithm.t, string, cryptoDigestOptions) =>
Js.Promise.t(string) =
"digestStringAsync";
"digestStringAsync";
2 changes: 1 addition & 1 deletion packages/reason-expo/src/DocumentPicker.re
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ type result = {

[@bs.module "expo-document-picker"]
external getDocumentAsync: options => Js.Promise.t(result) =
"getDocumentAsync";
"getDocumentAsync";
2 changes: 1 addition & 1 deletion packages/reason-expo/src/ErrorRecovery.re
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
[@bs.module "expo"] [@bs.scope "ErrorRecovery"]
external setRecoveryProps: Js.t({..}) => unit = "setRecoveryProps";
external setRecoveryProps: Js.t({..}) => unit = "setRecoveryProps";
2 changes: 1 addition & 1 deletion packages/reason-expo/src/FaceDetector.re
Original file line number Diff line number Diff line change
Expand Up @@ -86,4 +86,4 @@ and image = {
[@bs.module "expo-face-detector"]
external detectFacesAsync:
(string, detectionOptions) => Js.Promise.t(detectFacesAsyncResponse) =
"detectFacesAsync";
"detectFacesAsync";
2 changes: 1 addition & 1 deletion packages/reason-expo/src/Facebook.re
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ type options = {
[@bs.module "expo-facebook"]
external logInWithReadPermissionsAsync:
(string, options) => Js.Promise.t(result) =
"logInWithReadPermissionsAsync";
"logInWithReadPermissionsAsync";
2 changes: 1 addition & 1 deletion packages/reason-expo/src/FacebookAds.re
Original file line number Diff line number Diff line change
Expand Up @@ -82,4 +82,4 @@ module BannerAd = {
) =>
React.element =
"BannerAd";
};
};
2 changes: 1 addition & 1 deletion packages/reason-expo/src/FileSystem.re
Original file line number Diff line number Diff line change
Expand Up @@ -206,4 +206,4 @@ external createDownloadResumable:
string
) =>
DownloadResumable.t =
"createDownloadResumable";
"createDownloadResumable";
Loading