UNPKG

@naria2/node

Version:

Cross-platform wrapper of aria2

46 lines (41 loc) 1.45 kB
import * as child_process from 'child_process'; import * as execa from 'execa'; import { Options } from 'execa'; import { SpawnOptions } from 'node:child_process'; export { a as ChildProcessOpenOptions, C as ChildProcessOptions, b as ChildProcessSocket, R as ResolvedChildProcessOptions, c as createChildProcess } from './shared/node.b405a139.cjs'; import 'maria2'; import 'type-fest'; import 'maria2/transport'; import '@naria2/options'; interface ErrorDetail { /** * aria2 binary path */ binary?: string; /** * aria2 JSON RPC server url */ url?: string; /** * Raw error */ cause?: Error; } declare class Naria2NodeError extends Error { readonly binary: string | undefined; readonly url: string | undefined; constructor(message: string, detail?: ErrorDetail); } declare function getNaria2Binary(): string; declare function run(args: string[], options?: Options & { binary?: string; }): execa.ResultPromise<Options & { binary?: string; }>; declare function spawn(args: ReadonlyArray<string>, options?: SpawnOptions & { binary?: string; }): child_process.ChildProcess; declare function readTorrent(file: string): Promise<string>; declare function readTorrentSync(file: string): string; declare function fetchTorrent(...args: Parameters<typeof fetch>): Promise<string>; export { Naria2NodeError, fetchTorrent, getNaria2Binary, readTorrent, readTorrentSync, run, spawn };