mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-02-04 07:52:51 +00:00
Merge pull request #34314 from htkzhtm/add-marked-type
[marked] Add InlineLexer Type
This commit is contained in:
commit
effa252dd9
11
types/marked/index.d.ts
vendored
11
types/marked/index.d.ts
vendored
@ -77,6 +77,17 @@ declare namespace marked {
|
||||
*/
|
||||
function setOptions(options: MarkedOptions): typeof marked;
|
||||
|
||||
class InlineLexer {
|
||||
constructor(links: string[], options?: MarkedOptions);
|
||||
static rules: Rules;
|
||||
static output(src: string, links: string[], options?: MarkedOptions): string;
|
||||
output(src: string): string;
|
||||
static escapes(text: string): string;
|
||||
outputLink(cap: string[], link: string): string;
|
||||
smartypants(text: string): string;
|
||||
mangle(text: string): string;
|
||||
}
|
||||
|
||||
class Renderer {
|
||||
constructor(options?: MarkedOptions);
|
||||
code(code: string, language: string, isEscaped: boolean): string;
|
||||
|
||||
@ -56,3 +56,9 @@ const parseTestText = "- list1\n - list1.1\n\n listend";
|
||||
const parseTestTokens: marked.TokensList = marked.lexer(parseTestText, options);
|
||||
const parser = new marked.Parser();
|
||||
console.log(parser.parse(parseTestTokens));
|
||||
|
||||
const links = ['http', 'image'];
|
||||
const inlineLexer = new marked.InlineLexer(links);
|
||||
console.log(inlineLexer.output("http://"));
|
||||
console.log(marked.InlineLexer.output("http://", links));
|
||||
console.log(marked.InlineLexer.rules);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user