mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-11 20:40:20 +00:00
Added a MarkedRenderer definition
This commit is contained in:
@@ -14,7 +14,8 @@ var options: MarkedOptions = {
|
||||
return '';
|
||||
},
|
||||
langPrefix: 'lang-',
|
||||
smartypants: false
|
||||
smartypants: false,
|
||||
renderer: new marked.Renderer()
|
||||
};
|
||||
|
||||
function callback() {
|
||||
|
||||
Vendored
+29
-2
@@ -3,7 +3,6 @@
|
||||
// Definitions by: William Orr <https://github.com/worr>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
|
||||
interface MarkedStatic {
|
||||
/**
|
||||
* Compiles markdown to HTML.
|
||||
@@ -60,6 +59,34 @@ interface MarkedStatic {
|
||||
* @param options Hash of options
|
||||
*/
|
||||
setOptions(options: MarkedOptions): MarkedStatic;
|
||||
|
||||
Renderer: {
|
||||
new(): MarkedRenderer
|
||||
}
|
||||
}
|
||||
|
||||
interface MarkedRenderer {
|
||||
code(code: string, language: string): any;
|
||||
blockquote(quote: string): any;
|
||||
html(html: string): any;
|
||||
heading(text: string, level: number): any;
|
||||
hr(): any;
|
||||
list(body: string, ordered: boolean): any;
|
||||
listitem(text: string): any;
|
||||
paragraph(text: string): any;
|
||||
table(header: string, body: string): any;
|
||||
tablerow(content: string): any;
|
||||
tablecell(content: string, flags: {
|
||||
header: boolean,
|
||||
align: string
|
||||
}): any;
|
||||
strong(text: string): any;
|
||||
em(text: string): any;
|
||||
codespan(code: string): any;
|
||||
br(): any;
|
||||
del(text: string): any;
|
||||
link(href: string, title: string, text: string): any;
|
||||
image(href: string, title: string, text: string): any;
|
||||
}
|
||||
|
||||
interface MarkedOptions {
|
||||
@@ -68,7 +95,7 @@ interface MarkedOptions {
|
||||
*
|
||||
* An object containing functions to render tokens to HTML.
|
||||
*/
|
||||
renderer?: Object;
|
||||
renderer?: MarkedRenderer;
|
||||
|
||||
/**
|
||||
* Enable GitHub flavored markdown.
|
||||
|
||||
Reference in New Issue
Block a user