CoolFace
Apppublic

sourav-das/stem-separator

sourceHugging Facemitupdated 6mo agoView on Hugging Face
3likes
base-plugin.d.ts23 linesDownload Raw Back to dist
1import EventEmitter from './event-emitter.js';2import type WaveSurfer from './wavesurfer.js';3export type BasePluginEvents = {4    destroy: [];5};6export type GenericPlugin = BasePlugin<BasePluginEvents, unknown>;7/** Base class for wavesurfer plugins */8export declare class BasePlugin<EventTypes extends BasePluginEvents, Options> extends EventEmitter<EventTypes> {9    protected wavesurfer?: WaveSurfer;10    protected subscriptions: (() => void)[];11    protected options: Options;12    private isDestroyed;13    /** Create a plugin instance */14    constructor(options: Options);15    /** Called after this.wavesurfer is available */16    protected onInit(): void;17    /** Do not call directly, only called by WavesSurfer internally */18    _init(wavesurfer: WaveSurfer): void;19    /** Destroy the plugin and unsubscribe from all events */20    destroy(): void;21}22export default BasePlugin;23