1 // Don't use webtorrent typings for now
2 // It misses some little things I'll fix later
3 // <reference path="../../../../typings/globals/webtorrent/index.d.ts" />
5 import { Injectable } from '@angular/core';
7 // import WebTorrent = require('webtorrent');
8 declare var WebTorrent: any;
11 export class WebTorrentService {
12 // private client: WebTorrent.Client;
16 this.client = new WebTorrent({ dht: false });
19 add(magnetUri: string, callback: Function) {
20 return this.client.add(magnetUri, callback);
23 remove(magnetUri: string) {
24 return this.client.remove(magnetUri);