Installation
npm install --save @types/to-markdown
Summary
This package contains type definitions for to-markdown (https://github.com/domchristie/to-markdown).
Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/to-markdown.
index.d.ts
export = toMarkdown;
/**
* Converts HTML to markdown.
*/
declare function toMarkdown(input: string, options?: toMarkdown.Options): string;
declare namespace toMarkdown {
type Filter = string | string[] | ((node: HTMLElement) => boolean);
interface Options {
converters?: Converter[] | undefined;
gfm?: boolean | undefined;
}
interface Converter {
filter: Filter;
replacement(innerHTML: string, node: HTMLElement): string;
}
/**
* Returns true / false depending on whether the element is block level.
*/
function isBlock(node: HTMLElement): boolean;
/**
* Returns true / false depending on whether the element is void.
*/
function isVoid(node: HTMLElement): boolean;
/**
* Returns the HTML string of an element with its contents converted.
*/
function outer(node: HTMLElement, content: string): boolean;
}
Additional Details
- Last updated: Tue, 07 Nov 2023 15:11:36 GMT
- Dependencies: none
Credits
These definitions were written by SuperPaintman.