Skip to content

Commit

Permalink
First publication
Browse files Browse the repository at this point in the history
  • Loading branch information
sgny committed Jun 17, 2019
0 parents commit 3e76c3e
Show file tree
Hide file tree
Showing 26 changed files with 465 additions and 0 deletions.
11 changes: 11 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# macOS Finder artifacts
.DS_Store

# node
node_modules

# ocaml/reason build artifacts
.bsb.lock
**/lib/bs
**/lib/ocaml
**/.merlin
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# BuckleScript bindings to React Native Maps

[![Version](https://img.shields.io/npm/v/reason-react-native-maps.svg)](https://www.npmjs.com/package/reason-react-native-maps)

These are complete BuckleScript bindings to [`React Native Maps`](react-native-community/react-native-maps), in Reason syntax.

Version of these bindings follow that of the `React Native Maps` package.

Documentation will be added later.
21 changes: 21 additions & 0 deletions bsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"name": "reason-react-native-maps",
"namespace": "react-native-maps",
"refmt": 3,
"reason": {
"react-jsx": 3
},
"package-specs": {
"module": "commonjs",
"in-source": true
},
"suffix": ".bs.js",
"sources": [
{
"dir": "src",
"subdirs": false
}
],
"bsc-flags": ["-bs-no-version-header", "-warn-error @a"],
"bs-dependencies": ["reason-react", "reason-react-native"]
}
29 changes: 29 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"name": "reason-react-native-maps",
"version": "0.24.0",
"author": "sgny (https://github.com/sgny)",
"repository": "https://github.com/sgny/reason-react-native-maps.git",
"license": "MIT",
"keywords": [
"reason",
"reasonml",
"bucklescript",
"react-native",
"react-native-maps"
],
"scripts": {
"clean": "bsb -clean-world",
"start": "bsb -make-world -w",
"build": "bsb -make-world",
"clean-build": "bsb -clean-world -make-world"
},
"peerDependencies": {
"bs-platform": "~5.0.4",
"react-native": "~0.59.9",
"reason-react": "^0.7.0",
"reason-react-native": "^0.60.0"
},
"dependencies": {
"react-native-maps": "~0.24.0"
}
}
1 change: 1 addition & 0 deletions src/Callout.bs.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */
12 changes: 12 additions & 0 deletions src/Callout.re
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[@react.component] [@bs.module "react-native-maps/lib/components/MapCallout"]
// supports view props
external make:
(
~tooltip: bool=?,
~alphaHitTest: bool=?,
~onPress: unit => unit=?,
~style: ReactNative.Style.t=?,
~children: React.element=?
) =>
React.element =
"default";
1 change: 1 addition & 0 deletions src/CalloutSubview.bs.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */
11 changes: 11 additions & 0 deletions src/CalloutSubview.re
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[@react.component]
[@bs.module "react-native-maps/lib/components/MapCalloutSubview"]
// supports view props
external make:
(
~onPress: unit => unit=?,
~style: ReactNative.Style.t=?,
~children: React.element=?
) =>
React.element =
"default";
1 change: 1 addition & 0 deletions src/Circle.bs.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */
20 changes: 20 additions & 0 deletions src/Circle.re
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
[@react.component] [@bs.module "react-native-maps/lib/components/MapCircle"]
external make:
(
~center: LatLng.t,
~radius: float,
~strokeWidth: float=?,
~strokeColor: ReactNative.Color.t=?,
~fillColor: ReactNative.Color.t=?,
~zIndex: int=?,
~lineCap: [@bs.string] [ | `butt | `round | `square]=?,
~lineJoin: [@bs.string] [ | `bevel | `miter | `round]=?,
~miterLimit: int=?,
~geodesic: bool=?,
~lineDashPhase: int=?,
~lineDashPattern: array(int)=?,
~style: ReactNative.Style.t=?,
~children: React.element=?
) =>
React.element =
"default";
1 change: 1 addition & 0 deletions src/LatLng.bs.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */
3 changes: 3 additions & 0 deletions src/LatLng.re
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
type t;

