@ctrl/shared-torrent
Advanced tools
Comparing version 1.0.3 to 1.1.0
import { AgentOptions } from 'got'; | ||
export interface TorrentClient { | ||
config: TorrentSettings; | ||
getAllData(): Promise<AllClientData>; | ||
getTorrent(id: string): Promise<NormalizedTorrent>; | ||
pauseTorrent(id: string): Promise<any>; | ||
resumeTorrent(id: string): Promise<any>; | ||
removeTorrent(id: string, removeData?: boolean): Promise<any>; | ||
queueUp(id: string): Promise<any>; | ||
queueDown(id: string): Promise<any>; | ||
} | ||
export interface TorrentSettings { | ||
@@ -24,1 +34,76 @@ /** | ||
} | ||
export declare enum TorrentState { | ||
downloading = "downloading", | ||
seeding = "seeding", | ||
paused = "paused", | ||
queued = "queued", | ||
checking = "checking", | ||
error = "error", | ||
unknown = "unknown" | ||
} | ||
export interface Label { | ||
id: string; | ||
name: string; | ||
count: number; | ||
} | ||
export interface NormalizedTorrent { | ||
id: string; | ||
/** | ||
* torrent name | ||
*/ | ||
name: string; | ||
/** | ||
* progress percent out of 100 | ||
*/ | ||
progress: number; | ||
isCompleted: boolean; | ||
/** | ||
* 1:1 is 1, half seeded is 0.5 | ||
*/ | ||
ratio: number; | ||
/** | ||
* date as iso string | ||
*/ | ||
dateAdded: string; | ||
/** | ||
* date completd as iso string; | ||
*/ | ||
dateCompleted?: string; | ||
savePath: string; | ||
label?: string; | ||
state: TorrentState; | ||
stateMessage: string; | ||
/** | ||
* bytes per second | ||
*/ | ||
uploadSpeed: number; | ||
/** | ||
* bytes per second | ||
*/ | ||
downloadSpeed: number; | ||
/** | ||
* seconds until finish | ||
*/ | ||
eta: number; | ||
queuePosition: number; | ||
connectedSeeds: number; | ||
connectedPeers: number; | ||
totalSeeds: number; | ||
totalPeers: number; | ||
/** | ||
* size of files to download in bytes | ||
*/ | ||
totalSelected: number; | ||
/** | ||
* total upload in bytes | ||
*/ | ||
totalUploaded: number; | ||
/** | ||
* total download in bytes | ||
*/ | ||
totalDownloaded: number; | ||
} | ||
export interface AllClientData { | ||
labels: Label[]; | ||
torrents: NormalizedTorrent[]; | ||
} |
10
index.js
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var TorrentState; | ||
(function (TorrentState) { | ||
TorrentState["downloading"] = "downloading"; | ||
TorrentState["seeding"] = "seeding"; | ||
TorrentState["paused"] = "paused"; | ||
TorrentState["queued"] = "queued"; | ||
TorrentState["checking"] = "checking"; | ||
TorrentState["error"] = "error"; | ||
TorrentState["unknown"] = "unknown"; | ||
})(TorrentState = exports.TorrentState || (exports.TorrentState = {})); | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "@ctrl/shared-torrent", | ||
"version": "1.0.3", | ||
"version": "1.1.0", | ||
"description": "shared types and interfaces between torrent clients", | ||
@@ -33,3 +33,3 @@ "author": "Scott Cooper <scttcper@gmail.com>", | ||
"@typescript-eslint/parser": "1.4.2", | ||
"eslint": "5.15.0", | ||
"eslint": "5.15.1", | ||
"eslint-config-prettier": "4.1.0", | ||
@@ -36,0 +36,0 @@ "eslint-config-xo-space": "0.21.0", |
Sorry, the diff of this file is not supported yet
8337
120