Skip to content

Commit

Permalink
fix(types): initial types for use with TypeScript
Browse files Browse the repository at this point in the history
  • Loading branch information
MrSwitch committed Sep 29, 2021
1 parent 40d23ad commit cee7d39
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
17 changes: 17 additions & 0 deletions @types/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
interface DigitalHubApiConstructorOptions {
username: string;
password: string;
tenant: string;
}

interface DigitalHubApiCallOptions {
path: string;
method?: 'GET' | 'POST' | 'PUT' | 'DELETE';
body?: any;
json?: boolean;
}

export default class DigitalHubApi {
constructor(options: DigitalHubApiConstructorOptions);
api(options: DigitalHubApiCallOptions): Promise<Response | Object>;
}
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"engines": {
"node": ">=14.17.0"
},
"types": "./@types/index.d.ts",
"scripts": {
"lint": "eslint ./",
"lint-fix": "eslint --fix ./",
Expand Down

0 comments on commit cee7d39

Please sign in to comment.