@types/marked
Advanced tools
Comparing version 5.0.0 to 5.0.1
@@ -24,3 +24,3 @@ // Type definitions for Marked 5.0 | ||
*/ | ||
export function marked(src: string, options: marked.MarkedOptions & {async: true}): Promise<string>; | ||
export function marked(src: string, options: marked.MarkedOptions & { async: true }): Promise<string>; | ||
@@ -64,2 +64,71 @@ /** | ||
export class Marked { | ||
constructor(...extensions: marked.MarkedExtension[]); | ||
/** | ||
* Compiles markdown to HTML. | ||
* | ||
* @param src String of markdown source to be compiled | ||
* @param callback Function called when the markdownString has been fully parsed when using async highlighting | ||
* @return String of compiled HTML | ||
*/ | ||
parse(src: string, callback: (error: any, parseResult: string) => void): void; | ||
/** | ||
* Compiles markdown to HTML asynchronously. | ||
* | ||
* @param src String of markdown source to be compiled | ||
* @param options Hash of options having async: true | ||
* @return Promise of string of compiled HTML | ||
*/ | ||
parse(src: string, options: marked.MarkedOptions & { async: true }): Promise<string>; | ||
/** | ||
* Compiles markdown to HTML synchronously. | ||
* | ||
* @param src String of markdown source to be compiled | ||
* @param options Optional hash of options | ||
* @return String of compiled HTML | ||
*/ | ||
parse(src: string, options?: marked.MarkedOptions): string; | ||
/** | ||
* Compiles markdown to HTML synchronously. | ||
* | ||
* @param src String of markdown source to be compiled | ||
* @param options Optional hash of options | ||
* @param callback Function called when the markdownString has been fully parsed when using async highlighting | ||
* @return String of compiled HTML | ||
*/ | ||
parse(src: string, options: marked.MarkedOptions, callback: (error: any, parseResult: string) => void): void; | ||
/** | ||
* Compiles markdown to HTML without enclosing `p` tag. | ||
* | ||
* @param src String of markdown source to be compiled | ||
* @param options Hash of options | ||
* @return String of compiled HTML | ||
*/ | ||
parseInline(src: string, options?: marked.MarkedOptions): string; | ||
/** | ||
* Gets the original marked default options. | ||
*/ | ||
getDefaults(): marked.MarkedOptions; | ||
/** | ||
* Sets the default options. | ||
* | ||
* @param options Hash of options | ||
*/ | ||
setOptions(options: marked.MarkedOptions): Marked; | ||
/** | ||
* Use Extension | ||
* @param MarkedExtension | ||
*/ | ||
use(...extensions: marked.MarkedExtension[]): void; | ||
walkTokens(tokens: marked.Token[] | marked.TokensList, callback: (token: marked.Token) => void): Marked; | ||
} | ||
export namespace marked { | ||
@@ -90,3 +159,3 @@ const defaults: MarkedOptions; | ||
*/ | ||
function parse(src: string, options: MarkedOptions & {async: true}): Promise<string>; | ||
function parse(src: string, options: MarkedOptions & { async: true }): Promise<string>; | ||
@@ -513,3 +582,6 @@ /** | ||
type TokenizerAndRendererExtension = TokenizerExtension | RendererExtension | (TokenizerExtension & RendererExtension); | ||
type TokenizerAndRendererExtension = | ||
| TokenizerExtension | ||
| RendererExtension | ||
| (TokenizerExtension & RendererExtension); | ||
@@ -537,5 +609,3 @@ interface MarkedExtension { | ||
*/ | ||
extensions?: | ||
| TokenizerAndRendererExtension[] | ||
| undefined; | ||
extensions?: TokenizerAndRendererExtension[] | undefined; | ||
@@ -577,4 +647,4 @@ /** | ||
hooks?: { | ||
preprocess?: (markdown: string) => string, | ||
postprocess?: (html: string) => string, | ||
preprocess?: (markdown: string) => string; | ||
postprocess?: (html: string) => string; | ||
}; | ||
@@ -581,0 +651,0 @@ |
{ | ||
"name": "@types/marked", | ||
"version": "5.0.0", | ||
"version": "5.0.1", | ||
"description": "TypeScript definitions for Marked", | ||
@@ -78,3 +78,3 @@ "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/marked", | ||
"dependencies": {}, | ||
"typesPublisherContentHash": "fb1cff94d069290483245990c613f5815fe7d72ae8ef2981447e4c11644a7e66", | ||
"typesPublisherContentHash": "4f58854d58c53e9f2d76cd69695c4e1ff087392e624e53f520b8d7e6e9cdfcb8", | ||
"typeScriptVersion": "4.3", | ||
@@ -81,0 +81,0 @@ "exports": { |
@@ -11,3 +11,3 @@ # Installation | ||
### Additional Details | ||
* Last updated: Thu, 18 May 2023 22:02:51 GMT | ||
* Last updated: Fri, 14 Jul 2023 15:32:57 GMT | ||
* Dependencies: none | ||
@@ -14,0 +14,0 @@ * Global values: none |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
29111
643