Skip to content

Commit d498c06

Browse files
committed
ReScript
1 parent 1d7cefe commit d498c06

File tree

10 files changed

+104
-124
lines changed

10 files changed

+104
-124
lines changed

.gitattributes

Lines changed: 0 additions & 3 deletions
This file was deleted.

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ node_modules
99
# npm unused lock file (we use yarn.lock)
1010
package-lock.json
1111

12-
# ReScript / Reason / Ocaml artifacts
13-
#*.bs.js # we do want this files to ensure zero-cost
12+
# ReScript artifacts
13+
# *.bs.js # we do want this files to ensure zero-cost
1414
.bsb.lock
1515
**/lib/bs
1616
**/lib/ocaml

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Changelog of `@reason-react-native/geolocation`
1+
# Changelog of `@rescript-react-native/geolocation`
22

33
## 2.0.2 - 2020-11-17
44

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2019 @reason-react-native contributors
3+
Copyright (c) 2019 @rescript-react-native contributors
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
# `@reason-react-native/geolocation`
1+
# `@rescript-react-native/geolocation`
22

3-
[![Build Status](https://github.com/reason-react-native/geolocation/workflows/Build/badge.svg)](https://github.com/reason-react-native/geolocation/actions)
4-
[![Version](https://img.shields.io/npm/v/@reason-react-native/geolocation.svg)](https://www.npmjs.com/@reason-react-native/geolocation)
5-
[![Chat](https://img.shields.io/discord/235176658175262720.svg?logo=discord&colorb=blue)](https://reason-react-native.github.io/discord/)
3+
[![Build Status](https://github.com/rescript-react-native/geolocation/workflows/Build/badge.svg)](https://github.com/rescript-react-native/geolocation/actions)
4+
[![Version](https://img.shields.io/npm/v/@rescript-react-native/geolocation.svg)](https://www.npmjs.com/@rescript-react-native/geolocation)
5+
[![ReScript Forum](https://img.shields.io/discourse/posts?color=e6484f&label=ReScript%20Forum&server=https%3A%2F%2Fforum.rescript-lang.org)](https://forum.rescript-lang.org/)
66

7-
[ReScript](https://rescript-lang.org) / [Reason](https://reasonml.github.io) bindings for
7+
[ReScript](https://rescript-lang.org) bindings for
88
[`@react-native-community/geolocation`](https://github.com/react-native-geolocation/react-native-geolocation).
99

1010
Exposed as `ReactNativeGeolocation` module.
1111

12-
`@reason-react-native/geolocation` X.y.\* means it's compatible with
12+
`@rescript-react-native/geolocation` X.y.\* means it's compatible with
1313
`@react-native-community/geolocation` X.y.\*
1414

1515
## Installation
@@ -20,22 +20,22 @@ is properly installed & configured by following their installation instructions,
2020
you can install the bindings:
2121

2222
```console
23-
npm install @reason-react-native/geolocation
23+
npm install @rescript-react-native/geolocation
2424
# or
25-
yarn add @reason-react-native/geolocation
25+
yarn add @rescript-react-native/geolocation
2626
```
2727

28-
`@reason-react-native/geolocation` should be added to `bs-dependencies` in your
28+
`@rescript-react-native/geolocation` should be added to `bs-dependencies` in your
2929
`bsconfig.json`:
3030

3131
```diff
3232
{
3333
//...
3434
"bs-dependencies": [
35-
"reason-react",
36-
"reason-react-native",
35+
"@rescript/react",
36+
"rescript-react-native",
3737
// ...
38-
+ "@reason-react-native/geolocation"
38+
+ "@rescript-react-native/geolocation"
3939
],
4040
//...
4141
}
@@ -69,11 +69,11 @@ releases.
6969
## Contribute
7070

7171
Read the
72-
[contribution guidelines](https://github.com/reason-react-native/.github/blob/master/CONTRIBUTING.md)
72+
[contribution guidelines](https://github.com/rescript-react-native/.github/blob/master/CONTRIBUTING.md)
7373
before contributing.
7474

7575
## Code of Conduct
7676

7777
We want this community to be friendly and respectful to each other. Please read
78-
[our full code of conduct](https://github.com/reason-react-native/.github/blob/master/CODE_OF_CONDUCT.md)
78+
[our full code of conduct](https://github.com/rescript-react-native/.github/blob/master/CODE_OF_CONDUCT.md)
7979
so that you can understand what actions will and will not be tolerated.

bsconfig.json

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
{
2-
"name": "@reason-react-native/geolocation",
3-
"refmt": 3,
4-
"reason": {
5-
"react-jsx": 3
6-
},
2+
"name": "@rescript-react-native/geolocation",
3+
"reason": { "react-jsx": 3 },
74
"package-specs": {
85
"module": "commonjs",
96
"in-source": true

package.json

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "@reason-react-native/geolocation",
2+
"name": "@rescript-react-native/geolocation",
33
"description": "ReScript bindings for @react-native-community/geolocation.",
44
"version": "2.0.2",
55
"publishConfig": {
@@ -8,20 +8,18 @@
88
"peerDependencies": {
99
"@react-native-community/geolocation": "^2.0.0"
1010
},
11-
"repository": "https://github.com/reason-react-native/geolocation.git",
11+
"repository": "https://github.com/rescript-react-native/geolocation.git",
1212
"license": "MIT",
1313
"keywords": [
1414
"rescript",
15-
"reason",
16-
"reasonml",
17-
"bucklescript",
1815
"react-native",
1916
"geolocation"
2017
],
2118
"files": [
2219
"*.md",
2320
"bsconfig.json",
24-
"src/**/*.re",
21+
"src/**/*.res",
22+
"src/**/*.resi",
2523
"src/**/*.js",
2624
"!src/**/*.bs.js"
2725
],
@@ -38,7 +36,7 @@
3836
"release": "npmpub"
3937
},
4038
"devDependencies": {
41-
"bs-platform": "^8.2.0",
39+
"bs-platform": "^9.0.0",
4240
"husky": "^4.0.0",
4341
"lint-staged": "^10.0.0",
4442
"npmpub": "^5.0.0",

src/ReactNativeGeolocation.re

Lines changed: 0 additions & 87 deletions
This file was deleted.

src/ReactNativeGeolocation.res

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
type coords = {
2+
speed: float,
3+
longitude: float,
4+
latitude: float,
5+
accuracy: float,
6+
heading: float,
7+
}
8+
9+
type position = {
10+
coords: coords,
11+
timestamp: float,
12+
}
13+
14+
type error = {
15+
code: int,
16+
message: string,
17+
}
18+
19+
type config
20+
@obj
21+
external config: (
22+
~skipPermissionRequests: bool=?,
23+
~authorizationLevel: [#always | #auto | #whenInUse]=?,
24+
unit,
25+
) => config = ""
26+
27+
@module("@react-native-community/geolocation")
28+
external setRNConfiguration: config => unit = "setRNConfiguration"
29+
30+
@module("@react-native-community/geolocation")
31+
external requestAuthorization: unit => unit = "requestAuthorization"
32+
33+
@module("@react-native-community/geolocation")
34+
external stopObserving: unit => unit = "stopObserving"
35+
36+
type currentPositionOptions
37+
@obj
38+
external currentPositionOptions: (
39+
~timeout: float=?,
40+
~maximumAge: float=?,
41+
~enableHighAccuracy: bool=?,
42+
unit,
43+
) => currentPositionOptions = ""
44+
45+
@module("@react-native-community/geolocation")
46+
external getCurrentPosition: (
47+
position => unit,
48+
~onError: error => unit=?,
49+
~options: currentPositionOptions=?,
50+
unit,
51+
) => unit = "getCurrentPosition"
52+
53+
type watchId
54+
55+
type watchPositionOptions
56+
@obj
57+
external watchPositionOptions: (
58+
~timeout: float=?,
59+
~maximumAge: float=?,
60+
~enableHighAccuracy: bool=?,
61+
~distanceFilter: float=?,
62+
~useSignificantChanges: bool=?,
63+
unit,
64+
) => watchPositionOptions = ""
65+
66+
@module("@react-native-community/geolocation")
67+
external watchPosition: (
68+
position => unit,
69+
~onError: error => unit=?,
70+
~options: watchPositionOptions=?,
71+
unit,
72+
) => watchId = "watchPosition"
73+
74+
@module("@react-native-community/geolocation")
75+
external clearWatch: watchId => unit = "clearWatch"

yarn.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -251,10 +251,10 @@ braces@^3.0.1:
251251
dependencies:
252252
fill-range "^7.0.1"
253253

254-
bs-platform@^8.2.0:
255-
version "8.3.2"
256-
resolved "https://registry.yarnpkg.com/bs-platform/-/bs-platform-8.3.2.tgz#c307f1cc2d2397c3d088c7f3b62e9f493283cdcf"
257-
integrity sha512-iOTi5JIlNPoCPq31NS9ET79FLyCpwTL2JZbgHz35LzY9Bch1iDtbBR3FVGhRbjphxelAP4fLlFONfUNp5Y3a5g==
254+
bs-platform@^9.0.0:
255+
version "9.0.2"
256+
resolved "https://registry.yarnpkg.com/bs-platform/-/bs-platform-9.0.2.tgz#a6eac70eb8924a322556dacaccbfbc9b2a0d3a37"
257+
integrity sha512-Ye9JqJ4Oa7mcjjoOVRYI8Uc2Cf8N7jQLWDcdUplY7996d/YErSR7WitmV7XnSwr4EvdrbwjEsg1NxNjUQv3ChA==
258258

259259
callsites@^3.0.0:
260260
version "3.1.0"

0 commit comments

Comments
 (0)