lunify.js
Version:
A basic api wrapper for the spotify api covering the oauth routes.
25 lines (24 loc) • 799 B
TypeScript
import type { Lunify, Player } from "../..";
import { PlayerDevice } from "../..";
export declare class PlayerDeviceManager {
client: Lunify;
player: Player;
constructor(client: Lunify, player: Player);
/**
* Fetch all available devices for the user and current playback
* @example ```ts
* await player.devices.fetch();
* ```
*/
fetch(): Promise<PlayerDevice[]>;
/**
* Transfer the current playback to provided device
* @param {string | string[]} device - id of the playback device
* @example ```ts
* const devices = await player.devices.fetch();
* const deviceId = devices[0].id;
* player.devices.transferPlaybackTo(deviceId);
* ```
*/
transferPlaybackTo(deviceId: string | string[]): Promise<boolean>;
}