UNPKG

@gibme/tablo.tv

Version:

API interface for interacting with a Tablo TV device

156 lines (155 loc) 5.24 kB
import { Logo } from './types'; export declare class Lighthouse { private readonly email; private readonly password; readonly timeout: number; private readonly request_logging; private static readonly base_uri; private token?; private context_token; constructor(email: string, password: string, timeout?: number, request_logging?: boolean); get authenticated(): boolean; private get base_uri(); static execute<ResponseType = any>(method: string, endpoint: string, params?: Record<string, any>, payload?: Record<string, any> | string, timeout?: number): Promise<ResponseType>; /** * Retrieves a list of devices associated with the network from which this API call is made. * @param timeout */ static listAvailableDevices(timeout?: number): Promise<Lighthouse.Device[]>; /** * Retrieves a list of virtual devices associated with the network from which this API call is made. * @param timeout */ static listVirtualDevices(timeout?: number): Promise<Lighthouse.Device[]>; /** * Attempts to retrieve the specified virtual device associated with the network from which this API call is made. * @param server_id * @param timeout */ static virtualDevice(server_id: string, timeout?: number): Promise<Lighthouse.Device | undefined>; private static get; /** * Retrieves the account information */ accountInfo(timeout?: number): Promise<Lighthouse.AccountInfo | undefined>; /** * Retrieves the current airing information for the specified channel within the specified device context * @param channel_id * @param context_token * @param timeout */ channelAirings(channel_id: string, context_token?: string, timeout?: number): Promise<Lighthouse.GuideAiring[]>; /** * Retrieves the list of live airings for the specified device context * @param context_token * @param timeout */ currentLiveAirings(context_token?: string, timeout?: number): Promise<Lighthouse.LiveAiring[]>; /** * Retrieves a list of the devices associated with the account */ devices(timeout?: number): Promise<Lighthouse.Device[]>; /** * Retrieves the list of channels available within the specified device context * @param context_token * @param timeout */ guideChannels(context_token?: string, timeout?: number): Promise<Lighthouse.GuideChannel[]>; /** * Attempts to retrieve information regarding a specific device associated with the account * @param server_id * @param timeout */ resolveDevice(server_id: string, timeout?: number): Promise<Lighthouse.Device | undefined>; /** * Selects the device context based upon the specified `profile_id` and `server_id`. * @param profile_id * @param server_id * @param timeout */ selectDeviceContext(profile_id: string, server_id: string, timeout?: number): Promise<string | undefined>; protected get<ResponseType = any>(endpoint: string, params?: Record<string, any>, timeout?: number, token?: string): Promise<ResponseType>; protected post<ResponseType = any>(endpoint: string, payload?: object, timeout?: number, token?: string): Promise<ResponseType>; private authenticate; private execute; } export declare namespace Lighthouse { export type Device = { serverId: string; name: string; type: string; product: string; version: string; buildNumber: number; registrationStatus: string; lastSeen: string; reachability: string; url: string; }; export type Profile = { identifier: string; name: string; date_joined: string; preferences: Record<string, any>; }; export type AccountInfo = { identifier: string; is_verified: boolean; email: string; firstName: string; lastName: string; postalCode: string; dma: string; devices: Device[]; profiles: Profile[]; }; type OTA = { major: number; minor: number; callsign: string; network: string; }; export type GuideChannel = { identifier: string; name: string; kind: string; logos: Logo[]; ota: OTA; }; export type GuideAiring = { identifier: string; title: string; channel: { identifier: string; }; datetime: string; onnow: string; description: string; kind: string; qualifiers: number; genres: string[]; images: Logo[]; duration: number; show: { identifier: string; title: string; sortTitle: string; sectionTitle: string; }; episode: { season: { kind: string; number: number; }; episodeNumber: number; originalAirDate: string; rating: string; }; }; export type LiveAiring = { channel: GuideChannel; airing: GuideAiring; }; export {}; } export default Lighthouse;