@types/parse-torrent
TypeScript icon, indicating that this package has built-in type declarations

5.8.7 • Public • Published

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 * as ParseTorrentFile from "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.

Readme

Keywords

none

Package Sidebar

Install

npm i @types/parse-torrent

Weekly Downloads

2,415

Version

5.8.7

License

MIT

Unpacked Size

5.11 kB

Total Files

5

Last publish

Collaborators

  • types