diff --git a/notNeededPackages.json b/notNeededPackages.json index ed1e186bf0..1e4234e725 100644 --- a/notNeededPackages.json +++ b/notNeededPackages.json @@ -270,6 +270,12 @@ "sourceRepoURL": "https://github.com/blakeembrey/param-case", "asOfVersion": "1.1.2" }, + { + "libraryName": "parse5", + "typingsPackageName": "parse5", + "sourceRepoURL": "https://github.com/inikulin/parse5", + "asOfVersion": "3.0.0" + }, { "libraryName": "pascal-case", "typingsPackageName": "pascal-case", diff --git a/types/parse5/index.d.ts b/types/parse5/index.d.ts deleted file mode 100644 index 34d8d80946..0000000000 --- a/types/parse5/index.d.ts +++ /dev/null @@ -1,263 +0,0 @@ -// Type definitions for parse5 2.2.0 -// Project: https://github.com/inikulin/parse5 -// Definitions by: Nico Jansen , Meirion Hughes -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -/// - -import * as stream from "stream"; -import * as events from "events"; - -/** - * Parses an HTML string. - * @function - * @param {string} html - Input HTML string. - * @param {ParserOptions} html - Parsing options. - * - * @example - * var parse5 = require('parse5'); - * var document = parse5.parse('Hi there!'); - */ -export declare function parse(html: string, options?: ParserOptions): ASTNode; - -/** - * Parses an HTML fragment. - * - * @param {string} html - Input html fragment - * @param {ParserOptions} - Parsign options - * @example - * var parse5 = require('parse5'); - * var documentFragment = parse5.parseFragment('
'); - * // Parses the html fragment in the context of the parsed element. - * var trFragment = parser.parseFragment(documentFragment.childNodes[0], ''); - */ -export declare function parseFragment(html: string, options?: ParserOptions): ASTNode; -export declare function parseFragment(fragmentContext: any, html: string, options?: ParserOptions): ASTNode; - -/** - * Serializes an AST node to an HTML string. - * @param node Node to serialize. - * @param options Serialization options - */ -export declare function serialize(node: ASTNode, options?: SerializerOptions): string; - -export interface ASTAttribute { - name: string; - value: string; - prefix?: string; -} - -export interface Attribute { - key: string; - value: string; -} - -export interface ASTNode { - attrs: ASTAttribute[]; - childNodes?: ASTNode[]; - data?: string; - namespaceURI?: string; - parentNode?: ASTNode; - nodeName: string; - tagName?: string; - quirksMode?: boolean; - value?: string; - __location: LocationInfo | ElementLocationInfo; -} - -export interface LocationInfo { - /** - * One-based line index - */ - line: number; - /** - * Zero-based first character index - */ - col: number; - /** - * Zero-based first character index - */ - startOffset: number; - /** - * Zero-based last character index - */ - endOffset: number; -} - - -/** - * Streaming AST node to an HTML serializer. A readable stream. - */ -export declare class SerializerStream extends stream.Readable { - /** - * Streaming AST node to an HTML serializer. A readable stream. - * - * @param Node to serialize. - * @param options Serialization options. - */ - constructor(node: ASTNode, options: SerializerOptions); -} - -/** - * Streaming HTML parser with scripting support. A writable stream. - */ -export declare class ParserStream extends stream.Writable { - /** - * @param options Parsing options. - */ - constructor(options?: ParserOptions); - /** - * The resulting document node. - */ - document: ASTNode; - on(event: string, listener: Function): this; - /** - * Raised then parser encounters a
Shake it, baby