plex-websocket
Version:
Read [Github](https://github.com/Forbidden-Duck/plex-websocket) README, in case of unpublished changes # Plex-Websocket A tool to allow JavaScript and Typescript users to aquire the full power of [plex-api](https://github.com/phillipj/node-plex-api) wit
18 lines (16 loc) • 618 B
JavaScript
const PlexAPI = require("plex-api");
const WSClient = require("./WebsocketClient");
/**
* @typedef {"update.statechange" | "playing" | "backgroundProcessingQueue" | "progress" | "activity" | "unknown"} types
*/
/**
* @param {PlexAPI} plexInstance
* @param {(type: types, data: object) => void} onPacket
*/
function PlexWebsocket(plexInstance, onPacket) {
return new WSClient(plexInstance, onPacket);
}
PlexWebsocket.WebsocketClient = require("./WebsocketClient");
PlexWebsocket.Webhook = require("./structures/Websocket");
PlexWebsocket.PlexAPI = PlexAPI;
module.exports = PlexWebsocket;