Skip to content

Commit

Permalink
chore:TypeScript support. (#47)
Browse files Browse the repository at this point in the history
* chore:TypeScript support.
  • Loading branch information
duncup committed Apr 9, 2018
1 parent c53612f commit 2d63647
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
28 changes: 28 additions & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import sequelize from "sequelize";

declare module 'egg' {

// extend app
interface Application {
Sequelize: sequelize;
model: sequelize.Sequelize;
}

// extend context
interface Context {
model: sequelize.Sequelize;
}

// extend your config
interface EggAppConfig {
sequelize: {
dialect: string;
database: string;
host: string;
port: number;
username: string;
password: string;
};
}

}
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"orm"
],
"dependencies": {
"@types/sequelize": "^4.27.14",
"chalk": "^2.0.1",
"sequelize": "^4.4.2",
"sequelize-cli": "^2.7.0"
Expand Down

0 comments on commit 2d63647

Please sign in to comment.