mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-24 05:06:02 +08:00
prismjs: Fix lint (#20909)
This commit is contained in:
23
types/prismjs/index.d.ts
vendored
23
types/prismjs/index.d.ts
vendored
@@ -14,9 +14,9 @@ export const hooks: Hooks;
|
||||
* This is the most high-level function in Prism’s API. It fetches all the elements that have a .language-xxxx class and
|
||||
* then calls Prism.highlightElement() on each one of them.
|
||||
*
|
||||
* @param {boolean} async Whether to use Web Workers to improve performance and avoid blocking the UI when highlighting
|
||||
* @param async Whether to use Web Workers to improve performance and avoid blocking the UI when highlighting
|
||||
* very large chunks of code. False by default.
|
||||
* @param {Function} callback An optional callback to be invoked after the highlighting is done. Mostly useful when async
|
||||
* @param callback An optional callback to be invoked after the highlighting is done. Mostly useful when async
|
||||
* is true, since in that case, the highlighting is done asynchronously.
|
||||
*/
|
||||
export function highlightAll(async: boolean, callback?: (element: Element) => void): void;
|
||||
@@ -24,11 +24,11 @@ export function highlightAll(async: boolean, callback?: (element: Element) => vo
|
||||
/**
|
||||
* Highlights the code inside a single element.
|
||||
*
|
||||
* @param {Elment} element The element containing the code. It must have a class of language-xxxx to be processed,
|
||||
* @param element The element containing the code. It must have a class of language-xxxx to be processed,
|
||||
* where xxxx is a valid language identifier.
|
||||
* @param {boolean} async Whether to use Web Workers to improve performance and avoid blocking the UI when
|
||||
* @param async Whether to use Web Workers to improve performance and avoid blocking the UI when
|
||||
* highlighting very large chunks of code. False by default.
|
||||
* @param {Function} callback An optional callback to be invoked after the highlighting is done.
|
||||
* @param callback An optional callback to be invoked after the highlighting is done.
|
||||
* Mostly useful when async is true, since in that case, the highlighting is done asynchronously.
|
||||
*/
|
||||
export function highlightElement(element: Element, async: boolean, callback?: (element: Element) => void): void;
|
||||
@@ -37,11 +37,10 @@ export function highlightElement(element: Element, async: boolean, callback?: (e
|
||||
* Low-level function, only use if you know what you’re doing. It accepts a string of text as input and the language
|
||||
* definitions to use, and returns a string with the HTML produced.
|
||||
*
|
||||
* @param {string} text A string with the code to be highlighted.
|
||||
* @param {LanguageDefinition} grammer - An object containing the tokens to use. Usually a language definition like
|
||||
* @param text A string with the code to be highlighted.
|
||||
* @param grammer - An object containing the tokens to use. Usually a language definition like
|
||||
* Prism.languages.markup
|
||||
* @param {LanguageDefinition} language
|
||||
* @returns {string} The highlighted HTML
|
||||
* @returns The highlighted HTML
|
||||
*/
|
||||
export function highlight(text: string, grammer: LanguageDefinition, language?: LanguageDefinition): string;
|
||||
|
||||
@@ -51,10 +50,10 @@ export function highlight(text: string, grammer: LanguageDefinition, language?:
|
||||
* nested tokens, the function is called recursively on each of these tokens. This method could be useful in other
|
||||
* contexts as well, as a very crude parser.
|
||||
*
|
||||
* @param {string} text A string with the code to be highlighted.
|
||||
* @param {LanguageDefinition} grammar An object containing the tokens to use. Usually a language definition like
|
||||
* @param text A string with the code to be highlighted.
|
||||
* @param grammar An object containing the tokens to use. Usually a language definition like
|
||||
* Prism.languages.markup
|
||||
* @returns {Array} An array of strings, tokens (class Prism.Token) and other arrays.
|
||||
* @returns An array of strings, tokens (class Prism.Token) and other arrays.
|
||||
*/
|
||||
export function tokenize(text: string, grammar: LanguageDefinition): Array<Token | string>;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user