Clean up comments

This commit is contained in:
Andre Wiggins
2017-03-10 17:58:22 -08:00
parent 6b90165d60
commit f403fb6bdd
+14 -16
View File
@@ -19,24 +19,22 @@ 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 very large chunks of code. False by default.
* @param {(element:Element)=>void} 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.
* @returns void
* @param {boolean} 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
* is true, since in that case, the highlighting is done asynchronously.
*/
export function highlightAll(async: boolean, callback?: (element: Element) => void): void;
/**
* Highlights the code inside a single element.
*
* @param {Element} element - The element containing the code. It must have a class of language-xxxx to be processed,
* @param {Elment} 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 {boolean} 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 {(element:Element)=>void} callback? - An optional callback to be invoked after the highlighting is done.
* @param {Function} 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.
* @returns void
*/
export function highlightElement(element: Element, async: boolean, callback?: (element: Element) => void): void;
@@ -45,11 +43,11 @@ 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 {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
* Prism.languages.markup
* @param {LanguageDefinition} language
* @returns string - The highlighted HTML
* @param {LanguageDefinition} language
* @returns {string} The highlighted HTML
*/
export function highlight(text: string, grammer: LanguageDefinition, language?: LanguageDefinition): string;
@@ -59,10 +57,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 {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
* Prism.languages.markup
* @returns Array - An array of strings, tokens (class Prism.Token) and other arrays.
* @returns {Array} An array of strings, tokens (class Prism.Token) and other arrays.
*/
export function tokenize(text: string, grammar: LanguageDefinition): Array<Token | string>;