4.0.6 • Published 6 months ago

@types/parse-torrent-file v4.0.6

Weekly downloads
2,713
License
MIT
Repository
github
Last release
6 months ago

Installation

npm install --save @types/parse-torrent-file

Summary

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

Details

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

index.d.ts

// Type definitions for parse-torrent-file 4.0
// Project: https://github.com/webtorrent/parse-torrent-file
// Definitions by: Tomasz Łaziuk <https://github.com/tlaziuk>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped

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

declare function ParseTorrentFile(torrent: Buffer | ParseTorrentFile.Torrent): ParseTorrentFile.Instance;

declare namespace ParseTorrentFile {
    function decode(torrent: Buffer | Torrent): Instance;
    function encode(parsed: Instance): Buffer;

    interface TorrentInfo {
        'name.utf-8'?: string | undefined;
        name?: string | undefined;
        files?: File[] | undefined;
        'piece length'?: number | undefined;
        pieces?: number | undefined;
        private?: boolean | undefined;
    }

    interface Torrent {
        info?: TorrentInfo | undefined;
        'creation date'?: number | undefined;
        'created by'?: string | undefined;
        comment?: Buffer | undefined;
        'announce-list'?: string[][] | undefined;
        announce?: string | undefined;
        'url-list'?: Buffer | undefined;
    }

    interface ParsedFile {
        path: string;
        name: string;
        length: number;
        offset: number;
    }

    interface Instance extends Object {
        info?: TorrentInfo | undefined;
        infoBuffer?: Buffer | undefined;
        infoHash?: string | undefined;
        infoHashBuffer?: Buffer | undefined;
        name?: string | undefined;
        private?: boolean | undefined;
        created?: Date | undefined;
        createdBy?: string | undefined;
        announce?: string[] | undefined;
        urlList?: string[] | undefined;
        pieceLength?: number | undefined;
        lastPieceLength?: number | undefined;
        pieces?: string[] | undefined;
        length?: number | undefined;
        files?: ParsedFile[] | undefined;
    }
}

export = ParseTorrentFile;

Additional Details

  • Last updated: Thu, 08 Jul 2021 20:19:20 GMT
  • Dependencies: @types/node
  • Global values: none

Credits

These definitions were written by Tomasz Łaziuk.

4.0.5

7 months ago

4.0.4

8 months ago

4.0.6

6 months ago

4.0.3

3 years ago

4.0.2

5 years ago

4.0.1

7 years ago

4.0.0

7 years ago