UNPKG

779 BTypeScriptView Raw
1import "../../";
2
3declare module "../../" {
4 /**
5 * Provides a convenient way to syntax-highlight code snippets in a webpage. Depends on the runmode addon (or its standalone variant).
6 * Can be called with an array (or other array-ish collection) of DOM nodes that represent the code snippets. By default, it'll get all pre tags.
7 * Will read the data-lang attribute of these nodes to figure out their language, and syntax-color their content using the relevant CodeMirror
8 * mode (you'll have to load the scripts for the relevant modes yourself).
9 * A second argument may be provided to give a default mode, used when no language attribute is found for a node.
10 */
11 function colorize(collection?: ArrayLike<Element>, defaultMode?: string): void;
12}