-
Notifications
You must be signed in to change notification settings - Fork 0
/
global.d.ts
61 lines (54 loc) · 1.42 KB
/
global.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
import { commandFormat } from '@/libs/eventReg.ts'
import { manifest } from '@/libs/loadPlugin.ts'
import { SRWebsocket, SocketHandle } from 'node-open-shamrock'
import { Knex } from 'knex'
export type messageCallback = (
event: SocketHandle['message'],
command: commandFormat | false
) => Promise<undefined | any | 'quit'>
export type noticeCallback = (event: SocketHandle['notice']) => Promise<undefined | any | 'quit'>
export type requestCallback = (event: SocketHandle['request']) => Promise<undefined | any | 'quit'>
interface messageEvent {
callback: messageCallback
priority: number
pluginName: string
}
interface noticeEvent {
callback: noticeCallback
priority: number
pluginName: string
}
interface requestEvent {
callback: requestCallback
priority: number
pluginName: string
}
declare global {
var events: {
message: messageEvent[]
notice: noticeEvent[]
request: requestEvent[]
}
var plugins: {
[pluginName: string]: {
pluginPath: string
configPath: string | null
manifest: manifest
loaded: boolean
}
} = {}
var config: { [pluginNameConfig: string]: any } = {}
var data: { [pluginNameData: string]: any } = {}
var debug: boolean
var dev: boolean
var baseDir: string
var nowLoadPluginName: string
var packageData: {
version: string
plguinVersion: string
repository: string
}
var bot: SRWebsocket
var database: Knex
}
export {}