types(showdown): add missing showdown types for v1.9.0

This commit is contained in:
Hamed Baatour
2019-01-01 15:41:27 +03:00
parent 0d851ec699
commit a051a8341d
+62 -8
View File
@@ -1,6 +1,6 @@
// Type definitions for Showdown 1.9.0
// Project: https://github.com/coreyti/showdown
// Definitions by: cbowdon <https://github.com/cbowdon>, Pei-Tang Huang <https://github.com/tan9>, Ariel-Saldana <https://github.com/arielsaldana>
// Project: https://github.com/showdownjs/showdown
// Definitions by: Hamed Baatour<https://github.com/hamedbaatour>, cbowdon <https://github.com/cbowdon>, Pei-Tang Huang <https://github.com/tan9>, Ariel-Saldana <https://github.com/arielsaldana>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
export = Showdown;
@@ -64,6 +64,10 @@ declare namespace Showdown {
output: ShowdownExtension[];
}
interface Metadata {
[meta: string]: string;
}
interface ShowdownOptions {
/**
* Omit the trailing newline in a code block. Ex:
@@ -279,6 +283,43 @@ declare namespace Showdown {
* @default false
*/
backslashEscapesHTMLTags?: boolean;
/**
* Enable emoji support. Ex: `this is a :smile: emoji.
*
* @default false
*/
emoji?: boolean;
/**
* Enable support for underline. Syntax is double or triple underscores: `__underline word__`. With this option enabled,
* underscores no longer parses into `<em>` and `<strong>`
*
* @default false
*/
underline?: boolean;
/**
* Outputs a complete html document, including `<html>`, `<head>` and `<body>` tags
*
* @default false
*/
completeHTMLDocument?: boolean;
/**
* Outputs a complete html document, including `<html>`, `<head>` and `<body>` tags
*
* @default false
*/
metadata?: boolean;
/**
* Split adjacent blockquote blocks
*
* @default false
*/
splitAdjacentBlockquotes?: boolean;
}
@@ -296,11 +337,11 @@ declare namespace Showdown {
/**
* Converts an HTML string into a markdown string
*
* @param src The input text (HTML)
* @returns The output markdown
* @param src
* @param [HTMLParser] A WHATWG DOM and HTML parser, such as JSDOM. If none is supplied, window.document will be used.
* @returns {string}
*/
makeMarkdown(src: string): string;
makeMarkdown(src: string, HTMLParser?: any): string;
/**
* Setting a "local" option only affects the specified Converter object.
@@ -360,7 +401,20 @@ declare namespace Showdown {
*
* @param flavor name
*/
setFlavor(name: string): void;
setFlavor(name: 'github' | 'original' | 'ghost' | 'vanilla' | 'allOn'): void;
/**
* Get the metadata of the previously parsed document
* @param raw
* @returns {string|{}}
*/
getMetadata(raw?: boolean): string | Metadata
/**
* Get the metadata format of the previously parsed document
* @returns {string}
*/
getMetadataFormat(): string;
}
@@ -477,5 +531,5 @@ declare namespace Showdown {
*
* @param name
*/
function setFlavor(name: string): void;
function setFlavor(name: 'github' | 'original' | 'ghost' | 'vanilla' | 'allOn'): void;
}