forked from stone-lyl/egg-sequelize-ts
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.d.ts
More file actions
34 lines (27 loc) · 770 Bytes
/
Copy pathindex.d.ts
File metadata and controls
34 lines (27 loc) · 770 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import { Sequelize, ISequelizeValidationOnlyConfig } from 'sequelize-typescript';
import { SequelizeConfig } from "sequelize-typescript/lib/types/SequelizeConfig";
declare module 'egg' {
// 便于egg 将方法挂载到IModel上
interface IModel extends Sequelize { }
// extend app
interface Application {
Sequelize: Sequelize;
model: IModel;
}
// extend context
interface Context {
model: IModel;
}
// extend your config
interface EggAppConfig {
sequelize: SequelizeConfig | ISequelizeValidationOnlyConfig
}
}
// todo: 实现多配置。
// interface EggSequelizeOptions extends sequelize.Options {
// delegate?: string;
// baseDir?: string;
// }
// interface DataSources {
// [datasources]: EggSequelizeOptions;
// }