Skip to content

Commit

Permalink
try to add type defs
Browse files Browse the repository at this point in the history
  • Loading branch information
jessedp committed Apr 19, 2020
1 parent a33edf0 commit 26d2c2d
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 4 deletions.
8 changes: 5 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@
"url": "https://github.com/jessedp/tablo-api-js"
},
"main": "dist/index.js",
"types": "dist/index.d.js",
"scripts": {
"build": "yarn lint && tsc -p tsconfig.json",
"format": "prettier --write \"src/**/*.ts\" \"src/**/*.js\"",
"format": "prettier --write \"src/**/*.ts\" \"src/**/*.d.*ts\" \"src/**/*.js\"",
"lint": "tslint -p tsconfig.json",
"test": "echo \"Error: no test specified\" && exit 0",
"prepare": "yarn lint && yarn build",
Expand All @@ -33,11 +34,12 @@
},
"license": "MIT",
"dependencies": {
"axios": "^0.19.0",
"axios": "^0.19.2",
"byte-data": "^16.0.3",
"core-js": "^3.3.2",
"debug": "^4.1.1",
"structjs": "^0.2.2"
"structjs": "^0.2.2",
"tablo-api": "^0.4.0"
},
"devDependencies": {
"@types/debug": "^4.1.5",
Expand Down
32 changes: 32 additions & 0 deletions src/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
// import { Tablo } from "./index"
import Device from "./Device";
import ServerInfo from "./ServerInfo";

/**
Simple API for accessing Tablo devices
*/
export class Tablo {
constructor(...args: any[]);

batch(...args: any[]): void;

delete(...args: any[]): void;

discover(...args: any[]): Device;

get(...args: any[]): void;

getRecordings(...args: any[]): void;

getRecordingsCount(...args: any[]): void;

getServerInfo(...args: any[]): ServerInfo;

getUrl(...args: any[]): void;

isReady(...args: any[]): void;

post(...args: any[]): void;

}

13 changes: 12 additions & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ astral-regex@^1.0.0:
resolved "https://registry.yarnpkg.com/astral-regex/-/astral-regex-1.0.0.tgz#6c8c3fb827dd43ee3918f27b82782ab7658a6fd9"
integrity sha512-+Ryf6g3BKoRc7jfp7ad8tM4TtMiaWvbF/1/sQcZPkkS7ag3D5nMBCe2UfOTONtAkaG0tO0ij3C5Lwmf1EiyjHg==

axios@^0.19.0:
axios@^0.19.0, axios@^0.19.2:
version "0.19.2"
resolved "https://registry.yarnpkg.com/axios/-/axios-0.19.2.tgz#3ea36c5d8818d0d5f8a8a97a6d36b86cdc00cb27"
integrity sha512-fjgm5MvRHLhx+osE2xoekY70AhARk3a6hkN+3Io1jc00jtquGvxYlKlsFUhmUET0V5te6CcZI7lcv2Ym61mjHA==
Expand Down Expand Up @@ -1303,6 +1303,17 @@ table@^5.2.3:
slice-ansi "^2.1.0"
string-width "^3.0.0"

tablo-api@^0.4.0:
version "0.4.0"
resolved "https://registry.yarnpkg.com/tablo-api/-/tablo-api-0.4.0.tgz#d33bbf3f924e556b23491be9e8b0e05cf9091587"
integrity sha512-H1QKaHQ6KTc6QLrFKNUJcVKOwDnjU9v7W0/PX4/uYvvlDTZLBmalzm/XtFY7qiuUqc2ePQ/e2lQGUeU9aLKlXQ==
dependencies:
axios "^0.19.0"
byte-data "^16.0.3"
core-js "^3.3.2"
debug "^4.1.1"
structjs "^0.2.2"

text-table@^0.2.0:
version "0.2.0"
resolved "https://registry.yarnpkg.com/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4"
Expand Down

0 comments on commit 26d2c2d

Please sign in to comment.