kodi-api
Version:
A complete implementation of Kodi JSON-RPC calls in an easy-to-use Javascript/TypeScript client.
25 lines (24 loc) • 1.24 kB
TypeScript
import type { JsonRpcResponse, JsonSchema, MethodDescription, NotificationDescription, ServiceDescription } from './Types';
/** Wrapper class for Kodi's `JSONRPC.Introspect` metadata response. */
export declare class KodiIntrospect implements JsonRpcResponse {
constructor(introspect: KodiIntrospect);
private validator?;
id?: string | number;
jsonrpc: '2.0';
result: ServiceDescription;
/** Method to return a method descripton. */
describeMethod?(method: string): MethodDescription;
/** Method to return a notification description. */
describeNotification?(notification: string): NotificationDescription;
/** Method to return a type description. */
describeType?(typeName: string): JsonSchema;
/** Method to validate an input by it's accompanying schema. */
validateSchema?(input: any, schema: JsonSchema, throwError?: boolean): boolean;
/** Method to list Kodi JSON-RPC methods. */
listMethods?(): string[];
listMethods?(group: false): string[];
listMethods?(group: true): Record<string, string[]>;
listMethods?(group: boolean): string[] | Record<string, string[]>;
/** Get the version of the Kodi API. */
version?(): string;
}