aria2-client
Version:
A download client based on aria2 (a lightweight multi-protocol & multi-source, cross platform download utility operated in command-line. It supports HTTP/HTTPS, FTP, SFTP, BitTorrent and Metalink)
82 lines (81 loc) • 1.86 kB
TypeScript
import { Aria2DownloadStatus, Aria2ExitStatus } from '../enums/aria2.enum';
export interface IAria2Config {
host: string;
port: number;
secure: boolean;
secret: string;
path: string;
}
export interface IAria2Download {
gid: string;
status: Aria2DownloadStatus;
totalLength: number;
completedLength: number;
uploadLength: number;
bitfield?: string;
downloadSpeed: number;
uploadSpeed: number;
infoHash?: string;
numSeeders?: string;
seeder?: string;
pieceLength: string;
numPieces: number;
connections: number;
errorCode?: Aria2ExitStatus;
errorMessage?: string;
followedBy?: string[];
following?: string;
belongsTo?: string;
dir: string;
files: IAria2File[];
bittorrent?: {
announceList: string[];
comment?: string;
creationDate: number;
mode: 'single' | 'multi';
info: {
name: string;
};
};
verifiedLength?: number;
verifyIntegrityPending?: boolean;
}
export interface IAria2Uri {
uri: string;
status: Aria2DownloadStatus;
}
export interface IAria2File {
index: number;
path: string;
length: number;
completedLength: number;
selected: boolean;
uris: IAria2Uri[];
}
export interface IAria2Peer {
peerId: string;
ip: string;
port: number;
bitfield: string;
amChoking?: boolean;
peerChoking?: boolean;
downloadSpeed: number;
uploadSpeed: number;
seeder: boolean;
}
export interface IAria2Server {
index: number;
servers: {
uri: string;
currentUri: string;
downloadSpeed: number;
}[];
}
export interface IAria2GlobalStat {
downloadSpeed: number;
uploadSpeed: number;
numActive: number;
numWaiting: number;
numStopped: number;
numStoppedTotal: number;
}