generated from rescript-react-native/__template__
-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
110 additions
and
119 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
open ReactNative | ||
include ViewPagerElement | ||
|
||
module PageScrollEvent = { | ||
type payload = { | ||
position: int, | ||
offset: float, | ||
} | ||
include Event.SyntheticEvent({ | ||
type _payload = payload | ||
}) | ||
} | ||
|
||
module PageSelectedEvent = { | ||
type payload = {position: float} | ||
include Event.SyntheticEvent({ | ||
type _payload = payload | ||
}) | ||
} | ||
|
||
module PageScrollStateChangedEvent = { | ||
// new bs new polyvar encoding | ||
//type payload = {pageScrollState: [ | `idle | `dragging | `settling]}; | ||
type payload = {pageScrollState: string} | ||
include Event.SyntheticEvent({ | ||
type _payload = payload | ||
}) | ||
} | ||
|
||
@module("@react-native-community/viewpager") @react.component | ||
external make: ( | ||
~ref: ref=?, | ||
~initialPage: int=?, | ||
~scrollEnabled: bool=?, | ||
~onPageScroll: PageScrollEvent.t => unit=?, | ||
~onPageSelected: PageSelectedEvent.t => unit=?, | ||
~onPageScrollStateChanged: PageScrollStateChangedEvent.t => unit=?, | ||
~keyboardDismissMode: @string [#none | @as("on-drag") #onDrag]=?, | ||
~pageMargin: int=?, | ||
~onMoveShouldSetResponderCapture: ReactNative.Event.pressEvent => bool=?, | ||
~style: ReactNative.Style.t=?, | ||
~children: React.element=?, | ||
~orientation: [#horizontal | #vertical]=?, | ||
~transitionStyle: [#scroll | #curl]=?, | ||
~showPageIndicator: bool=?, | ||
~overScrollMode: ScrollView.overScrollMode=?, | ||
) => React.element = "default" |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
type element | ||
type ref = React.ref<Js.nullable<element>> | ||
|
||
include ViewPagerMethods.Make({ | ||
type t = element | ||
}) |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
module Make = ( | ||
T: { | ||
type t | ||
}, | ||
) => { | ||
@send external setPage: (T.t, int) => unit = "setPage" | ||
@send | ||
external setPageWithoutAnimation: (T.t, int) => unit = "setPageWithoutAnimation" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters