import { PlexObject } from './base/plexObject.ts'; import type { AgeRatingData, CommonSenseMediaData, ParentalAdvisoryTopicData, TalkingPointData } from './media.types.ts'; import type { ChapterData, MarkerData, MediaData, MediaPartData, MediaPartStreamData } from './video.types.ts'; /** * Base class for media tags used for filtering and searching your library * items or navigating the metadata of media items in your library. Tags are * the construct used for things such as Country, Director, Genre, etc. */ export declare abstract class MediaTag extends PlexObject { static TAG: string; /** Tag ID (This seems meaningless except to use it as a unique id). */ id?: number | string; /** Filter expression used by Plex for this tag. */ filter?: string; /** unknown */ role?: string; /** * Name of the tag. This will be Animation, SciFi etc for Genres. * The name of person for Directors and Roles (ex: Animation, Stephen Graham, etc). */ tag: string; /** Numeric Plex tag type. */ tagType?: number; abstract FILTER: string; protected _loadData(data: any): void; } export declare class Media extends PlexObject { static TAG: "Media"; aspectRatio: number; /** * Number of audio channels for this video (ex: 6) */ audioChannels: number; /** * Audio codec used within the video (ex: ac3) */ audioCodec: string; /** * Bitrate of the video (ex: 1624) */ bitrate: number; /** * Length of the video in milliseconds (ex: 6990483) */ duration: number; /** * Height of the video in pixels (ex: 256) */ height: number; /** * Plex ID of this media item */ id: number; /** * True if video has 64 bit offsets */ has64bitOffsets: boolean; optimizedForStreaming: boolean; title?: string; videoCodec: string; videoFrameRate: string; videoProfile: string; /** Width of the video in pixels */ width: number; parts: MediaPart[]; protected _loadData(data: MediaData): void; } export declare class MediaPart extends PlexObject { static TAG: "Part"; container: string; duration: number; file: string; id: number; indexes: string; size: number; optimizedForStreaming: boolean; syncItemId: string; syncState: string; videoProfile: string; streams: MediaPartStream[]; exists?: boolean; /** * Set the selected {@link AudioStream} for this MediaPart. * @param stream Audio stream or stream ID to set as selected. */ setSelectedAudioStream(stream: AudioStream | number): Promise; /** * Set the selected {@link SubtitleStream} for this MediaPart. * @param stream Subtitle stream or stream ID to set as selected. */ setSelectedSubtitleStream(stream: SubtitleStream | number): Promise; /** * Returns a list of {@link AudioStream} objects in this MediaPart. */ audioStreams(): AudioStream[]; /** * Returns a list of {@link SubtitleStream} objects in this MediaPart. */ subtitleStreams(): SubtitleStream[]; /** * Returns a list of {@link LyricStream} objects in this MediaPart. */ lyricStreams(): LyricStream[]; protected _loadData(data: MediaPartData): void; } export declare class MediaPartStream extends PlexObject { static TAG: "Stream"; id: number; codec: string; index: number; language?: string; languageCode?: string; selected?: boolean; streamType?: number; protected _loadData(data: MediaPartStreamData): void; } /** * Represents a single Subtitle stream within a {@link MediaPart}. */ export declare class SubtitleStream extends MediaPartStream { static TAG: "Stream"; static STREAMTYPE: number; /** True if the subtitle stream can be auto synced. */ canAutoSync?: boolean; /** The container of the subtitle stream. */ container?: string; /** True if this is a forced subtitle. */ forced: boolean; /** The format of the subtitle stream (ex: srt). */ format?: string; /** The header compression of the subtitle stream. */ headerCompression?: string; /** True if this is a hearing impaired (SDH) subtitle. */ hearingImpaired: boolean; /** True if the on-demand subtitle is a perfect match. */ perfectMatch?: boolean; /** The provider title where the on-demand subtitle is downloaded from. */ providerTitle?: string; /** The match score (download count) of the on-demand subtitle. */ score?: number; /** The source key of the on-demand subtitle. */ sourceKey?: string; /** Unknown. */ transient?: string; /** The user id of the user that downloaded the on-demand subtitle. */ userID?: number; /** * Sets this subtitle stream as the selected subtitle stream. * Alias for `MediaPart.setSelectedSubtitleStream`. */ setSelected(): Promise; protected _loadData(data: any): void; } /** * Represents a single Lyric stream within a {@link MediaPart}. */ export declare class LyricStream extends MediaPartStream { static TAG: "Stream"; static STREAMTYPE: number; /** The format of the lyric stream (ex: lrc). */ format?: string; /** The minimum number of lines in the (timed) lyric stream. */ minLines?: number; /** The provider of the lyric stream (ex: com.plexapp.agents.lyricfind). */ provider?: string; /** True if the lyrics are timed to the track. */ timed: boolean; protected _loadData(data: any): void; } /** * Represents a single Role (actor/actress) media tag. */ export declare class Role extends MediaTag { static TAG: "Role"; FILTER: "role"; } /** * Represents a single Genre media tag. */ export declare class Genre extends MediaTag { static TAG: "Genre"; FILTER: "genre"; } /** * Represents a single Country media tag. */ export declare class Country extends MediaTag { static TAG: "Country"; FILTER: "country"; } /** * Represents a single Writer media tag. */ export declare class Writer extends MediaTag { static TAG: "Writer"; FILTER: "writer"; } /** * Represents a single Director media tag. */ export declare class Director extends MediaTag { static TAG: "Director"; FILTER: "director"; } export declare class Similar extends MediaTag { static TAG: "Similar"; FILTER: "similar"; } export declare class Producer extends MediaTag { static TAG: "Producer"; FILTER: "producer"; } export declare class Marker extends MediaTag { static TAG: "Marker"; FILTER: "marker"; type: 'intro' | 'credits'; startTimeOffset: number; endTimeOffset: number; protected _loadData(data: MarkerData): void; } /** * Represents a single Chapter media tag. */ export declare class Chapter extends MediaTag { static TAG: "Chapter"; FILTER: "chapter"; startTimeOffset: number; endTimeOffset: number; thumb?: string; protected _loadData(data: ChapterData): void; } /** * Represents a single Collection media tag. */ export declare class Collection extends MediaTag { static TAG: "Collection"; FILTER: "collection"; } /** Represents a single Label media tag. */ export declare class Label extends MediaTag { static TAG: "Label"; FILTER: "label"; } /** Represents a single Style media tag. */ export declare class Style extends MediaTag { static TAG: "Style"; FILTER: "style"; } /** Represents a single Format media tag. */ export declare class Format extends MediaTag { static TAG: "Format"; FILTER: "format"; } /** Represents a single Subformat media tag. */ export declare class Subformat extends MediaTag { static TAG: "Subformat"; FILTER: "subformat"; } /** Represents a single Tag media tag. */ export declare class Tag extends MediaTag { static TAG: "Tag"; FILTER: "tag"; } export declare class Optimized extends PlexObject { static TAG: string; id: string; composite: any; title: any; type: any; target: any; targetTagID: any; /** * Remove this Optimized item. */ remove(): Promise; /** * Rename this Optimized item. * @param title New title for the item. */ rename(title: string): Promise; /** * Reprocess a removed Conversion item that is still a listed Optimize item. * @param ratingKey The rating key of the item to reprocess. */ reprocess(ratingKey: string | number): Promise; protected _loadData(data: any): void; } /** * Base class for guid tags used only for Guids, as they contain only a string identifier */ declare class GuidTag extends PlexObject { /** * The guid for external metadata sources (e.g. IMDB, TMDB, TVDB). ex - imdb://tt3222784 */ id: string; protected _loadData(data: any): void; } export declare class Guid extends GuidTag { static TAG: "Guid"; } /** * Represents a single Rating media tag. */ export declare class Rating extends PlexObject { static TAG: "Rating"; /** * The uri for the rating image * (e.g. ``imdb://image.rating``, ``rottentomatoes://image.rating.ripe``, * ``rottentomatoes://image.rating.upright``, ``themoviedb://image.rating``). */ image: string; /** * The type of rating (e.g. audience or critic). */ type: 'audience' | 'critic'; /** * The rating value. */ value: number; protected _loadData(data: any): void; } export declare class CommonSenseMedia extends PlexObject { static TAG: "CommonSenseMedia"; ageRatings: AgeRating[]; anyGood?: string; id?: number; oneLiner?: string; parentalAdvisoryTopics: ParentalAdvisoryTopic[]; parentsNeedToKnow?: string; talkingPoints: TalkingPoint[]; reload(): Promise; protected _loadData(data: CommonSenseMediaData): void; } export declare class AgeRating extends PlexObject { static TAG: "AgeRating"; age?: number; ageGroup?: string; rating?: number; ratingCount?: number; type?: string; protected _loadData(data: AgeRatingData): void; } export declare class TalkingPoint extends PlexObject { static TAG: "TalkingPoint"; tag?: string; protected _loadData(data: TalkingPointData): void; } export declare class ParentalAdvisoryTopic extends PlexObject { static TAG: "ParentalAdvisoryTopic"; id?: string; label?: string; positive?: boolean; rating?: number; tag?: string; protected _loadData(data: ParentalAdvisoryTopicData): void; } /** * Base class for all Art, Poster, and Theme objects. */ declare abstract class BaseResource extends PlexObject { /** * The source of the resource. 'local' for local files (e.g. theme.mp3), */ provider: string; /** * Unique key identifying the resource. */ ratingKey: string; /** * True if the resource is currently selected. */ selected: boolean; /** * The URL to retrieve the resource thumbnail. */ thumb: string; select(): Promise; resourceFilepath(): string; protected _loadData(data: any): void; } /** * Represents a single Art object. */ export declare class Art extends BaseResource { static TAG: string; } /** * Represents a single Logo object. */ export declare class Logo extends BaseResource { static TAG: string; } /** * Represents a single Poster object. */ export declare class Poster extends BaseResource { static TAG: string; } /** * Represents a single Square Art object. */ export declare class SquareArt extends BaseResource { static TAG: string; } /** * Represents a single Theme object. */ export declare class Theme extends BaseResource { static TAG: string; } /** * Represents a single Audio stream within a {@link MediaPart}. */ export declare class AudioStream extends MediaPartStream { static TAG: "Stream"; static STREAMTYPE: number; /** The audio channel layout of the audio stream (ex: 5.1(side)). */ audioChannelLayout?: string; /** The bit depth of the audio stream (ex: 16). */ bitDepth?: number; /** The bitrate mode of the audio stream (ex: cbr). */ bitrateMode?: string; /** The number of audio channels of the audio stream (ex: 6). */ channels?: number; /** The duration of audio stream in milliseconds. */ duration?: number; /** The profile of the audio stream. */ profile?: string; /** The sampling rate of the audio stream (ex: 48000) */ samplingRate?: number; /** The stream identifier of the audio stream. */ streamIdentifier?: number; /** True if this is a visually impaired (AD) audio stream. */ visualImpaired: boolean; /** The gain for the album. */ albumGain?: number; /** The peak for the album. */ albumPeak?: number; /** The range for the album. */ albumRange?: number; /** The end ramp for the track. */ endRamp?: string; /** The gain for the track. */ gain?: number; /** The loudness for the track. */ loudness?: number; /** The lra for the track. */ lra?: number; /** The peak for the track. */ peak?: number; /** The start ramp for the track. */ startRamp?: string; /** * Sets this audio stream as the selected audio stream. * Alias for {@link MediaPart.setSelectedAudioStream}. */ setSelected(): Promise; protected _loadData(data: any): void; } /** Represents a single Image media tag. */ export declare class Image extends PlexObject { static TAG: "Image"; /** The alt text for the image. */ alt?: string; /** The type of image (e.g. coverPoster, background, snapshot). */ type?: string; /** The API URL (/library/metadata//thumb/). */ url?: string; protected _loadData(data: any): void; } /** Represents a single Field. */ export declare class Field extends PlexObject { static TAG: "Field"; /** True if the field is locked. */ locked: boolean; /** The name of the field. */ name: string; protected _loadData(data: any): void; } /** Represents a single Mood media tag. */ export declare class Mood extends MediaTag { static TAG: "Mood"; FILTER: "mood"; } export {};