-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathindex.d.ts
46 lines (37 loc) · 1.17 KB
/
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
import sequlize from 'sequelize';
declare enum Relation {
HAS_ONE = 'hasOne',
BELONG_TO = 'belongsTo',
HAS_MANY = 'hasMany',
MANY_TO_MANY = 'belongsToMany'
}
declare interface ThinkSequelize extends sequlize.Model<any, any> {
new(modelName: string, config: object, name?: string): ThinkSequelize;
readonly tablePrefix: string
readonly tableName: string
readonly models: any
sequel(modelName: string): ThinkSequelize
addInstanceMethod(fn: () => any): void
Sequel: typeof sequlize
Relation: typeof Relation
}
declare interface ThinkSequelInst {
Sequel: ThinkSequelize
}
declare interface ThinkSequelMethod {
sequel(modelName: string, config: object, m?: string): ThinkSequelize
}
declare module 'thinkjs' {
interface Think extends ThinkSequelInst, ThinkSequelMethod {}
interface Controller extends ThinkSequelMethod {}
interface Context extends ThinkSequelMethod {}
interface Service extends ThinkSequelMethod {}
}
declare interface IThinkSequelize {
think: ThinkSequelInst & ThinkSequelMethod
controller: ThinkSequelMethod
context: ThinkSequelMethod
service: ThinkSequelMethod
}
declare function model(app: object): IThinkSequelize;
export = model