Comparing version 0.0.11 to 0.0.12
@@ -0,5 +1,7 @@ | ||
import * as maria2_index from 'maria2/index'; | ||
import { PartialDeep } from 'type-fest'; | ||
import { Conn, Socket, Aria2ServerVersion } from 'maria2'; | ||
import { Conn, Socket, Aria2ServerVersion, Aria2ServerGlobalStat } from 'maria2'; | ||
import { Aria2InputOptions } from '@naria2/options'; | ||
export * from '@naria2/options'; | ||
import { Emitter, Handler, WildcardHandler } from 'mitt'; | ||
@@ -21,2 +23,5 @@ interface ClientOptions { | ||
} | ||
interface DownloadOptions { | ||
position?: number; | ||
} | ||
interface TorrentFile { | ||
@@ -29,12 +34,56 @@ } | ||
type Aria2MonitorEvents = { | ||
'download.start': string; | ||
'download.pause': string; | ||
'download.stop': string; | ||
'download.complete': string; | ||
'bt.download.complete': string; | ||
'download.error': string; | ||
}; | ||
type GenericEventHandler = Handler<Aria2MonitorEvents[keyof Aria2MonitorEvents]> | WildcardHandler<Aria2MonitorEvents>; | ||
declare class Aria2Monitor implements Pick<Emitter<Aria2MonitorEvents>, 'on' | 'off'> { | ||
private _conn; | ||
private disposables; | ||
private emitter; | ||
constructor(conn: Conn); | ||
start(): Promise<void>; | ||
close(): void; | ||
watchStatus(gid: string): Promise<void>; | ||
on<Key extends keyof Aria2MonitorEvents>(key: Key, handler: GenericEventHandler): void; | ||
off<Key extends keyof Aria2MonitorEvents>(key: Key, handler?: GenericEventHandler): void; | ||
private onDownloadStart; | ||
private onDownloadPause; | ||
private onDownloadStop; | ||
private onDownloadComplete; | ||
private onBtDownloadComplete; | ||
private onDownloadError; | ||
} | ||
declare class Aria2Client { | ||
private _conn; | ||
private _monitor; | ||
constructor(conn: Conn); | ||
get conn(): Conn; | ||
get socket(): Socket; | ||
close(): Promise<void>; | ||
get monitor(): Aria2Monitor; | ||
close(): void; | ||
/** | ||
* This method shuts down aria2. | ||
* | ||
* @param force Call forceShutdown or shutdown | ||
*/ | ||
shutdown(force?: boolean): Promise<void>; | ||
/** | ||
* This method returns the version of aria2 and the list of enabled features. The response is a struct and contains following keys. | ||
*/ | ||
version(): Promise<Aria2ServerVersion>; | ||
downloadMagnet(magnet: string, options?: PartialDeep<Aria2InputOptions>): Promise<void>; | ||
downloadTorrent(torrent: string, options?: PartialDeep<Aria2InputOptions>): Promise<void>; | ||
downloadUri(uris: string | string[], options?: PartialDeep<Aria2InputOptions>): Promise<void>; | ||
/** | ||
* This method returns global statistics such as the overall download and upload speeds. The response is a struct and contains the following keys. Values are strings. | ||
*/ | ||
globalStat(): Promise<Aria2ServerGlobalStat>; | ||
downloadTorrent(torrent: string, options?: PartialDeep<Aria2InputOptions> & DownloadOptions): Promise<void>; | ||
downloadUri(uri: string | string[], options?: PartialDeep<Aria2InputOptions> & DownloadOptions): Promise<void>; | ||
listActive(): Promise<maria2_index.Aria2DownloadStatus[]>; | ||
listWaiting(offset: number, num: number): Promise<maria2_index.Aria2DownloadStatus[]>; | ||
listStopped(offset: number, num: number): Promise<maria2_index.Aria2DownloadStatus[]>; | ||
} | ||
@@ -46,2 +95,2 @@ declare function createClient(_socket: Socket | Promise<Socket>, options?: ClientOptions): Promise<Aria2Client>; | ||
export { Aria2Client, type ClientOptions, Torrent, type TorrentFile, type TorrentPiece, createClient }; | ||
export { Aria2Client, type ClientOptions, type DownloadOptions, Torrent, type TorrentFile, type TorrentPiece, createClient }; |
{ | ||
"name": "naria2", | ||
"version": "0.0.11", | ||
"version": "0.0.12", | ||
"description": "High-level and Convenient BitTorrent Client based on aria2 JSON-RPC", | ||
@@ -58,4 +58,5 @@ "keywords": [ | ||
"maria2": "^0.3.2", | ||
"mitt": "^3.0.1", | ||
"type-fest": "^4.6.0", | ||
"@naria2/options": "0.0.11" | ||
"@naria2/options": "0.0.12" | ||
}, | ||
@@ -66,6 +67,6 @@ "devDependencies": { | ||
"ws": "^8.14.2", | ||
"@naria2/node": "0.0.11" | ||
"@naria2/node": "0.0.12" | ||
}, | ||
"peerDependencies": { | ||
"@naria2/node": "0.0.11" | ||
"@naria2/node": "0.0.12" | ||
}, | ||
@@ -72,0 +73,0 @@ "peerDependenciesMeta": { |
@@ -12,3 +12,3 @@ # naria2 (WIP) | ||
## Usage | ||
## Installation | ||
@@ -15,0 +15,0 @@ ### Browser |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
26903
450
5
1
+ Addedmitt@^3.0.1
+ Added@breadc/color@0.9.7(transitive)
+ Added@breadc/death@0.9.7(transitive)
+ Added@naria2/node@0.0.12(transitive)
+ Added@naria2/options@0.0.12(transitive)
+ Addedbig-integer@1.6.52(transitive)
+ Addedbplist-parser@0.2.0(transitive)
+ Addedbundle-name@3.0.0(transitive)
+ Addeddebug@2.6.9(transitive)
+ Addeddefault-browser@4.0.0(transitive)
+ Addeddefault-browser-id@3.0.0(transitive)
+ Addeddefine-lazy-prop@3.0.0(transitive)
+ Addeddepd@2.0.0(transitive)
+ Addeddestroy@1.2.0(transitive)
+ Addedee-first@1.1.1(transitive)
+ Addedencodeurl@1.0.22.0.0(transitive)
+ Addedescape-html@1.0.3(transitive)
+ Addedetag@1.8.1(transitive)
+ Addedexeca@5.1.17.2.0(transitive)
+ Addedfinalhandler@1.3.1(transitive)
+ Addedfresh@0.5.2(transitive)
+ Addedget-stream@6.0.1(transitive)
+ Addedhttp-errors@2.0.0(transitive)
+ Addedhuman-signals@2.1.04.3.1(transitive)
+ Addedinherits@2.0.4(transitive)
+ Addedis-docker@2.2.13.0.0(transitive)
+ Addedis-inside-container@1.0.0(transitive)
+ Addedis-stream@2.0.1(transitive)
+ Addedis-wsl@2.2.0(transitive)
+ Addedmime@1.6.0(transitive)
+ Addedmimic-fn@2.1.0(transitive)
+ Addedmitt@3.0.1(transitive)
+ Addedms@2.0.0(transitive)
+ Addednpm-run-path@4.0.1(transitive)
+ Addedon-finished@2.4.1(transitive)
+ Addedonetime@5.1.2(transitive)
+ Addedopen@9.1.0(transitive)
+ Addedparseurl@1.3.3(transitive)
+ Addedrange-parser@1.2.1(transitive)
+ Addedrun-applescript@5.0.0(transitive)
+ Addedsend@0.19.0(transitive)
+ Addedserve-static@1.16.2(transitive)
+ Addedsetprototypeof@1.2.0(transitive)
+ Addedsignal-exit@3.0.7(transitive)
+ Addedstatuses@2.0.1(transitive)
+ Addedstrip-final-newline@2.0.0(transitive)
+ Addedtitleize@3.0.0(transitive)
+ Addedtoidentifier@1.0.1(transitive)
+ Addedunpipe@1.0.0(transitive)
+ Addeduntildify@4.0.0(transitive)
- Removed@naria2/node@0.0.11(transitive)
- Removed@naria2/options@0.0.11(transitive)
Updated@naria2/options@0.0.12