import { Token } from "../../token"; import { EpisodeContainer } from "../../util/episode-container"; export declare const HBO_HEADERS: { Accept: string; "User-Agent": string; "X-Hbo-Client-Version": string; }; export interface IMarker { /** Formatted as eg: "2019-03-27T23:16:25Z" */ created: string; /** The part after `urn:hbo:episode:` */ cutId: string; /** The URN */ id: string; /** In seconds */ position: number; /** In seconds */ runtime: number; } export interface ISeriesMarker { focusEpisode: string; markerStatus: "START" | "LATEST" | "CONTINUE" | "TOPICAL"; } export interface HboProfile { profileId: string; name: string; isMe: boolean; isPrimary: boolean; } declare type EntityType = "series" | "season" | "episode" | "extra" | "feature" | "franchise"; interface IHboTitles { full: string; short: string; ultraShort: string; } interface IHboRawBody { images?: { tile?: string; tileburnedin?: string; tilezoom?: string; }; references?: { edits?: string[]; episodes?: string[]; extras?: string[]; items?: string[]; next?: string; previews?: string[]; season?: string; series?: string; viewable?: string; }; summaries?: { full: string; short: string; }; numberInSeason?: number; seasonNumber?: number; seriesTitles?: IHboTitles; titles?: IHboTitles; } export interface IHboRawItem { id: string; statusCode: number; headers: Partial>; body: IHboRawBody; } export declare function unpackUrn(urn: string): { type: "tile" | "page"; id: string; pageType: EntityType; } | { type: EntityType; id: string; pageType?: undefined; }; export declare function pageUrnFrom(urn: string): string; export declare function urlForUrn(urn: ReturnType): string; export declare function entityTypeFromUrn(urn: string): EntityType; export interface IHboEpisode { urn: string; indexInSeason: number; season: number; title: string; } export interface IHboResult { imageTemplate?: string; urn: string; seriesTitle?: string; seriesUrn?: string; title: string; } export declare class HboApi { private token; private refreshToken; private refreshTokenExpires; private cachedHeadWaiter; constructor(token: Token); stopConcurrentStreams(): Promise; /** * Given a series Urn, attempt to determine the Urn and * start position (in seconds) of the next episode (or * episode to resume) for that series */ fetchNextEpisodeForSeries(seriesUrn: string): Promise<{ position: number | undefined; urn: string; }>; getEpisodesForSeries(seriesUrn: string): Promise>; /** * Fetch a map of series URN to its `ISeriesMarker`. It's * unclear what criteria is used to determine which series * are included in this map. */ getSeriesMarkers(): Promise<{ [urn: string]: ISeriesMarker; }>; /** * Given `urn:hbo:episode:` or just ``, * fetch a marker for the episode, or null if none */ getMarkerForEpisode(episodeUrnOrId: string): Promise; /** * Given an array of `urn:hbo:episode:` or just ``, * fetch a marker for each episode. Episodes for which there * are no markers will not have a corresponding element in the * responding array, so you should not expect the Markers in * the resulting array to be in the same order as the provided * array */ getMarkersForEpisodes(episodeUrnOrIds: string[]): Promise; queryContinueWatching(): AsyncGenerator; queryRecommended(): AsyncGenerator; search(title: string): AsyncGenerator; private queryPlayables; resolveFranchiseSeries(franchiseUrn: string): Promise; extractTokenInfo(): Promise<{ clientId: string; deviceSerialNumber: string; }>; getRefreshToken(): Promise; private getHeadWaiter; private fetchContentBody; private request; private fillRequest; listProfiles(): Promise; private loadRefreshToken; private acceptTokens; private loadProfileToken; private postTokensRequest; } export {};