-
Notifications
You must be signed in to change notification settings - Fork 145
/
plugin.js
45 lines (40 loc) · 938 Bytes
/
plugin.js
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
/**
* The plugin's loading stage.
*
* none = the plugin has not been loaded
* ok = we're ready to go
* error = something horrible has happened
*/
// export type PluginLoadState = 'none' | 'ok' | 'error'
/**
* The error state.
*
* none = no problems
* input = invalid directory input
* missingdir = can't find the plugin directory
* baddname = this name is not permitted
*/
// export type PluginErrorState =
// 'none' | 'input' | 'missingdir'
/**
* Extends the environment with new commands.
*/
class Plugin {
constructor () {
this.name = null
this.loadState = 'none'
this.errorState = 'none'
this.description = null
this.defaults = {}
this.directory = null
this.errorMessage = null
this.hidden = false
/**
* A list of commands.
*/
this.commands = []
this.extensions = []
this.exception = null
}
}
module.exports = Plugin