-
Notifications
You must be signed in to change notification settings - Fork 345
/
Plugin.ts
66 lines (60 loc) 路 1.05 KB
/
Plugin.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
/**
* Copyright (c) 2017 ~ present NAVER Corp.
* billboard.js project is licensed under the MIT license
*/
/**
* Base class to generate billboard.js plugin
* @class Plugin
*/
/**
* Version info string for plugin
* @name version
* @static
* @memberof Plugin
* @type {string}
* @example
* bb.plugin.stanford.version; // ex) 1.9.0
*/
export default class Plugin {
public $$;
public options;
static version = "__VERSION__";
/**
* Constructor
* @param {Any} options config option object
* @private
*/
constructor(options = {}) {
this.options = options;
}
/**
* Lifecycle hook for 'beforeInit' phase.
* @private
*/
$beforeInit() {}
/**
* Lifecycle hook for 'init' phase.
* @private
*/
$init() {}
/**
* Lifecycle hook for 'afterInit' phase.
* @private
*/
$afterInit() {}
/**
* Lifecycle hook for 'redraw' phase.
* @private
*/
$redraw() {}
/**
* Lifecycle hook for 'willDestroy' phase.
* @private
*/
$willDestroy() {
Object.keys(this).forEach(key => {
this[key] = null;
delete this[key];
});
}
}