UNPKG

@putdotio/api-client

Version:

JavaScript SDK for interacting with the put.io API.

65 lines (64 loc) 2.75 kB
/// <reference types="event-emitter" /> import { AxiosInstance, AxiosRequestConfig } from 'axios'; import { IPutioAPIClientOptions, IPutioAPIClientResponse } from './types'; import { PutioAPIClientEventTypes, EventListener } from '../eventEmitter'; import Account from '../resources/Account/Account'; import Auth from '../resources/Auth/Auth'; import OAuth from '../resources/Auth/OAuth'; import DownloadLinks from '../resources/DownloadLinks/DownloadLinks'; import Sharing from '../resources/Sharing/Sharing'; import Config from '../resources/Config'; import Events from '../resources/Events/Events'; import File from '../resources/Files/File'; import Files from '../resources/Files/Files'; import FriendInvites from '../resources/FriendInvites/FriendInvites'; import Friends from '../resources/Friends/Friends'; import IFTTT from '../resources/IFTTT'; import Payment from '../resources/Payment/Payment'; import RSS from '../resources/RSS/RSS'; import Transfers from '../resources/Transfers/Transfers'; import Trash from '../resources/Trash'; import Tunnel from '../resources/Tunnel'; import User from '../resources/User/User'; import Zips from '../resources/Zips'; export declare class PutioAPIClient { static EVENTS: { readonly ERROR: "ERROR"; readonly CLIENT_IP_CHANGED: "CLIENT_IP_CHANGED"; }; static DEFAULT_OPTIONS: IPutioAPIClientOptions; options: IPutioAPIClientOptions; token: string | undefined; http: AxiosInstance; Account: Account; Auth: Auth; DownloadLinks: DownloadLinks; Sharing: Sharing; Config: Config; Events: Events; Files: Files; File: File; Friends: Friends; FriendInvites: FriendInvites; IFTTT: IFTTT; OAuth: OAuth; Payment: Payment; RSS: RSS; Transfers: Transfers; Trash: Trash; Tunnel: Tunnel; User: User; Zips: Zips; constructor(options: IPutioAPIClientOptions); once(event: PutioAPIClientEventTypes, listener: EventListener): void; on(event: PutioAPIClientEventTypes, listener: EventListener): void; off(event: PutioAPIClientEventTypes, listener: EventListener): void; configure(options: IPutioAPIClientOptions): this; setToken(token: string): PutioAPIClient; clearToken(): PutioAPIClient; get<T = any>(url: string, config?: AxiosRequestConfig): Promise<IPutioAPIClientResponse<T>>; post<T = any>(url: string, config?: AxiosRequestConfig): Promise<IPutioAPIClientResponse<T>>; put<T = any>(url: string, config?: AxiosRequestConfig): Promise<IPutioAPIClientResponse<T>>; delete<T = any>(url: string, config?: AxiosRequestConfig): Promise<IPutioAPIClientResponse<T>>; private createHTTPClient; }