Skip to content

Commit

Permalink
trying out type definition
Browse files Browse the repository at this point in the history
  • Loading branch information
ianpogi5 committed Aug 31, 2020
1 parent bac667a commit a569f28
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"version": "0.8.4",
"description": "Lightweight DynamoDB ODM",
"main": "dist/ddb.js",
"types": "types/index.d.ts",
"scripts": {
"bundle": "webpack",
"clean": "rm -fR dist",
Expand Down
13 changes: 13 additions & 0 deletions types/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
declare namespace DDB {
class Document {
toObject(): Object;
toJSON(): String;
pKey(): Object;
sKey(): Object;
}
class Schema {
constructor(fields: Object, pKey: Object, sKey: Object): void;
}
declare function db(op: String, params: Object): Promise;
declare function model(name: String, schema: Schema): Document;
}

0 comments on commit a569f28

Please # to comment.