npm.io
5.8.8 • Published 9 months ago

@types/parse-torrent

Licence
MIT
Version
5.8.8
Deps
3
Size
5 kB
Vulns
0
Weekly
0
Stars
51.4K

Installation

npm install --save @types/parse-torrent

Summary

This package contains type definitions for parse-torrent (https://github.com/webtorrent/parse-torrent).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/parse-torrent.

index.d.ts

/// <reference types="node" />

import MagnetUri = require("magnet-uri");
import ParseTorrentFile = require("parse-torrent-file");

declare const ParseTorrent: ParseTorrent.ParseTorrent;

declare namespace ParseTorrent {
    interface ParseTorrent {
        (torrent: string): MagnetUri.Instance;
        (torrent: Buffer): MagnetUri.Instance | ParseTorrentFile.Instance;
        (torrent: Instance | MagnetUri.Instance | ParseTorrentFile.Instance): Instance;

        toMagnetURI: typeof MagnetUri.encode;
        toTorrentFile: typeof ParseTorrentFile.encode;

        remote(
            torrent: string | Buffer | Instance | MagnetUri.Instance | ParseTorrentFile.Instance | Blob,
            cb?: (err: Error, torrent?: Instance) => void,
        ): void;
    }

    interface Instance extends MagnetUri.Instance, ParseTorrentFile.Instance {
        infoHash: string;
        name?: string | undefined;
        announce?: string[] | undefined;
        urlList?: string[] | undefined;
    }
}

export = ParseTorrent;

Additional Details

Credits

These definitions were written by Bazyli Brzóska, and Tomasz Łaziuk.