kernl API
    Preparing search index...

    Interface WebTorrentBackend

    A torrent backend that downloads inside the page and reports its jobs.

    interface WebTorrentBackend {
        handoff?: true;
        add(
            infoHash: string,
            trackers: readonly string[],
            context: BridgeContext,
            name?: string,
        ): Promise<{ id: string; name: string }>;
        files(id: string): Promise<readonly DownloadedFile[]>;
        jobs(): readonly DownloadJob[];
        pause(id: string): void;
        remove(id: string): void;
        resume(id: string): void;
        subscribe(listener: DownloadListener): () => void;
    }

    Hierarchy (View Summary)

    Index
    handoff?: true

    True when the backend hands the locator to an app on the user's device rather than moving data itself. kernl then makes no connection for the resolution. Read on every availability check, so a backend that lets the user choose may switch it.

    • Parameters

      • infoHash: string
      • trackers: readonly string[]
      • context: BridgeContext
      • Optionalname: string

      Returns Promise<{ id: string; name: string }>

    • Parameters

      • id: string

      Returns Promise<readonly DownloadedFile[]>

      denied:unknown-download, unavailable:not-finished

    • Parameters

      • id: string

      Returns void

      denied:unknown-download

    • Stops the download and drops what it stored.

      Parameters

      • id: string

      Returns void

      denied:unknown-download

    • Parameters

      • id: string

      Returns void

      denied:unknown-download

    • Calls listener now and on every change; the returned function stops it.

      Parameters

      Returns () => void