Skip to content

Commit 8d7f302

Browse files
committed
Update readme for port to TypeScript
1 parent b70f9a8 commit 8d7f302

1 file changed

Lines changed: 5 additions & 16 deletions

File tree

README.md

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
# Tide predictor
44

5-
A Javascript tide harmonic calculator.
5+
A tide harmonic calculator written in TypeScript.
66

77
<!-- START DOCS -->
88

@@ -25,17 +25,6 @@ yarn add @neaps/tide-predictor
2525
2626
```
2727

28-
## Importing
29-
30-
You can import the module using Ecmascript, or CommonJS. Note that the CommonJS export is transpiled, so deep debugging the module that way will be difficult.
31-
32-
```js
33-
import TidePredictor from '@neaps/tide-predictor'
34-
const TidePredictor = require('@neaps/tide-predictor')
35-
```
36-
37-
There are also packaged and minified versions for the browser in `dist/web`.
38-
3928
# Usage
4029

4130
Neaps requires that you [provide your own tidal harmonics information](#constituent-object) to generate a prediction.
@@ -44,7 +33,7 @@ Because many constituent datum come with multiple phases (in the case of NOAA's
4433

4534
Note that, for now, Neaps **will not** do any timezone corrections. This means you need to pass date objects that align with whatever timezone the constituents are in.
4635

47-
```javascript
36+
```typescript
4837
import TidePredictor from '@neaps/tide-predictor'
4938

5039
const constituents = [
@@ -83,7 +72,7 @@ The returned tide prediction object has various methods. All of these return reg
8372

8473
Returns the predicted high and low tides between a start and end date.
8574

86-
```javascript
75+
```typescript
8776
const startDate = new Date()
8877
const endDate = new Date(startDate + 3 * 24 * 60 * 60 * 1000)
8978
const tides = TidePredictor(constituents).getExtremesPrediction({
@@ -99,7 +88,7 @@ const tides = TidePredictor(constituents).getExtremesPrediction({
9988

10089
If you want predictions for a subservient station, first set the reference station in the prediction, and pass the [subservient station offests](#subservient-station) to the `getExtremesPrediction` method:
10190

102-
```javascript
91+
```typescript
10392
const tides = TidePredictor(constituents).getExtremesPrediction({
10493
start: startDate,
10594
end: endDate,
@@ -142,7 +131,7 @@ High and low tides are returned as arrays of objects:
142131

143132
Gives you the predicted water level at a specific time.
144133

145-
```javascript
134+
```typescript
146135
const waterLevel = TidePredictor(constituents).getWaterLevelAtTime({
147136
time: new Date()
148137
})

0 commit comments

Comments
 (0)