-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
/
plugin.ts.template
42 lines (31 loc) · 886 Bytes
/
plugin.ts.template
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
/**
* The Template plugin
*/
import BasePlugin, { type BasePluginEvents } from '../base-plugin.js'
export type TemplatePluginOptions = {
}
const defaultOptions = {
}
export type TemplatePluginEvents = BasePluginEvents & {
}
export class TemplatePlugin extends BasePlugin<TemplatePluginEvents, TemplatePluginOptions> {
protected options: TemplatePluginOptions & typeof defaultOptions
constructor(options?: TemplatePluginOptions) {
super(options || {})
this.options = Object.assign({}, defaultOptions, options)
}
public static create(options?: TemplatePluginOptions) {
return new TemplatePlugin(options)
}
/** Called by wavesurfer, don't call manually */
onInit() {
if (!this.wavesurfer) {
throw Error('WaveSurfer is not initialized')
}
}
/** Unmount */
public destroy() {
super.destroy()
}
}
export default TemplatePlugin