import type { Playable } from './base/playable.ts'; import { PlexObject } from './base/plexObject.ts'; import type { Playlist } from './playlist.ts'; import type { AddPlayQueueItemOptions, CreatePlayQueueOptions, GetPlayQueueOptions, MovePlayQueueItemOptions, PlayQueueResponse } from './playqueue.types.ts'; import type { PlexServer } from './server.ts'; type QueueItem = Playable & { playQueueItemID?: number; }; /** * Control a PlayQueue. * * A PlayQueue is a linear list of media items that can be played in sequence. * It represents the current playback queue and supports operations like adding, * removing, and reordering items. */ export declare class PlayQueue extends PlexObject { static TAG: string; static TYPE: string; /** PlayQueue identifier */ identifier: string; /** Media tag prefix path */ mediaTagPrefix: string; /** Media tag version number */ mediaTagVersion: number; /** Unique ID of the PlayQueue */ playQueueID: number; /** ID of the last added item, defines where "Up Next" region starts */ playQueueLastAddedItemID?: number; /** The queue item ID of the currently selected item */ playQueueSelectedItemID: number; /** The offset of the selected item in the PlayQueue */ playQueueSelectedItemOffset: number; /** ID of the currently selected item, matches ratingKey */ playQueueSelectedMetadataItemID: number; /** True if the PlayQueue is shuffled */ playQueueShuffled: boolean; /** Original URI used to create the PlayQueue */ playQueueSourceURI: string; /** Total number of items in the PlayQueue */ playQueueTotalCount: number; /** Version of the PlayQueue, increments on changes */ playQueueVersion: number; /** Total size of the PlayQueue (alias for playQueueTotalCount) */ size: number; /** Media object for the currently selected item */ selectedItem?: Playable; /** Cache of PlayQueue items */ private _items; /** Raw data from server */ private _data; /** * Retrieve an existing PlayQueue by identifier. */ static get(server: PlexServer, playQueueID: number, options?: GetPlayQueueOptions): Promise; /** * Create and return a new PlayQueue. */ static create(server: PlexServer, items: Playable | Playable[] | Playlist, options?: CreatePlayQueueOptions): Promise; /** * Create and return a new PlayQueue from a station key. * This is a convenience method for radio stations. */ static fromStationKey(server: PlexServer, key: string): Promise; /** * Get items in the PlayQueue. */ get items(): QueueItem[]; /** * Get item at specific index. */ getItem(index: number): Playable | null; /** * Get the length of the PlayQueue. */ get length(): number; /** * Check if the PlayQueue contains the provided media item. */ contains(media: Playable): boolean; /** * Get a similar object from this PlayQueue. * Useful for looking up playQueueItemIDs using items from the Library. */ getQueueItem(item: Playable): Playable; /** * Append an item to the "Up Next" section of the PlayQueue. */ addItem(item: Playable | Playlist, options?: AddPlayQueueItemOptions): Promise; /** * Move an item to the beginning of the PlayQueue. * If 'after' is provided, the item will be placed immediately after the specified item. */ moveItem(item: Playable, options?: MovePlayQueueItemOptions): Promise; /** * Remove an item from the PlayQueue. */ removeItem(item: Playable, refresh?: boolean): Promise; /** * Remove all items from the PlayQueue. */ clear(): Promise; /** * Refresh the PlayQueue from the Plex server. */ refresh(): Promise; protected _loadData(data: PlayQueueResponse): void; private _invalidateCacheAndLoadData; } export {};