mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-05-31 03:02:04 +08:00
Support for helper functions
This commit is contained in:
2
.github/CODEOWNERS
vendored
2
.github/CODEOWNERS
vendored
@@ -3379,7 +3379,7 @@
|
||||
/types/shopify-buy/ @openminder
|
||||
/types/shortid/ @stpettersens @despairblue
|
||||
/types/shot/ @AJamesPhillips
|
||||
/types/showdown/ @cbowdon @tan9
|
||||
/types/showdown/ @cbowdon @tan9 @arielsaldana
|
||||
/types/shrink-ray/ @forabi
|
||||
/types/siema/ @Irmiz @0x6368656174 @samnau
|
||||
/types/siesta/ @bquarmby
|
||||
|
||||
15
types/showdown/index.d.ts
vendored
15
types/showdown/index.d.ts
vendored
@@ -1,6 +1,6 @@
|
||||
// Type definitions for Showdown 1.7.2
|
||||
// Type definitions for Showdown 1.7.3
|
||||
// Project: https://github.com/coreyti/showdown
|
||||
// Definitions by: cbowdon <https://github.com/cbowdon>, Pei-Tang Huang <https://github.com/tan9>
|
||||
// Definitions by: 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;
|
||||
@@ -362,10 +362,21 @@ declare namespace Showdown {
|
||||
*/
|
||||
new (converterOptions?: ConverterOptions): Converter;
|
||||
}
|
||||
/**
|
||||
* Helper Interface
|
||||
*/
|
||||
interface Helper {
|
||||
replaceRecursiveRegExp(...args: any[]): string;
|
||||
}
|
||||
|
||||
/** Constructor function for a Converter */
|
||||
var Converter: ConverterStatic;
|
||||
|
||||
/**
|
||||
* Showdown helper
|
||||
*/
|
||||
var helper: Helper;
|
||||
|
||||
/**
|
||||
* Setting a "global" option affects all instances of showdown
|
||||
*/
|
||||
|
||||
@@ -17,6 +17,8 @@ var preloadedExtensions = [ 'my-ext' ],
|
||||
var configuredConverter = new showdown.Converter();
|
||||
configuredConverter.addExtension({type: 'output', filter: (text, converter)=>{return text.replace('#', '*')}}, 'myext');
|
||||
|
||||
console.log(showdown.helper);
|
||||
|
||||
console.log(converter.makeHtml(exampleMarkdown));
|
||||
// should log '<h1 id="hellomarkdown">hello, markdown</h1>'
|
||||
|
||||
|
||||
Reference in New Issue
Block a user