From f403fb6bdda69f1e720c914e56da1cf37540c9d2 Mon Sep 17 00:00:00 2001 From: Andre Wiggins Date: Fri, 10 Mar 2017 17:58:22 -0800 Subject: [PATCH] Clean up comments --- prismjs/index.d.ts | 30 ++++++++++++++---------------- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/prismjs/index.d.ts b/prismjs/index.d.ts index 14197acf73..531dfe9b8f 100644 --- a/prismjs/index.d.ts +++ b/prismjs/index.d.ts @@ -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;