Skip to content

Commit f1aa735

Browse files
committed
Support for typescript
1 parent 71b9483 commit f1aa735

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

index.d.ts

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
interface ISSLocation {
2+
message: string
3+
position: {
4+
latitude: number
5+
longitude: number
6+
}
7+
date_time: Date
8+
}
9+
interface Astronaut { name: string, craft: string }
10+
interface PeopleInSpace {
11+
number: number
12+
message: string
13+
people: Astronaut[]
14+
}
15+
16+
declare class OpenNotify {
17+
public static getISSLocation(): Promise<ISSLocation>
18+
public static getPeopleInSpace(): Promise<PeopleInSpace>
19+
}
20+
21+
export = OpenNotify;

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"version": "1.0.0",
44
"description": "Open Nofity API client for javascript",
55
"main": "index.js",
6+
"types": "index.d.ts",
67
"scripts": {
78
"test": "echo \"Error: no test specified\" && exit 1"
89
},

0 commit comments

Comments
 (0)