-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathindex.d.ts
More file actions
44 lines (38 loc) · 871 Bytes
/
index.d.ts
File metadata and controls
44 lines (38 loc) · 871 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
34
35
36
37
38
39
40
41
42
43
44
/**
* xl created at 2019-04-16 18:23:51
*/
import 'egg';
import { Sequelize, Model, SequelizeOptions } from 'sequelize-typescript';
/**
* 连接实例 MAP
*/
interface Clients<V> {
get(kye: String): V;
}
// egg 申明合并
declare module 'egg' {
interface TsSequelizeModel {
[propName: string]: typeof Model;
}
// extend app
interface Application {
sequelize: Clients<InstanceType<typeof Sequelize>>;
model: TsSequelizeModel;
}
interface TsSequelizeOptions extends SequelizeOptions {
isAutoSync?: boolean;
}
// extend your config
interface EggAppConfig {
sequelize?: {
clients: {
[index: string]: TsSequelizeOptions;
}
default: TsSequelizeOptions;
// 是否加载到 app,默认 true
app?: boolean;
// 是否加载到 agent,默认 false
agent?: boolean;
},
}
}