@georgemiao/qbit.js
Version:
a qBittorrent library made with typescript
50 lines • 1.43 kB
TypeScript
/// <reference types="node" />
import EventEmitter from "node:events";
import { RequestInit } from "node-fetch";
import { Api } from "./Api.js";
import { Application } from "./Application.js";
export declare class QBittorrent extends EventEmitter {
application: Application;
api: Api;
/** @private */
destroyed: boolean;
private user?;
private password?;
private host;
private agent;
private defer?;
private session;
private exp;
/**
* Create a new qBittorrent client
* @param host qBittorrent host
* @param insecure if to allow self signed certs
*/
constructor(host: string, insecure?: boolean);
/**
* Function to run before any action.
* Checks if the client is destroyed,
* not logged in yet or session expired
* and logs automaticly back in if is.
* @private
*/
checkLogin(): Promise<void>;
/**
* Wrapper for node-fetch
* Adds session cookies, base path and http agent
* @private
* @param url api url to fetch
* @param opts fetch options
*/
fetch(url: string, opts?: RequestInit): Promise<import("node-fetch").Response>;
/**
* Log out and destroy the client
*/
logout(): Promise<void>;
/**
* Login to qBittorrent
*/
login(username: string, password: string): Promise<void>;
private sessionLogin;
}
//# sourceMappingURL=QBittorrent.d.ts.map