@types/showdown
Advanced tools
Comparing version 2.0.1 to 2.0.2
@@ -19,3 +19,2 @@ // Type definitions for showdown 2.0 | ||
declare namespace Showdown { | ||
/** | ||
@@ -38,3 +37,9 @@ * Showdown event listener. | ||
*/ | ||
(evtName: string, text: string, converter: Converter, options: ShowdownOptions, globals: ConverterGlobals): void | string; | ||
( | ||
evtName: string, | ||
text: string, | ||
converter: Converter, | ||
options: ShowdownOptions, | ||
globals: ConverterGlobals, | ||
): void | string; | ||
} | ||
@@ -45,16 +50,16 @@ | ||
gDimensions?: { | ||
width?: number | undefined; | ||
width?: number | undefined; | ||
height?: number | undefined; | ||
} | undefined; | ||
gHtmlBlocks?: string[] | undefined; | ||
gHtmlBlocks?: string[] | undefined; | ||
gHtmlMdBlocks?: string[] | undefined; | ||
gHtmlSpans?: string[] | undefined; | ||
gListLevel?: number | undefined; | ||
gTitles?: {[key: string]: string} | undefined; | ||
gUrls?: {[key: string]: string} | undefined; | ||
ghCodeBlocks?: {codeblock?: string | undefined, text?: string | undefined}[] | undefined; | ||
hashLinkCounts?: {[key: string]: number} | undefined; | ||
gTitles?: { [key: string]: string } | undefined; | ||
gUrls?: { [key: string]: string } | undefined; | ||
ghCodeBlocks?: { codeblock?: string | undefined; text?: string | undefined }[] | undefined; | ||
hashLinkCounts?: { [key: string]: number } | undefined; | ||
langExtensions?: ShowdownExtension[] | undefined; | ||
metadata?: { | ||
parsed?: {[key: string]: string} | undefined; | ||
parsed?: { [key: string]: string } | undefined; | ||
raw?: string | undefined; | ||
@@ -79,3 +84,3 @@ format?: string | undefined; | ||
*/ | ||
listeners?: {[event: string]: EventListener} | undefined | ||
listeners?: { [event: string]: EventListener } | undefined; | ||
} | ||
@@ -86,3 +91,3 @@ | ||
* Two properties are given, `regex` and `replace`. | ||
* | ||
* | ||
* @example | ||
@@ -117,8 +122,8 @@ * ```ts | ||
* The filter property should be a function that acts as a callback. | ||
* | ||
* | ||
* @example | ||
* ```ts | ||
* let myExt: ShowdownExtension = { | ||
* let myExt: ShowdownExtension = { | ||
* type: 'lang', | ||
* filter: (text: string, converter: Converter) => text.replace('#', '*') | ||
* filter: (text: string, converter: Converter) => text.replace('#', '*') | ||
* }; | ||
@@ -138,5 +143,5 @@ * ``` | ||
* + Listener Extension -- Listener extensions for listen to conversion events. | ||
* | ||
* | ||
* Each extension can provide two combinations of interfaces for showdown. | ||
* | ||
* | ||
* @example | ||
@@ -155,3 +160,3 @@ * ```ts | ||
* }, | ||
* // ... | ||
* // ... | ||
* } | ||
@@ -168,3 +173,3 @@ * }; | ||
interface ShowdownExtensions { | ||
[name: string]: ShowdownExtension[] | ||
[name: string]: ShowdownExtension[]; | ||
} | ||
@@ -320,3 +325,3 @@ | ||
* Enable support for setting image dimensions from within markdown syntax. | ||
* | ||
* | ||
* @example | ||
@@ -335,3 +340,3 @@ * ```md | ||
* Set the header starting level. For instance, setting this to 3 means that | ||
* | ||
* | ||
* @example | ||
@@ -388,3 +393,3 @@ * **input**: | ||
* @deprecated https://github.com/showdownjs/showdown/commit/d3ebff7ef0cde5abfc3874463946d5297fc82e78 | ||
* | ||
* | ||
* This option excludes trailing punctuation from autolinking urls. | ||
@@ -519,3 +524,3 @@ * Punctuation excluded: . ! ? ( ). | ||
* Prevents weird effects in live previews due to incomplete input. | ||
* | ||
* | ||
* @example | ||
@@ -744,3 +749,3 @@ * ![awkward effect](http://i.imgur.com/YQ9iHTL.gif) | ||
* ``` | ||
* | ||
* | ||
* **openLinksInNewWindow** = true | ||
@@ -769,3 +774,3 @@ * ```html | ||
* ``` | ||
* | ||
* | ||
* **backslashEscapesHTMLTags** = true | ||
@@ -782,3 +787,3 @@ * ```html | ||
* Enable emoji support. | ||
* | ||
* | ||
* @example | ||
@@ -809,3 +814,3 @@ * ```md | ||
* ``` | ||
* | ||
* | ||
* **underline** = true | ||
@@ -840,3 +845,3 @@ * ```html | ||
* ``` | ||
* | ||
* | ||
* **completeHTMLDocument** = true | ||
@@ -862,3 +867,3 @@ * ```html | ||
* between `«««` and `»»»` or between `---` and `---`). | ||
* | ||
* | ||
* @example | ||
@@ -885,12 +890,12 @@ * ```js | ||
*/ | ||
[key:string]: any; | ||
[key: string]: any; | ||
} | ||
interface ConverterOptions extends ShowdownOptions { | ||
/** | ||
* Add extensions to the new converter can be showdown extensions or "global" extensions name. | ||
*/ | ||
extensions?: ((() => ShowdownExtension[] | ShowdownExtension) | ShowdownExtension[] | ShowdownExtension | string)[] | undefined; | ||
extensions?: | ||
| ((() => ShowdownExtension[] | ShowdownExtension) | ShowdownExtension[] | ShowdownExtension | string)[] | ||
| undefined; | ||
} | ||
@@ -901,7 +906,7 @@ | ||
*/ | ||
type Flavor = 'github' | 'original' | 'ghost' | 'vanilla' | 'allOn'; | ||
type Flavor = "github" | "original" | "ghost" | "vanilla" | "allOn"; | ||
/** | ||
* Showdown option description. | ||
*/ | ||
* Showdown option description. | ||
*/ | ||
interface ShowdownOptionDescription { | ||
@@ -919,8 +924,8 @@ /** | ||
*/ | ||
type?: 'boolean' | 'string' | 'integer' | undefined | ||
type?: "boolean" | "string" | "integer" | undefined; | ||
} | ||
/** | ||
* Showdown options schema. | ||
*/ | ||
/** | ||
* Showdown options schema. | ||
*/ | ||
interface ShowdownOptionsSchema { | ||
@@ -930,5 +935,5 @@ [key: string]: ShowdownOptionDescription; | ||
/** | ||
* Showdown subParser. | ||
*/ | ||
/** | ||
* Showdown subParser. | ||
*/ | ||
type SubParser = (...args: any[]) => string; | ||
@@ -942,3 +947,2 @@ | ||
interface Converter { | ||
/** | ||
@@ -966,3 +970,3 @@ * Listen to an event. | ||
* Converts a markdown string into HTML string. | ||
* | ||
* | ||
* @param text - The input text (markdown). | ||
@@ -1000,3 +1004,3 @@ * @return The output HTML. | ||
* Get the options of this Converter instance. | ||
* | ||
* | ||
* @returns Returns the current convertor options object. | ||
@@ -1012,3 +1016,6 @@ */ | ||
*/ | ||
addExtension(extension: (() => ShowdownExtension[] | ShowdownExtension) | ShowdownExtension[] | ShowdownExtension, name?: string): void; | ||
addExtension( | ||
extension: (() => ShowdownExtension[] | ShowdownExtension) | ShowdownExtension[] | ShowdownExtension, | ||
name?: string, | ||
): void; | ||
@@ -1054,15 +1061,14 @@ /** | ||
* Get the metadata of the previously parsed document. | ||
* | ||
* | ||
* @param raw - If to returns Row or Metadata. | ||
* @returns Returns Row if `row` is `true`, otherwise Metadata. | ||
*/ | ||
getMetadata(raw?: boolean): string | Metadata | ||
getMetadata(raw?: boolean): string | Metadata; | ||
/** | ||
* Get the metadata format of the previously parsed document. | ||
* | ||
* | ||
* @returns Returns the metadata format. | ||
*/ | ||
getMetadataFormat(): string; | ||
} | ||
@@ -1077,4 +1083,4 @@ | ||
/** | ||
* Helper Interface | ||
/** | ||
* Helper Interface | ||
*/ | ||
@@ -1103,3 +1109,3 @@ interface Helper { | ||
* Setting a "global" option affects all instances of showdown. | ||
* | ||
* | ||
* @param key - the option key. | ||
@@ -1179,3 +1185,2 @@ * @param value - the option value. | ||
/** | ||
@@ -1197,3 +1202,6 @@ * Get a registered extension. | ||
*/ | ||
function extension(name: string, ext: (() => ShowdownExtension[] | ShowdownExtension) | ShowdownExtension[] | ShowdownExtension): void; | ||
function extension( | ||
name: string, | ||
ext: (() => ShowdownExtension[] | ShowdownExtension) | ShowdownExtension[] | ShowdownExtension, | ||
): void; | ||
@@ -1200,0 +1208,0 @@ /** |
{ | ||
"name": "@types/showdown", | ||
"version": "2.0.1", | ||
"version": "2.0.2", | ||
"description": "TypeScript definitions for showdown", | ||
@@ -43,4 +43,4 @@ "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/showdown", | ||
"dependencies": {}, | ||
"typesPublisherContentHash": "77914779adf84f97d3970f5ccfb268dec7d84a0c5723fde66f3498c09a718713", | ||
"typeScriptVersion": "4.3" | ||
"typesPublisherContentHash": "1038e7cf5976c6ce93c24bcbf9cafac6ae4730efd3fd126ec84b8ff406222ec8", | ||
"typeScriptVersion": "4.5" | ||
} |
@@ -11,3 +11,3 @@ # Installation | ||
### Additional Details | ||
* Last updated: Sat, 29 Apr 2023 04:03:45 GMT | ||
* Last updated: Mon, 25 Sep 2023 13:39:06 GMT | ||
* Dependencies: none | ||
@@ -14,0 +14,0 @@ * Global values: `showdown` |
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
38056
1117