maria2
Version:
Simple and Light RPC Library for aria2
905 lines (889 loc) • 47.5 kB
TypeScript
interface Disposable<T = void> {
dispose: () => T;
}
interface OpenOptions {
secret?: string;
onServerError?: (err: any) => void;
/**
* Timeout for each request (ms).
* @default 5000
* @public
*/
timeout?: number;
/**
* Timeout for waiting socket (ms).
* @default 5000
* @public
*/
openTimeout?: number;
}
/**
* Ready state of the socket.
*/
declare enum ReadyState {
Connecting = 0,
Open = 1,
Closing = 2,
Closed = 3
}
interface PreconfiguredSocket extends Socket {
getOptions: () => Partial<OpenOptions> | undefined;
}
interface Socket {
/**
* Ready state of the socket.
* - `0` if the socket is connecting.
* - `1` if the socket is open.
* - `2` if the socket is closing.
* - `3` if the socket is closed.
* @public
*/
readyState: ReadyState;
send: (data: string) => void;
close: (code?: number, reason?: string) => void;
addEventListener: ((type: 'message', listener: (event: {
data: any;
}) => void, options?: AddEventListenerOptions) => void) & ((type: 'open', listener: () => void, options?: AddEventListenerOptions) => void) & ((type: 'error', listener: (error: any) => void, options?: AddEventListenerOptions) => void) & ((type: 'close', listener: () => void, options?: AddEventListenerOptions) => void);
}
interface SendRequestOptions {
method: string;
/**
* Timeout of this request (ms).
* No timeout if `false`
* @public
*/
timeout?: number | boolean;
/**
* Request with secret.
* @default true
* @public
*/
secret?: boolean;
}
interface Conn {
sendRequest: <T>(options: SendRequestOptions, ...args: any[]) => PromiseLike<T>;
onNotification: <T extends (...args: unknown[]) => void>(type: string, listener: T) => Disposable<T>;
readonly secret: string | undefined;
readonly socket: Socket;
}
interface Open {
(socket: Socket | PreconfiguredSocket, options?: OpenOptions): Promise<Conn>;
}
type RpcVersion = '1.0' | '2.0';
type RpcMessageId = string | number;
type RpcMethod = string | number;
interface RpcMessage {
jsonrpc: RpcVersion;
id?: RpcMessageId;
}
interface RpcCall<TMethod extends RpcMethod = string, TParam = unknown> extends RpcMessage {
method: TMethod;
params: TParam;
}
interface RpcResult<T = unknown, E = unknown> extends RpcMessage {
result?: T;
error?: E;
}
interface Aria2ServerVersion {
/**
* List of enabled features. Each feature is given as a string.
* @public
*/
enabledFeatures: string[];
/**
* Version number of aria2 as a string.
* @public
*/
version: string;
}
type Aria2GetVersionCall = Aria2ServerVoidCall<'aria2.getVersion'>;
type Aria2GetVersionResult = RpcResult<Aria2ServerVersion>;
interface Aria2ServerGlobalStat {
/**
* Overall download speed (byte/sec).
*
* This number can be too large, you should parse with `BigInt`.
* @public
*/
downloadSpeed: string;
/**
* Overall upload speed (byte/sec).
*
* This number can be too large, you should parse with `BigInt`.
* @public
*/
uploadSpeed: string;
/**
* The number of active downloads.
* @public
*/
numActive: string;
/**
* The number of waiting downloads.
* @public
*/
numWaiting: string;
/**
* The number of stopped downloads in the current session.
* This value is capped by the `--max-download-result` option.
* @public
*/
numStopped: string;
/**
* The number of stopped downloads in the current session and not capped by the `--max-download-result` option.
* @public
*/
numStoppedTotal: string;
}
type Aria2GetGlobalStatCall = Aria2ServerVoidCall<'aria2.getGlobalStat'>;
type Aria2GetGlobalStatResult = RpcResult<Aria2ServerGlobalStat>;
interface Aria2ServerSessionInfo {
/**
* Session ID, which is generated each time when aria2 is invoked.
* @public
*/
sessionId: string;
}
type Aria2GetSessionInfoCall = Aria2ServerVoidCall<'aria2.getSessionInfo'>;
type Aria2GetSessionInfoResult = RpcResult<Aria2ServerSessionInfo>;
type Aria2ShutdownCall = Aria2ServerVoidCall<'aria2.shutdown'>;
type Aria2ShutdownResult = Aria2ServerOpResult;
type Aria2ForceShutdownCall = Aria2ServerVoidCall<'aria2.forceShutdown'>;
type Aria2ForceShutdownResult = Aria2ServerOpResult;
type Aria2SaveSessionCall = Aria2ServerVoidCall<'aria2.saveSession'>;
type Aria2SaveSessionResult = Aria2ServerOpResult;
type Aria2SystemListNotificationsCall = Aria2ServerVoidCall<'system.listNotifications'>;
type Aria2SystemListNotificationsResult = RpcResult<string[]>;
type Aria2SystemListMethodsCall = Aria2ServerVoidCall<'system.listMethods'>;
type Aria2SystemListMethodsResult = RpcResult<string[]>;
interface Aria2SystemMulticallItem<T extends string, TParams> {
methodName: T;
params: TParams;
}
type Aria2SystemMulticallParamItem = {
[P in Aria2RpcMethod]: Aria2SystemMulticallItem<P, Aria2RpcMethodCallMap[P]['params']>;
}[keyof Aria2RpcMethodCallMap];
type Aria2SystemMulticallParams = [Aria2SystemMulticallParamItem] | Array<Aria2SystemMulticallParamItem>;
type Aria2SystemMulticallCall = RpcCall<'system.multicall', Aria2SystemMulticallParams>;
type Aria2SystemMulticallResult = RpcResult<unknown[]>;
type Aria2SystemMulticallParamsToResult<T extends Aria2SystemMulticallParams> = RpcResult<{
[P in keyof T]: [
NonNullable<Aria2RpcMethodResultMap[T[P]['methodName']]['result']>
];
}>;
type Aria2RpcMethodCallMap = Aria2ClientMethodCallMap & Aria2SystemMethodCallMap;
interface Aria2ClientMethodCallMap {
'aria2.changeOption': Aria2ChangeOptionCall;
'aria2.changeGlobalOption': Aria2ChangeGlobalOptionCall;
'aria2.getGlobalOption': Aria2GetGlobalOptionCall;
'aria2.getOption': Aria2GetOptionCall;
'aria2.getSessionInfo': Aria2GetSessionInfoCall;
'aria2.shutdown': Aria2ShutdownCall;
'aria2.forceShutdown': Aria2ForceShutdownCall;
'aria2.saveSession': Aria2SaveSessionCall;
'aria2.getGlobalStat': Aria2GetGlobalStatCall;
'aria2.getVersion': Aria2GetVersionCall;
'aria2.purgeDownloadResult': Aria2PurgeDownloadResultCall;
'aria2.removeDownloadResult': Aria2RemoveDownloadResultCall;
'aria2.changeUri': Aria2ChangeUriCall;
'aria2.changePosition': Aria2ChangePositionCall;
'aria2.getPeers': Aria2GetPeersCall;
'aria2.getFiles': Aria2GetFilesCall;
'aria2.getUris': Aria2GetUrisCall;
'aria2.getServers': Aria2GetServersCall;
'aria2.tellStatus': Aria2TellStatusCall;
'aria2.tellWaiting': Aria2TellWaitingCall;
'aria2.tellStopped': Aria2TellStoppedCall;
'aria2.tellActive': Aria2TellActiveCall;
'aria2.remove': Aria2RemoveCall;
'aria2.forceRemove': Aria2ForceRemoveCall;
'aria2.pause': Aria2PauseCall;
'aria2.forcePause': Aria2ForcePauseCall;
'aria2.unpause': Aria2UnpauseCall;
'aria2.unpauseAll': Aria2UnpauseAllCall;
'aria2.pauseAll': Aria2PauseAllCall;
'aria2.forcePauseAll': Aria2ForcePauseAllCall;
'aria2.addMetalink': Aria2AddMetalinkCall;
'aria2.addTorrent': Aria2AddTorrentCall;
'aria2.addUri': Aria2AddUriCall;
}
interface Aria2SystemMethodCallMap {
'system.multicall': Aria2SystemMulticallCall;
'system.listMethods': Aria2SystemListMethodsCall;
'system.listNotifications': Aria2SystemListNotificationsCall;
}
type Aria2RpcMethodResultMap = Aria2SystemMethodResultMap & Aria2ClientMethodResultMap;
interface Aria2SystemMethodResultMap {
'system.multicall': Aria2SystemMulticallResult;
'system.listMethods': Aria2SystemListMethodsResult;
'system.listNotifications': Aria2SystemListNotificationsResult;
}
interface Aria2ClientMethodResultMap {
'aria2.changeOption': Aria2ChangeOptionResult;
'aria2.changeGlobalOption': Aria2ChangeGlobalOptionResult;
'aria2.getGlobalOption': Aria2GetGlobalOptionResult;
'aria2.getOption': Aria2GetOptionResult;
'aria2.getSessionInfo': Aria2GetSessionInfoResult;
'aria2.shutdown': Aria2ShutdownResult;
'aria2.forceShutdown': Aria2ForceShutdownResult;
'aria2.saveSession': Aria2SaveSessionResult;
'aria2.getGlobalStat': Aria2GetGlobalStatResult;
'aria2.getVersion': Aria2GetVersionResult;
'aria2.purgeDownloadResult': Aria2PurgeDownloadResultResult;
'aria2.removeDownloadResult': Aria2RemoveDownloadResultResult;
'aria2.changeUri': Aria2ChangeUriResult;
'aria2.changePosition': Aria2ChangePositionResult;
'aria2.getPeers': Aria2GetPeersResult;
'aria2.getFiles': Aria2GetFilesResult;
'aria2.getUris': Aria2GetUrisResult;
'aria2.getServers': Aria2GetServersResult;
'aria2.tellStatus': Aria2TellStatusResult;
'aria2.tellWaiting': Aria2TellWaitingResult;
'aria2.tellStopped': Aria2TellStoppedResult;
'aria2.tellActive': Aria2TellActiveResult;
'aria2.remove': Aria2RemoveResult;
'aria2.forceRemove': Aria2ForceRemoveResult;
'aria2.pause': Aria2PauseResult;
'aria2.forcePause': Aria2ForcePauseResult;
'aria2.unpause': Aria2UnpauseResult;
'aria2.unpauseAll': Aria2UnpauseAllResult;
'aria2.pauseAll': Aria2PauseAllResult;
'aria2.forcePauseAll': Aria2ForcePauseAllResult;
'aria2.addMetalink': Aria2AddMetalinkResult;
'aria2.addTorrent': Aria2AddTorrentResult;
'aria2.addUri': Aria2AddUriResult;
}
type Aria2RpcMethod = keyof Aria2RpcMethodCallMap;
interface Aria2StringUtf8 {
'utf-8': string;
}
type Aria2ServerOpResultOk = 'OK';
type Aria2ServerOpResult = RpcResult<Aria2ServerOpResultOk>;
type Aria2ClientGidOpParams = [gid: Aria2DownloadGid];
type Aria2ClientGidOpCall<T extends Aria2RpcMethod> = RpcCall<T, Aria2ClientGidOpParams>;
type Aria2ServerVoidCall<T extends Aria2RpcMethod> = RpcCall<T, []>;
type Aria2ClientInputOptionKey = 'all-proxy' | 'all-proxy-passwd' | 'all-proxy-user' | 'allow-overwrite' | 'allow-piece-length-change' | 'always-resume' | 'async-dns' | 'auto-file-renaming' | 'bt-enable-hook-after-hash-check' | 'bt-enable-lpd' | 'bt-exclude-tracker' | 'bt-external-ip' | 'bt-force-encryption' | 'bt-hash-check-seed' | 'bt-load-saved-metadata' | 'bt-max-peers' | 'bt-metadata-only' | 'bt-min-crypto-level' | 'bt-prioritize-piece' | 'bt-remove-unselected-file' | 'bt-request-peer-speed-limit' | 'bt-require-crypto' | 'bt-save-metadata' | 'bt-seed-unverified' | 'bt-stop-timeout' | 'bt-tracker' | 'bt-tracker-connect-timeout' | 'bt-tracker-interval' | 'bt-tracker-timeout' | 'check-integrity' | 'checksum' | 'conditional-get' | 'connect-timeout' | 'content-disposition-default-utf8' | 'continue' | 'dir' | 'dry-run' | 'enable-http-keep-alive' | 'enable-http-pipelining' | 'enable-mmap' | 'enable-peer-exchange' | 'file-allocation' | 'follow-metalink' | 'follow-torrent' | 'force-save' | 'ftp-passwd' | 'ftp-pasv' | 'ftp-proxy' | 'ftp-proxy-passwd' | 'ftp-proxy-user' | 'ftp-reuse-connection' | 'ftp-type' | 'ftp-user' | 'gid' | 'hash-check-only' | 'header' | 'http-accept-gzip' | 'http-auth-challenge' | 'http-no-cache' | 'http-passwd' | 'http-proxy' | 'http-proxy-passwd' | 'http-proxy-user' | 'http-user' | 'https-proxy' | 'https-proxy-passwd' | 'https-proxy-user' | 'index-out' | 'lowest-speed-limit' | 'max-connection-per-server' | 'max-download-limit' | 'max-file-not-found' | 'max-mmap-limit' | 'max-resume-failure-tries' | 'max-tries' | 'max-upload-limit' | 'metalink-base-uri' | 'metalink-enable-unique-protocol' | 'metalink-language' | 'metalink-location' | 'metalink-os' | 'metalink-preferred-protocol' | 'metalink-version' | 'min-split-size' | 'no-file-allocation-limit' | 'no-netrc' | 'no-proxy' | 'out' | 'parameterized-uri' | 'pause' | 'pause-metadata' | 'piece-length' | 'proxy-method' | 'realtime-chunk-checksum' | 'referer' | 'remote-time' | 'remove-control-file' | 'retry-wait' | 'reuse-uri' | 'rpc-save-upload-metadata' | 'seed-ratio' | 'seed-time' | 'select-file' | 'split' | 'ssh-host-key-md' | 'stream-piece-selector' | 'timeout' | 'uri-selector' | 'use-head' | 'user-agent';
type Aria2ClientGlobalOptionKey = 'bt-max-open-files' | 'download-result' | 'keep-unfinished-download-result' | 'log' | 'log-level' | 'max-concurrent-downloads' | 'max-download-result' | 'max-overall-download-limit' | 'max-overall-upload-limit' | 'optimize-concurrent-downloads' | 'save-cookies' | 'save-session' | 'server-stat-of' | Exclude<Aria2ClientInputOptionKey, 'checksum' | 'index-out' | 'out' | 'pause' | 'select-file'>;
type Aria2ClientInputOptions = Partial<Record<Aria2ClientInputOptionKey, any>>;
type Aria2ClientGlobalOptions = Partial<Record<Aria2ClientGlobalOptionKey, any>>;
type Aria2ChangeOptionOpResult = string;
type Aria2ChangeOptionParams = [
gid: Aria2DownloadGid,
options: Aria2ClientInputOptions
];
type Aria2ChangeOptionCall = RpcCall<'aria2.changeOption', Aria2ChangeOptionParams>;
type Aria2ChangeOptionResult = Aria2ServerOpResult;
type Aria2ChangeGlobalOptionParams = [options: Aria2ClientGlobalOptions];
type Aria2ChangeGlobalOptionCall = RpcCall<'aria2.changeGlobalOption', Aria2ChangeGlobalOptionParams>;
type Aria2ChangeGlobalOptionResult = Aria2ServerOpResult;
type Aria2GetOptionCall = Aria2ClientGidOpCall<'aria2.getOption'>;
type Aria2GetOptionResult = RpcResult<Aria2ClientInputOptions>;
type Aria2GetGlobalOptionCall = Aria2ServerVoidCall<'aria2.getGlobalOption'>;
type Aria2GetGlobalOptionResult = RpcResult<Aria2ClientGlobalOptions>;
type Aria2DownloadGid = string;
type Aria2PurgeDownloadResultCall = Aria2ServerVoidCall<'aria2.purgeDownloadResult'>;
type Aria2PurgeDownloadResultResult = Aria2ServerOpResult;
type Aria2RemoveDownloadResultCall = Aria2ClientGidOpCall<'aria2.removeDownloadResult'>;
type Aria2RemoveDownloadResultResult = Aria2ServerOpResult;
type Aria2ChangeUriParams = [
gid: Aria2DownloadGid,
fileIndex: number,
delUris: string[],
addUris: string[],
position: number
];
type Aria2ChangeUriCall = RpcCall<'aria2.changeUri', Aria2ChangeUriParams>;
type Aria2ChangeUriResultOk = [deleted: number, added: number];
type Aria2ChangeUriResult = RpcResult<Aria2ChangeUriResultOk>;
type Aria2PositionHow = 'POS_CUR' | 'POS_SET' | 'POS_END';
type Aria2ChangePositionParams = [
gid: Aria2DownloadGid,
pos: number,
how: Aria2PositionHow
];
type Aria2ChangePositionCall = RpcCall<'aria2.changePosition', Aria2ChangePositionParams>;
type Aria2ChangePositionResultOk = number;
type Aria2ChangePositionResult = RpcResult<Aria2ChangePositionResultOk>;
type Aria2UriStatusString = 'waiting' | 'used';
interface Aria2UriStatus {
/**
* `used` if the URI is in use. `waiting` if the URI is still waiting in the queue.
* @public
*/
status: Aria2UriStatusString;
/**
* URI.
* @public
*/
uri: string;
}
type Aria2GetUrisCall = Aria2ClientGidOpCall<'aria2.getUris'>;
type Aria2GetUrisResult = RpcResult<Aria2UriStatus[]>;
type Aria2DownloadBitTorrentMode = 'single' | 'multi';
interface Aria2FileStatus {
/**
* Index of the file, starting at 1, in the same order as files appear in the multi-file torrent.
* @public
*/
index: number;
/**
* File path.
* @public
*/
path: string;
/**
* File size in bytes.
*
* This number can be too large, you should parse with `BigInt`.
*
* @public
*/
length: string;
/**
* Completed length of this file in bytes.
*
* This number can be too large, you should parse with `BigInt`.
*
* Please note that it is possible that sum of `completedLength` is less than the `completedLength` returned by the `aria2.tellStatus()` method.
*
* This is because completedLength in `aria2.getFiles()` only includes completed pieces.
* On the other hand, completedLength in `aria2.tellStatus()` also includes partially completed pieces.
* @public
*/
completedLength: string;
/**
* `"true"` if this file is selected by `--select-file` option.
* If `--select-file` is not specified or this is single-file torrent or not a torrent download at all, this value is always `"true"`. Otherwise `"false"`.
* @public
*/
selected: 'true' | 'false';
/**
* Returns a list of URIs for this file.
* The element type is the same struct used in the `aria2.getUris()` method.
* @public
*/
uris: Aria2UriStatus[];
}
type Aria2FilesStatus = Aria2FileStatus[];
type Aria2GetFilesCall = Aria2ClientGidOpCall<'aria2.getFiles'>;
type Aria2GetFilesResult = RpcResult<Aria2FileStatus>;
interface Aria2DownloadBitTorrentInfo {
/**
* name in info dictionary. `name.utf-8` is used if available.
* @public
*/
name: string | Aria2StringUtf8;
}
interface Aria2DownloadBitTorrentStatus {
/**
* List of lists of announce URIs. If the torrent contains `announce` and no `announce-list`, `announce` is converted to the `announce-list` format.
* @public
*/
announceList: string[];
/**
* The comment of the torrent. `comment.utf-8` is used if available.
* @public
*/
comment: string | Aria2StringUtf8;
/**
* The creation time of the torrent. The value is an integer since the epoch, measured in seconds.
* @public
*/
creationDate: number;
/**
* File mode of the torrent. The value is either `single` or `multi`.
* @public
*/
mode: Aria2DownloadBitTorrentMode;
/**
* Struct which contains data from Info dictionary.
* @public
*/
info: Aria2DownloadBitTorrentInfo;
}
interface Aria2PeerInfo {
/**
* `"true"` if aria2 is choking the peer. Otherwise `"false"`.
* @public
*/
amChoking: 'true' | 'false';
/**
* Hexadecimal representation of the download progress of the peer.
* The highest bit corresponds to the piece at index 0.
* Set bits indicate the piece is available and unset bits indicate the piece is missing.
* Any spare bits at the end are set to zero.
* @public
*/
bitfield: string;
/**
* Download speed (byte/sec) that this client obtains from the peer.
*
* This number can be too large, you should parse with `BigInt`.
*
* @public
*/
downloadSpeed: string;
/**
* IP address of the peer.
* @public
*/
ip: string;
/**
* `
* "true"` if the peer is choking aria2. Otherwise `"false"`.
* @public
*/
peerChoking: 'true' | 'false';
/**
* Percent-encoded peer ID.
* @public
*/
peerId: string;
/**
* Port number of the peer.
* @public
*/
port: string;
/**
* `"true"` if this peer is a seeder. Otherwise `"false"`.
* @public
*/
seeder: 'true' | 'false';
/**
* Upload speed(byte/sec) that this client uploads to the peer.
*
* This number can be too large, you should parse with `BigInt`.
*
* @public
*/
uploadSpeed: string;
}
type Aria2PeersInfo = Aria2PeerInfo[];
type Aria2GetPeersCall = Aria2ClientGidOpCall<'aria2.getPeers'>;
type Aria2GetPeersResult = RpcResult<Aria2PeersInfo>;
interface Aria2ServerInfo {
/**
* Original URI.
* @public
*/
uri: string;
/**
* This is the URI currently used for downloading.
* If redirection is involved, currentUri and uri may differ.
*
* @public
*/
currentUri: string;
/**
* Download speed (byte/sec).
*
* This number can be too large, you should parse with `BigInt`.
*
* @public
*/
downloadSpeed: string;
}
interface Aria2ServersInfoItem {
/**
* Index of the file, starting at 1, in the same order as files appear in the multi-file metalink.
* @public
*/
index: string;
/**
* A list of structs.
* @public
*/
servers: Aria2ServerInfo[];
}
type Aria2ServersInfo = Aria2ServersInfoItem[];
type Aria2GetServersCall = Aria2ClientGidOpCall<'aria2.getServers'>;
type Aria2GetServersResult = RpcResult<Aria2ServersInfo>;
type Aria2DownloadState = 'active' | 'waiting' | 'paused' | 'error' | 'complete' | 'removed';
interface Aria2DownloadStatus {
/**
* GID of the download.
* @public
*/
gid: Aria2DownloadGid;
/**
* - `active` for currently downloading/seeding downloads.
* - `waiting` for downloads in the queue; download is not started.
* - `paused` for paused downloads.
* - `error` for downloads that were stopped because of error.
* - `complete` for stopped and completed downloads.
* - `removed` for the downloads removed by user.
* @public
*/
status: Aria2DownloadState;
/**
* Total length of the download in bytes.
*
* This number can be too large, you should parse with `BigInt`.
*
* @public
*/
totalLength: string;
/**
* Completed length of the download in bytes.
*
* This number can be too large, you should parse with `BigInt`.
*
* @public
*/
completedLength: string;
/**
* Uploaded length of the download in bytes.
*
* This number can be too large, you should parse with `BigInt`.
*
* @public
*/
uploadLength: string;
/**
* Hexadecimal representation of the download progress.
* The highest bit corresponds to the piece at index 0.
* Any set bits indicate loaded pieces, while unset bits indicate not yet loaded and/or missing pieces.
* Any overflow bits at the end are set to zero.
* When the download was not started yet, this key will not be included in the response.
*/
bitfield: string;
/**
* Download speed of this download measured in bytes/sec.
*
* This number can be too large, you should parse with `BigInt`.
*
* @public
*/
downloadSpeed: string;
/**
* Upload speed of this download measured in bytes/sec.
*
* This number can be too large, you should parse with `BigInt`.
*
* @public
*/
uploadSpeed: string;
/**
* InfoHash. BitTorrent only.
* @public
*/
infoHash?: string;
/**
* The number of seeders aria2 has connected to. BitTorrent only.
* @public
*/
numSeeders?: string;
/**
* `true` if the local endpoint is a seeder. Otherwise `false`. BitTorrent only.
* @public
*/
seeder?: 'true' | 'false';
/**
* Piece length in bytes.
*
* This number can be too large, you should parse with `BigInt`.
*
* @public
*/
pieceLength: string;
/**
* The number of pieces.
* @public
*/
numPieces: string;
/**
* The number of peers/servers aria2 has connected to.
* @public
*/
connections: string;
/**
* The code of the last error for this item, if any.
* The value is a string.
* The error codes are defined in the [EXIT STATUS](https://aria2.github.io/manual/en/html/aria2c.html#id1) section.
* This value is only available for stopped/completed downloads.
* @public
*/
errorCode?: string;
/**
* The (hopefully) human readable error message associated to `errorCode`.
* @public
*/
errorMessage?: string;
/**
* List of GIDs which are generated as the result of this download.
* For example, when aria2 downloads a Metalink file, it generates downloads described in the Metalink (see the `--follow-metalink` option).
* This value is useful to track auto-generated downloads.
* If there are no such downloads, this key will not be included in the response.
* @public
*/
followedBy?: Aria2DownloadGid[];
/**
* The reverse link for `followedBy`.
* A download included in `followedBy` has this object's GID in its `following` value.
* @public
*/
following?: Aria2DownloadGid;
/**
* GID of a parent download.
* Some downloads are a part of another download.
* For example, if a file in a Metalink has BitTorrent resources, the downloads of ".torrent" files are parts of that parent.
* If this download has no parent, this key will not be included in the response.
* @public
*/
belongsTo?: Aria2DownloadGid;
/**
* Directory to save files.
* @public
*/
dir: string;
/**
* Returns the list of files.
* The elements of this list are the same structs used in `aria2.getFiles()` method.
* @public
*/
files: Aria2FileStatus[];
/**
* Struct which contains information retrieved from the .torrent (file). BitTorrent only.
* @public
*/
bittorrent?: Aria2DownloadBitTorrentStatus;
}
type Aria2TellStatusParams = [
gid: Aria2DownloadGid,
keys?: [keyof Aria2DownloadStatus] | (keyof Aria2DownloadStatus)[]
];
type Aria2TellStatusCall = RpcCall<'aria2.tellStatus', Aria2TellStatusParams>;
type Aria2TellStatusResult = RpcResult<Partial<Aria2DownloadStatus>>;
type Aria2TellStatusParamsToResult<T extends Aria2TellStatusParams> = RpcResult<T[1] extends void ? Aria2DownloadStatus : NonNullable<T[1]> extends [keyof Aria2DownloadStatus] | (keyof Aria2DownloadStatus)[] ? Pick<Aria2DownloadStatus, NonNullable<T[1]>[number]> : Aria2DownloadStatus>;
type Aria2TellStatusListParamsToResult<T extends [keyof Aria2DownloadStatus] | (keyof Aria2DownloadStatus)[] | undefined> = RpcResult<Array<T extends void ? Aria2DownloadStatus : NonNullable<T> extends [keyof Aria2DownloadStatus] | (keyof Aria2DownloadStatus)[] ? Pick<Aria2DownloadStatus, NonNullable<T>[number]> : Aria2DownloadStatus>>;
type Aria2TellStatusListParams = [
offset: number,
num: number,
keys?: [keyof Aria2DownloadStatus] | (keyof Aria2DownloadStatus)[]
];
type Aria2TellWaitingCall = RpcCall<'aria2.tellWaiting', Aria2TellStatusListParams>;
type Aria2TellWaitingResult = RpcResult<Partial<Aria2DownloadStatus>[]>;
type Aria2TellStoppedCall = RpcCall<'aria2.tellStopped', Aria2TellStatusListParams>;
type Aria2TellStoppedResult = RpcResult<Partial<Aria2DownloadStatus>[]>;
type Aria2TellActiveParams = [
keys?: [keyof Aria2DownloadStatus] | (keyof Aria2DownloadStatus)[]
];
type Aria2TellActiveCall = RpcCall<'aria2.tellActive', Aria2TellStatusParams>;
type Aria2TellActiveResult = RpcResult<Partial<Aria2DownloadStatus>[]>;
type Aria2RemoveCall = Aria2ClientGidOpCall<'aria2.remove'>;
type Aria2RemoveResult = RpcResult<Aria2DownloadGid>;
type Aria2ForceRemoveCall = Aria2ClientGidOpCall<'aria2.forceRemove'>;
type Aria2ForceRemoveResult = RpcResult<Aria2DownloadGid>;
type Aria2PauseCall = Aria2ClientGidOpCall<'aria2.pause'>;
type Aria2PauseResult = RpcResult<Aria2DownloadGid>;
type Aria2ForcePauseCall = Aria2ClientGidOpCall<'aria2.forcePause'>;
type Aria2ForcePauseResult = RpcResult<Aria2DownloadGid>;
type Aria2UnpauseCall = Aria2ClientGidOpCall<'aria2.unpause'>;
type Aria2UnpauseResult = RpcResult<Aria2DownloadGid>;
type Aria2PauseAllCall = Aria2ServerVoidCall<'aria2.pauseAll'>;
type Aria2PauseAllResult = Aria2ServerOpResult;
type Aria2ForcePauseAllCall = Aria2ServerVoidCall<'aria2.forcePauseAll'>;
type Aria2ForcePauseAllResult = Aria2ServerOpResult;
type Aria2UnpauseAllCall = Aria2ServerVoidCall<'aria2.unpauseAll'>;
type Aria2UnpauseAllResult = Aria2ServerOpResult;
type Aria2AddMetalinkParams = [
metalink: string,
options?: Aria2ClientInputOptions,
position?: number
];
type Aria2AddMetalinkCall = RpcCall<'aria2.addMetalink', Aria2AddMetalinkParams>;
type Aria2AddMetalinkResult = RpcResult<Aria2DownloadGid>;
type Aria2AddTorrentParams = [
torrent: string,
uris?: string[],
options?: Aria2ClientInputOptions,
position?: number
];
type Aria2AddTorrentCall = RpcCall<'aria2.addTorrent', Aria2AddTorrentParams>;
type Aria2AddTorrentResult = RpcResult<Aria2DownloadGid>;
type Aria2AddUriParams = [
uris: string[],
options?: Aria2ClientInputOptions,
position?: number
];
type Aria2AddUriCall = RpcCall<'aria2.addUri', Aria2AddUriParams>;
type Aria2AddUriResult = RpcResult<Aria2DownloadGid>;
type Aria2ClientNotificationMethod = 'aria2.onDownloadStart' | 'aria2.onDownloadPause' | 'aria2.onDownloadStop' | 'aria2.onDownloadComplete' | 'aria2.onDownloadError' | 'aria2.onBtDownloadComplete';
interface Aria2ClientNotification {
gid: Aria2DownloadGid;
}
type Aria2ClientNotificationParams = [
notification: Aria2ClientNotification
];
type Aria2ClientNotificationCall = RpcCall<Aria2ClientNotificationMethod, Aria2ClientNotificationParams>;
type TrimStart<T, U extends string> = T extends `${U}${infer P}` ? P : T;
type ClientAria2 = {
[P in TrimStart<Exclude<keyof Aria2ClientMethodCallMap, 'aria2.tellStatus' | 'aria2.tellWaiting' | 'aria2.tellStopped' | 'aria2.tellActive'>, 'aria2.'>]: (conn: Conn, ...args: Aria2ClientMethodCallMap[`aria2.${P}`]['params']) => Promise<NonNullable<Aria2ClientMethodResultMap[`aria2.${P}`]['result']>>;
} & {
tellStatus: <T extends Aria2TellStatusParams>(conn: Conn, ...args: T) => Promise<NonNullable<Aria2TellStatusParamsToResult<T>['result']>>;
} & {
[_ in 'tellWaiting' | 'tellStopped']: <T extends Aria2TellStatusListParams>(conn: Conn, ...args: T) => Promise<NonNullable<Aria2TellStatusListParamsToResult<T[2]>['result']>>;
} & {
tellActive: <T extends Aria2TellActiveParams>(conn: Conn, ...args: T) => Promise<NonNullable<Aria2TellStatusListParamsToResult<T[0]>['result']>>;
} & {
[P in TrimStart<Aria2ClientNotificationMethod, 'aria2.'>]: <T extends (...args: Aria2ClientNotificationParams) => void>(conn: Conn, listener: T) => Disposable<T>;
} & {
when: <T extends (...args: Aria2ClientNotificationParams) => void>(conn: Conn, method: Aria2ClientNotificationMethod, listener: T) => Disposable<T>;
};
type ClientSystem = {
[P in TrimStart<Exclude<keyof Aria2SystemMethodCallMap, 'system.multicall'>, 'system.'>]: (conn: Conn, ...args: Aria2SystemMethodCallMap[`system.${P}`]['params']) => Promise<NonNullable<Aria2SystemMethodResultMap[`system.${P}`]['result']>>;
} & {
multicall: <T extends Aria2SystemMulticallParams>(conn: Conn, ...args: T) => Promise<NonNullable<Aria2SystemMulticallParamsToResult<T>['result']>>;
};
declare function close(conn: Conn, code?: number, reason?: string): void;
declare const open: Open;
declare const system: Readonly<ClientSystem>;
declare const aria2: Readonly<ClientAria2>;
type Aria2RpcHTTPUrl = `${'http' | 'https'}://${string}:${number}/jsonrpc` | `${'http' | 'https'}://${string}/jsonrpc`;
declare function createHTTP(url: Aria2RpcHTTPUrl): Socket;
declare function createHTTP(url: Aria2RpcHTTPUrl, options: Partial<OpenOptions>): PreconfiguredSocket;
type Aria2RpcWebSocketUrl = `${'ws' | 'wss'}://${string}:${number}/jsonrpc` | `${'ws' | 'wss'}://${string}/jsonrpc`;
declare function createWebSocket(url: Aria2RpcWebSocketUrl): Socket;
declare function createWebSocket(url: Aria2RpcWebSocketUrl, options: Partial<OpenOptions>): PreconfiguredSocket;
type raw_Aria2AddMetalinkCall = Aria2AddMetalinkCall;
type raw_Aria2AddMetalinkParams = Aria2AddMetalinkParams;
type raw_Aria2AddMetalinkResult = Aria2AddMetalinkResult;
type raw_Aria2AddTorrentCall = Aria2AddTorrentCall;
type raw_Aria2AddTorrentParams = Aria2AddTorrentParams;
type raw_Aria2AddTorrentResult = Aria2AddTorrentResult;
type raw_Aria2AddUriCall = Aria2AddUriCall;
type raw_Aria2AddUriParams = Aria2AddUriParams;
type raw_Aria2AddUriResult = Aria2AddUriResult;
type raw_Aria2ChangeGlobalOptionCall = Aria2ChangeGlobalOptionCall;
type raw_Aria2ChangeGlobalOptionParams = Aria2ChangeGlobalOptionParams;
type raw_Aria2ChangeGlobalOptionResult = Aria2ChangeGlobalOptionResult;
type raw_Aria2ChangeOptionCall = Aria2ChangeOptionCall;
type raw_Aria2ChangeOptionOpResult = Aria2ChangeOptionOpResult;
type raw_Aria2ChangeOptionParams = Aria2ChangeOptionParams;
type raw_Aria2ChangeOptionResult = Aria2ChangeOptionResult;
type raw_Aria2ChangePositionCall = Aria2ChangePositionCall;
type raw_Aria2ChangePositionParams = Aria2ChangePositionParams;
type raw_Aria2ChangePositionResult = Aria2ChangePositionResult;
type raw_Aria2ChangePositionResultOk = Aria2ChangePositionResultOk;
type raw_Aria2ChangeUriCall = Aria2ChangeUriCall;
type raw_Aria2ChangeUriParams = Aria2ChangeUriParams;
type raw_Aria2ChangeUriResult = Aria2ChangeUriResult;
type raw_Aria2ChangeUriResultOk = Aria2ChangeUriResultOk;
type raw_Aria2ClientGidOpCall<T extends Aria2RpcMethod> = Aria2ClientGidOpCall<T>;
type raw_Aria2ClientGidOpParams = Aria2ClientGidOpParams;
type raw_Aria2ClientGlobalOptionKey = Aria2ClientGlobalOptionKey;
type raw_Aria2ClientGlobalOptions = Aria2ClientGlobalOptions;
type raw_Aria2ClientInputOptionKey = Aria2ClientInputOptionKey;
type raw_Aria2ClientInputOptions = Aria2ClientInputOptions;
type raw_Aria2ClientMethodCallMap = Aria2ClientMethodCallMap;
type raw_Aria2ClientMethodResultMap = Aria2ClientMethodResultMap;
type raw_Aria2ClientNotification = Aria2ClientNotification;
type raw_Aria2ClientNotificationCall = Aria2ClientNotificationCall;
type raw_Aria2ClientNotificationMethod = Aria2ClientNotificationMethod;
type raw_Aria2ClientNotificationParams = Aria2ClientNotificationParams;
type raw_Aria2DownloadBitTorrentInfo = Aria2DownloadBitTorrentInfo;
type raw_Aria2DownloadBitTorrentMode = Aria2DownloadBitTorrentMode;
type raw_Aria2DownloadBitTorrentStatus = Aria2DownloadBitTorrentStatus;
type raw_Aria2DownloadGid = Aria2DownloadGid;
type raw_Aria2DownloadState = Aria2DownloadState;
type raw_Aria2DownloadStatus = Aria2DownloadStatus;
type raw_Aria2FileStatus = Aria2FileStatus;
type raw_Aria2FilesStatus = Aria2FilesStatus;
type raw_Aria2ForcePauseAllCall = Aria2ForcePauseAllCall;
type raw_Aria2ForcePauseAllResult = Aria2ForcePauseAllResult;
type raw_Aria2ForcePauseCall = Aria2ForcePauseCall;
type raw_Aria2ForcePauseResult = Aria2ForcePauseResult;
type raw_Aria2ForceRemoveCall = Aria2ForceRemoveCall;
type raw_Aria2ForceRemoveResult = Aria2ForceRemoveResult;
type raw_Aria2ForceShutdownCall = Aria2ForceShutdownCall;
type raw_Aria2ForceShutdownResult = Aria2ForceShutdownResult;
type raw_Aria2GetFilesCall = Aria2GetFilesCall;
type raw_Aria2GetFilesResult = Aria2GetFilesResult;
type raw_Aria2GetGlobalOptionCall = Aria2GetGlobalOptionCall;
type raw_Aria2GetGlobalOptionResult = Aria2GetGlobalOptionResult;
type raw_Aria2GetGlobalStatCall = Aria2GetGlobalStatCall;
type raw_Aria2GetGlobalStatResult = Aria2GetGlobalStatResult;
type raw_Aria2GetOptionCall = Aria2GetOptionCall;
type raw_Aria2GetOptionResult = Aria2GetOptionResult;
type raw_Aria2GetPeersCall = Aria2GetPeersCall;
type raw_Aria2GetPeersResult = Aria2GetPeersResult;
type raw_Aria2GetServersCall = Aria2GetServersCall;
type raw_Aria2GetServersResult = Aria2GetServersResult;
type raw_Aria2GetSessionInfoCall = Aria2GetSessionInfoCall;
type raw_Aria2GetSessionInfoResult = Aria2GetSessionInfoResult;
type raw_Aria2GetUrisCall = Aria2GetUrisCall;
type raw_Aria2GetUrisResult = Aria2GetUrisResult;
type raw_Aria2GetVersionCall = Aria2GetVersionCall;
type raw_Aria2GetVersionResult = Aria2GetVersionResult;
type raw_Aria2PauseAllCall = Aria2PauseAllCall;
type raw_Aria2PauseAllResult = Aria2PauseAllResult;
type raw_Aria2PauseCall = Aria2PauseCall;
type raw_Aria2PauseResult = Aria2PauseResult;
type raw_Aria2PeerInfo = Aria2PeerInfo;
type raw_Aria2PeersInfo = Aria2PeersInfo;
type raw_Aria2PositionHow = Aria2PositionHow;
type raw_Aria2PurgeDownloadResultCall = Aria2PurgeDownloadResultCall;
type raw_Aria2PurgeDownloadResultResult = Aria2PurgeDownloadResultResult;
type raw_Aria2RemoveCall = Aria2RemoveCall;
type raw_Aria2RemoveDownloadResultCall = Aria2RemoveDownloadResultCall;
type raw_Aria2RemoveDownloadResultResult = Aria2RemoveDownloadResultResult;
type raw_Aria2RemoveResult = Aria2RemoveResult;
type raw_Aria2RpcMethod = Aria2RpcMethod;
type raw_Aria2RpcMethodCallMap = Aria2RpcMethodCallMap;
type raw_Aria2RpcMethodResultMap = Aria2RpcMethodResultMap;
type raw_Aria2SaveSessionCall = Aria2SaveSessionCall;
type raw_Aria2SaveSessionResult = Aria2SaveSessionResult;
type raw_Aria2ServerGlobalStat = Aria2ServerGlobalStat;
type raw_Aria2ServerInfo = Aria2ServerInfo;
type raw_Aria2ServerOpResult = Aria2ServerOpResult;
type raw_Aria2ServerOpResultOk = Aria2ServerOpResultOk;
type raw_Aria2ServerSessionInfo = Aria2ServerSessionInfo;
type raw_Aria2ServerVersion = Aria2ServerVersion;
type raw_Aria2ServerVoidCall<T extends Aria2RpcMethod> = Aria2ServerVoidCall<T>;
type raw_Aria2ServersInfo = Aria2ServersInfo;
type raw_Aria2ServersInfoItem = Aria2ServersInfoItem;
type raw_Aria2ShutdownCall = Aria2ShutdownCall;
type raw_Aria2ShutdownResult = Aria2ShutdownResult;
type raw_Aria2StringUtf8 = Aria2StringUtf8;
type raw_Aria2SystemListMethodsCall = Aria2SystemListMethodsCall;
type raw_Aria2SystemListMethodsResult = Aria2SystemListMethodsResult;
type raw_Aria2SystemListNotificationsCall = Aria2SystemListNotificationsCall;
type raw_Aria2SystemListNotificationsResult = Aria2SystemListNotificationsResult;
type raw_Aria2SystemMethodCallMap = Aria2SystemMethodCallMap;
type raw_Aria2SystemMethodResultMap = Aria2SystemMethodResultMap;
type raw_Aria2SystemMulticallCall = Aria2SystemMulticallCall;
type raw_Aria2SystemMulticallItem<T extends string, TParams> = Aria2SystemMulticallItem<T, TParams>;
type raw_Aria2SystemMulticallParamItem = Aria2SystemMulticallParamItem;
type raw_Aria2SystemMulticallParams = Aria2SystemMulticallParams;
type raw_Aria2SystemMulticallParamsToResult<T extends Aria2SystemMulticallParams> = Aria2SystemMulticallParamsToResult<T>;
type raw_Aria2SystemMulticallResult = Aria2SystemMulticallResult;
type raw_Aria2TellActiveCall = Aria2TellActiveCall;
type raw_Aria2TellActiveParams = Aria2TellActiveParams;
type raw_Aria2TellActiveResult = Aria2TellActiveResult;
type raw_Aria2TellStatusCall = Aria2TellStatusCall;
type raw_Aria2TellStatusListParams = Aria2TellStatusListParams;
type raw_Aria2TellStatusListParamsToResult<T extends [keyof Aria2DownloadStatus] | (keyof Aria2DownloadStatus)[] | undefined> = Aria2TellStatusListParamsToResult<T>;
type raw_Aria2TellStatusParams = Aria2TellStatusParams;
type raw_Aria2TellStatusParamsToResult<T extends Aria2TellStatusParams> = Aria2TellStatusParamsToResult<T>;
type raw_Aria2TellStatusResult = Aria2TellStatusResult;
type raw_Aria2TellStoppedCall = Aria2TellStoppedCall;
type raw_Aria2TellStoppedResult = Aria2TellStoppedResult;
type raw_Aria2TellWaitingCall = Aria2TellWaitingCall;
type raw_Aria2TellWaitingResult = Aria2TellWaitingResult;
type raw_Aria2UnpauseAllCall = Aria2UnpauseAllCall;
type raw_Aria2UnpauseAllResult = Aria2UnpauseAllResult;
type raw_Aria2UnpauseCall = Aria2UnpauseCall;
type raw_Aria2UnpauseResult = Aria2UnpauseResult;
type raw_Aria2UriStatus = Aria2UriStatus;
type raw_Aria2UriStatusString = Aria2UriStatusString;
type raw_Disposable<T = void> = Disposable<T>;
type raw_RpcCall<TMethod extends RpcMethod = string, TParam = unknown> = RpcCall<TMethod, TParam>;
type raw_RpcMessage = RpcMessage;
type raw_RpcMessageId = RpcMessageId;
type raw_RpcMethod = RpcMethod;
type raw_RpcResult<T = unknown, E = unknown> = RpcResult<T, E>;
type raw_RpcVersion = RpcVersion;
declare namespace raw {
export type { raw_Aria2AddMetalinkCall as Aria2AddMetalinkCall, raw_Aria2AddMetalinkParams as Aria2AddMetalinkParams, raw_Aria2AddMetalinkResult as Aria2AddMetalinkResult, raw_Aria2AddTorrentCall as Aria2AddTorrentCall, raw_Aria2AddTorrentParams as Aria2AddTorrentParams, raw_Aria2AddTorrentResult as Aria2AddTorrentResult, raw_Aria2AddUriCall as Aria2AddUriCall, raw_Aria2AddUriParams as Aria2AddUriParams, raw_Aria2AddUriResult as Aria2AddUriResult, raw_Aria2ChangeGlobalOptionCall as Aria2ChangeGlobalOptionCall, raw_Aria2ChangeGlobalOptionParams as Aria2ChangeGlobalOptionParams, raw_Aria2ChangeGlobalOptionResult as Aria2ChangeGlobalOptionResult, raw_Aria2ChangeOptionCall as Aria2ChangeOptionCall, raw_Aria2ChangeOptionOpResult as Aria2ChangeOptionOpResult, raw_Aria2ChangeOptionParams as Aria2ChangeOptionParams, raw_Aria2ChangeOptionResult as Aria2ChangeOptionResult, raw_Aria2ChangePositionCall as Aria2ChangePositionCall, raw_Aria2ChangePositionParams as Aria2ChangePositionParams, raw_Aria2ChangePositionResult as Aria2ChangePositionResult, raw_Aria2ChangePositionResultOk as Aria2ChangePositionResultOk, raw_Aria2ChangeUriCall as Aria2ChangeUriCall, raw_Aria2ChangeUriParams as Aria2ChangeUriParams, raw_Aria2ChangeUriResult as Aria2ChangeUriResult, raw_Aria2ChangeUriResultOk as Aria2ChangeUriResultOk, raw_Aria2ClientGidOpCall as Aria2ClientGidOpCall, raw_Aria2ClientGidOpParams as Aria2ClientGidOpParams, raw_Aria2ClientGlobalOptionKey as Aria2ClientGlobalOptionKey, raw_Aria2ClientGlobalOptions as Aria2ClientGlobalOptions, raw_Aria2ClientInputOptionKey as Aria2ClientInputOptionKey, raw_Aria2ClientInputOptions as Aria2ClientInputOptions, raw_Aria2ClientMethodCallMap as Aria2ClientMethodCallMap, raw_Aria2ClientMethodResultMap as Aria2ClientMethodResultMap, raw_Aria2ClientNotification as Aria2ClientNotification, raw_Aria2ClientNotificationCall as Aria2ClientNotificationCall, raw_Aria2ClientNotificationMethod as Aria2ClientNotificationMethod, raw_Aria2ClientNotificationParams as Aria2ClientNotificationParams, raw_Aria2DownloadBitTorrentInfo as Aria2DownloadBitTorrentInfo, raw_Aria2DownloadBitTorrentMode as Aria2DownloadBitTorrentMode, raw_Aria2DownloadBitTorrentStatus as Aria2DownloadBitTorrentStatus, raw_Aria2DownloadGid as Aria2DownloadGid, raw_Aria2DownloadState as Aria2DownloadState, raw_Aria2DownloadStatus as Aria2DownloadStatus, raw_Aria2FileStatus as Aria2FileStatus, raw_Aria2FilesStatus as Aria2FilesStatus, raw_Aria2ForcePauseAllCall as Aria2ForcePauseAllCall, raw_Aria2ForcePauseAllResult as Aria2ForcePauseAllResult, raw_Aria2ForcePauseCall as Aria2ForcePauseCall, raw_Aria2ForcePauseResult as Aria2ForcePauseResult, raw_Aria2ForceRemoveCall as Aria2ForceRemoveCall, raw_Aria2ForceRemoveResult as Aria2ForceRemoveResult, raw_Aria2ForceShutdownCall as Aria2ForceShutdownCall, raw_Aria2ForceShutdownResult as Aria2ForceShutdownResult, raw_Aria2GetFilesCall as Aria2GetFilesCall, raw_Aria2GetFilesResult as Aria2GetFilesResult, raw_Aria2GetGlobalOptionCall as Aria2GetGlobalOptionCall, raw_Aria2GetGlobalOptionResult as Aria2GetGlobalOptionResult, raw_Aria2GetGlobalStatCall as Aria2GetGlobalStatCall, raw_Aria2GetGlobalStatResult as Aria2GetGlobalStatResult, raw_Aria2GetOptionCall as Aria2GetOptionCall, raw_Aria2GetOptionResult as Aria2GetOptionResult, raw_Aria2GetPeersCall as Aria2GetPeersCall, raw_Aria2GetPeersResult as Aria2GetPeersResult, raw_Aria2GetServersCall as Aria2GetServersCall, raw_Aria2GetServersResult as Aria2GetServersResult, raw_Aria2GetSessionInfoCall as Aria2GetSessionInfoCall, raw_Aria2GetSessionInfoResult as Aria2GetSessionInfoResult, raw_Aria2GetUrisCall as Aria2GetUrisCall, raw_Aria2GetUrisResult as Aria2GetUrisResult, raw_Aria2GetVersionCall as Aria2GetVersionCall, raw_Aria2GetVersionResult as Aria2GetVersionResult, raw_Aria2PauseAllCall as Aria2PauseAllCall, raw_Aria2PauseAllResult as Aria2PauseAllResult, raw_Aria2PauseCall as Aria2PauseCall, raw_Aria2PauseResult as Aria2PauseResult, raw_Aria2PeerInfo as Aria2PeerInfo, raw_Aria2PeersInfo as Aria2PeersInfo, raw_Aria2PositionHow as Aria2PositionHow, raw_Aria2PurgeDownloadResultCall as Aria2PurgeDownloadResultCall, raw_Aria2PurgeDownloadResultResult as Aria2PurgeDownloadResultResult, raw_Aria2RemoveCall as Aria2RemoveCall, raw_Aria2RemoveDownloadResultCall as Aria2RemoveDownloadResultCall, raw_Aria2RemoveDownloadResultResult as Aria2RemoveDownloadResultResult, raw_Aria2RemoveResult as Aria2RemoveResult, raw_Aria2RpcMethod as Aria2RpcMethod, raw_Aria2RpcMethodCallMap as Aria2RpcMethodCallMap, raw_Aria2RpcMethodResultMap as Aria2RpcMethodResultMap, raw_Aria2SaveSessionCall as Aria2SaveSessionCall, raw_Aria2SaveSessionResult as Aria2SaveSessionResult, raw_Aria2ServerGlobalStat as Aria2ServerGlobalStat, raw_Aria2ServerInfo as Aria2ServerInfo, raw_Aria2ServerOpResult as Aria2ServerOpResult, raw_Aria2ServerOpResultOk as Aria2ServerOpResultOk, raw_Aria2ServerSessionInfo as Aria2ServerSessionInfo, raw_Aria2ServerVersion as Aria2ServerVersion, raw_Aria2ServerVoidCall as Aria2ServerVoidCall, raw_Aria2ServersInfo as Aria2ServersInfo, raw_Aria2ServersInfoItem as Aria2ServersInfoItem, raw_Aria2ShutdownCall as Aria2ShutdownCall, raw_Aria2ShutdownResult as Aria2ShutdownResult, raw_Aria2StringUtf8 as Aria2StringUtf8, raw_Aria2SystemListMethodsCall as Aria2SystemListMethodsCall, raw_Aria2SystemListMethodsResult as Aria2SystemListMethodsResult, raw_Aria2SystemListNotificationsCall as Aria2SystemListNotificationsCall, raw_Aria2SystemListNotificationsResult as Aria2SystemListNotificationsResult, raw_Aria2SystemMethodCallMap as Aria2SystemMethodCallMap, raw_Aria2SystemMethodResultMap as Aria2SystemMethodResultMap, raw_Aria2SystemMulticallCall as Aria2SystemMulticallCall, raw_Aria2SystemMulticallItem as Aria2SystemMulticallItem, raw_Aria2SystemMulticallParamItem as Aria2SystemMulticallParamItem, raw_Aria2SystemMulticallParams as Aria2SystemMulticallParams, raw_Aria2SystemMulticallParamsToResult as Aria2SystemMulticallParamsToResult, raw_Aria2SystemMulticallResult as Aria2SystemMulticallResult, raw_Aria2TellActiveCall as Aria2TellActiveCall, raw_Aria2TellActiveParams as Aria2TellActiveParams, raw_Aria2TellActiveResult as Aria2TellActiveResult, raw_Aria2TellStatusCall as Aria2TellStatusCall, raw_Aria2TellStatusListParams as Aria2TellStatusListParams, raw_Aria2TellStatusListParamsToResult as Aria2TellStatusListParamsToResult, raw_Aria2TellStatusParams as Aria2TellStatusParams, raw_Aria2TellStatusParamsToResult as Aria2TellStatusParamsToResult, raw_Aria2TellStatusResult as Aria2TellStatusResult, raw_Aria2TellStoppedCall as Aria2TellStoppedCall, raw_Aria2TellStoppedResult as Aria2TellStoppedResult, raw_Aria2TellWaitingCall as Aria2TellWaitingCall, raw_Aria2TellWaitingResult as Aria2TellWaitingResult, raw_Aria2UnpauseAllCall as Aria2UnpauseAllCall, raw_Aria2UnpauseAllResult as Aria2UnpauseAllResult, raw_Aria2UnpauseCall as Aria2UnpauseCall, raw_Aria2UnpauseResult as Aria2UnpauseResult, raw_Aria2UriStatus as Aria2UriStatus, raw_Aria2UriStatusString as Aria2UriStatusString, raw_Disposable as Disposable, raw_RpcCall as RpcCall, raw_RpcMessage as RpcMessage, raw_RpcMessageId as RpcMessageId, raw_RpcMethod as RpcMethod, raw_RpcResult as RpcResult, raw_RpcVersion as RpcVersion };
}
export { type Aria2ChangePositionResultOk, type Aria2ChangeUriResultOk, type Aria2ClientGlobalOptionKey, type Aria2ClientGlobalOptions, type Aria2ClientInputOptionKey, type Aria2ClientInputOptions, type Aria2ClientNotification, type Aria2ClientNotificationMethod, type Aria2ClientNotificationParams, type Aria2DownloadBitTorrentInfo, type Aria2DownloadBitTorrentMode, type Aria2DownloadBitTorrentStatus, type Aria2DownloadGid, type Aria2DownloadState, type Aria2DownloadStatus, type Aria2FileStatus, type Aria2PeerInfo, type Aria2PeersInfo, type Aria2PositionHow, type Aria2RpcHTTPUrl, type Aria2RpcMethod, type Aria2RpcWebSocketUrl, type Aria2ServerGlobalStat, type Aria2ServerInfo, type Aria2ServerSessionInfo, type Aria2ServerVersion, type Aria2ServersInfo, type Aria2ServersInfoItem, type Aria2StringUtf8, type Aria2SystemMulticallParams, type Aria2UriStatus, type Aria2UriStatusString, type ClientAria2, type ClientSystem, type Conn, type Disposable, type Open, type OpenOptions, type PreconfiguredSocket, ReadyState, type RpcCall, type RpcResult, type SendRequestOptions, type Socket, aria2, close, createHTTP, createWebSocket, open, raw, system };