[@bs.obj] external create: (~latitude: float, ~longitude: float) => t = "";
1 change: 1 addition & 0 deletions src/MapView.bs.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */
201 changes: 201 additions & 0 deletions src/MapView.re
Original file line number Diff line number Diff line change
@@ -0,0 +1,201 @@
include Shared;

type element;

type camera;
[@bs.obj]
external camera:
(
~center: LatLng.t,
~pitch: float,
~heading: float,
~altitude: float=?,
~zoom: int=?,
unit
) =>
camera =
"";

type edgePadding;
[@bs.obj]
external edgePadding:
(~top: float, ~right: float, ~bottom: float, ~left: float) => edgePadding =
"";

type edgeInsets;
[@bs.obj]
external edgeInsets:
(~top: float, ~left: float, ~bottom: float, ~right: float) => edgeInsets =
"";

type marker;
[@bs.obj]
external marker:
(~id: string, ~coordinate: LatLng.t, ~title: string, ~description: string) =>
marker =
"";

type kmlContainer = {. "markers": array(marker)};

type indoorLevel = {
.
"activeLevelIndex": int,
"name": string,
"shortName": string,
};

type indoorBuilding = {
.
"underground": bool,
"activeLevelIndex": int,
"levels": array(indoorLevel),
};

type frame = {
.
"x": float,
"y": float,
"width": float,
"height": float,
};

[@bs.send] external getCamera: (element, unit) => unit = "";
[@bs.send]
external animateCamera: (element, camera, {. "duration": float}) => unit = "";
[@bs.send]
external setCamera: (element, camera, {. "duration": float}) => unit = "";
[@bs.send] external animateToRegion: (element, Region.t, float) => unit = "";
[@bs.send]
external getMapBoundaries:
(element, unit) =>
Js.Promise.t({
.
"northEast": LatLng.t,
"southWest": LatLng.t,
}) =
"";
[@bs.send]
external setMapBoundaries:
(
element,
{
.
"northEast": LatLng.t,
"southWest": LatLng.t,
}
) =>
unit =
"";
[@bs.send] external setIndoorActiveLevelIndex: (element, int) => unit = "";
[@bs.send] external fitToElements: (element, bool) => unit = "";
[@bs.send]
external fitToSuppliedMarkers:
(
element,
array(string),
{
.
"edgePadding": edgePadding,
"animated": bool,
}
) =>
unit =
"";
[@bs.send]
external fitToCoordinates:
(
element,
array(LatLng.t),
{
.
"edgePadding": edgePadding,
"animated": bool,
}
) =>
unit =
"";
[@bs.send]
external pointForCoordinate: (element, LatLng.t) => Js.Promise.t(point) = "";
[@bs.send]
external coordinateForPoint: (element, point) => Js.Promise.t(LatLng.t) = "";
[@bs.send]
external getMarkersFrames:
(element, bool) =>
Js.Promise.t({
.
"markerID": {
.
"point": point,
"frame": frame,
},
}) =
"";

