mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
22 lines
557 B
TypeScript
22 lines
557 B
TypeScript
import * as Mark from 'mark.js';
|
|
|
|
/* test instance */
|
|
const mark = new Mark(document.querySelectorAll('div'));
|
|
const markBySelector = new Mark('div');
|
|
const markByElement = new Mark(document.body);
|
|
|
|
mark.mark('keyword');
|
|
mark.mark('keyword', {
|
|
element: "span",
|
|
className: "highlight"
|
|
});
|
|
mark.mark(['keyword1', 'keyword2']);
|
|
mark.markRegExp(/regex/, {className: 'highlight'});
|
|
mark.markRanges([{start: 0, length: 10}], {className: 'highlight'});
|
|
|
|
/* test jquery */
|
|
$("div.context").mark("text", {
|
|
element: "span",
|
|
className: "highlight"
|
|
});
|