-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.d.ts
executable file
·103 lines (96 loc) · 2.02 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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
export interface INamespaceOption {
// TODO: Options for namespace customizing, like middlewares and so on
}
export interface IServerOptions {
devmode: boolean,
host: null | string,
port: number,
secure: boolean,
ssl: {
certPath: string,
keyPath: string,
certChainPath: string,
passphrase: string,
},
api: {
auth: {
token: string,
},
allowCors: boolean,
allowOrigin: string,
allowMethods: string,
allowHeaders: string,
},
socketio: {
namespaces: {
'/': INamespaceOption,
[key: string]: INamespaceOption,
},
options: {
//
},
},
app: {
baseURL: string,
auth: {
token: string,
},
},
database: {
driver: string,
tables: {
[key: string]: string,
},
mysql: {
host: string,
port: number,
user: string,
password: string,
database: string,
},
memcached: {
//
},
},
}
export interface IErrorPacket {
message: string,
event: string,
response?: {
status: number,
data: any,
},
}
export interface ISocketRes {
id: string,
pure_id: string,
nsp: string,
handshake: object,
decoded_token?: object,
}
export interface IEventRes {
name: string,
callback?: boolean,
args?: any[],
reason?: string,
error?: any,
}
export interface IEventErrorRes {
// TODO: Structure for event error object
}
export interface ISocketRecord {
id: string,
data: {
rooms: string[],
handshake: object,
decoded_token?: object,
},
created_at: number,
updated_at: number,
}
export interface ISocketRow {
id: string,
data: string,
created_at?: number,
updated_at: number,
}