@discord-player/plugin-host
Entry point @discord-player/plugin-host in @discord-player/plugin-host (TypeScript API).
You are reading the v8 docsDev
Entry pointTypeScript@discord-player/plugin-host
Classes
| BaseExtractor | Minimal v7 lifecycle and source API, adapted to the source operation registry. |
| DiscordPlayerError | Base error carrying a stable Discord Player error code. |
| ExtractorExecutionContext | Small legacy ownership adapter; all execution goes through player.plugins. |
| IllegalHookInvocationError | Error thrown when a guild-scoped hook cannot resolve a Player or guild queue. |
| LrcLib | LRCLIB API client with serialized requests and bounded retries. |
| Playlist | A playlist and its tracks, independent of any Discord client library. |
| PluginError | Failure attributed to a source registration and lifecycle stage or operation. |
| PluginRegistry | Context-owned capability registry. Removal aborts and drains calls before teardown. |
| SafeEventEmitter | Typed EventEmitter with a fallback error listener so unobserved errors do not crash the process. |
| SearchResult | Familiar search result wrapper used by Player-level playback. |
| SerializationError | Error thrown when a serialization input cannot be encoded or decoded. |
| SourcePluginHost | Source runtime and the published Remedia transport sharing one set of handlers. |
| SourcePluginRuntime | Shared source execution and compatibility facade, independent of audio and Discord clients. |
| SourceUnavailableError | Error thrown when a Track has no source plugin able to produce a Remedia source. |
| Track | A Discord-library-agnostic track model. Source resolution belongs to a source plugin. |
Interfaces
| ExecuteOptions | Optional dispatch targeting and cancellation. |
| ExtractorExecutionResult | Result returned from compatibility bridge requests. |
| ExtractorSearchContext | Search context passed to legacy handle methods. |
| HandlerOptions | Handler ordering metadata. |
| LegacyPlayerContext | Source-related Player surface shared by actual Players and standalone hosts. |
| LegacyTimeData | Duration fields consumed by legacy raw-stream extractors. |
| LrcGetParams | Parameters accepted by LRCLIB's exact lookup endpoints. |
| LrcSearchParams | Search parameters supported by the LRCLIB API. |
| LrcSearchResult | Lyrics record returned by LRCLIB search. |
| LyricsLine | One normalized synchronized lyric line. |
| LyricsRequest | Lookup input shared by local plugins and HTTP metadata transport. |
| LyricsResult | Provider-neutral lyrics record; either representation may be absent. |
| MediaAccessPolicy | Access limits for remote media materialization. Providers execute trusted code; this is not a plugin sandbox. |
| Operation | Declaration merged operation contract. |
| OperationContext | Per-invocation cancellation supplied to all handlers. |
| OperationMap | Extensible source operation contracts. Augmented operations also need host definitions. |
| PlaylistData | Metadata used to construct a Playlist. |
| PlaylistJSON | JSON-compatible Playlist representation. |
| PluginContext | Source setup context shared by embedded and standalone execution. |
| PluginDefinition | Source declaration reusable across Player instances. |
| PluginRegistration | Registration descriptor produced by a factory. |
| PortableLyricsRequest | Lyrics metadata request; persistence intentionally excludes runtime source-state hints. |
| PortableSourceQuery | Portable search input, normalized before crossing the metadata boundary. |
| PortableSourceResult | HTTP metadata response payload inside Remedia's handled/result envelope. |
| ProviderMap | Declaration-merged singleton services supplied only by modern plugins. |
| RemotePluginHostOptions | Existing standalone HTTP deployment. Authentication stays outside Track metadata. |
| SearchOptions | Source search and compatibility options. |
| SearchResultData | Resolved Tracks and optional source playlist metadata returned by search. |
| Serializable | Structural contract implemented by models that can produce a persistence payload. |
| SourceBridgeRequest | Fallback request excluding the original provider. |
| SourceMatch | Match result carries identity so metadata resolves through the same provider. |
| SourcePluginHostOptions | Standalone source host configuration. |
| SourcePluginRuntimeOptions | Standalone source configuration; no playback services are created. |
| SourceQuery | Search request independent of Discord client libraries. |
| SourceRelatedRequest | Related-media request with optional local legacy history. |
| SourceRuntimeEvents | Events supported by the source compatibility context. |
| SourceStreamTransform | Encoded local stream transformation payload. |
| SourceTrackRequest | Source request for one Track. |
| StreamResolutionOptions | Playback resolution configuration selected after the Remedia session is connected. |
| SynchronousOperationMap | Declaration merged names restricted to synchronous callbacks. |
| TrackData | Public metadata and optional portable source identity. |
| TrackJSON | JSON-compatible representation of a Track. |
Functions
| cloneJSONValue | Validate and clone an unknown value into JSON-safe data. Only primitives, dense arrays, and plain objects with data properties are accepted. |
| createSourcePluginHost | Create an independent source host; no HTTP server is started. |
| decode | Decode Base64 JSON without validating its entity shape. Decoded values must still pass through deserialize() before reconstruction. |
| definePlugin | Define a reusable source plugin. |
| deserialize | Reconstruct a Track from a versioned Track payload. |
| deserializeSourceResult | Reconstruct source-host metadata in a consumer process without restoring private extractor objects. The normal Track retains the transient hint without requiring a second representation. |
| encode | Encode a versioned serialized entity as Base64 JSON. |
| normalizeLyrics | Normalize and validate a lyrics record once, including sorted synchronized timestamps. |
| parseLyrics | Parse LRC once, including multiple timestamps and decimal-second fractions. |
| searchLyrics | Resolve lyrics through the same operation registry as source metadata. |
| serialize | Serialize any model that follows the structural Serializable contract. The returned value is checked at runtime so custom implementations cannot emit non-JSON data. |
| serializeSourceTrack | Encode a queued Track for a host operation, retaining its transient state hint. |
Type aliases
| DiscordPlayerErrorCode | Error code union for Discord Player errors. |
| DispatchPolicy | Operation dispatch behavior. |
| Encodable | Compatibility alias for the supported serialized entity union. |
| EventMap | Event map whose values are listener argument tuples. |
| ExtractorConstructor | Class constructors only: instances and modern plugin descriptors are not accepted. |
| ExtractorInfo | Legacy extractor result. |
| ExtractorResolvable | Legacy identifier or owned instance. |
| ExtractorStreamable | Legacy encoded source; format hints cannot restore the obsolete audio stack. |
| JSONPrimitive | JSON scalar value accepted by Discord Player persistence payloads. |
| JSONValue | Deep JSON-compatible value accepted by the serialization contract. |
| LrcGetResult | Lyrics record returned by the LRCLIB exact lookup endpoints. |
| MediaResource | Media accepted by the public player orchestration API. Strings are dispatched to source plugins. |
| MetadataRequest | Direct HTTP metadata request, also suitable for future generic forwarding. |
| NextFunction | Legacy post-stream callback. |
| OperationHandler | A handler may decline only by returning undefined. |
| OperationInput | Typed input selected by operation name. |
| OperationName | Names available to source plugins. |
| OperationOutput | Typed handler result selected by operation name. |
| OperationResult | Dispatch result selected by the declared policy. |
| PluginFactory | Factory requires options only when the options type has required fields. |
| PortableSourceTrack | Versioned metadata plus an optional, expiring host-owned process-state hint. Use serializeSourceTrack() for operation requests; serialize() deliberately omits the hint. |
| ProviderReference | Serializable provider identity; never put credentials or live objects in this payload. |
| RawTrackData | Legacy raw construction fields; live engines and callbacks remain process-local. |
| SearchQueryType | Legacy query hint, including provider-defined string values. |
| SerializedEntity | A versioned, discriminated serialized entity. |
| SerializedEntityUnion | Versioned persistence entities supported by Discord Player. |
| SerializedPlaylist | Version 1 persistence representation of a Playlist. |
| SerializedPlaylistData | Public Playlist fields stored by the versioned persistence format. |
| SerializedTrack | Version 1 persistence representation of a Track. |
| SerializedTrackData | Public Track fields stored by the versioned persistence format. |
| SourceStream | Supported local source results. Readables and byte buffers require embedded Remedia. |
| TrackRequester | Requester identifier or a structural requester object. |
| TrackSource | Name or identifier for a Track's source integration. |
| WithMetadata | Legacy metadata refinement for custom extractor helpers. |
Variables
| DiscordPlayerErrorCode | Public error codes for Discord Player's application-level failures. |
| lrclibPlugin | Optional LRCLIB provider. No provider is installed by constructing a Player. |
| QueryType | Legacy symbolic query hints. Uppercase underscore keys map to their v7 camel-case string values. Source-specific routing stays in plugins; this object performs no network or URL classification. |
| SERIALIZATION_SCHEMA_VERSION | Current Discord Player serialization schema version, independent of package versions. |
| SerializedType | Entity discriminator values used in versioned persistence payloads. |
| SOURCE_PLUGIN_ID | Stable aggregate protocol registration identifier. |
| Util | Small metadata helpers; obsolete voice and transcoding helpers are intentionally unavailable. |