UNPKG

@jellyfin/sdk

Version:
33 lines (32 loc) 1.48 kB
/** * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ import type { AxiosInstance, AxiosResponse } from 'axios'; import { Configuration } from './generated-client/configuration'; import type { AuthenticationResult } from './generated-client/models/authentication-result'; import type { ClientInfo, DeviceInfo } from './models'; /** The authorization header field name. */ export declare const AUTHORIZATION_HEADER = "Authorization"; /** Class representing the Jellyfin API. */ export declare class Api { basePath: string; clientInfo: ClientInfo; deviceInfo: DeviceInfo; accessToken: string; axiosInstance: AxiosInstance; constructor(basePath: string, clientInfo: ClientInfo, deviceInfo: DeviceInfo, accessToken?: string, axiosInstance?: AxiosInstance); get configuration(): Configuration; /** * Convenience method for authenticating a user by name and updating the internal state. * @param username The username. * @param password The user password if required. */ authenticateUserByName(username: string, password?: string): Promise<AxiosResponse<AuthenticationResult>>; /** * Convenience method for logging out and updating the internal state. */ logout(): Promise<AxiosResponse<never> | AxiosResponse<void>>; get authorizationHeader(): string; }