UNPKG

larakazagumo

Version:

A shoukaku wrapper with built-in queue support.

71 lines (70 loc) 2.2 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.KazagumoError = exports.KazagumoPlugin = exports.PlayerState = exports.SupportedSources = exports.Events = exports.SourceIDs = exports.escapeRegExp = void 0; const escapeRegExp = (str) => str.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'); exports.escapeRegExp = escapeRegExp; exports.SourceIDs = { youtube: 'yt', youtube_music: 'ytm', soundcloud: 'sc', }; exports.Events = { // Player events PlayerDestroy: 'playerDestroy', PlayerCreate: 'playerCreate', PlayerStart: 'playerStart', PlayerEnd: 'playerEnd', PlayerEmpty: 'playerEmpty', PlayerClosed: 'playerClosed', PlayerUpdate: 'playerUpdate', PlayerException: 'playerException', PlayerError: 'playerError', PlayerResumed: 'playerResumed', PlayerStuck: 'playerStuck', PlayerResolveError: 'playerResolveError', PlayerMoved: 'playerMoved', QueueUpdate: 'queueUpdate', // Kazagumo events Debug: 'debug', }; exports.SupportedSources = [ 'bandcamp', 'beam', 'getyarn', 'http', 'local', 'nico', 'soundcloud', 'stream', 'twitch', 'vimeo', 'youtube', 'spotify', ]; var PlayerState; (function (PlayerState) { PlayerState[PlayerState["CONNECTING"] = 0] = "CONNECTING"; PlayerState[PlayerState["CONNECTED"] = 1] = "CONNECTED"; PlayerState[PlayerState["DISCONNECTING"] = 2] = "DISCONNECTING"; PlayerState[PlayerState["DISCONNECTED"] = 3] = "DISCONNECTED"; PlayerState[PlayerState["DESTROYING"] = 4] = "DESTROYING"; PlayerState[PlayerState["DESTROYED"] = 5] = "DESTROYED"; })(PlayerState || (exports.PlayerState = PlayerState = {})); class KazagumoPlugin { load(kazagumo) { throw new KazagumoError(1, 'Plugin must implement load()'); } unload(kazagumo) { throw new KazagumoError(1, 'Plugin must implement unload()'); } } exports.KazagumoPlugin = KazagumoPlugin; /* tslint:disable:max-classes-per-file */ class KazagumoError extends Error { constructor(code, message) { super(message); this.code = code; this.message = message; } } exports.KazagumoError = KazagumoError;