-
Notifications
You must be signed in to change notification settings - Fork 136
/
index.d.ts
49 lines (40 loc) · 972 Bytes
/
index.d.ts
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
import * as sequelize from 'sequelize';
interface EggSequelizeOptions extends sequelize.Options {
/**
* load all models to `app[delegate]` and `ctx[delegate]`, default to `model`
*/
delegate?: string;
/**
* load models from `app/model/*.js`
*/
baseDir?: string;
/**
* ignore `app/${baseDir}/index.js` when load models, support glob and array
*/
exclude?: string | Array<string>;
/**
* A full database URI
* @example
* `connectionUri:"mysql://localhost:3306/database"`
*/
connectionUri?: string;
}
interface DataSources {
datasources: EggSequelizeOptions[];
}
declare module 'egg' {
interface IModel extends sequelize.Sequelize, PlainObject {}
// extend app
interface Application {
Sequelize: typeof sequelize;
model: IModel;
}
// extend context
interface Context {
model: IModel;
}
// extend your config
interface EggAppConfig {
sequelize: EggSequelizeOptions | DataSources;
}
}