UNPKG

kodi-api

Version:

A complete implementation of Kodi JSON-RPC calls in an easy-to-use Javascript/TypeScript client.

47 lines (46 loc) 2.25 kB
import { KodiIntrospect } from './KodiIntrospect'; import { KodiMethodNamespace } from './KodiMethodNamespace'; import type { ClientType, JaysonClient, KodiClientOptions } from './Types'; /** Class for dynamically calling the Kodi JSON-RPC api, regardless of api version. */ export declare class KodiClient { constructor(options: KodiClientOptions); clientType: ClientType; jsonRpcClient: JaysonClient; introspectionCache?: KodiIntrospect; throwValidationError: boolean; Addons?: KodiMethodNamespace; Application?: KodiMethodNamespace; AudioLibrary?: KodiMethodNamespace; Favourites?: KodiMethodNamespace; Files?: KodiMethodNamespace; GUI?: KodiMethodNamespace; Input?: KodiMethodNamespace; JSONRPC?: KodiMethodNamespace; PVR?: KodiMethodNamespace; Player?: KodiMethodNamespace; Playlist?: KodiMethodNamespace; Profiles?: KodiMethodNamespace; Settings?: KodiMethodNamespace; System?: KodiMethodNamespace; Textures?: KodiMethodNamespace; VideoLibrary?: KodiMethodNamespace; XBMC?: KodiMethodNamespace; /** Method to manually connect to the defined web socket; silently returns for any other client type. */ connect(): Promise<void>; /** Method to manually disconnect from the defined web socket; silently returns for any other client type. */ disconnect(): Promise<void>; /** Method to get and cache the introspection result on this instance. */ getIntrospectionCache(refresh?: boolean): Promise<KodiIntrospect>; /** Method to list Kodi JSON-RPC methods. */ listMethods(): Promise<string[]>; listMethods(group: false): Promise<string[]>; listMethods(group: true): Promise<Record<string, string[]>>; /** Construct an HTTP instance with Kodi defaults. */ static http(): KodiClient; /** Construct an HTTPS instance with Kodi defaults. __NOTE:__ _Kodi does not natively or officially support HTTPS; some users have unofficially found a way, though._ */ static https(): KodiClient; /** Construct a TCP instance with Kodi defaults. */ static tcp(): KodiClient; /** Construct a WebSocket instance with Kodi defaults. */ static ws(): KodiClient; }