[@react.component] [@bs.module "react-native-maps/lib/components/MapView"]
external make:
(
~provider: [@bs.string] [ | `google]=?,
~region: Region.t,
~initialRegion: Region.t,
~camera: camera=?,
~initialCamera: camera=?,
~mapPadding: edgePadding=?,
~paddingAdjustmentBehavior: [@bs.string] [ | `always | `automatic | `never]
=?,
~liteMode: bool=?,
~mapType: [@bs.string] [
| `standard
| `satellite
| `hybrid
| `none
| `terrain
| `mutedStandard
]
=?,
~showsUserLocation: bool=?,
~userLocationAnnotationTitle: string=?,
~followsUserLocation: bool=?,
~showsMyLocationButton: bool=?,
~showsPointsOfInterest: bool=?,
~showsCompass: bool=?,
~showsScale: bool=?,
~showsBuildings: bool=?,
~showsTraffic: bool=?,
~showsIndoors: bool=?,
~showsIndoorLevelPicker: bool=?,
~zoomEnabled: bool=?,
~zoomControlEnabled: bool=?,
~minZoomLevel: int=?,
~maxZoomLevel: int=?,
~rotateEnabled: bool=?,
~scrollEnabled: bool=?,
~pitchEnabled: bool=?,
~toolbarEnabled: bool=?,
~cacheEnabled: bool=?,
~loadingEnabled: bool=?,
~loadingIndicatorColor: ReactNative.Color.t=?,
~loadingBackgroundColor: ReactNative.Color.t=?,
~moveOnMarkerPress: bool=?,
~onRegionChange: ReactNative.Event.syntheticEvent(Region.t) => unit=?,
~onRegionChangeComplete: ReactNative.Event.syntheticEvent(Region.t) =>
unit
=?,
~onPress: ReactNative.Event.syntheticEvent(copos) => unit=?,
~onLongPress: ReactNative.Event.syntheticEvent(copos) => unit=?,
~onPanDrag: ReactNative.Event.syntheticEvent(copos) => unit=?,
~onPoiClick: ReactNative.Event.syntheticEvent(poi) => unit=?,
~onMapReady: unit => unit=?,
~onKmlReady: ReactNative.Event.syntheticEvent(kmlContainer) => unit=?,
~onIndoorLevelActivated: ReactNative.Event.syntheticEvent(indoorLevel) =>
unit
=?,
~onIndoorBuildingFocused: ReactNative.Event.syntheticEvent(
indoorBuilding,
) =>
unit
=?,
~style: ReactNative.Style.t=?,
~children: React.element=?
) =>
React.element =
"default";
1 change: 1 addition & 0 deletions src/Marker.bs.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */
44 changes: 44 additions & 0 deletions src/Marker.re
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
include Shared;

type element;

[@react.component] [@bs.module "react-native-maps/lib/components/MapMarker"]
external make:
(
~title: string=?,
~description: string=?,
~image: ReactNative.Image.Source.t=?,
~icon: ReactNative.Image.Source.t=?,
~pinColor: string=?,
~coordinate: LatLng.t,
~centerOffset: point=?,
~calloutOffset: point=?,
~anchor: point=?,
~calloutAnchor: point=?,
~flat: bool=?,
~identifier: string=?,
~rotation: float=?,
~draggable: bool=?,
~tracksViewChanges: bool=?,
~tracksInfoWindowChanges: bool=?,
~stopPropagation: bool=?,
~opacity: float=?,
~onPress: ReactNative.Event.syntheticEvent(copos) => unit=?,
~onSelect: ReactNative.Event.syntheticEvent(copos) => unit=?,
~onDeselect: ReactNative.Event.syntheticEvent(copos) => unit=?,
~onCalloutPress: unit => unit=?,
~onDragStart: ReactNative.Event.syntheticEvent(copos) => unit=?,
~onDrag: ReactNative.Event.syntheticEvent(copos) => unit=?,
~onDragEnd: ReactNative.Event.syntheticEvent(copos) => unit=?,
~style: ReactNative.Style.t=?,
~children: React.element=?
) =>
React.element =
"default";

[@bs.send] external showCallout: (element, unit) => unit = "";
[@bs.send] external hideCallout: (element, unit) => unit = "";
[@bs.send] external redrawCallout: (element, unit) => unit = "";
[@bs.send]
external animateMarkerToCoordinate: (element, LatLng.t, float) => unit = "";
[@bs.send] external redraw: (element, unit) => unit = "";
1 change: 1 addition & 0 deletions src/Overlay.bs.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */
11 changes: 11 additions & 0 deletions src/Overlay.re
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[@react.component] [@bs.module "react-native-maps/lib/components/MapOverlay"]
// supports view props
external make:
(
~image: ReactNative.Image.Source.t=?,
~bounds: array(LatLng.t),
~style: ReactNative.Style.t=?,
~children: React.element=?
) =>
React.element =
"default";
1 change: 1 addition & 0 deletions src/Polygon.bs.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */
Loading

0 comments on commit 3e76c3e

Please sign in to comment.