torrent-to-pixeldrain
Version:
Allows you to download a torrent and upload it to pixeldrain.com
43 lines (42 loc) • 1.48 kB
TypeScript
import { Torrent } from "../interfaces/torrenttype";
import { PixeldrainService } from "../services/pixeldrainservice";
export type TorrentType = "magnet" | "single file" | "file directory";
export declare class TorrentBuilder {
private torrent;
private torrentDownloadService;
constructor();
/**
* Set the type of the torrent.
*
* @param {TorrentType} type
* @return {*} {TorrentBuilder}
* @memberof TorrentBuilder
*/
setType(type: TorrentType): TorrentBuilder;
/**
* Set the Input of the torrent. Input can be a magnet link, path to a single torrent file or a directory of torrent files
*
* @param {string} input A file path of a Magnet link
* @return {*} {TorrentBuilder}
* @memberof TorrentBuilder
*/
setInput(input: string): TorrentBuilder;
/**
* Optional. Set the Output of the torrent. A filepath where files of the torrent should be downloaded.
* Output defaults to "downloads" folder in source directory
*
* @param {string} output A file path
* @return {*} {TorrentBuilder}
* @memberof TorrentBuilder
*/
setOutput(output: string): TorrentBuilder;
setName(name: string): TorrentBuilder;
/**
* Called inside TorrentToPixeldrain class.
*
* @param {PixeldrainService} pixeldrainService
* @return {*} {Torrent}
* @memberof TorrentBuilder
*/
build(pixeldrainService: PixeldrainService): Torrent;
}