-
-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #33 from remarkablemark/chore/types
chore: update JSDoc and type declaration files
- Loading branch information
Showing
12 changed files
with
68 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
// TypeScript Version: 3.3 | ||
// TypeScript Version: 4.1 | ||
|
||
import htmlToDomServer from './lib/html-to-dom-server'; | ||
export default htmlToDomServer; | ||
export { default } from './lib/html-to-dom-server'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
// TypeScript Version: 3.3 | ||
// TypeScript Version: 4.1 | ||
|
||
/** | ||
* Parses HTML string to DOM nodes. | ||
* | ||
* @param - Raw string of HTML to parse. | ||
* @returns NodeList or empty array. | ||
* @param - HTML markup. | ||
* @return - NodeList. | ||
*/ | ||
export default function parseDOM(html: string): NodeList | []; | ||
export default function domparser(html: string): NodeList; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
// TypeScript Version: 3.3 | ||
// TypeScript Version: 4.1 | ||
|
||
import { DomElement } from 'domhandler'; | ||
|
||
/** | ||
* Parses HTML and reformats DOM nodes output. | ||
* Parses HTML string to DOM nodes in browser. | ||
* | ||
* @param - Raw string of HTML to parse. | ||
* @returns Parsed DomElements. | ||
* @param - HTML markup. | ||
* @return - DOM elements. | ||
*/ | ||
export default function parseDOM(html: string): DomElement[]; | ||
export default function HTMLDOMParser(html: string): DomElement[]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,18 @@ | ||
// TypeScript Version: 3.3 | ||
|
||
import { DomHandlerOptions, DomElement } from 'domhandler'; | ||
|
||
/** | ||
* Parses HTML string to DOM nodes (server). | ||
* | ||
* @remarks | ||
* This is the same method as `require('htmlparser2').parseDOM` | ||
* https://github.com/fb55/htmlparser2/blob/v3.9.1/lib/index.js#L39-L43 | ||
* | ||
* @param - Raw string of HTML to parse. | ||
* @param - Options to pass to domhandler (See https://github.com/fb55/DomHandler#readme). | ||
* @returns Parsed DomElements. | ||
*/ | ||
export default function parseDOM(html: string, options?: DomHandlerOptions): DomElement[]; | ||
// TypeScript Version: 4.1 | ||
|
||
import { DomHandlerOptions, DomElement } from 'domhandler'; | ||
|
||
/** | ||
* Parses HTML string to DOM nodes in Node.js. | ||
* | ||
* This is the same method as `require('htmlparser2').parseDOM` | ||
* https://github.com/fb55/htmlparser2/blob/v3.9.1/lib/index.js#L39-L43 | ||
* | ||
* @param - HTML markup. | ||
* @param - Parser options (https://github.com/fb55/domhandler/tree/v2.4.2#readme). | ||
* @return - DOM elements. | ||
*/ | ||
export default function HTMLDOMParser( | ||
html: string, | ||
options?: DomHandlerOptions | ||
): DomElement[]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,35 @@ | ||
// TypeScript Version: 3.3 | ||
// TypeScript Version: 4.1 | ||
|
||
import { DomElement } from 'domhandler'; | ||
|
||
/** | ||
* Formats DOM attributes to a hash map. | ||
* | ||
* @param attributes - The list of attributes to format. | ||
* @returns - A map of attribute name to value. | ||
* @param attributes - List of attributes. | ||
* @return - Map of attribute name to value. | ||
*/ | ||
export function formatAttributes(attributes: NamedNodeMap): {[name: string]: string}; | ||
export function formatAttributes( | ||
attributes: NamedNodeMap | ||
): { [name: string]: string }; | ||
|
||
/** | ||
* Formats the browser DOM nodes to mimic the output of `htmlparser2.parseDOM()`. | ||
* | ||
* @param nodes - The DOM nodes to format. | ||
* @param parentObj - The formatted parent node of the given DOM nodes. | ||
* @param directive - The directive. | ||
* @param nodes - DOM nodes. | ||
* @param parentNode - Formatted parent node. | ||
* @param directive - Directive. | ||
* @return - DOM elements. | ||
*/ | ||
export function formatDOM(nodes: NodeList, parentObj?: DomElement, directive?: string): DomElement[]; | ||
export function formatDOM( | ||
nodes: NodeList, | ||
parentNode?: DomElement, | ||
directive?: string | ||
): DomElement[]; | ||
|
||
/** | ||
* Detects IE with or without version. | ||
* Detects if browser is Internet Explorer. | ||
* | ||
* @param version - The IE version to detect. | ||
* @returns - Whether IE or the version has been detected. | ||
* @param version - IE version to detect. | ||
* @return - Whether IE or the version is detected. | ||
*/ | ||
export function isIE(version?: number): boolean; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.