Shoukaku
    Preparing search index...

    Interface PluginEvent

    Plugin events should implement this interface to use with Player#onPluginEvent

    Example with LavaLyrics LyricsLineEvent event

    	export class LyricsLineEvent implements PluginEvent {
    public readonly pluginRequired = {
    name: 'lavalyrics-plugin',
    version: '^1.1.0'
    };

    public readonly name = 'LyricsLineEvent';

    public readonly T = t<{
    lineIndex: number;
    line: {
    timestamp: number;
    duration?: number;
    line: string;
    plugin: unknown;
    };
    skipped: boolean;
    }>;
    }
    interface PluginEvent {
        name: string;
        pluginRequired?: PluginRequirement;
        T: TFn;
    }

    Hierarchy (View Summary)

    Index

    Properties

    name: string

    Name of event

    pluginRequired?: PluginRequirement

    Plugin required by event

    T: TFn

    This hack is to work around TypeScript types not existing at runtime. We can specify the return type here.

    This function is never actually called, so the implementation can be simply:

    T = (response: unknown) => response as LavalinkResponse;
    

    Or using the t utility function

    import { t } from 'shoukaku';

    T = t<LavalinkResponse>;