Skip to content

0.76 changes #826

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

Merged
merged 3 commits into from
Feb 2, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"npm-run-all": "^4.0.0",
"npmpub": "^5.0.0",
"prettier": "^2.0.0",
"rescript": "^11.0.1"
"rescript": "^11.1.0"
},
"prettier": {
"trailingComma": "all"
Expand Down
2 changes: 0 additions & 2 deletions src/apis/Alert.res
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ external alert: (
~message: string=?,
~buttons: array<button>=?,
~options: options=?,
unit,
) => unit = "alert"

type type_ = [
Expand All @@ -41,5 +40,4 @@ external prompt: (
~defaultValue: string=?,
~keyboardType: string=?,
~options: options=?,
unit,
) => unit = "prompt"
9 changes: 4 additions & 5 deletions src/apis/Animated.res
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module Animation = {
type endResult = {finished: bool}
type endCallback = endResult => unit
@send
external start: (t, ~endCallback: endCallback=?, unit) => unit = "start"
external start: (t, ~endCallback: endCallback=?) => unit = "start"

@send external stop: t => unit = "stop"
@send external reset: t => unit = "reset"
Expand Down Expand Up @@ -139,10 +139,10 @@ module ValueMethods = (Val: Value) => {
@send external removeAllListeners: t => unit = "removeAllListeners"

@send
external resetAnimation: (t, ~callback: callback=?, unit) => unit = "resetAnimation"
external resetAnimation: (t, ~callback: callback=?) => unit = "resetAnimation"

@send
external stopAnimation: (t, ~callback: callback=?, unit) => unit = "stopAnimation"
external stopAnimation: (t, ~callback: callback=?) => unit = "stopAnimation"

include ValueAnimations(Val)
}
Expand Down Expand Up @@ -311,5 +311,4 @@ module View = {
type config = {useNativeDriver: bool}

@module("react-native")
external useAnimatedValue: (~initialValue: float, ~config: config=?, unit) => Value.t =
"useAnimatedValue"
external useAnimatedValue: (~initialValue: float, ~config: config=?) => Value.t = "useAnimatedValue"
32 changes: 32 additions & 0 deletions src/apis/Style.res
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,36 @@ type transformOriginY =

type transformOrigin = (transformOriginX, transformOriginY, float)

type boxShadow = {
offsetX: float,
offsetY: float,
color?: Color.t,
blurRadius?: float,
spreadDistance?: float,
inset?: bool,
}

type dropShadow = {
offsetX: float,
offsetY: float,
standardDeviation?: float,
color?: Color.t,
}

type filter
@obj external brightness: (~brightness: float) => filter = ""
@obj external blur: (~blur: float) => filter = ""
@obj external contrast: (~contrast: float) => filter = ""
@obj external grayscale: (~grayscale: float) => filter = ""
@obj external hueRotate: (~hueRotate: float) => filter = ""
@obj external invert: (~invert: float) => filter = ""
@obj external opacity: (~opacity: float) => filter = ""
@obj external saturate: (~saturate: float) => filter = ""
@obj external sepia: (~sepia: float) => filter = ""
@obj external dropShadow: (~dropShadow: dropShadow) => filter = ""

external unsafeFilter: {..} => filter = "%identity"

type resizeMode = [#cover | #contain | #stretch | #repeat | #center]

type fontStyle = [#normal | #italic]
Expand Down Expand Up @@ -298,6 +328,8 @@ type viewCoreStyle = {
borderTopLeftRadius?: float,
borderTopRightRadius?: float,
borderTopStartRadius?: float,
boxShadow?: array<boxShadow>,
filter?: array<filter>,
elevation?: float,
opacity?: float,
}
Expand Down
32 changes: 32 additions & 0 deletions src/apis/Style.resi
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,36 @@ type transformOriginY =

type transformOrigin = (transformOriginX, transformOriginY, float)

type boxShadow = {
offsetX: float,
offsetY: float,
color?: Color.t,
blurRadius?: float,
spreadDistance?: float,
inset?: bool,
}

type dropShadow = {
offsetX: float,
offsetY: float,
standardDeviation?: float,
color?: Color.t,
}

type filter
@obj external brightness: (~brightness: float) => filter = ""
@obj external blur: (~blur: float) => filter = ""
@obj external contrast: (~contrast: float) => filter = ""
@obj external grayscale: (~grayscale: float) => filter = ""
@obj external hueRotate: (~hueRotate: float) => filter = ""
@obj external invert: (~invert: float) => filter = ""
@obj external opacity: (~opacity: float) => filter = ""
@obj external saturate: (~saturate: float) => filter = ""
@obj external sepia: (~sepia: float) => filter = ""
@obj external dropShadow: (~dropShadow: dropShadow) => filter = ""

external unsafeFilter: {..} => filter = "%identity"

type resizeMode = [#cover | #contain | #stretch | #repeat | #center]

type fontStyle = [#normal | #italic]
Expand Down Expand Up @@ -286,6 +316,8 @@ type viewCoreStyle = {
borderTopLeftRadius?: float,
borderTopRightRadius?: float,
borderTopStartRadius?: float,
boxShadow?: array<boxShadow>,
filter?: array<filter>,
elevation?: float,
opacity?: float,
}
Expand Down
4 changes: 2 additions & 2 deletions src/apis/Vibration.res
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
@scope("Vibration") @module("react-native")
external vibrateWithDuration: (int, ~repeat: bool=?, unit) => unit = "vibrate"
external vibrateWithDuration: (int, ~repeat: bool=?) => unit = "vibrate"

@scope("Vibration") @module("react-native")
external vibrateWithPattern: (array<int>, ~repeat: bool=?, unit) => unit = "vibrate"
external vibrateWithPattern: (array<int>, ~repeat: bool=?) => unit = "vibrate"

@scope("Vibration") @module("react-native")
external cancel: unit => unit = "cancel"
1 change: 0 additions & 1 deletion src/components/Image.res
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,6 @@ external getSize: (
~uri: string,
~success: (~width: float, ~height: float) => unit,
~failure: sizeError => unit=?,
unit,
) => unit = "getSize"

type requestId
Expand Down
4 changes: 2 additions & 2 deletions src/elements/DrawerLayoutAndroidMethods.res
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ module Make = (
type t
},
) => {
@send external openDrawer: (T.t, unit) => unit = "openDrawer"
@send external closeDrawer: (T.t, unit) => unit = "closeDrawer"
@send external openDrawer: T.t => unit = "openDrawer"
@send external closeDrawer: T.t => unit = "closeDrawer"
}
Loading