diff --git a/types/mozilla-readability/index.d.ts b/types/mozilla-readability/index.d.ts index a30925fb0b..7a7c26fdb8 100644 --- a/types/mozilla-readability/index.d.ts +++ b/types/mozilla-readability/index.d.ts @@ -7,21 +7,13 @@ export = Readability; declare class Readability { - constructor(uri: Readability.Uri, doc: Document, options?: Readability.Options); + constructor(doc: Document, options?: Readability.Options); parse(): Readability.ParseResult; isProbablyReaderable(helperIsVisible?: (node: any) => boolean): boolean; } declare namespace Readability { - interface Uri { - spec: string; - host: string; - prePath: string; - scheme: string; - pathBase: string; - } - interface Options { debug?: boolean; maxElemsToParse?: number; @@ -31,7 +23,6 @@ declare namespace Readability { } interface ParseResult { - uri: Uri; title: string; byline: string; dir: string; diff --git a/types/mozilla-readability/mozilla-readability-tests.ts b/types/mozilla-readability/mozilla-readability-tests.ts index e5431dd14e..0dec719559 100644 --- a/types/mozilla-readability/mozilla-readability-tests.ts +++ b/types/mozilla-readability/mozilla-readability-tests.ts @@ -5,42 +5,25 @@ import { JSDOM } from 'jsdom'; // because issue https://github.com/mozilla/readability/issues/346 // requires global variable `Node` when using nodejs. -const fakeUri: Readability.Uri = { - spec: "http://fakehost/test/page.html", - host: "fakehost", - prePath: "http://fakehost", - scheme: "http", - pathBase: "http://fakehost/test/" -}; - function test_basic_usage() { const dom = new JSDOM(`
Hello
Hi!`); - // Required until https://github.com/mozilla/readability/issues/346 - // is fixed. - Node = dom.window.Node; - const reader = new Readability(fakeUri, dom.window.document); + const reader = new Readability(dom.window.document); const article = reader.parse(); } function test_readability_with_options() { const dom = new JSDOM(`
Hello
Hi!`); - // Required until https://github.com/mozilla/readability/issues/346 - // is fixed. - Node = dom.window.Node; const options: Readability.Options = { debug: true, maxElemsToParse: 100, }; - const article = new Readability(fakeUri, dom.window.document, options).parse(); + const article = new Readability(dom.window.document, options).parse(); } function test_is_probably_readerable() { const dom = new JSDOM(`
Hello
Hi!`); - // Required until https://github.com/mozilla/readability/issues/346 - // is fixed. - Node = dom.window.Node; - const isReadable = new Readability(fakeUri, dom.window.document).isProbablyReaderable(); + const isReadable = new Readability(dom.window.document).isProbablyReaderable(); }