forked from DefinitelyTyped/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 0
/
katex.d.ts
33 lines (30 loc) · 968 Bytes
/
katex.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
// Type definitions for KaTeX v.0.5.0
// Project: http://khan.github.io/KaTeX/
// Definitions by: Michael Randolph <https://github.com/mrand01>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare module "katex" {
interface KatexOptions {
displayMode?: boolean;
breakOnUnsupportedCmds?: boolean;
errorColor?: string;
}
class ParseError implements Error {
constructor(message: string, lexer: any, position: number);
name: string;
message: string;
position: number;
}
/**
* Renders a TeX expression into the specified DOM element
* @param tex A TeX expression
* @param element The DOM element to render into
* @param options KaTeX options
*/
function render(tex: string, element: HTMLElement, options?:KatexOptions): void;
/**
* Renders a TeX expression into an HTML string
* @param tex A TeX expression
* @param options KaTeX options
*/
function renderToString(tex: string, options?:KatexOptions): string;
}